Fixed the floating nuke

Made the egg cursed
This commit is contained in:
2026-06-19 14:00:59 -05:00
parent 1b120edd93
commit e1a9260c79
5 changed files with 37 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ public class EntityEgg extends EntityThrowable {
for(int var3 = 0; var3 < var2; ++var3) {
EntityChicken var4 = new EntityChicken(this.worldObj);
var4.setGrowingAge(-24000);
var4.setGrowingAge(1);
var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
this.worldObj.spawnEntityInWorld(var4);
}
@@ -37,7 +37,18 @@ public class EntityEgg extends EntityThrowable {
}
if(!this.worldObj.isRemote) {
EntityChicken var4 = new EntityChicken(this.worldObj);
EntityChicken var5 = new EntityChicken(this.worldObj);
EntityChicken var6 = new EntityChicken(this.worldObj);
EntityChicken var7 = new EntityChicken(this.worldObj);
var4.setGrowingAge(1);
var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
this.worldObj.spawnEntityInWorld(var4);
this.setDead();
}
}

View File

@@ -17,7 +17,7 @@ public class EntityTNTPrimed extends Entity {
this.setPosition(var2, var4, var6);
float var9 = (float)(Math.random() * (double)((float)Math.PI) * 2.0D);
this.motionX = (double)(-((float)Math.sin((double)var9)) * 0.02F);
this.motionY = (double)0.2F;
this.motionY = (double)-0.2F;
this.motionZ = (double)(-((float)Math.cos((double)var9)) * 0.02F);
this.fuse = 80;
this.prevPosX = var2;
@@ -49,8 +49,9 @@ public class EntityTNTPrimed extends Entity {
if(this.onGround) {
this.motionX *= (double)0.7F;
this.motionZ *= (double)0.7F;
this.motionY *= -0.5D;
this.motionY *= -0D;
}
System.out.println(this.motionY);
if(this.fuse-- <= 0) {
this.setDead();

View File

@@ -59,6 +59,7 @@ public class BlockNuke extends Block {
var1.spawnEntityInWorld(var7);
var1.playSoundAtEntity(var7, "mod.beep", 1.0F, 1.0F);
System.out.println("SPAWNING TNT NOW!");
}
}

View File

@@ -47,6 +47,8 @@ public class EntityNukePrimed extends Entity {
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= 0.04D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= (double)0.98F;
@@ -60,17 +62,13 @@ public class EntityNukePrimed extends Entity {
this.motionY *= -0.5D;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
// Spawn smoke fizz while ticking down on the client side
if (this.worldObj.isRemote) {
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
}
if (this.fuse-- <= 0) {
this.setDead();
if (!this.worldObj.isRemote) {
this.explode();
} else {
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ , 0.0D, 0.0D, 0.0D);
}
}
@@ -82,11 +80,9 @@ public class EntityNukePrimed extends Entity {
}
protected void writeEntityToNBT(NBTTagCompound var1) {
var1.setByte("Fuse", (byte)this.fuse);
}
protected void readEntityFromNBT(NBTTagCompound var1) {
this.fuse = var1.getByte("Fuse");
}
public float getShadowSize() {