Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package TheMod;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.item.EntityTNTPrimed;
- import net.minecraft.world.World;
- public class EntityNukePrimed extends EntityTNTPrimed {
- public int fuse;
- private EntityLivingBase tntPlacedBy;
- public EntityNukePrimed(World worldIn) {
- super(worldIn);
- }
- public EntityNukePrimed(World worldIn, double posX, double posY, double posZ, EntityLivingBase EntityYaw) {
- this(worldIn);
- this.setPosition(posX, posY, posZ);
- float f = (float) (Math.random() * Math.PI * 2.0D);
- this.motionX = (double) (-((float) Math.sin((double) f)) * 0.02F);
- this.motionY = 0.20000000298023224D;
- this.motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
- this.fuse = 80;
- this.prevPosX = posX;
- this.prevPosY = posY;
- this.prevPosZ = posZ;
- this.tntPlacedBy = EntityYaw;
- }
- /* public void onUpdate() {
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
- this.motionY -= 0.03999999910593033D;
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.9800000190734863D;
- this.motionY *= 0.9800000190734863D;
- this.motionZ *= 0.9800000190734863D;
- if (this.onGround) {
- this.motionX *= 0.699999988079071D;
- this.motionZ *= 0.699999988079071D;
- this.motionY *= -0.5D;
- }
- if (this.fuse-- <= 0) {
- this.setDead();
- if (!this.worldObj.isRemote) {
- this.explode();
- }
- } else {
- this.handleWaterMovement();
- this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
- }
- }
- */
- private void explode() {
- float f = 16.0F;
- this.worldObj.createExplosion(this, this.posX, this.posY + (double) (this.height / 7.0F), this.posZ, f, true);
- }
- }
Add Comment
Please, Sign In to add comment