Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. package com.mod.drakania.dynamite;
  2.  
  3. import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
  4. import cpw.mods.fml.relauncher.Side;
  5. import cpw.mods.fml.relauncher.SideOnly;
  6. import io.netty.buffer.ByteBuf;
  7. import net.minecraft.entity.EntityLivingBase;
  8. import net.minecraft.entity.monster.EntityBlaze;
  9. import net.minecraft.entity.projectile.EntityThrowable;
  10. import net.minecraft.util.DamageSource;
  11. import net.minecraft.util.MathHelper;
  12. import net.minecraft.util.MovingObjectPosition;
  13. import net.minecraft.world.World;
  14.  
  15. public class EntityBigDynamite extends EntityThrowable implements IEntityAdditionalSpawnData
  16. {
  17. private int fuseTime = 10;
  18.  
  19. public EntityBigDynamite(World world)
  20. {
  21. super(world);
  22. }
  23.  
  24. public EntityBigDynamite(World world, EntityLivingBase thrower)
  25. {
  26. super(world, thrower);
  27. this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 10 * 1.5F, 1.0F);
  28.  
  29. }
  30.  
  31. public EntityBigDynamite(World world, double x, double y, double z)
  32. {
  33. super(world, x, y, z);
  34.  
  35. }
  36.  
  37. protected void onImpact(MovingObjectPosition mop)
  38. {
  39. this.motionX = 0;
  40. this.motionY = 0;
  41. this.motionZ = 0;
  42. if (!this.worldObj.isRemote)
  43. {
  44.  
  45. }
  46. }
  47. @Override
  48. public void onUpdate()
  49. {
  50. super.onUpdate();
  51. if(this.fuseTime > 0)
  52. {
  53. this.fuseTime --;
  54. }
  55.  
  56. else if(!this.worldObj.isRemote)
  57. {
  58. this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 4F, false, true);
  59. this.setDead();
  60. }
  61.  
  62.  
  63. }
  64.  
  65. @Override
  66. public void writeSpawnData(ByteBuf buffer)
  67. {
  68. buffer.writeInt(this.fuseTime);
  69. }
  70.  
  71. @Override
  72. public void readSpawnData(ByteBuf additionalData)
  73. {
  74. this.fuseTime = additionalData.readInt();
  75. }
  76. {
  77.  
  78. }
  79.  
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement