Advertisement
MrCyberdragon

Untitled

Mar 8th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. public class blueFlame extends Particle {
  2.  
  3. private static TextureAtlasSprite sprite;
  4.  
  5. private static ResourceLocation texture = new ResourceLocation("ltn:particles/blueflame");
  6.  
  7. public blueFlame(World world, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed)
  8. {
  9. super(world, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed);
  10. this.motionX = xSpeed;
  11. this.motionY = ySpeed;
  12. this.motionZ = zSpeed;
  13. this.posX = xCoord;
  14. this.posY = yCoord;
  15. this.posZ = zCoord;
  16. }
  17.  
  18. @SubscribeEvent
  19. public static void onTextureStitch(TextureStitchEvent.Pre event) {
  20. sprite = event.getMap().registerSprite(texture);;
  21. }
  22.  
  23. @SideOnly(Side.CLIENT)
  24. public static class Factory implements IParticleFactory
  25. {
  26. public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
  27. {
  28. return new blueFlame(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
  29. }
  30. }
  31.  
  32. @Override
  33. public int getFXLayer()
  34. {
  35. return 1;
  36. }
  37.  
  38. @Override
  39. public void renderParticle(BufferBuilder builder, Entity entity, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
  40. this.setParticleTexture(this.sprite);
  41. super.renderParticle(builder, entity, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement