-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nullity particle as workaround for artemis missile tick calls
- Loading branch information
1 parent
f6a1e11
commit f55c7df
Showing
6 changed files
with
69 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...main/java/org/mineplugin/locusazzurro/icaruswings/event/ClientParticleFactoryHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/org/mineplugin/locusazzurro/icaruswings/particles/NullityParticle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.mineplugin.locusazzurro.icaruswings.particles; | ||
|
||
import net.minecraft.client.particle.*; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particles.BasicParticleType; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/* | ||
Particle used to get around classes/methods that require a particle without making a complicated workaround | ||
*/ | ||
public class NullityParticle extends SpriteTexturedParticle { | ||
|
||
public NullityParticle(ClientWorld world, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { | ||
super(world, x, y, z, xSpeed, ySpeed, zSpeed); | ||
this.setSize(0.00f, 0.00f); | ||
this.xd = 0; | ||
this.yd = 0; | ||
this.zd = 0; | ||
this.lifetime = 0; | ||
this.hasPhysics = false; | ||
} | ||
|
||
@Override | ||
public void tick(){ | ||
this.remove(); | ||
} | ||
|
||
@Override | ||
public IParticleRenderType getRenderType() { | ||
return IParticleRenderType.NO_RENDER; | ||
} | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public static class Factory implements IParticleFactory<BasicParticleType> { | ||
|
||
private final IAnimatedSprite sprites; | ||
|
||
public Factory(IAnimatedSprite sprite) { | ||
this.sprites = sprite; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Particle createParticle(BasicParticleType dataIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { | ||
NullityParticle particle = new NullityParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed); | ||
particle.pickSprite(sprites); | ||
return particle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/locusazzurro_icaruswings/particles/nullity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"textures": [ | ||
"locusazzurro_icaruswings:nullity" | ||
] | ||
} |
Binary file added
BIN
+1.55 KB
src/main/resources/assets/locusazzurro_icaruswings/textures/particle/nullity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.