Guest User

Entity Primed

a guest
Feb 22nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1. package TheMod;
  2.  
  3. import net.minecraft.entity.EntityLivingBase;
  4. import net.minecraft.entity.item.EntityTNTPrimed;
  5. import net.minecraft.world.World;
  6.  
  7. public class EntityNukePrimed extends EntityTNTPrimed {
  8.  
  9.     public int fuse;
  10.     private EntityLivingBase tntPlacedBy;
  11.  
  12.     public EntityNukePrimed(World worldIn) {
  13.         super(worldIn);
  14.     }
  15.  
  16.     public EntityNukePrimed(World worldIn, double posX, double posY, double posZ, EntityLivingBase EntityYaw) {
  17.         this(worldIn);
  18.         this.setPosition(posX, posY, posZ);
  19.         float f = (float) (Math.random() * Math.PI * 2.0D);
  20.         this.motionX = (double) (-((float) Math.sin((double) f)) * 0.02F);
  21.         this.motionY = 0.20000000298023224D;
  22.         this.motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
  23.         this.fuse = 80;
  24.         this.prevPosX = posX;
  25.         this.prevPosY = posY;
  26.         this.prevPosZ = posZ;
  27.         this.tntPlacedBy = EntityYaw;
  28.     }
  29.  
  30.    /* public void onUpdate() {
  31.         this.prevPosX = this.posX;
  32.         this.prevPosY = this.posY;
  33.         this.prevPosZ = this.posZ;
  34.         this.motionY -= 0.03999999910593033D;
  35.         this.moveEntity(this.motionX, this.motionY, this.motionZ);
  36.         this.motionX *= 0.9800000190734863D;
  37.         this.motionY *= 0.9800000190734863D;
  38.         this.motionZ *= 0.9800000190734863D;
  39.  
  40.         if (this.onGround) {
  41.             this.motionX *= 0.699999988079071D;
  42.             this.motionZ *= 0.699999988079071D;
  43.             this.motionY *= -0.5D;
  44.         }
  45.  
  46.         if (this.fuse-- <= 0) {
  47.             this.setDead();
  48.  
  49.             if (!this.worldObj.isRemote) {
  50.                 this.explode();
  51.             }
  52.         } else {
  53.             this.handleWaterMovement();
  54.             this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
  55.         }
  56.     }
  57.     */
  58.     private void explode() {
  59.         float f = 16.0F;
  60.         this.worldObj.createExplosion(this, this.posX, this.posY + (double) (this.height / 7.0F), this.posZ, f, true);
  61.     }
  62.  
  63.  
  64. }
Add Comment
Please, Sign In to add comment