removed residual integrated server code
This commit is contained in:
parent
2a011f6766
commit
0bc20dec09
|
@ -4,7 +4,7 @@ public class ConfigConstants {
|
||||||
|
|
||||||
public static boolean profanity = false;
|
public static boolean profanity = false;
|
||||||
|
|
||||||
public static final String version = "22w10a";
|
public static final String version = "22w10b";
|
||||||
public static final String mainMenuString = "eaglercraft " + version;
|
public static final String mainMenuString = "eaglercraft " + version;
|
||||||
|
|
||||||
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";
|
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";
|
||||||
|
|
|
@ -645,19 +645,6 @@ public class Block {
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
* Drops the block items with a specified chance of dropping the specified items
|
||||||
*/
|
*/
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var8 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
|
||||||
|
|
||||||
for (int var9 = 0; var9 < var8; ++var9) {
|
|
||||||
if (par1World.rand.nextFloat() <= par6) {
|
|
||||||
int var10 = this.idDropped(par5, par1World.rand, par7);
|
|
||||||
|
|
||||||
if (var10 > 0) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -665,28 +652,12 @@ public class Block {
|
||||||
* remote.
|
* remote.
|
||||||
*/
|
*/
|
||||||
protected void dropBlockAsItem_do(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) {
|
protected void dropBlockAsItem_do(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) {
|
||||||
if (!par1World.isRemote && par1World.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
|
|
||||||
float var6 = 0.7F;
|
|
||||||
double var7 = (double) (par1World.rand.nextFloat() * var6) + (double) (1.0F - var6) * 0.5D;
|
|
||||||
double var9 = (double) (par1World.rand.nextFloat() * var6) + (double) (1.0F - var6) * 0.5D;
|
|
||||||
double var11 = (double) (par1World.rand.nextFloat() * var6) + (double) (1.0F - var6) * 0.5D;
|
|
||||||
EntityItem var13 = new EntityItem(par1World, (double) par2 + var7, (double) par3 + var9, (double) par4 + var11, par5ItemStack);
|
|
||||||
var13.delayBeforeCanPickup = 10;
|
|
||||||
par1World.spawnEntityInWorld(var13);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called by spawner, ore, redstoneOre blocks
|
* called by spawner, ore, redstoneOre blocks
|
||||||
*/
|
*/
|
||||||
protected void dropXpOnBlockBreak(World par1World, int par2, int par3, int par4, int par5) {
|
protected void dropXpOnBlockBreak(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
while (par5 > 0) {
|
|
||||||
int var6 = EntityXPOrb.getXPSplit(par5);
|
|
||||||
par5 -= var6;
|
|
||||||
par1World.spawnEntityInWorld(new EntityXPOrb(par1World, (double) par2 + 0.5D, (double) par3 + 0.5D, (double) par4 + 0.5D, var6));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -89,12 +89,7 @@ public class BlockAnvil extends BlockSand {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
par5EntityPlayer.displayGUIAnvil(par2, par3, par4);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public abstract class BlockBasePressurePlate extends Block {
|
public abstract class BlockBasePressurePlate extends Block {
|
||||||
private String pressurePlateIconName;
|
private String pressurePlateIconName;
|
||||||
|
|
||||||
|
@ -93,33 +91,6 @@ public abstract class BlockBasePressurePlate extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4));
|
|
||||||
|
|
||||||
if (var6 > 0) {
|
|
||||||
this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4));
|
|
||||||
|
|
||||||
if (var6 == 0) {
|
|
||||||
this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there are mobs on the plate. If a mob is on the plate and it is
|
* Checks if there are mobs on the plate. If a mob is on the plate and it is
|
||||||
* off, it turns it on, and vice versa.
|
* off, it turns it on, and vice versa.
|
||||||
|
|
|
@ -21,17 +21,7 @@ public class BlockBeacon extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityBeacon var10 = (TileEntityBeacon) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIBeacon(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,82 +19,7 @@ public class BlockBed extends BlockDirectional {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if (!isBlockHeadOfBed(var10)) {
|
|
||||||
int var11 = getDirection(var10);
|
|
||||||
par2 += footBlockToHeadBlockMap[var11][0];
|
|
||||||
par4 += footBlockToHeadBlockMap[var11][1];
|
|
||||||
|
|
||||||
if (par1World.getBlockId(par2, par3, par4) != this.blockID) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.provider.canRespawnHere() && par1World.getBiomeGenForCoords(par2, par4) != BiomeGenBase.hell) {
|
|
||||||
if (isBedOccupied(var10)) {
|
|
||||||
EntityPlayer var19 = null;
|
|
||||||
Iterator var12 = par1World.playerEntities.iterator();
|
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
|
||||||
EntityPlayer var21 = (EntityPlayer) var12.next();
|
|
||||||
|
|
||||||
if (var21.isPlayerSleeping()) {
|
|
||||||
ChunkCoordinates var14 = var21.playerLocation;
|
|
||||||
|
|
||||||
if (var14.posX == par2 && var14.posY == par3 && var14.posZ == par4) {
|
|
||||||
var19 = var21;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var19 != null) {
|
|
||||||
par5EntityPlayer.addChatMessage("tile.bed.occupied");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
setBedOccupied(par1World, par2, par3, par4, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumStatus var20 = par5EntityPlayer.sleepInBedAt(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var20 == EnumStatus.OK) {
|
|
||||||
setBedOccupied(par1World, par2, par3, par4, true);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (var20 == EnumStatus.NOT_POSSIBLE_NOW) {
|
|
||||||
par5EntityPlayer.addChatMessage("tile.bed.noSleep");
|
|
||||||
} else if (var20 == EnumStatus.NOT_SAFE) {
|
|
||||||
par5EntityPlayer.addChatMessage("tile.bed.notSafe");
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
double var18 = (double) par2 + 0.5D;
|
|
||||||
double var13 = (double) par3 + 0.5D;
|
|
||||||
double var15 = (double) par4 + 0.5D;
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
int var17 = getDirection(var10);
|
|
||||||
par2 += footBlockToHeadBlockMap[var17][0];
|
|
||||||
par4 += footBlockToHeadBlockMap[var17][1];
|
|
||||||
|
|
||||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID) {
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
var18 = (var18 + (double) par2 + 0.5D) / 2.0D;
|
|
||||||
var13 = (var13 + (double) par3 + 0.5D) / 2.0D;
|
|
||||||
var15 = (var15 + (double) par4 + 0.5D) / 2.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.newExplosion((Entity) null, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), 5.0F, true, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -169,10 +94,6 @@ public class BlockBed extends BlockDirectional {
|
||||||
}
|
}
|
||||||
} else if (par1World.getBlockId(par2 + footBlockToHeadBlockMap[var7][0], par3, par4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) {
|
} else if (par1World.getBlockId(par2 + footBlockToHeadBlockMap[var7][0], par3, par4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) {
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,17 +66,7 @@ public class BlockBrewingStand extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityBrewingStand var10 = (TileEntityBrewingStand) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIBrewingStand(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -247,27 +247,6 @@ public abstract class BlockButton extends Block {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if ((var6 & 8) != 0) {
|
|
||||||
if (this.sensible) {
|
|
||||||
this.func_82535_o(par1World, par2, par3, par4);
|
|
||||||
} else {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & 7, 3);
|
|
||||||
int var7 = var6 & 7;
|
|
||||||
this.func_82536_d(par1World, par2, par3, par4, var7);
|
|
||||||
par1World.playSoundEffect((double) par2 + 0.5D, (double) par3 + 0.5D, (double) par4 + 0.5D, "random.click", 0.3F, 0.5F);
|
|
||||||
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the block's bounds for rendering it as an item
|
* Sets the block's bounds for rendering it as an item
|
||||||
*/
|
*/
|
||||||
|
@ -278,20 +257,6 @@ public abstract class BlockButton extends Block {
|
||||||
this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3);
|
this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (this.sensible) {
|
|
||||||
if ((par1World.getBlockMetadata(par2, par3, par4) & 8) == 0) {
|
|
||||||
this.func_82535_o(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void func_82535_o(World par1World, int par2, int par3, int par4) {
|
private void func_82535_o(World par1World, int par2, int par3, int par4) {
|
||||||
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
int var6 = var5 & 7;
|
int var6 = var5 & 7;
|
||||||
|
|
|
@ -91,51 +91,7 @@ public class BlockCauldron extends Block {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem();
|
|
||||||
|
|
||||||
if (var10 == null) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
int var11 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10.itemID == Item.bucketWater.itemID) {
|
|
||||||
if (var11 < 3) {
|
|
||||||
if (!par5EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (var10.itemID == Item.glassBottle.itemID) {
|
|
||||||
if (var11 > 0) {
|
|
||||||
ItemStack var12 = new ItemStack(Item.potion, 1, 0);
|
|
||||||
par1World.spawnEntityInWorld(new EntityItem(par1World, (double) par2 + 0.5D, (double) par3 + 1.5D, (double) par4 + 0.5D, var12));
|
|
||||||
|
|
||||||
--var10.stackSize;
|
|
||||||
|
|
||||||
if (var10.stackSize <= 0) {
|
|
||||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 - 1, 2);
|
|
||||||
}
|
|
||||||
} else if (var11 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor) var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) {
|
|
||||||
ItemArmor var13 = (ItemArmor) var10.getItem();
|
|
||||||
var13.removeColor(var10);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 - 1, 2);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -145,88 +145,6 @@ public class BlockChest extends BlockContainer {
|
||||||
* Turns the adjacent chests to a double chest.
|
* Turns the adjacent chests to a double chest.
|
||||||
*/
|
*/
|
||||||
public void unifyAdjacentChests(World par1World, int par2, int par3, int par4) {
|
public void unifyAdjacentChests(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var5 = par1World.getBlockId(par2, par3, par4 - 1);
|
|
||||||
int var6 = par1World.getBlockId(par2, par3, par4 + 1);
|
|
||||||
int var7 = par1World.getBlockId(par2 - 1, par3, par4);
|
|
||||||
int var8 = par1World.getBlockId(par2 + 1, par3, par4);
|
|
||||||
boolean var9 = true;
|
|
||||||
int var10;
|
|
||||||
int var11;
|
|
||||||
boolean var12;
|
|
||||||
byte var13;
|
|
||||||
int var14;
|
|
||||||
|
|
||||||
if (var5 != this.blockID && var6 != this.blockID) {
|
|
||||||
if (var7 != this.blockID && var8 != this.blockID) {
|
|
||||||
var13 = 3;
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) {
|
|
||||||
var13 = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) {
|
|
||||||
var13 = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) {
|
|
||||||
var13 = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) {
|
|
||||||
var13 = 4;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var10 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 - 1);
|
|
||||||
var11 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 + 1);
|
|
||||||
var13 = 3;
|
|
||||||
var12 = true;
|
|
||||||
|
|
||||||
if (var7 == this.blockID) {
|
|
||||||
var14 = par1World.getBlockMetadata(par2 - 1, par3, par4);
|
|
||||||
} else {
|
|
||||||
var14 = par1World.getBlockMetadata(par2 + 1, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var14 == 2) {
|
|
||||||
var13 = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Block.opaqueCubeLookup[var5] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) {
|
|
||||||
var13 = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var10]) {
|
|
||||||
var13 = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var10 = par1World.getBlockId(par2 - 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1);
|
|
||||||
var11 = par1World.getBlockId(par2 + 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1);
|
|
||||||
var13 = 5;
|
|
||||||
var12 = true;
|
|
||||||
|
|
||||||
if (var5 == this.blockID) {
|
|
||||||
var14 = par1World.getBlockMetadata(par2, par3, par4 - 1);
|
|
||||||
} else {
|
|
||||||
var14 = par1World.getBlockMetadata(par2, par3, par4 + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var14 == 4) {
|
|
||||||
var13 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) {
|
|
||||||
var13 = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var10]) {
|
|
||||||
var13 = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var13, 3);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -328,17 +246,7 @@ public class BlockChest extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
IInventory var10 = this.getInventory(par1World, par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIChest(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,26 +15,6 @@ public class BlockCommandBlock extends BlockContainer {
|
||||||
return new TileEntityCommandBlock();
|
return new TileEntityCommandBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
|
|
||||||
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
boolean var8 = (var7 & 1) != 0;
|
|
||||||
|
|
||||||
if (var6 && !var8) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 1, 4);
|
|
||||||
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
||||||
} else if (!var6 && var8) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -2, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ticks the block if it's been scheduled
|
* Ticks the block if it's been scheduled
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -138,25 +138,6 @@ public class BlockCrops extends BlockFlower {
|
||||||
return Item.wheat.itemID;
|
return Item.wheat.itemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
|
||||||
*/
|
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
|
||||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (par5 >= 7) {
|
|
||||||
int var8 = 3 + par7;
|
|
||||||
|
|
||||||
for (int var9 = 0; var9 < var8; ++var9) {
|
|
||||||
if (par1World.rand.nextInt(15) <= par5) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ID of the items to drop on destruction.
|
* Returns the ID of the items to drop on destruction.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,16 +23,4 @@ public class BlockDeadBush extends BlockFlower {
|
||||||
public int idDropped(int par1, Random par2Random, int par3) {
|
public int idDropped(int par1, Random par2Random, int par3) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the player destroys a block with an item that can harvest it. (i,
|
|
||||||
* j, k) are the coordinates of the block and l is the block's subtype/damage.
|
|
||||||
*/
|
|
||||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
|
||||||
if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.deadBush, 1, par6));
|
|
||||||
} else {
|
|
||||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockDetectorRail extends BlockRailBase {
|
public class BlockDetectorRail extends BlockRailBase {
|
||||||
private Icon[] iconArray;
|
private Icon[] iconArray;
|
||||||
|
@ -26,33 +25,6 @@ public class BlockDetectorRail extends BlockRailBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if ((var6 & 8) == 0) {
|
|
||||||
this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if ((var6 & 8) != 0) {
|
|
||||||
this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the block is emitting indirect/weak redstone power on the
|
* Returns true if the block is emitting indirect/weak redstone power on the
|
||||||
* specified side. If isBlockNormalCube returns true, standard redstone
|
* specified side. If isBlockNormalCube returns true, standard redstone
|
||||||
|
|
|
@ -34,31 +34,6 @@ public class BlockDispenser extends BlockContainer {
|
||||||
* chooses west to be direction if all surrounding blocks are opaque.
|
* chooses west to be direction if all surrounding blocks are opaque.
|
||||||
*/
|
*/
|
||||||
private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) {
|
private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var5 = par1World.getBlockId(par2, par3, par4 - 1);
|
|
||||||
int var6 = par1World.getBlockId(par2, par3, par4 + 1);
|
|
||||||
int var7 = par1World.getBlockId(par2 - 1, par3, par4);
|
|
||||||
int var8 = par1World.getBlockId(par2 + 1, par3, par4);
|
|
||||||
byte var9 = 3;
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) {
|
|
||||||
var9 = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) {
|
|
||||||
var9 = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) {
|
|
||||||
var9 = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) {
|
|
||||||
var9 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,17 +61,7 @@ public class BlockDispenser extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityDispenser var10 = (TileEntityDispenser) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIDispenser(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dispense(World par1World, int par2, int par3, int par4) {
|
protected void dispense(World par1World, int par2, int par3, int par4) {
|
||||||
|
@ -128,15 +93,6 @@ public class BlockDispenser extends BlockContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.dispense(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new instance of a block's tile entity class. Called on placing the
|
* Returns a new instance of a block's tile entity class. Called on placing the
|
||||||
* block.
|
* block.
|
||||||
|
|
|
@ -281,11 +281,7 @@ public class BlockDoor extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var7) {
|
if (!var7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||||
|
|
||||||
if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID) {
|
if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID) {
|
||||||
|
|
|
@ -82,24 +82,18 @@ public class BlockDragonEgg extends Block {
|
||||||
int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
|
int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
|
||||||
|
|
||||||
if (par1World.getBlockId(var6, var7, var8) == 0) {
|
if (par1World.getBlockId(var6, var7, var8) == 0) {
|
||||||
if (!par1World.isRemote) {
|
short var9 = 128;
|
||||||
par1World.setBlock(var6, var7, var8, this.blockID, par1World.getBlockMetadata(par2, par3, par4), 2);
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
} else {
|
|
||||||
short var9 = 128;
|
|
||||||
|
|
||||||
for (int var10 = 0; var10 < var9; ++var10) {
|
for (int var10 = 0; var10 < var9; ++var10) {
|
||||||
double var11 = par1World.rand.nextDouble();
|
double var11 = par1World.rand.nextDouble();
|
||||||
float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
||||||
float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
||||||
float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
||||||
double var16 = (double) var6 + (double) (par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
double var16 = (double) var6 + (double) (par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
||||||
double var18 = (double) var7 + (double) (par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D;
|
double var18 = (double) var7 + (double) (par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D;
|
||||||
double var20 = (double) var8 + (double) (par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
double var20 = (double) var8 + (double) (par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
||||||
par1World.spawnParticle("portal", var16, var18, var20, (double) var13, (double) var14, (double) var15);
|
par1World.spawnParticle("portal", var16, var18, var20, (double) var13, (double) var14, (double) var15);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,13 +79,7 @@ public class BlockEnchantmentTable extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
par5EntityPlayer.displayGUIEnchantment(par2, par3, par4, var10.func_94135_b() ? var10.func_94133_a() : null);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,16 +71,6 @@ public class BlockEndPortal extends BlockContainer {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null && !par1World.isRemote) {
|
|
||||||
par5Entity.travelToDimension(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A randomly called display update to be able to add particles or other items
|
* A randomly called display update to be able to add particles or other items
|
||||||
* for display
|
* for display
|
||||||
|
|
|
@ -85,22 +85,7 @@ public class BlockEnderChest extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
InventoryEnderChest var10 = par5EntityPlayer.getInventoryEnderChest();
|
return true;
|
||||||
TileEntityEnderChest var11 = (TileEntityEnderChest) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null && var11 != null) {
|
|
||||||
if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) {
|
|
||||||
return true;
|
|
||||||
} else if (par1World.isRemote) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
var10.setAssociatedChest(var11);
|
|
||||||
par5EntityPlayer.displayGUIChest(var10);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -63,19 +63,6 @@ public class BlockFarmland extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Block's chance to react to an entity falling on it.
|
|
||||||
*/
|
|
||||||
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {
|
|
||||||
if (!par1World.isRemote && par1World.rand.nextFloat() < par6 - 0.5F) {
|
|
||||||
if (!(par5Entity instanceof EntityPlayer) && !par1World.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1
|
* returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1
|
||||||
* to z+1)
|
* to z+1)
|
||||||
|
|
|
@ -105,28 +105,6 @@ public class BlockFenceGate extends BlockDirectional {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower()) {
|
|
||||||
if (var7 && !isFenceGateOpen(var6)) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 4, 2);
|
|
||||||
par1World.playAuxSFXAtEntity((EntityPlayer) null, 1003, par2, par3, par4, 0);
|
|
||||||
} else if (!var7 && isFenceGateOpen(var6)) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -5, 2);
|
|
||||||
par1World.playAuxSFXAtEntity((EntityPlayer) null, 1003, par2, par3, par4, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the fence gate is open according to its metadata.
|
* Returns if the fence gate is open according to its metadata.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,31 +45,6 @@ public class BlockFurnace extends BlockContainer {
|
||||||
* set a blocks direction
|
* set a blocks direction
|
||||||
*/
|
*/
|
||||||
private void setDefaultDirection(World par1World, int par2, int par3, int par4) {
|
private void setDefaultDirection(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var5 = par1World.getBlockId(par2, par3, par4 - 1);
|
|
||||||
int var6 = par1World.getBlockId(par2, par3, par4 + 1);
|
|
||||||
int var7 = par1World.getBlockId(par2 - 1, par3, par4);
|
|
||||||
int var8 = par1World.getBlockId(par2 + 1, par3, par4);
|
|
||||||
byte var9 = 3;
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) {
|
|
||||||
var9 = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) {
|
|
||||||
var9 = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) {
|
|
||||||
var9 = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) {
|
|
||||||
var9 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,17 +99,7 @@ public class BlockFurnace extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityFurnace var10 = (TileEntityFurnace) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIFurnace(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -94,22 +94,6 @@ public class BlockGrass extends Block {
|
||||||
* Ticks the block if it's been scheduled
|
* Ticks the block if it's been scheduled
|
||||||
*/
|
*/
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) {
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
|
||||||
} else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) {
|
|
||||||
for (int var6 = 0; var6 < 4; ++var6) {
|
|
||||||
int var7 = par2 + par5Random.nextInt(3) - 1;
|
|
||||||
int var8 = par3 + par5Random.nextInt(5) - 3;
|
|
||||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
|
||||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
|
||||||
|
|
||||||
if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) {
|
|
||||||
par1World.setBlock(var7, var8, var9, Block.grass.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -88,17 +88,7 @@ public class BlockHopper extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityHopper var10 = getHopperTile(par1World, par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
par5EntityPlayer.displayGUIHopper(var10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,42 +32,12 @@ public class BlockJukeBox extends BlockContainer {
|
||||||
* Insert the specified music disc in the jukebox at the given coordinates
|
* Insert the specified music disc in the jukebox at the given coordinates
|
||||||
*/
|
*/
|
||||||
public void insertRecord(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) {
|
public void insertRecord(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
TileEntityRecordPlayer var6 = (TileEntityRecordPlayer) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var6 != null) {
|
|
||||||
var6.func_96098_a(par5ItemStack.copy());
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ejects the current record inside of the jukebox.
|
* Ejects the current record inside of the jukebox.
|
||||||
*/
|
*/
|
||||||
public void ejectRecord(World par1World, int par2, int par3, int par4) {
|
public void ejectRecord(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
TileEntityRecordPlayer var5 = (TileEntityRecordPlayer) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var5 != null) {
|
|
||||||
ItemStack var6 = var5.func_96097_a();
|
|
||||||
|
|
||||||
if (var6 != null) {
|
|
||||||
par1World.playAuxSFX(1005, par2, par3, par4, 0);
|
|
||||||
par1World.playRecord((String) null, par2, par3, par4);
|
|
||||||
var5.func_96098_a((ItemStack) null);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2);
|
|
||||||
float var7 = 0.7F;
|
|
||||||
double var8 = (double) (par1World.rand.nextFloat() * var7) + (double) (1.0F - var7) * 0.5D;
|
|
||||||
double var10 = (double) (par1World.rand.nextFloat() * var7) + (double) (1.0F - var7) * 0.2D + 0.6D;
|
|
||||||
double var12 = (double) (par1World.rand.nextFloat() * var7) + (double) (1.0F - var7) * 0.5D;
|
|
||||||
ItemStack var14 = var6.copy();
|
|
||||||
EntityItem var15 = new EntityItem(par1World, (double) par2 + var8, (double) par3 + var10, (double) par4 + var12, var14);
|
|
||||||
var15.delayBeforeCanPickup = 10;
|
|
||||||
par1World.spawnEntityInWorld(var15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,9 +53,6 @@ public class BlockJukeBox extends BlockContainer {
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
* Drops the block items with a specified chance of dropping the specified items
|
||||||
*/
|
*/
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -90,93 +90,6 @@ public class BlockLeaves extends BlockLeavesBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
|
|
||||||
if ((var6 & 8) != 0 && (var6 & 4) == 0) {
|
|
||||||
byte var7 = 4;
|
|
||||||
int var8 = var7 + 1;
|
|
||||||
byte var9 = 32;
|
|
||||||
int var10 = var9 * var9;
|
|
||||||
int var11 = var9 / 2;
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks == null) {
|
|
||||||
this.adjacentTreeBlocks = new int[var9 * var9 * var9];
|
|
||||||
}
|
|
||||||
|
|
||||||
int var12;
|
|
||||||
|
|
||||||
if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) {
|
|
||||||
int var13;
|
|
||||||
int var14;
|
|
||||||
int var15;
|
|
||||||
|
|
||||||
for (var12 = -var7; var12 <= var7; ++var12) {
|
|
||||||
for (var13 = -var7; var13 <= var7; ++var13) {
|
|
||||||
for (var14 = -var7; var14 <= var7; ++var14) {
|
|
||||||
var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14);
|
|
||||||
|
|
||||||
if (var15 == Block.wood.blockID) {
|
|
||||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0;
|
|
||||||
} else if (var15 == Block.leaves.blockID) {
|
|
||||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2;
|
|
||||||
} else {
|
|
||||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var12 = 1; var12 <= 4; ++var12) {
|
|
||||||
for (var13 = -var7; var13 <= var7; ++var13) {
|
|
||||||
for (var14 = -var7; var14 <= var7; ++var14) {
|
|
||||||
for (var15 = -var7; var15 <= var7; ++var15) {
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) {
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) {
|
|
||||||
this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11];
|
|
||||||
|
|
||||||
if (var12 >= 0) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
|
||||||
} else {
|
|
||||||
this.removeLeaves(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A randomly called display update to be able to add particles or other items
|
* A randomly called display update to be able to add particles or other items
|
||||||
* for display
|
* for display
|
||||||
|
@ -213,52 +126,6 @@ public class BlockLeaves extends BlockLeavesBase {
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
* Drops the block items with a specified chance of dropping the specified items
|
||||||
*/
|
*/
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var8 = 20;
|
|
||||||
|
|
||||||
if ((par5 & 3) == 3) {
|
|
||||||
var8 = 40;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par7 > 0) {
|
|
||||||
var8 -= 2 << par7;
|
|
||||||
|
|
||||||
if (var8 < 10) {
|
|
||||||
var8 = 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.rand.nextInt(var8) == 0) {
|
|
||||||
int var9 = this.idDropped(par5, par1World.rand, par7);
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var9, 1, this.damageDropped(par5)));
|
|
||||||
}
|
|
||||||
|
|
||||||
var8 = 200;
|
|
||||||
|
|
||||||
if (par7 > 0) {
|
|
||||||
var8 -= 10 << par7;
|
|
||||||
|
|
||||||
if (var8 < 40) {
|
|
||||||
var8 = 40;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((par5 & 3) == 0 && par1World.rand.nextInt(var8) == 0) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleRed, 1, 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the player destroys a block with an item that can harvest it. (i,
|
|
||||||
* j, k) are the coordinates of the block and l is the block's subtype/damage.
|
|
||||||
*/
|
|
||||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
|
||||||
if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3));
|
|
||||||
} else {
|
|
||||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -241,34 +241,7 @@ public class BlockLever extends Block {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
int var11 = var10 & 7;
|
|
||||||
int var12 = 8 - (var10 & 8);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3);
|
|
||||||
par1World.playSoundEffect((double) par2 + 0.5D, (double) par3 + 0.5D, (double) par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
||||||
|
|
||||||
if (var11 == 1) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
|
|
||||||
} else if (var11 == 2) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
|
|
||||||
} else if (var11 == 3) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
|
|
||||||
} else if (var11 == 4) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
|
|
||||||
} else if (var11 != 5 && var11 != 6) {
|
|
||||||
if (var11 == 0 || var11 == 7) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -50,22 +50,6 @@ public class BlockMycelium extends Block {
|
||||||
* Ticks the block if it's been scheduled
|
* Ticks the block if it's been scheduled
|
||||||
*/
|
*/
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
public void updateTick(World par1World, int par2, int par3, int par4, EaglercraftRandom par5Random) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) {
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
|
||||||
} else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) {
|
|
||||||
for (int var6 = 0; var6 < 4; ++var6) {
|
|
||||||
int var7 = par2 + par5Random.nextInt(3) - 1;
|
|
||||||
int var8 = par3 + par5Random.nextInt(5) - 3;
|
|
||||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
|
||||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
|
||||||
|
|
||||||
if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) {
|
|
||||||
par1World.setBlock(var7, var8, var9, this.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -63,21 +63,6 @@ public class BlockNetherStalk extends BlockFlower {
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
* Drops the block items with a specified chance of dropping the specified items
|
||||||
*/
|
*/
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var8 = 1;
|
|
||||||
|
|
||||||
if (par5 >= 3) {
|
|
||||||
var8 = 2 + par1World.rand.nextInt(3);
|
|
||||||
|
|
||||||
if (par7 > 0) {
|
|
||||||
var8 += par1World.rand.nextInt(par7 + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var9 = 0; var9 < var8; ++var9) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,31 +30,7 @@ public class BlockNote extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
TileEntityNote var10 = (TileEntityNote) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var10 != null) {
|
|
||||||
var10.changePitch();
|
|
||||||
var10.triggerNote(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
|
|
||||||
*/
|
|
||||||
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
TileEntityNote var6 = (TileEntityNote) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var6 != null) {
|
|
||||||
var6.triggerNote(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -94,30 +94,12 @@ public class BlockPistonBase extends Block {
|
||||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) {
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) {
|
||||||
int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLiving);
|
int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLiving);
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.updatePistonState(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.updatePistonState(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
||||||
*/
|
*/
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) {
|
|
||||||
this.updatePistonState(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,19 +146,6 @@ public class BlockPistonBase extends Block {
|
||||||
* z, blockID, EventID, event parameter
|
* z, blockID, EventID, event parameter
|
||||||
*/
|
*/
|
||||||
public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6);
|
|
||||||
|
|
||||||
if (var7 && par5 == 1) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!var7 && par5 == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par5 == 0) {
|
if (par5 == 0) {
|
||||||
if (!this.tryExtend(par1World, par2, par3, par4, par6)) {
|
if (!this.tryExtend(par1World, par2, par3, par4, par6)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -80,12 +80,7 @@ public class BlockPistonMoving extends BlockContainer {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) {
|
return false;
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,13 +94,6 @@ public class BlockPistonMoving extends BlockContainer {
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
* Drops the block items with a specified chance of dropping the specified items
|
||||||
*/
|
*/
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
TileEntityPiston var8 = this.getTileEntityAtLocation(par1World, par2, par3, par4);
|
|
||||||
|
|
||||||
if (var8 != null) {
|
|
||||||
Block.blocksList[var8.getStoredBlockID()].dropBlockAsItem(par1World, par2, par3, par4, var8.getBlockMetadata(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,9 +102,6 @@ public class BlockPistonMoving extends BlockContainer {
|
||||||
* blockID
|
* blockID
|
||||||
*/
|
*/
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -37,19 +37,6 @@ public class BlockPotato extends BlockCrops {
|
||||||
return Item.potato.itemID;
|
return Item.potato.itemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
|
||||||
*/
|
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
|
||||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (par5 >= 7 && par1World.rand.nextInt(50) == 0) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.poisonousPotato));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When this method is called, your block should register all the icons it needs
|
* When this method is called, your block should register all the icons it needs
|
||||||
* with the given IconRegister. This is the only chance you get to register
|
* with the given IconRegister. This is the only chance you get to register
|
||||||
|
|
|
@ -30,19 +30,6 @@ public class BlockPumpkin extends BlockDirectional {
|
||||||
super.onBlockAdded(par1World, par2, par3, par4);
|
super.onBlockAdded(par1World, par2, par3, par4);
|
||||||
|
|
||||||
if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockSnow.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockSnow.blockID) {
|
if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockSnow.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockSnow.blockID) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
par1World.setBlock(par2, par3, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2);
|
|
||||||
EntitySnowman var9 = new EntitySnowman();
|
|
||||||
var9.setWorld(par1World);
|
|
||||||
var9.setLocationAndAngles((double) par2 + 0.5D, (double) par3 - 1.95D, (double) par4 + 0.5D, 0.0F, 0.0F);
|
|
||||||
par1World.spawnEntityInWorld(var9);
|
|
||||||
par1World.notifyBlockChange(par2, par3, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 1, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 2, par4, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var10 = 0; var10 < 120; ++var10) {
|
for (int var10 = 0; var10 < 120; ++var10) {
|
||||||
par1World.spawnParticle("snowshovel", (double) par2 + par1World.rand.nextDouble(), (double) (par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double) par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
|
par1World.spawnParticle("snowshovel", (double) par2 + par1World.rand.nextDouble(), (double) (par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double) par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,60 +109,8 @@ public abstract class BlockRailBase extends Block {
|
||||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
||||||
*/
|
*/
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.refreshTrackShape(par1World, par2, par3, par4, true);
|
|
||||||
|
|
||||||
if (this.isPowered) {
|
|
||||||
this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
int var7 = var6;
|
|
||||||
|
|
||||||
if (this.isPowered) {
|
|
||||||
var7 = var6 & 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean var8 = false;
|
|
||||||
|
|
||||||
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) {
|
|
||||||
var8 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var7 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4)) {
|
|
||||||
var8 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var7 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4)) {
|
|
||||||
var8 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var7 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1)) {
|
|
||||||
var8 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var7 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1)) {
|
|
||||||
var8 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var8) {
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
} else {
|
|
||||||
this.func_94358_a(par1World, par2, par3, par4, var6, var7, par5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) {
|
protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,9 +118,6 @@ public abstract class BlockRailBase extends Block {
|
||||||
* Completely recalculates the track shape based on neighboring tracks
|
* Completely recalculates the track shape based on neighboring tracks
|
||||||
*/
|
*/
|
||||||
protected void refreshTrackShape(World par1World, int par2, int par3, int par4, boolean par5) {
|
protected void refreshTrackShape(World par1World, int par2, int par3, int par4, boolean par5) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
(new BlockBaseRailLogic(this, par1World, par2, par3, par4)).func_94511_a(par1World.isBlockIndirectlyGettingPowered(par2, par3, par4), par5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,43 +28,6 @@ public class BlockRedstoneLight extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
||||||
*/
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
|
|
||||||
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4);
|
|
||||||
} else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
|
|
||||||
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4);
|
|
||||||
} else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote && this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
|
|
||||||
par1World.setBlock(par2, par3, par4, Block.redstoneLampIdle.blockID, 0, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ID of the items to drop on destruction.
|
* Returns the ID of the items to drop on destruction.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -156,109 +156,6 @@ public class BlockRedstoneWire extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls World.notifyBlocksOfNeighborChange() for all neighboring blocks, but
|
|
||||||
* only if the given block is a redstone wire.
|
|
||||||
*/
|
|
||||||
private void notifyWireNeighborsOfNeighborChange(World par1World, int par2, int par3, int par4) {
|
|
||||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
||||||
*/
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
|
||||||
super.onBlockAdded(par1World, par2, par3, par4);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1);
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ejects contained items into the world, and notifies neighbours of an update,
|
|
||||||
* as appropriate
|
|
||||||
*/
|
|
||||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
|
||||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
|
|
||||||
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
|
|
||||||
this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1);
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1);
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1);
|
|
||||||
} else {
|
|
||||||
this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current strength at the specified block if it is greater than the
|
* Returns the current strength at the specified block if it is greater than the
|
||||||
* passed value, or the passed value otherwise. Signature: (world, x, y, z,
|
* passed value, or the passed value otherwise. Signature: (world, x, y, z,
|
||||||
|
@ -273,26 +170,6 @@ public class BlockRedstoneWire extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
boolean var6 = this.canPlaceBlockAt(par1World, par2, par3, par4);
|
|
||||||
|
|
||||||
if (var6) {
|
|
||||||
this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4);
|
|
||||||
} else {
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0);
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ID of the items to drop on destruction.
|
* Returns the ID of the items to drop on destruction.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,15 +31,6 @@ public class BlockSand extends Block {
|
||||||
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
this.tryToFall(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there is space to fall below will start this block falling
|
* If there is space to fall below will start this block falling
|
||||||
*/
|
*/
|
||||||
|
@ -47,13 +38,7 @@ public class BlockSand extends Block {
|
||||||
if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) {
|
if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) {
|
||||||
byte var8 = 32;
|
byte var8 = 32;
|
||||||
|
|
||||||
if (!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) {
|
if (!(!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
EntityFallingSand var9 = new EntityFallingSand(par1World, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), this.blockID, par1World.getBlockMetadata(par2, par3, par4));
|
|
||||||
this.onStartFalling(var9);
|
|
||||||
par1World.spawnEntityInWorld(var9);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
par1World.setBlockToAir(par2, par3, par4);
|
||||||
|
|
||||||
while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) {
|
while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) {
|
||||||
|
|
|
@ -29,22 +29,6 @@ public class BlockSilverfish extends Block {
|
||||||
public void registerIcons(IconRegister par1IconRegister) {
|
public void registerIcons(IconRegister par1IconRegister) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called right before the block is destroyed by a player. Args: world, x, y, z,
|
|
||||||
* metaData
|
|
||||||
*/
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
EntitySilverfish var6 = new EntitySilverfish();
|
|
||||||
var6.setWorld(par1World);
|
|
||||||
var6.setLocationAndAngles((double) par2 + 0.5D, (double) par3, (double) par4 + 0.5D, 0.0F, 0.0F);
|
|
||||||
par1World.spawnEntityInWorld(var6);
|
|
||||||
var6.spawnExplosionParticle();
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the quantity of items to drop on block destruction.
|
* Returns the quantity of items to drop on block destruction.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -132,21 +132,6 @@ public class BlockSkull extends BlockContainer {
|
||||||
* as appropriate
|
* as appropriate
|
||||||
*/
|
*/
|
||||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if ((par6 & 8) == 0) {
|
|
||||||
ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
|
|
||||||
TileEntitySkull var8 = (TileEntitySkull) par1World.getBlockTileEntity(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0) {
|
|
||||||
var7.setTagCompound(new NBTTagCompound());
|
|
||||||
var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, var7);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -160,91 +145,6 @@ public class BlockSkull extends BlockContainer {
|
||||||
* This method attempts to create a wither at the given location and skull
|
* This method attempts to create a wither at the given location and skull
|
||||||
*/
|
*/
|
||||||
public void makeWither(World par1World, int par2, int par3, int par4, TileEntitySkull par5TileEntitySkull) {
|
public void makeWither(World par1World, int par2, int par3, int par4, TileEntitySkull par5TileEntitySkull) {
|
||||||
if (par5TileEntitySkull.getSkullType() == 1 && par3 >= 2 && par1World.difficultySetting > 0 && !par1World.isRemote) {
|
|
||||||
int var6 = Block.slowSand.blockID;
|
|
||||||
int var7;
|
|
||||||
EntityWither var8;
|
|
||||||
int var9;
|
|
||||||
|
|
||||||
for (var7 = -2; var7 <= 0; ++var7) {
|
|
||||||
if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6
|
|
||||||
&& par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1)
|
|
||||||
&& this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1)) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7, 8, 2);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 1, 8, 2);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 2, 8, 2);
|
|
||||||
par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 1, par4 + var7 + 2, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2, par3 - 2, par4 + var7 + 1, 0, 0, 2);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
var8 = new EntityWither();
|
|
||||||
var8.setWorld(par1World);
|
|
||||||
var8.setLocationAndAngles((double) par2 + 0.5D, (double) par3 - 1.45D, (double) (par4 + var7) + 1.5D, 90.0F, 0.0F);
|
|
||||||
var8.renderYawOffset = 90.0F;
|
|
||||||
var8.func_82206_m();
|
|
||||||
par1World.spawnEntityInWorld(var8);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var9 = 0; var9 < 120; ++var9) {
|
|
||||||
par1World.spawnParticle("snowballpoof", (double) par2 + par1World.rand.nextDouble(), (double) (par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double) (par4 + var7 + 1) + par1World.rand.nextDouble(), 0.0D, 0.0D,
|
|
||||||
0.0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.notifyBlockChange(par2, par3, par4 + var7, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3, par4 + var7 + 1, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3, par4 + var7 + 2, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 1, par4 + var7, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 1, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 2, 0);
|
|
||||||
par1World.notifyBlockChange(par2, par3 - 2, par4 + var7 + 1, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var7 = -2; var7 <= 0; ++var7) {
|
|
||||||
if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6
|
|
||||||
&& par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1)
|
|
||||||
&& this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1)) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2 + var7, par3, par4, 8, 2);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2 + var7 + 1, par3, par4, 8, 2);
|
|
||||||
par1World.setBlockMetadataWithNotify(par2 + var7 + 2, par3, par4, 8, 2);
|
|
||||||
par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7 + 2, par3 - 1, par4, 0, 0, 2);
|
|
||||||
par1World.setBlock(par2 + var7 + 1, par3 - 2, par4, 0, 0, 2);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
var8 = new EntityWither();
|
|
||||||
var8.setWorld(par1World);
|
|
||||||
var8.setLocationAndAngles((double) (par2 + var7) + 1.5D, (double) par3 - 1.45D, (double) par4 + 0.5D, 0.0F, 0.0F);
|
|
||||||
var8.func_82206_m();
|
|
||||||
par1World.spawnEntityInWorld(var8);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var9 = 0; var9 < 120; ++var9) {
|
|
||||||
par1World.spawnParticle("snowballpoof", (double) (par2 + var7 + 1) + par1World.rand.nextDouble(), (double) (par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double) par4 + par1World.rand.nextDouble(), 0.0D, 0.0D,
|
|
||||||
0.0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
par1World.notifyBlockChange(par2 + var7, par3, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7 + 1, par3, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7 + 2, par3, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7, par3 - 1, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7 + 1, par3 - 1, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7 + 2, par3 - 1, par4, 0);
|
|
||||||
par1World.notifyBlockChange(par2 + var7 + 1, par3 - 2, par4, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean func_82528_d(World par1World, int par2, int par3, int par4, int par5) {
|
private boolean func_82528_d(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
|
|
|
@ -192,31 +192,6 @@ public class BlockStem extends BlockFlower {
|
||||||
: (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1))));
|
: (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Drops the block items with a specified chance of dropping the specified items
|
|
||||||
*/
|
|
||||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
|
|
||||||
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
|
|
||||||
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
Item var8 = null;
|
|
||||||
|
|
||||||
if (this.fruitType == Block.pumpkin) {
|
|
||||||
var8 = Item.pumpkinSeeds;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.fruitType == Block.melon) {
|
|
||||||
var8 = Item.melonSeeds;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var9 = 0; var9 < 3; ++var9) {
|
|
||||||
if (par1World.rand.nextInt(15) <= par5) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ID of the items to drop on destruction.
|
* Returns the ID of the items to drop on destruction.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,11 +54,6 @@ public class BlockTNT extends Block {
|
||||||
* Called upon the block being destroyed by an explosion
|
* Called upon the block being destroyed by an explosion
|
||||||
*/
|
*/
|
||||||
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {
|
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
EntityTNTPrimed var6 = new EntityTNTPrimed(par1World, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), par5Explosion.func_94613_c());
|
|
||||||
var6.fuse = par1World.rand.nextInt(var6.fuse / 4) + var6.fuse / 8;
|
|
||||||
par1World.spawnEntityInWorld(var6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,13 +65,6 @@ public class BlockTNT extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_94391_a(World par1World, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) {
|
public void func_94391_a(World par1World, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) {
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if ((par5 & 1) == 1) {
|
|
||||||
EntityTNTPrimed var7 = new EntityTNTPrimed(par1World, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), par6EntityLiving);
|
|
||||||
par1World.spawnEntityInWorld(var7);
|
|
||||||
par1World.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,21 +80,6 @@ public class BlockTNT extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (par5Entity instanceof EntityArrow && !par1World.isRemote) {
|
|
||||||
EntityArrow var6 = (EntityArrow) par5Entity;
|
|
||||||
|
|
||||||
if (var6.isBurning()) {
|
|
||||||
this.func_94391_a(par1World, par2, par3, par4, 1, var6.shootingEntity instanceof EntityLiving ? (EntityLiving) var6.shootingEntity : null);
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether this block can drop from an explosion.
|
* Return whether this block can drop from an explosion.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -71,18 +71,6 @@ public class BlockTallGrass extends BlockFlower {
|
||||||
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
return 1 + par2Random.nextInt(par1 * 2 + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the player destroys a block with an item that can harvest it. (i,
|
|
||||||
* j, k) are the coordinates of the block and l is the block's subtype/damage.
|
|
||||||
*/
|
|
||||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
|
||||||
if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6));
|
|
||||||
} else {
|
|
||||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the block's damage value (for use with pick block).
|
* Get the block's damage value (for use with pick block).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -127,46 +127,6 @@ public class BlockTrapDoor extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
int var7 = par2;
|
|
||||||
int var8 = par4;
|
|
||||||
|
|
||||||
if ((var6 & 3) == 0) {
|
|
||||||
var8 = par4 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((var6 & 3) == 1) {
|
|
||||||
--var8;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((var6 & 3) == 2) {
|
|
||||||
var7 = par2 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((var6 & 3) == 3) {
|
|
||||||
--var7;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8))) {
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean var9 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
|
|
||||||
|
|
||||||
if (var9 || par5 > 0 && Block.blocksList[par5].canProvidePower()) {
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, var9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ray traces through the blocks collision from start vector to end vector
|
* Ray traces through the blocks collision from start vector to end vector
|
||||||
* returning a ray trace hit. Args: world, x, y, z, startVec, endVec
|
* returning a ray trace hit. Args: world, x, y, z, startVec, endVec
|
||||||
|
|
|
@ -123,17 +123,6 @@ public class BlockTripWire extends Block {
|
||||||
this.func_72149_e(par1World, par2, par3, par4, par6 | 1);
|
this.func_72149_e(par1World, par2, par3, par4, par6 | 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the block is attempted to be harvested
|
|
||||||
*/
|
|
||||||
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) {
|
private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) {
|
||||||
int var6 = 0;
|
int var6 = 0;
|
||||||
|
|
||||||
|
@ -164,29 +153,6 @@ public class BlockTripWire extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered whenever an entity collides with this block (enters into the
|
|
||||||
* block). Args: world, x, y, z, entity
|
|
||||||
*/
|
|
||||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if ((par1World.getBlockMetadata(par2, par3, par4) & 1) != 1) {
|
|
||||||
this.updateTripWireState(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote) {
|
|
||||||
if ((par1World.getBlockMetadata(par2, par3, par4) & 1) == 1) {
|
|
||||||
this.updateTripWireState(par1World, par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTripWireState(World par1World, int par2, int par3, int par4) {
|
private void updateTripWireState(World par1World, int par2, int par3, int par4) {
|
||||||
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
boolean var6 = (var5 & 1) == 1;
|
boolean var6 = (var5 & 1) == 1;
|
||||||
|
|
|
@ -211,124 +211,6 @@ public class BlockVine extends Block {
|
||||||
return (var5 & 0xff00ff) | (var6 << 8);
|
return (var5 & 0xff00ff) | (var6 << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
|
||||||
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
|
|
||||||
* blockID
|
|
||||||
*/
|
|
||||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
|
||||||
if (!par1World.isRemote && !this.canVineStay(par1World, par2, par3, par4)) {
|
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
|
||||||
par1World.setBlockToAir(par2, par3, par4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticks the block if it's been scheduled
|
|
||||||
*/
|
|
||||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
|
||||||
if (!par1World.isRemote && par1World.rand.nextInt(4) == 0) {
|
|
||||||
byte var6 = 4;
|
|
||||||
int var7 = 5;
|
|
||||||
boolean var8 = false;
|
|
||||||
int var9;
|
|
||||||
int var10;
|
|
||||||
int var11;
|
|
||||||
label138:
|
|
||||||
|
|
||||||
for (var9 = par2 - var6; var9 <= par2 + var6; ++var9) {
|
|
||||||
for (var10 = par4 - var6; var10 <= par4 + var6; ++var10) {
|
|
||||||
for (var11 = par3 - 1; var11 <= par3 + 1; ++var11) {
|
|
||||||
if (par1World.getBlockId(var9, var11, var10) == this.blockID) {
|
|
||||||
--var7;
|
|
||||||
|
|
||||||
if (var7 <= 0) {
|
|
||||||
var8 = true;
|
|
||||||
break label138;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var9 = par1World.getBlockMetadata(par2, par3, par4);
|
|
||||||
var10 = par1World.rand.nextInt(6);
|
|
||||||
var11 = Direction.facingToDirection[var10];
|
|
||||||
int var12;
|
|
||||||
int var13;
|
|
||||||
|
|
||||||
if (var10 == 1 && par3 < 255 && par1World.isAirBlock(par2, par3 + 1, par4)) {
|
|
||||||
if (var8) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var12 = par1World.rand.nextInt(16) & var9;
|
|
||||||
|
|
||||||
if (var12 > 0) {
|
|
||||||
for (var13 = 0; var13 <= 3; ++var13) {
|
|
||||||
if (!this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3 + 1, par4 + Direction.offsetZ[var13]))) {
|
|
||||||
var12 &= ~(1 << var13);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var12 > 0) {
|
|
||||||
par1World.setBlock(par2, par3 + 1, par4, this.blockID, var12, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int var14;
|
|
||||||
|
|
||||||
if (var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) {
|
|
||||||
if (var8) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var12 = par1World.getBlockId(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11]);
|
|
||||||
|
|
||||||
if (var12 != 0 && Block.blocksList[var12] != null) {
|
|
||||||
if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var13 = var11 + 1 & 3;
|
|
||||||
var14 = var11 + 3 & 3;
|
|
||||||
|
|
||||||
if ((var9 & 1 << var13) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) {
|
|
||||||
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var13, 2);
|
|
||||||
} else if ((var9 & 1 << var14) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) {
|
|
||||||
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var14, 2);
|
|
||||||
} else if ((var9 & 1 << var13) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13])
|
|
||||||
&& this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var13]))) {
|
|
||||||
par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], this.blockID, 1 << (var11 + 2 & 3), 2);
|
|
||||||
} else if ((var9 & 1 << var14) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14])
|
|
||||||
&& this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var14]))) {
|
|
||||||
par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], this.blockID, 1 << (var11 + 2 & 3), 2);
|
|
||||||
} else if (this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11], par3 + 1, par4 + Direction.offsetZ[var11]))) {
|
|
||||||
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 0, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (par3 > 1) {
|
|
||||||
var12 = par1World.getBlockId(par2, par3 - 1, par4);
|
|
||||||
|
|
||||||
if (var12 == 0) {
|
|
||||||
var13 = par1World.rand.nextInt(16) & var9;
|
|
||||||
|
|
||||||
if (var13 > 0) {
|
|
||||||
par1World.setBlock(par2, par3 - 1, par4, this.blockID, var13, 2);
|
|
||||||
}
|
|
||||||
} else if (var12 == this.blockID) {
|
|
||||||
var13 = par1World.rand.nextInt(16) & var9;
|
|
||||||
var14 = par1World.getBlockMetadata(par2, par3 - 1, par4);
|
|
||||||
|
|
||||||
if (var14 != (var14 | var13)) {
|
|
||||||
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
|
||||||
* side, hitX, hitY, hitZ, block metadata
|
* side, hitX, hitY, hitZ, block metadata
|
||||||
|
@ -369,16 +251,4 @@ public class BlockVine extends Block {
|
||||||
public int quantityDropped(Random par1Random) {
|
public int quantityDropped(Random par1Random) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the player destroys a block with an item that can harvest it. (i,
|
|
||||||
* j, k) are the coordinates of the block and l is the block's subtype/damage.
|
|
||||||
*/
|
|
||||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
|
||||||
if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) {
|
|
||||||
this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0));
|
|
||||||
} else {
|
|
||||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,11 +32,6 @@ public class BlockWorkbench extends Block {
|
||||||
* Called upon block activation (right click on the block.)
|
* Called upon block activation (right click on the block.)
|
||||||
*/
|
*/
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||||
if (par1World.isRemote) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
par5EntityPlayer.displayGUIWorkbench(par2, par3, par4);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,18 +516,10 @@ public class Chunk {
|
||||||
int var12 = this.xPosition * 16 + par1;
|
int var12 = this.xPosition * 16 + par1;
|
||||||
int var13 = this.zPosition * 16 + par3;
|
int var13 = this.zPosition * 16 + par3;
|
||||||
|
|
||||||
if (var8 != 0 && !this.worldObj.isRemote) {
|
|
||||||
Block.blocksList[var8].onSetBlockIDWithMetaData(this.worldObj, var12, par2, var13, var9);
|
|
||||||
}
|
|
||||||
|
|
||||||
var10.setExtBlockID(par1, par2 & 15, par3, par4);
|
var10.setExtBlockID(par1, par2 & 15, par3, par4);
|
||||||
|
|
||||||
if (var8 != 0) {
|
if (var8 != 0) {
|
||||||
if (!this.worldObj.isRemote) {
|
this.worldObj.removeBlockTileEntity(var12, par2, var13);
|
||||||
Block.blocksList[var8].breakBlock(this.worldObj, var12, par2, var13, var8, var9);
|
|
||||||
} else if (Block.blocksList[var8] instanceof ITileEntityProvider && var8 != par4) {
|
|
||||||
this.worldObj.removeBlockTileEntity(var12, par2, var13);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var10.getExtBlockID(par1, par2 & 15, par3) != par4) {
|
if (var10.getExtBlockID(par1, par2 & 15, par3) != par4) {
|
||||||
|
@ -552,10 +544,6 @@ public class Chunk {
|
||||||
TileEntity var14;
|
TileEntity var14;
|
||||||
|
|
||||||
if (par4 != 0) {
|
if (par4 != 0) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
Block.blocksList[par4].onBlockAdded(this.worldObj, var12, par2, var13);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Block.blocksList[par4] instanceof ITileEntityProvider) {
|
if (Block.blocksList[par4] instanceof ITileEntityProvider) {
|
||||||
var14 = this.getChunkBlockTileEntity(par1, par2, par3);
|
var14 = this.getChunkBlockTileEntity(par1, par2, par3);
|
||||||
|
|
||||||
|
|
|
@ -79,49 +79,6 @@ public class ContainerEnchantment extends Container {
|
||||||
|
|
||||||
if (var2 != null && var2.isItemEnchantable()) {
|
if (var2 != null && var2.isItemEnchantable()) {
|
||||||
this.nameSeed = this.rand.nextLong();
|
this.nameSeed = this.rand.nextLong();
|
||||||
|
|
||||||
if (!this.worldPointer.isRemote) {
|
|
||||||
var3 = 0;
|
|
||||||
int var4;
|
|
||||||
|
|
||||||
for (var4 = -1; var4 <= 1; ++var4) {
|
|
||||||
for (int var5 = -1; var5 <= 1; ++var5) {
|
|
||||||
if ((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) {
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var5 != 0 && var4 != 0) {
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldPointer.getBlockId(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) {
|
|
||||||
++var3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var4 = 0; var4 < 3; ++var4) {
|
|
||||||
this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.rand, var4, var3, var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.detectAndSendChanges();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for (var3 = 0; var3 < 3; ++var3) {
|
for (var3 = 0; var3 < 3; ++var3) {
|
||||||
this.enchantLevels[var3] = 0;
|
this.enchantLevels[var3] = 0;
|
||||||
|
@ -138,56 +95,12 @@ public class ContainerEnchantment extends Container {
|
||||||
ItemStack var3 = this.tableInventory.getStackInSlot(0);
|
ItemStack var3 = this.tableInventory.getStackInSlot(0);
|
||||||
|
|
||||||
if (this.enchantLevels[par2] > 0 && var3 != null && (par1EntityPlayer.experienceLevel >= this.enchantLevels[par2] || par1EntityPlayer.capabilities.isCreativeMode)) {
|
if (this.enchantLevels[par2] > 0 && var3 != null && (par1EntityPlayer.experienceLevel >= this.enchantLevels[par2] || par1EntityPlayer.capabilities.isCreativeMode)) {
|
||||||
if (!this.worldPointer.isRemote) {
|
|
||||||
List var4 = EnchantmentHelper.buildEnchantmentList(this.rand, var3, this.enchantLevels[par2]);
|
|
||||||
boolean var5 = var3.itemID == Item.book.itemID;
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
par1EntityPlayer.addExperienceLevel(-this.enchantLevels[par2]);
|
|
||||||
|
|
||||||
if (var5) {
|
|
||||||
var3.itemID = Item.enchantedBook.itemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
int var6 = var5 ? this.rand.nextInt(var4.size()) : -1;
|
|
||||||
|
|
||||||
for (int var7 = 0; var7 < var4.size(); ++var7) {
|
|
||||||
EnchantmentData var8 = (EnchantmentData) var4.get(var7);
|
|
||||||
|
|
||||||
if (!var5 || var7 == var6) {
|
|
||||||
if (var5) {
|
|
||||||
Item.enchantedBook.func_92115_a(var3, var8);
|
|
||||||
} else {
|
|
||||||
var3.addEnchantment(var8.enchantmentobj, var8.enchantmentLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onCraftMatrixChanged(this.tableInventory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback for when the crafting gui is closed.
|
|
||||||
*/
|
|
||||||
public void onCraftGuiClosed(EntityPlayer par1EntityPlayer) {
|
|
||||||
super.onCraftGuiClosed(par1EntityPlayer);
|
|
||||||
|
|
||||||
if (!this.worldPointer.isRemote) {
|
|
||||||
ItemStack var2 = this.tableInventory.getStackInSlotOnClosing(0);
|
|
||||||
|
|
||||||
if (var2 != null) {
|
|
||||||
par1EntityPlayer.dropPlayerItem(var2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||||
return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false
|
return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false
|
||||||
: par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
|
: par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
|
||||||
|
|
|
@ -115,19 +115,5 @@ public class ContainerMerchant extends Container {
|
||||||
super.onCraftGuiClosed(par1EntityPlayer);
|
super.onCraftGuiClosed(par1EntityPlayer);
|
||||||
this.theMerchant.setCustomer((EntityPlayer) null);
|
this.theMerchant.setCustomer((EntityPlayer) null);
|
||||||
super.onCraftGuiClosed(par1EntityPlayer);
|
super.onCraftGuiClosed(par1EntityPlayer);
|
||||||
|
|
||||||
if (!this.theWorld.isRemote) {
|
|
||||||
ItemStack var2 = this.merchantInventory.getStackInSlotOnClosing(0);
|
|
||||||
|
|
||||||
if (var2 != null) {
|
|
||||||
par1EntityPlayer.dropPlayerItem(var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
var2 = this.merchantInventory.getStackInSlotOnClosing(1);
|
|
||||||
|
|
||||||
if (var2 != null) {
|
|
||||||
par1EntityPlayer.dropPlayerItem(var2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,23 +319,6 @@ public class ContainerRepair extends Container {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback for when the crafting gui is closed.
|
|
||||||
*/
|
|
||||||
public void onCraftGuiClosed(EntityPlayer par1EntityPlayer) {
|
|
||||||
super.onCraftGuiClosed(par1EntityPlayer);
|
|
||||||
|
|
||||||
if (!this.theWorld.isRemote) {
|
|
||||||
for (int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) {
|
|
||||||
ItemStack var3 = this.inputSlots.getStackInSlotOnClosing(var2);
|
|
||||||
|
|
||||||
if (var3 != null) {
|
|
||||||
par1EntityPlayer.dropPlayerItem(var3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||||
return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false
|
return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false
|
||||||
: par1EntityPlayer.getDistanceSq((double) this.field_82861_i + 0.5D, (double) this.field_82858_j + 0.5D, (double) this.field_82859_k + 0.5D) <= 64.0D;
|
: par1EntityPlayer.getDistanceSq((double) this.field_82861_i + 0.5D, (double) this.field_82858_j + 0.5D, (double) this.field_82859_k + 0.5D) <= 64.0D;
|
||||||
|
|
|
@ -44,23 +44,6 @@ public class ContainerWorkbench extends Container {
|
||||||
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
|
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback for when the crafting gui is closed.
|
|
||||||
*/
|
|
||||||
public void onCraftGuiClosed(EntityPlayer par1EntityPlayer) {
|
|
||||||
super.onCraftGuiClosed(par1EntityPlayer);
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
for (int var2 = 0; var2 < 9; ++var2) {
|
|
||||||
ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2);
|
|
||||||
|
|
||||||
if (var3 != null) {
|
|
||||||
par1EntityPlayer.dropPlayerItem(var3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||||
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
|
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,23 +394,7 @@ public abstract class Entity {
|
||||||
|
|
||||||
this.handleWaterMovement();
|
this.handleWaterMovement();
|
||||||
|
|
||||||
if (this.worldObj.isRemote) {
|
this.fire = 0;
|
||||||
this.fire = 0;
|
|
||||||
} else if (this.fire > 0) {
|
|
||||||
if (this.isImmuneToFire) {
|
|
||||||
this.fire -= 4;
|
|
||||||
|
|
||||||
if (this.fire < 0) {
|
|
||||||
this.fire = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.fire % 20 == 0) {
|
|
||||||
this.attackEntityFrom(DamageSource.onFire, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
--this.fire;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.handleLavaMovement()) {
|
if (this.handleLavaMovement()) {
|
||||||
this.setOnFireFromLava();
|
this.setOnFireFromLava();
|
||||||
|
@ -421,11 +405,6 @@ public abstract class Entity {
|
||||||
this.kill();
|
this.kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setFlag(0, this.fire > 0);
|
|
||||||
this.setFlag(2, this.ridingEntity != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.firstUpdate = false;
|
this.firstUpdate = false;
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
}
|
}
|
||||||
|
@ -1616,13 +1595,6 @@ public abstract class Entity {
|
||||||
if (this.timeUntilPortal > 0) {
|
if (this.timeUntilPortal > 0) {
|
||||||
this.timeUntilPortal = this.getPortalCooldown();
|
this.timeUntilPortal = this.getPortalCooldown();
|
||||||
} else {
|
} else {
|
||||||
double var1 = this.prevPosX - this.posX;
|
|
||||||
double var3 = this.prevPosZ - this.posZ;
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && !this.inPortal) {
|
|
||||||
this.teleportDirection = Direction.getMovementDirection(var1, var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inPortal = true;
|
this.inPortal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,42 +6,6 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||||
|
|
||||||
public abstract EntityAgeable createChild(EntityAgeable var1);
|
public abstract EntityAgeable createChild(EntityAgeable var1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets
|
|
||||||
* into the saddle on a pig.
|
|
||||||
*/
|
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
|
||||||
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
|
||||||
|
|
||||||
if (var2 != null && var2.itemID == Item.monsterPlacer.itemID && !this.worldObj.isRemote) {
|
|
||||||
Class var3 = EntityList.getClassFromID(var2.getItemDamage());
|
|
||||||
|
|
||||||
if (var3 != null && var3.isAssignableFrom(this.getClass())) {
|
|
||||||
EntityAgeable var4 = this.createChild(this);
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
var4.setGrowingAge(-24000);
|
|
||||||
var4.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F);
|
|
||||||
this.worldObj.spawnEntityInWorld(var4);
|
|
||||||
|
|
||||||
if (var2.hasDisplayName()) {
|
|
||||||
var4.func_94058_c(var2.getDisplayName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!par1EntityPlayer.capabilities.isCreativeMode) {
|
|
||||||
--var2.stackSize;
|
|
||||||
|
|
||||||
if (var2.stackSize <= 0) {
|
|
||||||
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.interact(par1EntityPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void entityInit() {
|
protected void entityInit() {
|
||||||
super.entityInit();
|
super.entityInit();
|
||||||
this.dataWatcher.addObject(12, new Integer(0));
|
this.dataWatcher.addObject(12, new Integer(0));
|
||||||
|
@ -90,20 +54,7 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||||
*/
|
*/
|
||||||
public void onLivingUpdate() {
|
public void onLivingUpdate() {
|
||||||
super.onLivingUpdate();
|
super.onLivingUpdate();
|
||||||
|
this.func_98054_a(this.isChild());
|
||||||
if (this.worldObj.isRemote) {
|
|
||||||
this.func_98054_a(this.isChild());
|
|
||||||
} else {
|
|
||||||
int var1 = this.getGrowingAge();
|
|
||||||
|
|
||||||
if (var1 < 0) {
|
|
||||||
++var1;
|
|
||||||
this.setGrowingAge(var1);
|
|
||||||
} else if (var1 > 0) {
|
|
||||||
--var1;
|
|
||||||
this.setGrowingAge(var1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -271,10 +271,6 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||||
if (var4.entityHit instanceof EntityLiving) {
|
if (var4.entityHit instanceof EntityLiving) {
|
||||||
EntityLiving var25 = (EntityLiving) var4.entityHit;
|
EntityLiving var25 = (EntityLiving) var4.entityHit;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
var25.setArrowCountInEntity(var25.getArrowCountInEntity() + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.knockbackStrength > 0) {
|
if (this.knockbackStrength > 0) {
|
||||||
var27 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
var27 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
|
||||||
|
@ -416,25 +412,6 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by a player entity when they collide with an entity
|
|
||||||
*/
|
|
||||||
public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {
|
|
||||||
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) {
|
|
||||||
boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode;
|
|
||||||
|
|
||||||
if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1))) {
|
|
||||||
var2 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2) {
|
|
||||||
this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
|
||||||
par1EntityPlayer.onItemPickup(this, 1);
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns if this entity triggers Block.onEntityWalking on the blocks they walk
|
* returns if this entity triggers Block.onEntityWalking on the blocks they walk
|
||||||
* on. used for spiders and wolves to prevent them from trampling crops
|
* on. used for spiders and wolves to prevent them from trampling crops
|
||||||
|
|
|
@ -190,10 +190,6 @@ public class EntityBat extends EntityAmbientCreature {
|
||||||
if (this.isEntityInvulnerable()) {
|
if (this.isEntityInvulnerable()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.worldObj.isRemote && this.getIsBatHanging()) {
|
|
||||||
this.setIsBatHanging(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.attackEntityFrom(par1DamageSource, par2);
|
return super.attackEntityFrom(par1DamageSource, par2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,45 +57,6 @@ public class EntityBlaze extends EntityMob {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called frequently so the entity can update its state every tick as required.
|
|
||||||
* For example, zombies and skeletons use this to react to sunlight and start to
|
|
||||||
* burn.
|
|
||||||
*/
|
|
||||||
public void onLivingUpdate() {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (this.isWet()) {
|
|
||||||
this.attackEntityFrom(DamageSource.drown, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
--this.heightOffsetUpdateTime;
|
|
||||||
|
|
||||||
if (this.heightOffsetUpdateTime <= 0) {
|
|
||||||
this.heightOffsetUpdateTime = 100;
|
|
||||||
this.heightOffset = 0.5F + (float) this.rand.nextGaussian() * 3.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double) this.getEntityToAttack().getEyeHeight() > this.posY + (double) this.getEyeHeight() + (double) this.heightOffset) {
|
|
||||||
this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.rand.nextInt(24) == 0) {
|
|
||||||
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.onGround && this.motionY < 0.0D) {
|
|
||||||
this.motionY *= 0.6D;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var1 = 0; var1 < 2; ++var1) {
|
|
||||||
this.worldObj.spawnParticle("largesmoke", this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height,
|
|
||||||
this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onLivingUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic mob attack. Default to touch of death in EntityCreature. Overridden by
|
* Basic mob attack. Default to touch of death in EntityCreature. Overridden by
|
||||||
* each mob to define their attack.
|
* each mob to define their attack.
|
||||||
|
|
|
@ -90,26 +90,6 @@ public class EntityBoat extends Entity {
|
||||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
||||||
if (this.isEntityInvulnerable()) {
|
if (this.isEntityInvulnerable()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!this.worldObj.isRemote && !this.isDead) {
|
|
||||||
this.setForwardDirection(-this.getForwardDirection());
|
|
||||||
this.setTimeSinceHit(10);
|
|
||||||
this.setDamageTaken(this.getDamageTaken() + par2 * 10);
|
|
||||||
this.setBeenAttacked();
|
|
||||||
boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer) par1DamageSource.getEntity()).capabilities.isCreativeMode;
|
|
||||||
|
|
||||||
if (var3 || this.getDamageTaken() > 40) {
|
|
||||||
if (this.riddenByEntity != null) {
|
|
||||||
this.riddenByEntity.mountEntity(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!var3) {
|
|
||||||
this.dropItemWithOffset(Item.boat.itemID, 1, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +211,7 @@ public class EntityBoat extends Entity {
|
||||||
double var12;
|
double var12;
|
||||||
double var25;
|
double var25;
|
||||||
|
|
||||||
if (this.worldObj.isRemote && this.field_70279_a) {
|
if (this.field_70279_a) {
|
||||||
if (this.boatPosRotationIncrements > 0) {
|
if (this.boatPosRotationIncrements > 0) {
|
||||||
var6 = this.posX + (this.boatX - this.posX) / (double) this.boatPosRotationIncrements;
|
var6 = this.posX + (this.boatX - this.posX) / (double) this.boatPosRotationIncrements;
|
||||||
var8 = this.posY + (this.boatY - this.posY) / (double) this.boatPosRotationIncrements;
|
var8 = this.posY + (this.boatY - this.posY) / (double) this.boatPosRotationIncrements;
|
||||||
|
@ -306,20 +286,7 @@ public class EntityBoat extends Entity {
|
||||||
|
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||||
|
|
||||||
if (this.isCollidedHorizontally && var23 > 0.2D) {
|
if (!(this.isCollidedHorizontally && var23 > 0.2D)) {
|
||||||
if (!this.worldObj.isRemote && !this.isDead) {
|
|
||||||
this.setDead();
|
|
||||||
int var24;
|
|
||||||
|
|
||||||
for (var24 = 0; var24 < 3; ++var24) {
|
|
||||||
this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var24 = 0; var24 < 2; ++var24) {
|
|
||||||
this.dropItemWithOffset(Item.stick.itemID, 1, 0.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.motionX *= 0.9900000095367432D;
|
this.motionX *= 0.9900000095367432D;
|
||||||
this.motionY *= 0.949999988079071D;
|
this.motionY *= 0.949999988079071D;
|
||||||
this.motionZ *= 0.9900000095367432D;
|
this.motionZ *= 0.9900000095367432D;
|
||||||
|
@ -346,41 +313,6 @@ public class EntityBoat extends Entity {
|
||||||
|
|
||||||
this.rotationYaw = (float) ((double) this.rotationYaw + var14);
|
this.rotationYaw = (float) ((double) this.rotationYaw + var14);
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
||||||
int var26;
|
|
||||||
|
|
||||||
if (var16 != null && !var16.isEmpty()) {
|
|
||||||
for (var26 = 0; var26 < var16.size(); ++var26) {
|
|
||||||
Entity var18 = (Entity) var16.get(var26);
|
|
||||||
|
|
||||||
if (var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) {
|
|
||||||
var18.applyEntityCollision(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var26 = 0; var26 < 4; ++var26) {
|
|
||||||
int var27 = MathHelper.floor_double(this.posX + ((double) (var26 % 2) - 0.5D) * 0.8D);
|
|
||||||
int var19 = MathHelper.floor_double(this.posZ + ((double) (var26 / 2) - 0.5D) * 0.8D);
|
|
||||||
|
|
||||||
for (int var20 = 0; var20 < 2; ++var20) {
|
|
||||||
int var21 = MathHelper.floor_double(this.posY) + var20;
|
|
||||||
int var22 = this.worldObj.getBlockId(var27, var21, var19);
|
|
||||||
|
|
||||||
if (var22 == Block.snow.blockID) {
|
|
||||||
this.worldObj.setBlockToAir(var27, var21, var19);
|
|
||||||
} else if (var22 == Block.waterlily.blockID) {
|
|
||||||
this.worldObj.destroyBlock(var27, var21, var19, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.riddenByEntity != null && this.riddenByEntity.isDead) {
|
|
||||||
this.riddenByEntity = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,15 +345,7 @@ public class EntityBoat extends Entity {
|
||||||
* into the saddle on a pig.
|
* into the saddle on a pig.
|
||||||
*/
|
*/
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
public boolean interact(EntityPlayer par1EntityPlayer) {
|
||||||
if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) {
|
return true;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
par1EntityPlayer.mountEntity(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -59,12 +59,6 @@ public class EntityChicken extends EntityAnimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.field_70886_e += this.field_70889_i * 2.0F;
|
this.field_70886_e += this.field_70889_i * 2.0F;
|
||||||
|
|
||||||
if (!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {
|
|
||||||
this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
|
||||||
this.dropItem(Item.egg.itemID, 1);
|
|
||||||
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,18 +99,6 @@ public class EntityCreeper extends EntityMob {
|
||||||
|
|
||||||
if (this.timeSinceIgnited >= this.fuseTime) {
|
if (this.timeSinceIgnited >= this.fuseTime) {
|
||||||
this.timeSinceIgnited = this.fuseTime;
|
this.timeSinceIgnited = this.fuseTime;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
boolean var2 = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
|
||||||
|
|
||||||
if (this.getPowered()) {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius * 2), var2);
|
|
||||||
} else {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius, var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,18 +113,11 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
* burn.
|
* burn.
|
||||||
*/
|
*/
|
||||||
public void onLivingUpdate() {
|
public void onLivingUpdate() {
|
||||||
float var1;
|
float var1 = MathHelper.cos(this.animTime * (float) Math.PI * 2.0F);
|
||||||
float var2;
|
float var2 = MathHelper.cos(this.prevAnimTime * (float) Math.PI * 2.0F);
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
if (var2 <= -0.3F && var1 >= -0.3F) {
|
||||||
this.dataWatcher.updateObject(16, Integer.valueOf(this.health));
|
this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false);
|
||||||
} else {
|
|
||||||
var1 = MathHelper.cos(this.animTime * (float) Math.PI * 2.0F);
|
|
||||||
var2 = MathHelper.cos(this.prevAnimTime * (float) Math.PI * 2.0F);
|
|
||||||
|
|
||||||
if (var2 <= -0.3F && var1 >= -0.3F) {
|
|
||||||
this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prevAnimTime = this.animTime;
|
this.prevAnimTime = this.animTime;
|
||||||
|
@ -167,105 +160,16 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
double var26;
|
double var26;
|
||||||
float var31;
|
float var31;
|
||||||
|
|
||||||
if (this.worldObj.isRemote) {
|
if (this.newPosRotationIncrements > 0) {
|
||||||
if (this.newPosRotationIncrements > 0) {
|
var26 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements;
|
||||||
var26 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements;
|
var4 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements;
|
||||||
var4 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements;
|
var6 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements;
|
||||||
var6 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements;
|
var8 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw);
|
||||||
var8 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw);
|
this.rotationYaw = (float) ((double) this.rotationYaw + var8 / (double) this.newPosRotationIncrements);
|
||||||
this.rotationYaw = (float) ((double) this.rotationYaw + var8 / (double) this.newPosRotationIncrements);
|
this.rotationPitch = (float) ((double) this.rotationPitch + (this.newRotationPitch - (double) this.rotationPitch) / (double) this.newPosRotationIncrements);
|
||||||
this.rotationPitch = (float) ((double) this.rotationPitch + (this.newRotationPitch - (double) this.rotationPitch) / (double) this.newPosRotationIncrements);
|
--this.newPosRotationIncrements;
|
||||||
--this.newPosRotationIncrements;
|
this.setPosition(var26, var4, var6);
|
||||||
this.setPosition(var26, var4, var6);
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var26 = this.targetX - this.posX;
|
|
||||||
var4 = this.targetY - this.posY;
|
|
||||||
var6 = this.targetZ - this.posZ;
|
|
||||||
var8 = var26 * var26 + var4 * var4 + var6 * var6;
|
|
||||||
|
|
||||||
if (this.target != null) {
|
|
||||||
this.targetX = this.target.posX;
|
|
||||||
this.targetZ = this.target.posZ;
|
|
||||||
double var10 = this.targetX - this.posX;
|
|
||||||
double var12 = this.targetZ - this.posZ;
|
|
||||||
double var14 = Math.sqrt(var10 * var10 + var12 * var12);
|
|
||||||
double var16 = 0.4000000059604645D + var14 / 80.0D - 1.0D;
|
|
||||||
|
|
||||||
if (var16 > 10.0D) {
|
|
||||||
var16 = 10.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.targetY = this.target.boundingBox.minY + var16;
|
|
||||||
} else {
|
|
||||||
this.targetX += this.rand.nextGaussian() * 2.0D;
|
|
||||||
this.targetZ += this.rand.nextGaussian() * 2.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) {
|
|
||||||
this.setNewTarget();
|
|
||||||
}
|
|
||||||
|
|
||||||
var4 /= (double) MathHelper.sqrt_double(var26 * var26 + var6 * var6);
|
|
||||||
var31 = 0.6F;
|
|
||||||
|
|
||||||
if (var4 < (double) (-var31)) {
|
|
||||||
var4 = (double) (-var31);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var4 > (double) var31) {
|
|
||||||
var4 = (double) var31;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.motionY += var4 * 0.10000000149011612D;
|
|
||||||
this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw);
|
|
||||||
double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / Math.PI;
|
|
||||||
double var13 = MathHelper.wrapAngleTo180_double(var11 - (double) this.rotationYaw);
|
|
||||||
|
|
||||||
if (var13 > 50.0D) {
|
|
||||||
var13 = 50.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var13 < -50.0D) {
|
|
||||||
var13 = -50.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize();
|
|
||||||
Vec3 var39 = this.worldObj.getWorldVec3Pool().getVecFromPool((double) MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F), this.motionY, (double) (-MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F)))
|
|
||||||
.normalize();
|
|
||||||
float var17 = (float) (var39.dotProduct(var15) + 0.5D) / 1.5F;
|
|
||||||
|
|
||||||
if (var17 < 0.0F) {
|
|
||||||
var17 = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.randomYawVelocity *= 0.8F;
|
|
||||||
float var18 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F;
|
|
||||||
double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D;
|
|
||||||
|
|
||||||
if (var19 > 40.0D) {
|
|
||||||
var19 = 40.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.randomYawVelocity = (float) ((double) this.randomYawVelocity + var13 * (0.699999988079071D / var19 / (double) var18));
|
|
||||||
this.rotationYaw += this.randomYawVelocity * 0.1F;
|
|
||||||
float var21 = (float) (2.0D / (var19 + 1.0D));
|
|
||||||
float var22 = 0.06F;
|
|
||||||
this.moveFlying(0.0F, -1.0F, var22 * (var17 * var21 + (1.0F - var21)));
|
|
||||||
|
|
||||||
if (this.slowed) {
|
|
||||||
this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D);
|
|
||||||
} else {
|
|
||||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3 var23 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.motionX, this.motionY, this.motionZ).normalize();
|
|
||||||
float var24 = (float) (var23.dotProduct(var39) + 1.0D) / 2.0F;
|
|
||||||
var24 = 0.8F + 0.15F * var24;
|
|
||||||
this.motionX *= (double) var24;
|
|
||||||
this.motionZ *= (double) var24;
|
|
||||||
this.motionY *= 0.9100000262260437D;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderYawOffset = this.rotationYaw;
|
this.renderYawOffset = this.rotationYaw;
|
||||||
|
@ -292,12 +196,6 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
this.dragonPartWing2.onUpdate();
|
this.dragonPartWing2.onUpdate();
|
||||||
this.dragonPartWing2.setLocationAndAngles(this.posX - (double) (var7 * 4.5F), this.posY + 2.0D, this.posZ - (double) (var28 * 4.5F), 0.0F, 0.0F);
|
this.dragonPartWing2.setLocationAndAngles(this.posX - (double) (var7 * 4.5F), this.posY + 2.0D, this.posZ - (double) (var28 * 4.5F), 0.0F, 0.0F);
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.hurtTime == 0) {
|
|
||||||
this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
|
|
||||||
this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
|
|
||||||
this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D)));
|
|
||||||
}
|
|
||||||
|
|
||||||
double[] var29 = this.getMovementOffsets(5, 1.0F);
|
double[] var29 = this.getMovementOffsets(5, 1.0F);
|
||||||
double[] var9 = this.getMovementOffsets(0, 1.0F);
|
double[] var9 = this.getMovementOffsets(0, 1.0F);
|
||||||
var31 = MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
|
var31 = MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
|
||||||
|
@ -330,10 +228,6 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
var32.setLocationAndAngles(this.posX - (double) ((var28 * var38 + var37 * var40) * var3), this.posY + (var34[1] - var29[1]) * 1.0D - (double) ((var40 + var38) * var27) + 1.5D,
|
var32.setLocationAndAngles(this.posX - (double) ((var28 * var38 + var37 * var40) * var3), this.posY + (var34[1] - var29[1]) * 1.0D - (double) ((var40 + var38) * var27) + 1.5D,
|
||||||
this.posZ + (double) ((var7 * var38 + var36 * var40) * var3), 0.0F, 0.0F);
|
this.posZ + (double) ((var7 * var38 + var36 * var40) * var3), 0.0F, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,10 +237,6 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
private void updateDragonEnderCrystal() {
|
private void updateDragonEnderCrystal() {
|
||||||
if (this.healingEnderCrystal != null) {
|
if (this.healingEnderCrystal != null) {
|
||||||
if (this.healingEnderCrystal.isDead) {
|
if (this.healingEnderCrystal.isDead) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion) null), 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.healingEnderCrystal = null;
|
this.healingEnderCrystal = null;
|
||||||
} else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
|
} else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
|
||||||
this.setEntityHealth(this.getHealth() + 1);
|
this.setEntityHealth(this.getHealth() + 1);
|
||||||
|
@ -527,40 +417,8 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt
|
||||||
this.worldObj.spawnParticle("hugeexplosion", this.posX + (double) var1, this.posY + 2.0D + (double) var2, this.posZ + (double) var3, 0.0D, 0.0D, 0.0D);
|
this.worldObj.spawnParticle("hugeexplosion", this.posX + (double) var1, this.posY + 2.0D + (double) var2, this.posZ + (double) var3, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
int var4;
|
|
||||||
int var5;
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (this.deathTicks > 150 && this.deathTicks % 5 == 0) {
|
|
||||||
var4 = 1000;
|
|
||||||
|
|
||||||
while (var4 > 0) {
|
|
||||||
var5 = EntityXPOrb.getXPSplit(var4);
|
|
||||||
var4 -= var5;
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.deathTicks == 1) {
|
|
||||||
this.worldObj.func_82739_e(1018, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveEntity(0.0D, 0.10000000149011612D, 0.0D);
|
this.moveEntity(0.0D, 0.10000000149011612D, 0.0D);
|
||||||
this.renderYawOffset = this.rotationYaw += 20.0F;
|
this.renderYawOffset = this.rotationYaw += 20.0F;
|
||||||
|
|
||||||
if (this.deathTicks == 200 && !this.worldObj.isRemote) {
|
|
||||||
var4 = 2000;
|
|
||||||
|
|
||||||
while (var4 > 0) {
|
|
||||||
var5 = EntityXPOrb.getXPSplit(var4);
|
|
||||||
var4 -= var5;
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.createEnderPortal(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ));
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,28 +21,8 @@ public class EntityEgg extends EntityThrowable {
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0);
|
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) {
|
|
||||||
byte var2 = 1;
|
|
||||||
|
|
||||||
if (this.rand.nextInt(32) == 0) {
|
|
||||||
var2 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var3 = 0; var3 < var2; ++var3) {
|
|
||||||
EntityChicken var4 = new EntityChicken();
|
|
||||||
var4.setWorld(worldObj);
|
|
||||||
var4.setGrowingAge(-24000);
|
|
||||||
var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
|
|
||||||
this.worldObj.spawnEntityInWorld(var4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int var5 = 0; var5 < 8; ++var5) {
|
for (int var5 = 0; var5 < 8; ++var5) {
|
||||||
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,18 +82,6 @@ public class EntityEnderCrystal extends Entity {
|
||||||
if (this.isEntityInvulnerable()) {
|
if (this.isEntityInvulnerable()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.isDead && !this.worldObj.isRemote) {
|
|
||||||
this.health = 0;
|
|
||||||
|
|
||||||
if (this.health <= 0) {
|
|
||||||
this.setDead();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, 6.0F, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,28 +115,6 @@ public class EntityEnderEye extends Entity {
|
||||||
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
||||||
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
double var2 = this.targetX - this.posX;
|
|
||||||
double var4 = this.targetZ - this.posZ;
|
|
||||||
float var6 = (float) Math.sqrt(var2 * var2 + var4 * var4);
|
|
||||||
float var7 = (float) Math.atan2(var4, var2);
|
|
||||||
double var8 = (double) var1 + (double) (var6 - var1) * 0.0025D;
|
|
||||||
|
|
||||||
if (var6 < 1.0F) {
|
|
||||||
var8 *= 0.8D;
|
|
||||||
this.motionY *= 0.8D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.motionX = Math.cos((double) var7) * var8;
|
|
||||||
this.motionZ = Math.sin((double) var7) * var8;
|
|
||||||
|
|
||||||
if (this.posY < this.targetY) {
|
|
||||||
this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
|
|
||||||
} else {
|
|
||||||
this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float var10 = 0.25F;
|
float var10 = 0.25F;
|
||||||
|
|
||||||
if (this.isInWater()) {
|
if (this.isInWater()) {
|
||||||
|
@ -147,21 +125,6 @@ public class EntityEnderEye extends Entity {
|
||||||
this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double) var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double) var10 - 0.5D,
|
this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double) var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double) var10 - 0.5D,
|
||||||
this.posZ - this.motionZ * (double) var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ);
|
this.posZ - this.motionZ * (double) var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
|
||||||
++this.despawnTimer;
|
|
||||||
|
|
||||||
if (this.despawnTimer > 80 && !this.worldObj.isRemote) {
|
|
||||||
this.setDead();
|
|
||||||
|
|
||||||
if (this.shatterOrDrop) {
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.eyeOfEnder)));
|
|
||||||
} else {
|
|
||||||
this.worldObj.playAuxSFX(2003, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -107,54 +107,11 @@ public class EntityEnderman extends EntityMob {
|
||||||
this.moveSpeed = this.entityToAttack != null ? 6.5F : 0.3F;
|
this.moveSpeed = this.entityToAttack != null ? 6.5F : 0.3F;
|
||||||
int var1;
|
int var1;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
|
|
||||||
int var2;
|
|
||||||
int var3;
|
|
||||||
int var4;
|
|
||||||
|
|
||||||
if (this.getCarried() == 0) {
|
|
||||||
if (this.rand.nextInt(20) == 0) {
|
|
||||||
var1 = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D);
|
|
||||||
var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D);
|
|
||||||
var3 = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D);
|
|
||||||
var4 = this.worldObj.getBlockId(var1, var2, var3);
|
|
||||||
|
|
||||||
if (carriableBlocks[var4]) {
|
|
||||||
this.setCarried(this.worldObj.getBlockId(var1, var2, var3));
|
|
||||||
this.setCarryingData(this.worldObj.getBlockMetadata(var1, var2, var3));
|
|
||||||
this.worldObj.setBlock(var1, var2, var3, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.rand.nextInt(2000) == 0) {
|
|
||||||
var1 = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D);
|
|
||||||
var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D);
|
|
||||||
var3 = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D);
|
|
||||||
var4 = this.worldObj.getBlockId(var1, var2, var3);
|
|
||||||
int var5 = this.worldObj.getBlockId(var1, var2 - 1, var3);
|
|
||||||
|
|
||||||
if (var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) {
|
|
||||||
this.worldObj.setBlock(var1, var2, var3, this.getCarried(), this.getCarryingData(), 3);
|
|
||||||
this.setCarried(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var1 = 0; var1 < 2; ++var1) {
|
for (var1 = 0; var1 < 2; ++var1) {
|
||||||
this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height - 0.25D,
|
this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height - 0.25D,
|
||||||
this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {
|
|
||||||
float var6 = this.getBrightness(1.0F);
|
|
||||||
|
|
||||||
if (var6 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var6 - 0.4F) * 2.0F) {
|
|
||||||
this.entityToAttack = null;
|
|
||||||
this.setScreaming(false);
|
|
||||||
this.field_104003_g = false;
|
|
||||||
this.teleportRandomly();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isWet() || this.isBurning()) {
|
if (this.isWet() || this.isBurning()) {
|
||||||
this.entityToAttack = null;
|
this.entityToAttack = null;
|
||||||
this.setScreaming(false);
|
this.setScreaming(false);
|
||||||
|
@ -172,26 +129,6 @@ public class EntityEnderman extends EntityMob {
|
||||||
this.faceEntity(this.entityToAttack, 100.0F, 100.0F);
|
this.faceEntity(this.entityToAttack, 100.0F, 100.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.isEntityAlive()) {
|
|
||||||
if (this.entityToAttack != null) {
|
|
||||||
if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer) this.entityToAttack)) {
|
|
||||||
this.moveStrafing = this.moveForward = 0.0F;
|
|
||||||
this.moveSpeed = 0.0F;
|
|
||||||
|
|
||||||
if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) {
|
|
||||||
this.teleportRandomly();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.teleportDelay = 0;
|
|
||||||
} else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) {
|
|
||||||
this.teleportDelay = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.setScreaming(false);
|
|
||||||
this.teleportDelay = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onLivingUpdate();
|
super.onLivingUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,17 +34,5 @@ public class EntityExpBottle extends EntityThrowable {
|
||||||
* Called when this EntityThrowable hits a block or entity.
|
* Called when this EntityThrowable hits a block or entity.
|
||||||
*/
|
*/
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 0);
|
|
||||||
int var2 = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5);
|
|
||||||
|
|
||||||
while (var2 > 0) {
|
|
||||||
int var3 = EntityXPOrb.getXPSplit(var2);
|
|
||||||
var2 -= var3;
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var3));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,67 +96,6 @@ public class EntityFallingSand extends Entity {
|
||||||
this.motionX *= 0.9800000190734863D;
|
this.motionX *= 0.9800000190734863D;
|
||||||
this.motionY *= 0.9800000190734863D;
|
this.motionY *= 0.9800000190734863D;
|
||||||
this.motionZ *= 0.9800000190734863D;
|
this.motionZ *= 0.9800000190734863D;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
int var1 = MathHelper.floor_double(this.posX);
|
|
||||||
int var2 = MathHelper.floor_double(this.posY);
|
|
||||||
int var3 = MathHelper.floor_double(this.posZ);
|
|
||||||
|
|
||||||
if (this.fallTime == 1) {
|
|
||||||
if (this.worldObj.getBlockId(var1, var2, var3) != this.blockID) {
|
|
||||||
this.setDead();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.setBlockToAir(var1, var2, var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.onGround) {
|
|
||||||
this.motionX *= 0.699999988079071D;
|
|
||||||
this.motionZ *= 0.699999988079071D;
|
|
||||||
this.motionY *= -0.5D;
|
|
||||||
|
|
||||||
if (this.worldObj.getBlockId(var1, var2, var3) != Block.pistonMoving.blockID) {
|
|
||||||
this.setDead();
|
|
||||||
|
|
||||||
if (!this.isBreakingAnvil && this.worldObj.canPlaceEntityOnSide(this.blockID, var1, var2, var3, true, 1, (Entity) null, (ItemStack) null) && !BlockSand.canFallBelow(this.worldObj, var1, var2 - 1, var3)
|
|
||||||
&& this.worldObj.setBlock(var1, var2, var3, this.blockID, this.metadata, 3)) {
|
|
||||||
if (Block.blocksList[this.blockID] instanceof BlockSand) {
|
|
||||||
((BlockSand) Block.blocksList[this.blockID]).onFinishFalling(this.worldObj, var1, var2, var3, this.metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.fallingBlockTileEntityData != null && Block.blocksList[this.blockID] instanceof ITileEntityProvider) {
|
|
||||||
TileEntity var4 = this.worldObj.getBlockTileEntity(var1, var2, var3);
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
NBTTagCompound var5 = new NBTTagCompound();
|
|
||||||
var4.writeToNBT(var5);
|
|
||||||
Iterator var6 = this.fallingBlockTileEntityData.getTags().iterator();
|
|
||||||
|
|
||||||
while (var6.hasNext()) {
|
|
||||||
NBTBase var7 = (NBTBase) var6.next();
|
|
||||||
|
|
||||||
if (!var7.getName().equals("x") && !var7.getName().equals("y") && !var7.getName().equals("z")) {
|
|
||||||
var5.setTag(var7.getName(), var7.copy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var4.readFromNBT(var5);
|
|
||||||
var4.onInventoryChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.shouldDropItem && !this.isBreakingAnvil) {
|
|
||||||
this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.fallTime > 100 && !this.worldObj.isRemote && (var2 < 1 || var2 > 256) || this.fallTime > 600) {
|
|
||||||
if (this.shouldDropItem) {
|
|
||||||
this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,120 +70,116 @@ public abstract class EntityFireball extends Entity {
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int) this.posX, (int) this.posY, (int) this.posZ))) {
|
super.onUpdate();
|
||||||
this.setDead();
|
this.setFire(1);
|
||||||
|
|
||||||
|
if (this.inGround) {
|
||||||
|
int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
|
||||||
|
|
||||||
|
if (var1 == this.inTile) {
|
||||||
|
++this.ticksAlive;
|
||||||
|
|
||||||
|
if (this.ticksAlive == 600) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.inGround = false;
|
||||||
|
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionZ *= (double) (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.ticksAlive = 0;
|
||||||
|
this.ticksInAir = 0;
|
||||||
} else {
|
} else {
|
||||||
super.onUpdate();
|
++this.ticksInAir;
|
||||||
this.setFire(1);
|
|
||||||
|
|
||||||
if (this.inGround) {
|
|
||||||
int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
|
|
||||||
|
|
||||||
if (var1 == this.inTile) {
|
|
||||||
++this.ticksAlive;
|
|
||||||
|
|
||||||
if (this.ticksAlive == 600) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inGround = false;
|
|
||||||
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
|
|
||||||
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
|
|
||||||
this.motionZ *= (double) (this.rand.nextFloat() * 0.2F);
|
|
||||||
this.ticksAlive = 0;
|
|
||||||
this.ticksInAir = 0;
|
|
||||||
} else {
|
|
||||||
++this.ticksInAir;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
||||||
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
||||||
MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2);
|
|
||||||
var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
||||||
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
||||||
|
|
||||||
if (var3 != null) {
|
|
||||||
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
|
|
||||||
}
|
|
||||||
|
|
||||||
Entity var4 = null;
|
|
||||||
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
|
||||||
double var6 = 0.0D;
|
|
||||||
|
|
||||||
for (int var8 = 0; var8 < var5.size(); ++var8) {
|
|
||||||
Entity var9 = (Entity) var5.get(var8);
|
|
||||||
|
|
||||||
if (var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
|
||||||
float var10 = 0.3F;
|
|
||||||
AxisAlignedBB var11 = var9.boundingBox.expand((double) var10, (double) var10, (double) var10);
|
|
||||||
MovingObjectPosition var12 = var11.calculateIntercept(var15, var2);
|
|
||||||
|
|
||||||
if (var12 != null) {
|
|
||||||
double var13 = var15.distanceTo(var12.hitVec);
|
|
||||||
|
|
||||||
if (var13 < var6 || var6 == 0.0D) {
|
|
||||||
var4 = var9;
|
|
||||||
var6 = var13;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
var3 = new MovingObjectPosition(var4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3 != null) {
|
|
||||||
this.onImpact(var3);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.posX += this.motionX;
|
|
||||||
this.posY += this.motionY;
|
|
||||||
this.posZ += this.motionZ;
|
|
||||||
float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
|
||||||
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
|
|
||||||
|
|
||||||
for (this.rotationPitch = (float) (Math.atan2((double) var16, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
|
||||||
this.prevRotationPitch += 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
|
||||||
this.prevRotationYaw -= 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
|
||||||
this.prevRotationYaw += 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
|
||||||
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
|
||||||
float var17 = this.getMotionFactor();
|
|
||||||
|
|
||||||
if (this.isInWater()) {
|
|
||||||
for (int var18 = 0; var18 < 4; ++var18) {
|
|
||||||
float var19 = 0.25F;
|
|
||||||
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) var19, this.posY - this.motionY * (double) var19, this.posZ - this.motionZ * (double) var19, this.motionX, this.motionY, this.motionZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
var17 = 0.8F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.motionX += this.accelerationX;
|
|
||||||
this.motionY += this.accelerationY;
|
|
||||||
this.motionZ += this.accelerationZ;
|
|
||||||
this.motionX *= (double) var17;
|
|
||||||
this.motionY *= (double) var17;
|
|
||||||
this.motionZ *= (double) var17;
|
|
||||||
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2);
|
||||||
|
var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
||||||
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
|
||||||
|
if (var3 != null) {
|
||||||
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity var4 = null;
|
||||||
|
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double var6 = 0.0D;
|
||||||
|
|
||||||
|
for (int var8 = 0; var8 < var5.size(); ++var8) {
|
||||||
|
Entity var9 = (Entity) var5.get(var8);
|
||||||
|
|
||||||
|
if (var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) {
|
||||||
|
float var10 = 0.3F;
|
||||||
|
AxisAlignedBB var11 = var9.boundingBox.expand((double) var10, (double) var10, (double) var10);
|
||||||
|
MovingObjectPosition var12 = var11.calculateIntercept(var15, var2);
|
||||||
|
|
||||||
|
if (var12 != null) {
|
||||||
|
double var13 = var15.distanceTo(var12.hitVec);
|
||||||
|
|
||||||
|
if (var13 < var6 || var6 == 0.0D) {
|
||||||
|
var4 = var9;
|
||||||
|
var6 = var13;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var4 != null) {
|
||||||
|
var3 = new MovingObjectPosition(var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var3 != null) {
|
||||||
|
this.onImpact(var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
|
||||||
|
|
||||||
|
for (this.rotationPitch = (float) (Math.atan2((double) var16, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
||||||
|
this.prevRotationPitch += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
||||||
|
this.prevRotationYaw -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
||||||
|
this.prevRotationYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
||||||
|
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
||||||
|
float var17 = this.getMotionFactor();
|
||||||
|
|
||||||
|
if (this.isInWater()) {
|
||||||
|
for (int var18 = 0; var18 < 4; ++var18) {
|
||||||
|
float var19 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) var19, this.posY - this.motionY * (double) var19, this.posZ - this.motionZ * (double) var19, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
var17 = 0.8F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.motionX += this.accelerationX;
|
||||||
|
this.motionY += this.accelerationY;
|
||||||
|
this.motionZ += this.accelerationZ;
|
||||||
|
this.motionX *= (double) var17;
|
||||||
|
this.motionY *= (double) var17;
|
||||||
|
this.motionZ *= (double) var17;
|
||||||
|
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -110,28 +110,21 @@ public class EntityFireworkRocket extends Entity {
|
||||||
|
|
||||||
++this.fireworkAge;
|
++this.fireworkAge;
|
||||||
|
|
||||||
if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) {
|
if (this.fireworkAge % 2 < 2) {
|
||||||
this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D);
|
this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) {
|
|
||||||
this.worldObj.setEntityState(this, (byte) 17);
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleHealthUpdate(byte par1) {
|
public void handleHealthUpdate(byte par1) {
|
||||||
if (par1 == 17 && this.worldObj.isRemote) {
|
ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8);
|
||||||
ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8);
|
NBTTagCompound var3 = null;
|
||||||
NBTTagCompound var3 = null;
|
|
||||||
|
|
||||||
if (var2 != null && var2.hasTagCompound()) {
|
if (var2 != null && var2.hasTagCompound()) {
|
||||||
var3 = var2.getTagCompound().getCompoundTag("Fireworks");
|
var3 = var2.getTagCompound().getCompoundTag("Fireworks");
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3);
|
||||||
|
|
||||||
super.handleHealthUpdate(par1);
|
super.handleHealthUpdate(par1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,26 +167,6 @@ public class EntityFishHook extends Entity {
|
||||||
this.setPosition(var21, var22, var23);
|
this.setPosition(var21, var22, var23);
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
} else {
|
} else {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
ItemStack var1 = this.angler.getCurrentEquippedItem();
|
|
||||||
|
|
||||||
if (this.angler.isDead || !this.angler.isEntityAlive() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.angler) > 1024.0D) {
|
|
||||||
this.setDead();
|
|
||||||
this.angler.fishEntity = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.bobber != null) {
|
|
||||||
if (!this.bobber.isDead) {
|
|
||||||
this.posX = this.bobber.posX;
|
|
||||||
this.posY = this.bobber.boundingBox.minY + (double) this.bobber.height * 0.8D;
|
|
||||||
this.posZ = this.bobber.posZ;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bobber = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.shake > 0) {
|
if (this.shake > 0) {
|
||||||
--this.shake;
|
--this.shake;
|
||||||
|
@ -388,44 +368,7 @@ public class EntityFishHook extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int catchFish() {
|
public int catchFish() {
|
||||||
if (this.worldObj.isRemote) {
|
return 0;
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
byte var1 = 0;
|
|
||||||
|
|
||||||
if (this.bobber != null) {
|
|
||||||
double var2 = this.angler.posX - this.posX;
|
|
||||||
double var4 = this.angler.posY - this.posY;
|
|
||||||
double var6 = this.angler.posZ - this.posZ;
|
|
||||||
double var8 = (double) MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
|
|
||||||
double var10 = 0.1D;
|
|
||||||
this.bobber.motionX += var2 * var10;
|
|
||||||
this.bobber.motionY += var4 * var10 + (double) MathHelper.sqrt_double(var8) * 0.08D;
|
|
||||||
this.bobber.motionZ += var6 * var10;
|
|
||||||
var1 = 3;
|
|
||||||
} else if (this.ticksCatchable > 0) {
|
|
||||||
EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.fishRaw));
|
|
||||||
double var3 = this.angler.posX - this.posX;
|
|
||||||
double var5 = this.angler.posY - this.posY;
|
|
||||||
double var7 = this.angler.posZ - this.posZ;
|
|
||||||
double var9 = (double) MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7);
|
|
||||||
double var11 = 0.1D;
|
|
||||||
var13.motionX = var3 * var11;
|
|
||||||
var13.motionY = var5 * var11 + (double) MathHelper.sqrt_double(var9) * 0.08D;
|
|
||||||
var13.motionZ = var7 * var11;
|
|
||||||
this.worldObj.spawnEntityInWorld(var13);
|
|
||||||
this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1));
|
|
||||||
var1 = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.inGround) {
|
|
||||||
var1 = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
this.angler.fishEntity = null;
|
|
||||||
return var1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,10 +48,6 @@ public class EntityGhast extends EntityFlying implements IMob {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateEntityActionState() {
|
protected void updateEntityActionState() {
|
||||||
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.despawnEntity();
|
this.despawnEntity();
|
||||||
this.prevAttackCounter = this.attackCounter;
|
this.prevAttackCounter = this.attackCounter;
|
||||||
double var1 = this.waypointX - this.posX;
|
double var1 = this.waypointX - this.posX;
|
||||||
|
@ -129,15 +125,6 @@ public class EntityGhast extends EntityFlying implements IMob {
|
||||||
--this.attackCounter;
|
--this.attackCounter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
byte var21 = this.dataWatcher.getWatchableObjectByte(16);
|
|
||||||
byte var12 = (byte) (this.attackCounter > 10 ? 1 : 0);
|
|
||||||
|
|
||||||
if (var21 != var12) {
|
|
||||||
this.dataWatcher.updateObject(16, Byte.valueOf(var12));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,14 +99,6 @@ public abstract class EntityHanging extends Entity {
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) {
|
|
||||||
this.tickCounter1 = 0;
|
|
||||||
|
|
||||||
if (!this.isDead && !this.onValidSurface()) {
|
|
||||||
this.setDead();
|
|
||||||
this.dropItemStack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,22 +183,6 @@ public abstract class EntityHanging extends Entity {
|
||||||
if (this.isEntityInvulnerable()) {
|
if (this.isEntityInvulnerable()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.isDead && !this.worldObj.isRemote) {
|
|
||||||
this.setDead();
|
|
||||||
this.setBeenAttacked();
|
|
||||||
EntityPlayer var3 = null;
|
|
||||||
|
|
||||||
if (par1DamageSource.getEntity() instanceof EntityPlayer) {
|
|
||||||
var3 = (EntityPlayer) par1DamageSource.getEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3 != null && var3.capabilities.isCreativeMode) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dropItemStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,20 +191,12 @@ public abstract class EntityHanging extends Entity {
|
||||||
* Tries to moves the entity by the passed in displacement. Args: x, y, z
|
* Tries to moves the entity by the passed in displacement. Args: x, y, z
|
||||||
*/
|
*/
|
||||||
public void moveEntity(double par1, double par3, double par5) {
|
public void moveEntity(double par1, double par3, double par5) {
|
||||||
if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) {
|
|
||||||
this.setDead();
|
|
||||||
this.dropItemStack();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds to the current velocity of the entity. Args: x, y, z
|
* Adds to the current velocity of the entity. Args: x, y, z
|
||||||
*/
|
*/
|
||||||
public void addVelocity(double par1, double par3, double par5) {
|
public void addVelocity(double par1, double par3, double par5) {
|
||||||
if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) {
|
|
||||||
this.setDead();
|
|
||||||
this.dropItemStack();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,10 +84,6 @@ public class EntityItem extends Entity {
|
||||||
this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
|
this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
|
||||||
this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
|
this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.searchForOtherItemsNearby();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float var2 = 0.98F;
|
float var2 = 0.98F;
|
||||||
|
@ -110,10 +106,6 @@ public class EntityItem extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
++this.age;
|
++this.age;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.age >= 6000) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -236,41 +228,6 @@ public class EntityItem extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by a player entity when they collide with an entity
|
|
||||||
*/
|
|
||||||
public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
ItemStack var2 = this.getEntityItem();
|
|
||||||
int var3 = var2.stackSize;
|
|
||||||
|
|
||||||
if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(var2)) {
|
|
||||||
if (var2.itemID == Block.wood.blockID) {
|
|
||||||
par1EntityPlayer.triggerAchievement(AchievementList.mineWood);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2.itemID == Item.leather.itemID) {
|
|
||||||
par1EntityPlayer.triggerAchievement(AchievementList.killCow);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2.itemID == Item.diamond.itemID) {
|
|
||||||
par1EntityPlayer.triggerAchievement(AchievementList.diamonds);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2.itemID == Item.blazeRod.itemID) {
|
|
||||||
par1EntityPlayer.triggerAchievement(AchievementList.blazeRod);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
|
||||||
par1EntityPlayer.onItemPickup(this, var3);
|
|
||||||
|
|
||||||
if (var2.stackSize <= 0) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the username of the entity.
|
* Gets the username of the entity.
|
||||||
*/
|
*/
|
||||||
|
@ -285,18 +242,6 @@ public class EntityItem extends Entity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Teleports the entity to another dimension. Params: Dimension number to
|
|
||||||
* teleport to
|
|
||||||
*/
|
|
||||||
public void travelToDimension(int par1) {
|
|
||||||
super.travelToDimension(par1);
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.searchForOtherItemsNearby();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ItemStack corresponding to the Entity (Note: if no item exists,
|
* Returns the ItemStack corresponding to the Entity (Note: if no item exists,
|
||||||
* will log an error but still return an ItemStack containing Block.stone)
|
* will log an error but still return an ItemStack containing Block.stone)
|
||||||
|
|
|
@ -110,20 +110,6 @@ public class EntityItemFrame extends EntityHanging {
|
||||||
* into the saddle on a pig.
|
* into the saddle on a pig.
|
||||||
*/
|
*/
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
public boolean interact(EntityPlayer par1EntityPlayer) {
|
||||||
if (this.getDisplayedItem() == null) {
|
|
||||||
ItemStack var2 = par1EntityPlayer.getHeldItem();
|
|
||||||
|
|
||||||
if (var2 != null && !this.worldObj.isRemote) {
|
|
||||||
this.setDisplayedItem(var2);
|
|
||||||
|
|
||||||
if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize <= 0) {
|
|
||||||
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (!this.worldObj.isRemote) {
|
|
||||||
this.setItemRotation(this.getRotation() + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,14 +19,6 @@ public class EntityLargeFireball extends EntityFireball {
|
||||||
* Called when this EntityFireball hits a block or entity.
|
* Called when this EntityFireball hits a block or entity.
|
||||||
*/
|
*/
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
|
||||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.newExplosion((Entity) null, this.posX, this.posY, this.posZ, (float) this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,26 +27,6 @@ public class EntityLightningBolt extends EntityWeatherEffect {
|
||||||
this.lightningState = 2;
|
this.lightningState = 2;
|
||||||
this.boltVertex = this.rand.nextLong();
|
this.boltVertex = this.rand.nextLong();
|
||||||
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
||||||
|
|
||||||
if (!par1World.isRemote && par1World.difficultySetting >= 2 && par1World.doChunksNearChunkExist(MathHelper.floor_double(par2), MathHelper.floor_double(par4), MathHelper.floor_double(par6), 10)) {
|
|
||||||
int var8 = MathHelper.floor_double(par2);
|
|
||||||
int var9 = MathHelper.floor_double(par4);
|
|
||||||
int var10 = MathHelper.floor_double(par6);
|
|
||||||
|
|
||||||
if (par1World.getBlockId(var8, var9, var10) == 0 && Block.fire.canPlaceBlockAt(par1World, var8, var9, var10)) {
|
|
||||||
par1World.setBlock(var8, var9, var10, Block.fire.blockID);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var8 = 0; var8 < 4; ++var8) {
|
|
||||||
var9 = MathHelper.floor_double(par2) + this.rand.nextInt(3) - 1;
|
|
||||||
var10 = MathHelper.floor_double(par4) + this.rand.nextInt(3) - 1;
|
|
||||||
int var11 = MathHelper.floor_double(par6) + this.rand.nextInt(3) - 1;
|
|
||||||
|
|
||||||
if (par1World.getBlockId(var9, var10, var11) == 0 && Block.fire.canPlaceBlockAt(par1World, var9, var10, var11)) {
|
|
||||||
par1World.setBlock(var9, var10, var11, Block.fire.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,31 +49,11 @@ public class EntityLightningBolt extends EntityWeatherEffect {
|
||||||
--this.boltLivingTime;
|
--this.boltLivingTime;
|
||||||
this.lightningState = 1;
|
this.lightningState = 1;
|
||||||
this.boltVertex = this.rand.nextLong();
|
this.boltVertex = this.rand.nextLong();
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) {
|
|
||||||
int var1 = MathHelper.floor_double(this.posX);
|
|
||||||
int var2 = MathHelper.floor_double(this.posY);
|
|
||||||
int var3 = MathHelper.floor_double(this.posZ);
|
|
||||||
|
|
||||||
if (this.worldObj.getBlockId(var1, var2, var3) == 0 && Block.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) {
|
|
||||||
this.worldObj.setBlock(var1, var2, var3, Block.fire.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.lightningState >= 0) {
|
if (this.lightningState >= 0) {
|
||||||
if (this.worldObj.isRemote) {
|
this.worldObj.lastLightningBolt = 2;
|
||||||
this.worldObj.lastLightningBolt = 2;
|
|
||||||
} else {
|
|
||||||
double var6 = 3.0D;
|
|
||||||
List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getAABBPool().getAABB(this.posX - var6, this.posY - var6, this.posZ - var6, this.posX + var6, this.posY + 6.0D + var6, this.posZ + var6));
|
|
||||||
|
|
||||||
for (int var4 = 0; var4 < var7.size(); ++var4) {
|
|
||||||
Entity var5 = (Entity) var7.get(var4);
|
|
||||||
var5.onStruckByLightning(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -486,9 +486,7 @@ public abstract class EntityLiving extends Entity {
|
||||||
this.attackEntityFrom(DamageSource.inWall, 1);
|
this.attackEntityFrom(DamageSource.inWall, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isImmuneToFire() || this.worldObj.isRemote) {
|
this.extinguish();
|
||||||
this.extinguish();
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean var1 = this instanceof EntityPlayer && ((EntityPlayer) this).capabilities.disableDamage;
|
boolean var1 = this instanceof EntityPlayer && ((EntityPlayer) this).capabilities.disableDamage;
|
||||||
|
|
||||||
|
@ -569,16 +567,6 @@ public abstract class EntityLiving extends Entity {
|
||||||
if (this.deathTime == 20) {
|
if (this.deathTime == 20) {
|
||||||
int var1;
|
int var1;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) {
|
|
||||||
var1 = this.getExperiencePoints(this.attackingPlayer);
|
|
||||||
|
|
||||||
while (var1 > 0) {
|
|
||||||
int var2 = EntityXPOrb.getXPSplit(var1);
|
|
||||||
var1 -= var2;
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
|
|
||||||
for (var1 = 0; var1 < 20; ++var1) {
|
for (var1 = 0; var1 < 20; ++var1) {
|
||||||
|
@ -796,98 +784,7 @@ public abstract class EntityLiving extends Entity {
|
||||||
* Called when the entity is attacked.
|
* Called when the entity is attacked.
|
||||||
*/
|
*/
|
||||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
||||||
if (this.isEntityInvulnerable()) {
|
return false;
|
||||||
return false;
|
|
||||||
} else if (this.worldObj.isRemote) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.entityAge = 0;
|
|
||||||
|
|
||||||
if (this.health <= 0) {
|
|
||||||
return false;
|
|
||||||
} else if (par1DamageSource.isFireDamage() && this.isPotionActive(Potion.fireResistance)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getCurrentItemOrArmor(4) != null) {
|
|
||||||
this.getCurrentItemOrArmor(4).damageItem(par2 * 4 + this.rand.nextInt(par2 * 2), this);
|
|
||||||
par2 = (int) ((float) par2 * 0.75F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.limbYaw = 1.5F;
|
|
||||||
boolean var3 = true;
|
|
||||||
|
|
||||||
if ((float) this.hurtResistantTime > (float) this.maxHurtResistantTime / 2.0F) {
|
|
||||||
if (par2 <= this.lastDamage) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.damageEntity(par1DamageSource, par2 - this.lastDamage);
|
|
||||||
this.lastDamage = par2;
|
|
||||||
var3 = false;
|
|
||||||
} else {
|
|
||||||
this.lastDamage = par2;
|
|
||||||
this.prevHealth = this.health;
|
|
||||||
this.hurtResistantTime = this.maxHurtResistantTime;
|
|
||||||
this.damageEntity(par1DamageSource, par2);
|
|
||||||
this.hurtTime = this.maxHurtTime = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.attackedAtYaw = 0.0F;
|
|
||||||
Entity var4 = par1DamageSource.getEntity();
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
if (var4 instanceof EntityLiving) {
|
|
||||||
this.setRevengeTarget((EntityLiving) var4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var4 instanceof EntityPlayer) {
|
|
||||||
this.recentlyHit = 100;
|
|
||||||
this.attackingPlayer = (EntityPlayer) var4;
|
|
||||||
} else if (var4 instanceof EntityWolf) {
|
|
||||||
EntityWolf var5 = (EntityWolf) var4;
|
|
||||||
|
|
||||||
if (var5.isTamed()) {
|
|
||||||
this.recentlyHit = 100;
|
|
||||||
this.attackingPlayer = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3) {
|
|
||||||
this.worldObj.setEntityState(this, (byte) 2);
|
|
||||||
|
|
||||||
if (par1DamageSource != DamageSource.drown) {
|
|
||||||
this.setBeenAttacked();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
double var9 = var4.posX - this.posX;
|
|
||||||
double var7;
|
|
||||||
|
|
||||||
for (var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) {
|
|
||||||
var9 = (Math.random() - Math.random()) * 0.01D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.attackedAtYaw = (float) (Math.atan2(var7, var9) * 180.0D / Math.PI) - this.rotationYaw;
|
|
||||||
this.knockBack(var4, par2, var9, var7);
|
|
||||||
} else {
|
|
||||||
this.attackedAtYaw = (float) ((int) (Math.random() * 2.0D) * 180);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.health <= 0) {
|
|
||||||
if (var3) {
|
|
||||||
this.playSound(this.getDeathSound(), this.getSoundVolume(), this.getSoundPitch());
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onDeath(par1DamageSource);
|
|
||||||
} else if (var3) {
|
|
||||||
this.playSound(this.getHurtSound(), this.getSoundVolume(), this.getSoundPitch());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1060,27 +957,6 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
int var4 = 0;
|
|
||||||
|
|
||||||
if (var2 instanceof EntityPlayer) {
|
|
||||||
var4 = EnchantmentHelper.getLootingModifier((EntityLiving) var2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) {
|
|
||||||
this.dropFewItems(this.recentlyHit > 0, var4);
|
|
||||||
this.dropEquipment(this.recentlyHit > 0, var4);
|
|
||||||
|
|
||||||
if (this.recentlyHit > 0) {
|
|
||||||
int var5 = this.rand.nextInt(200) - var4;
|
|
||||||
|
|
||||||
if (var5 < 5) {
|
|
||||||
this.dropRareDrop(var5 <= 0 ? 1 : 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.setEntityState(this, (byte) 3);
|
this.worldObj.setEntityState(this, (byte) 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1246,7 +1122,7 @@ public abstract class EntityLiving extends Entity {
|
||||||
this.motionY = 0.2D;
|
this.motionY = 0.2D;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.worldObj.isRemote && (!this.worldObj.blockExists((int) this.posX, 0, (int) this.posZ) || !this.worldObj.getChunkFromBlockCoords((int) this.posX, (int) this.posZ).isChunkLoaded)) {
|
if ((!this.worldObj.blockExists((int) this.posX, 0, (int) this.posZ) || !this.worldObj.getChunkFromBlockCoords((int) this.posX, (int) this.posZ).isChunkLoaded)) {
|
||||||
if (this.posY > 0.0D) {
|
if (this.posY > 0.0D) {
|
||||||
this.motionY = -0.1D;
|
this.motionY = -0.1D;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1492,77 +1368,8 @@ public abstract class EntityLiving extends Entity {
|
||||||
this.landMovementFactor = var11;
|
this.landMovementFactor = var11;
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
this.worldObj.theProfiler.startSection("push");
|
this.worldObj.theProfiler.startSection("push");
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.func_85033_bc();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
this.worldObj.theProfiler.startSection("looting");
|
this.worldObj.theProfiler.startSection("looting");
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
|
|
||||||
List var2 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(1.0D, 0.0D, 1.0D));
|
|
||||||
Iterator var12 = var2.iterator();
|
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
|
||||||
EntityItem var4 = (EntityItem) var12.next();
|
|
||||||
|
|
||||||
if (!var4.isDead && var4.getEntityItem() != null) {
|
|
||||||
ItemStack var13 = var4.getEntityItem();
|
|
||||||
int var6 = getArmorPosition(var13);
|
|
||||||
|
|
||||||
if (var6 > -1) {
|
|
||||||
boolean var14 = true;
|
|
||||||
ItemStack var8 = this.getCurrentItemOrArmor(var6);
|
|
||||||
|
|
||||||
if (var8 != null) {
|
|
||||||
if (var6 == 0) {
|
|
||||||
if (var13.getItem() instanceof ItemSword && !(var8.getItem() instanceof ItemSword)) {
|
|
||||||
var14 = true;
|
|
||||||
} else if (var13.getItem() instanceof ItemSword && var8.getItem() instanceof ItemSword) {
|
|
||||||
ItemSword var9 = (ItemSword) var13.getItem();
|
|
||||||
ItemSword var10 = (ItemSword) var8.getItem();
|
|
||||||
|
|
||||||
if (var9.func_82803_g() == var10.func_82803_g()) {
|
|
||||||
var14 = var13.getItemDamage() > var8.getItemDamage() || var13.hasTagCompound() && !var8.hasTagCompound();
|
|
||||||
} else {
|
|
||||||
var14 = var9.func_82803_g() > var10.func_82803_g();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var14 = false;
|
|
||||||
}
|
|
||||||
} else if (var13.getItem() instanceof ItemArmor && !(var8.getItem() instanceof ItemArmor)) {
|
|
||||||
var14 = true;
|
|
||||||
} else if (var13.getItem() instanceof ItemArmor && var8.getItem() instanceof ItemArmor) {
|
|
||||||
ItemArmor var15 = (ItemArmor) var13.getItem();
|
|
||||||
ItemArmor var16 = (ItemArmor) var8.getItem();
|
|
||||||
|
|
||||||
if (var15.damageReduceAmount == var16.damageReduceAmount) {
|
|
||||||
var14 = var13.getItemDamage() > var8.getItemDamage() || var13.hasTagCompound() && !var8.hasTagCompound();
|
|
||||||
} else {
|
|
||||||
var14 = var15.damageReduceAmount > var16.damageReduceAmount;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var14 = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var14) {
|
|
||||||
if (var8 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[var6]) {
|
|
||||||
this.entityDropItem(var8, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setCurrentItemOrArmor(var6, var13);
|
|
||||||
this.equipmentDropChances[var6] = 2.0F;
|
|
||||||
this.persistenceRequired = true;
|
|
||||||
this.onItemPickup(var4, 1);
|
|
||||||
var4.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1943,34 +1750,14 @@ public abstract class EntityLiving extends Entity {
|
||||||
Integer var2 = (Integer) var1.next();
|
Integer var2 = (Integer) var1.next();
|
||||||
PotionEffect var3 = (PotionEffect) this.activePotionsMap.get(var2);
|
PotionEffect var3 = (PotionEffect) this.activePotionsMap.get(var2);
|
||||||
|
|
||||||
if (!var3.onUpdate(this)) {
|
if (var3.onUpdate(this)) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
var1.remove();
|
|
||||||
this.onFinishedPotionEffect(var3);
|
|
||||||
}
|
|
||||||
} else if (var3.getDuration() % 600 == 0) {
|
|
||||||
this.onChangedPotionEffect(var3);
|
this.onChangedPotionEffect(var3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int var12;
|
int var12;
|
||||||
|
|
||||||
if (this.potionsNeedUpdate) {
|
this.potionsNeedUpdate = false;
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (this.activePotionsMap.isEmpty()) {
|
|
||||||
this.dataWatcher.updateObject(9, Byte.valueOf((byte) 0));
|
|
||||||
this.dataWatcher.updateObject(8, Integer.valueOf(0));
|
|
||||||
this.setInvisible(false);
|
|
||||||
} else {
|
|
||||||
var12 = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values());
|
|
||||||
this.dataWatcher.updateObject(9, Byte.valueOf((byte) (PotionHelper.func_82817_b(this.activePotionsMap.values()) ? 1 : 0)));
|
|
||||||
this.dataWatcher.updateObject(8, Integer.valueOf(var12));
|
|
||||||
this.setInvisible(this.isPotionActive(Potion.invisibility.id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.potionsNeedUpdate = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var12 = this.dataWatcher.getWatchableObjectInt(8);
|
var12 = this.dataWatcher.getWatchableObjectInt(8);
|
||||||
boolean var13 = this.dataWatcher.getWatchableObjectByte(9) > 0;
|
boolean var13 = this.dataWatcher.getWatchableObjectByte(9) > 0;
|
||||||
|
@ -1999,17 +1786,6 @@ public abstract class EntityLiving extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearActivePotions() {
|
public void clearActivePotions() {
|
||||||
Iterator var1 = this.activePotionsMap.keySet().iterator();
|
|
||||||
|
|
||||||
while (var1.hasNext()) {
|
|
||||||
Integer var2 = (Integer) var1.next();
|
|
||||||
PotionEffect var3 = (PotionEffect) this.activePotionsMap.get(var2);
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
var1.remove();
|
|
||||||
this.onFinishedPotionEffect(var3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection getActivePotionEffects() {
|
public Collection getActivePotionEffects() {
|
||||||
|
|
|
@ -131,33 +131,7 @@ public abstract class EntityMinecart extends Entity {
|
||||||
* Called when the entity is attacked.
|
* Called when the entity is attacked.
|
||||||
*/
|
*/
|
||||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
|
||||||
if (!this.worldObj.isRemote && !this.isDead) {
|
return true;
|
||||||
if (this.isEntityInvulnerable()) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.setRollingDirection(-this.getRollingDirection());
|
|
||||||
this.setRollingAmplitude(10);
|
|
||||||
this.setBeenAttacked();
|
|
||||||
this.setDamage(this.getDamage() + par2 * 10);
|
|
||||||
boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer) par1DamageSource.getEntity()).capabilities.isCreativeMode;
|
|
||||||
|
|
||||||
if (var3 || this.getDamage() > 40) {
|
|
||||||
if (this.riddenByEntity != null) {
|
|
||||||
this.riddenByEntity.mountEntity(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3 && !this.isInvNameLocalized()) {
|
|
||||||
this.setDead();
|
|
||||||
} else {
|
|
||||||
this.killMinecart(par1DamageSource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void killMinecart(DamageSource par1DamageSource) {
|
public void killMinecart(DamageSource par1DamageSource) {
|
||||||
|
@ -219,92 +193,20 @@ public abstract class EntityMinecart extends Entity {
|
||||||
if (this.posY < -64.0D) {
|
if (this.posY < -64.0D) {
|
||||||
this.kill();
|
this.kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
int var2;
|
|
||||||
|
|
||||||
if (this.worldObj.isRemote) {
|
if (this.turnProgress > 0) {
|
||||||
if (this.turnProgress > 0) {
|
double var19 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress;
|
||||||
double var19 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress;
|
double var21 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress;
|
||||||
double var21 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress;
|
double var5 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress;
|
||||||
double var5 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress;
|
double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw);
|
||||||
double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw);
|
this.rotationYaw = (float) ((double) this.rotationYaw + var7 / (double) this.turnProgress);
|
||||||
this.rotationYaw = (float) ((double) this.rotationYaw + var7 / (double) this.turnProgress);
|
this.rotationPitch = (float) ((double) this.rotationPitch + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress);
|
||||||
this.rotationPitch = (float) ((double) this.rotationPitch + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress);
|
--this.turnProgress;
|
||||||
--this.turnProgress;
|
this.setPosition(var19, var21, var5);
|
||||||
this.setPosition(var19, var21, var5);
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
} else {
|
||||||
} else {
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.prevPosX = this.posX;
|
|
||||||
this.prevPosY = this.posY;
|
|
||||||
this.prevPosZ = this.posZ;
|
|
||||||
this.motionY -= 0.03999999910593033D;
|
|
||||||
int var18 = MathHelper.floor_double(this.posX);
|
|
||||||
var2 = MathHelper.floor_double(this.posY);
|
|
||||||
int var20 = MathHelper.floor_double(this.posZ);
|
|
||||||
|
|
||||||
if (BlockRailBase.isRailBlockAt(this.worldObj, var18, var2 - 1, var20)) {
|
|
||||||
--var2;
|
|
||||||
}
|
|
||||||
|
|
||||||
double var4 = 0.4D;
|
|
||||||
double var6 = 0.0078125D;
|
|
||||||
int var8 = this.worldObj.getBlockId(var18, var2, var20);
|
|
||||||
|
|
||||||
if (BlockRailBase.isRailBlock(var8)) {
|
|
||||||
int var9 = this.worldObj.getBlockMetadata(var18, var2, var20);
|
|
||||||
this.updateOnTrack(var18, var2, var20, var4, var6, var8, var9);
|
|
||||||
|
|
||||||
if (var8 == Block.railActivator.blockID) {
|
|
||||||
this.onActivatorRailPass(var18, var2, var20, (var9 & 8) != 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.func_94088_b(var4);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.doBlockCollisions();
|
|
||||||
this.rotationPitch = 0.0F;
|
|
||||||
double var22 = this.prevPosX - this.posX;
|
|
||||||
double var11 = this.prevPosZ - this.posZ;
|
|
||||||
|
|
||||||
if (var22 * var22 + var11 * var11 > 0.001D) {
|
|
||||||
this.rotationYaw = (float) (Math.atan2(var11, var22) * 180.0D / Math.PI);
|
|
||||||
|
|
||||||
if (this.isInReverse) {
|
|
||||||
this.rotationYaw += 180.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double var13 = (double) MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw);
|
|
||||||
|
|
||||||
if (var13 < -170.0D || var13 >= 170.0D) {
|
|
||||||
this.rotationYaw += 180.0F;
|
|
||||||
this.isInReverse = !this.isInReverse;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
|
||||||
|
|
||||||
if (var15 != null && !var15.isEmpty()) {
|
|
||||||
for (int var16 = 0; var16 < var15.size(); ++var16) {
|
|
||||||
Entity var17 = (Entity) var15.get(var16);
|
|
||||||
|
|
||||||
if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) {
|
|
||||||
var17.applyEntityCollision(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.riddenByEntity != null && this.riddenByEntity.isDead) {
|
|
||||||
if (this.riddenByEntity.ridingEntity == this) {
|
|
||||||
this.riddenByEntity.ridingEntity = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.riddenByEntity = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,80 +597,6 @@ public abstract class EntityMinecart extends Entity {
|
||||||
* Args: entity
|
* Args: entity
|
||||||
*/
|
*/
|
||||||
public void applyEntityCollision(Entity par1Entity) {
|
public void applyEntityCollision(Entity par1Entity) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (par1Entity != this.riddenByEntity) {
|
|
||||||
if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D
|
|
||||||
&& this.riddenByEntity == null && par1Entity.ridingEntity == null) {
|
|
||||||
par1Entity.mountEntity(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
double var2 = par1Entity.posX - this.posX;
|
|
||||||
double var4 = par1Entity.posZ - this.posZ;
|
|
||||||
double var6 = var2 * var2 + var4 * var4;
|
|
||||||
|
|
||||||
if (var6 >= 9.999999747378752E-5D) {
|
|
||||||
var6 = (double) MathHelper.sqrt_double(var6);
|
|
||||||
var2 /= var6;
|
|
||||||
var4 /= var6;
|
|
||||||
double var8 = 1.0D / var6;
|
|
||||||
|
|
||||||
if (var8 > 1.0D) {
|
|
||||||
var8 = 1.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
var2 *= var8;
|
|
||||||
var4 *= var8;
|
|
||||||
var2 *= 0.10000000149011612D;
|
|
||||||
var4 *= 0.10000000149011612D;
|
|
||||||
var2 *= (double) (1.0F - this.entityCollisionReduction);
|
|
||||||
var4 *= (double) (1.0F - this.entityCollisionReduction);
|
|
||||||
var2 *= 0.5D;
|
|
||||||
var4 *= 0.5D;
|
|
||||||
|
|
||||||
if (par1Entity instanceof EntityMinecart) {
|
|
||||||
double var10 = par1Entity.posX - this.posX;
|
|
||||||
double var12 = par1Entity.posZ - this.posZ;
|
|
||||||
Vec3 var14 = this.worldObj.getWorldVec3Pool().getVecFromPool(var10, 0.0D, var12).normalize();
|
|
||||||
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool((double) MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F), 0.0D, (double) MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F))
|
|
||||||
.normalize();
|
|
||||||
double var16 = Math.abs(var14.dotProduct(var15));
|
|
||||||
|
|
||||||
if (var16 < 0.800000011920929D) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
double var18 = par1Entity.motionX + this.motionX;
|
|
||||||
double var20 = par1Entity.motionZ + this.motionZ;
|
|
||||||
|
|
||||||
if (((EntityMinecart) par1Entity).getMinecartType() == 2 && this.getMinecartType() != 2) {
|
|
||||||
this.motionX *= 0.20000000298023224D;
|
|
||||||
this.motionZ *= 0.20000000298023224D;
|
|
||||||
this.addVelocity(par1Entity.motionX - var2, 0.0D, par1Entity.motionZ - var4);
|
|
||||||
par1Entity.motionX *= 0.949999988079071D;
|
|
||||||
par1Entity.motionZ *= 0.949999988079071D;
|
|
||||||
} else if (((EntityMinecart) par1Entity).getMinecartType() != 2 && this.getMinecartType() == 2) {
|
|
||||||
par1Entity.motionX *= 0.20000000298023224D;
|
|
||||||
par1Entity.motionZ *= 0.20000000298023224D;
|
|
||||||
par1Entity.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4);
|
|
||||||
this.motionX *= 0.949999988079071D;
|
|
||||||
this.motionZ *= 0.949999988079071D;
|
|
||||||
} else {
|
|
||||||
var18 /= 2.0D;
|
|
||||||
var20 /= 2.0D;
|
|
||||||
this.motionX *= 0.20000000298023224D;
|
|
||||||
this.motionZ *= 0.20000000298023224D;
|
|
||||||
this.addVelocity(var18 - var2, 0.0D, var20 - var4);
|
|
||||||
par1Entity.motionX *= 0.20000000298023224D;
|
|
||||||
par1Entity.motionZ *= 0.20000000298023224D;
|
|
||||||
par1Entity.addVelocity(var18 + var2, 0.0D, var20 + var4);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.addVelocity(-var2, 0.0D, -var4);
|
|
||||||
par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -240,10 +240,6 @@ public abstract class EntityMinecartContainer extends EntityMinecart implements
|
||||||
* into the saddle on a pig.
|
* into the saddle on a pig.
|
||||||
*/
|
*/
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
public boolean interact(EntityPlayer par1EntityPlayer) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
par1EntityPlayer.displayGUIChest(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,6 @@ public class EntityMinecartEmpty extends EntityMinecart {
|
||||||
} else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer) {
|
} else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
par1EntityPlayer.mountEntity(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,6 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements Hop
|
||||||
* into the saddle on a pig.
|
* into the saddle on a pig.
|
||||||
*/
|
*/
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
public boolean interact(EntityPlayer par1EntityPlayer) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
par1EntityPlayer.displayGUIHopperMinecart(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,26 +91,6 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements Hop
|
||||||
return this.posZ;
|
return this.posZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to update the entity's position/logic.
|
|
||||||
*/
|
|
||||||
public void onUpdate() {
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) {
|
|
||||||
--this.transferTicker;
|
|
||||||
|
|
||||||
if (!this.canTransfer()) {
|
|
||||||
this.setTransferTicker(0);
|
|
||||||
|
|
||||||
if (this.func_96112_aD()) {
|
|
||||||
this.setTransferTicker(4);
|
|
||||||
this.onInventoryChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean func_96112_aD() {
|
public boolean func_96112_aD() {
|
||||||
if (TileEntityHopper.suckItemsIntoHopper(this)) {
|
if (TileEntityHopper.suckItemsIntoHopper(this)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -56,16 +56,6 @@ public class EntityMinecartTNT extends EntityMinecart {
|
||||||
* Makes the minecart explode.
|
* Makes the minecart explode.
|
||||||
*/
|
*/
|
||||||
protected void explodeCart(double par1) {
|
protected void explodeCart(double par1) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
double var3 = Math.sqrt(par1);
|
|
||||||
|
|
||||||
if (var3 > 5.0D) {
|
|
||||||
var3 = 5.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (4.0D + this.rand.nextDouble() * 1.5D * var3), true);
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,11 +92,6 @@ public class EntityMinecartTNT extends EntityMinecart {
|
||||||
*/
|
*/
|
||||||
public void ignite() {
|
public void ignite() {
|
||||||
this.minecartTNTFuse = 80;
|
this.minecartTNTFuse = 80;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.worldObj.setEntityState(this, (byte) 10);
|
|
||||||
this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 1.0F);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int func_94104_d() {
|
public int func_94104_d() {
|
||||||
|
|
|
@ -24,17 +24,6 @@ public abstract class EntityMob extends EntityCreature implements IMob {
|
||||||
super.onLivingUpdate();
|
super.onLivingUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to update the entity's position/logic.
|
|
||||||
*/
|
|
||||||
public void onUpdate() {
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the closest player within 16 blocks to attack, or null if this Entity
|
* Finds the closest player within 16 blocks to attack, or null if this Entity
|
||||||
* isn't interested in attacking (Animals, Spiders at day, peaceful PigZombies).
|
* isn't interested in attacking (Animals, Spiders at day, peaceful PigZombies).
|
||||||
|
|
|
@ -82,21 +82,6 @@ public class EntityPig extends EntityAnimal {
|
||||||
this.playSound("mob.pig.step", 0.15F, 1.0F);
|
this.playSound("mob.pig.step", 0.15F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets
|
|
||||||
* into the saddle on a pig.
|
|
||||||
*/
|
|
||||||
public boolean interact(EntityPlayer par1EntityPlayer) {
|
|
||||||
if (super.interact(par1EntityPlayer)) {
|
|
||||||
return true;
|
|
||||||
} else if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) {
|
|
||||||
par1EntityPlayer.mountEntity(this);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the item ID for the item the mob drops on death.
|
* Returns the item ID for the item the mob drops on death.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -180,10 +180,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
public void clearItemInUse() {
|
public void clearItemInUse() {
|
||||||
this.itemInUse = null;
|
this.itemInUse = null;
|
||||||
this.itemInUseCount = 0;
|
this.itemInUseCount = 0;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setEating(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBlocking() {
|
public boolean isBlocking() {
|
||||||
|
@ -201,10 +197,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) {
|
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) {
|
||||||
this.updateItemUse(var1, 5);
|
this.updateItemUse(var1, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) {
|
|
||||||
this.onItemUseFinish();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.clearItemInUse();
|
this.clearItemInUse();
|
||||||
}
|
}
|
||||||
|
@ -220,14 +212,7 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
if (this.sleepTimer > 100) {
|
if (this.sleepTimer > 100) {
|
||||||
this.sleepTimer = 100;
|
this.sleepTimer = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (!this.isInBed()) {
|
|
||||||
this.wakeUpPlayer(true, true, false);
|
|
||||||
} else if (this.worldObj.isDaytime()) {
|
|
||||||
this.wakeUpPlayer(false, true, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (this.sleepTimer > 0) {
|
} else if (this.sleepTimer > 0) {
|
||||||
++this.sleepTimer;
|
++this.sleepTimer;
|
||||||
|
|
||||||
|
@ -238,11 +223,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
|
|
||||||
super.onUpdate();
|
super.onUpdate();
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) {
|
|
||||||
this.closeScreen();
|
|
||||||
this.openContainer = this.inventoryContainer;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isBurning() && this.capabilities.disableDamage) {
|
if (this.isBurning() && this.capabilities.disableDamage) {
|
||||||
this.extinguish();
|
this.extinguish();
|
||||||
}
|
}
|
||||||
|
@ -297,10 +277,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
if (this.ridingEntity == null) {
|
if (this.ridingEntity == null) {
|
||||||
this.startMinecartRidingCoordinate = null;
|
this.startMinecartRidingCoordinate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.foodStats.onUpdate(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -794,10 +770,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
if (this.getHealth() <= 0) {
|
if (this.getHealth() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (this.isPlayerSleeping() && !this.worldObj.isRemote) {
|
|
||||||
this.wakeUpPlayer(true, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1DamageSource.isDifficultyScaled()) {
|
if (par1DamageSource.isDifficultyScaled()) {
|
||||||
if (this.worldObj.difficultySetting == 0) {
|
if (this.worldObj.difficultySetting == 0) {
|
||||||
par2 = 0;
|
par2 = 0;
|
||||||
|
@ -1153,33 +1125,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
* Attempts to have the player sleep in a bed at the specified location.
|
* Attempts to have the player sleep in a bed at the specified location.
|
||||||
*/
|
*/
|
||||||
public EnumStatus sleepInBedAt(int par1, int par2, int par3) {
|
public EnumStatus sleepInBedAt(int par1, int par2, int par3) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (this.isPlayerSleeping() || !this.isEntityAlive()) {
|
|
||||||
return EnumStatus.OTHER_PROBLEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.worldObj.provider.isSurfaceWorld()) {
|
|
||||||
return EnumStatus.NOT_POSSIBLE_HERE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldObj.isDaytime()) {
|
|
||||||
return EnumStatus.NOT_POSSIBLE_NOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Math.abs(this.posX - (double) par1) > 3.0D || Math.abs(this.posY - (double) par2) > 2.0D || Math.abs(this.posZ - (double) par3) > 3.0D) {
|
|
||||||
return EnumStatus.TOO_FAR_AWAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
double var4 = 8.0D;
|
|
||||||
double var6 = 5.0D;
|
|
||||||
List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class,
|
|
||||||
AxisAlignedBB.getAABBPool().getAABB((double) par1 - var4, (double) par2 - var6, (double) par3 - var4, (double) par1 + var4, (double) par2 + var6, (double) par3 + var4));
|
|
||||||
|
|
||||||
if (!var8.isEmpty()) {
|
|
||||||
return EnumStatus.NOT_SAFE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setSize(0.2F, 0.2F);
|
this.setSize(0.2F, 0.2F);
|
||||||
this.yOffset = 0.2F;
|
this.yOffset = 0.2F;
|
||||||
|
|
||||||
|
@ -1217,10 +1162,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
this.playerLocation = new ChunkCoordinates(par1, par2, par3);
|
this.playerLocation = new ChunkCoordinates(par1, par2, par3);
|
||||||
this.motionX = this.motionZ = this.motionY = 0.0D;
|
this.motionX = this.motionZ = this.motionY = 0.0D;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.worldObj.updateAllPlayersSleepingFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
return EnumStatus.OK;
|
return EnumStatus.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1268,10 +1209,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
|
|
||||||
this.sleeping = false;
|
this.sleeping = false;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && par2) {
|
|
||||||
this.worldObj.updateAllPlayersSleepingFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (par1) {
|
if (par1) {
|
||||||
this.sleepTimer = 0;
|
this.sleepTimer = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1625,11 +1562,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
* increases exhaustion level by supplied amount
|
* increases exhaustion level by supplied amount
|
||||||
*/
|
*/
|
||||||
public void addExhaustion(float par1) {
|
public void addExhaustion(float par1) {
|
||||||
if (!this.capabilities.disableDamage) {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.foodStats.addExhaustion(par1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1658,10 +1590,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
|
||||||
if (par1ItemStack != this.itemInUse) {
|
if (par1ItemStack != this.itemInUse) {
|
||||||
this.itemInUse = par1ItemStack;
|
this.itemInUse = par1ItemStack;
|
||||||
this.itemInUseCount = par2;
|
this.itemInUseCount = par2;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setEating(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,51 +72,6 @@ public class EntityPotion extends EntityThrowable {
|
||||||
* Called when this EntityThrowable hits a block or entity.
|
* Called when this EntityThrowable hits a block or entity.
|
||||||
*/
|
*/
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
List var2 = Item.potion.getEffects(this.potionDamage);
|
|
||||||
|
|
||||||
if (var2 != null && !var2.isEmpty()) {
|
|
||||||
AxisAlignedBB var3 = this.boundingBox.expand(4.0D, 2.0D, 4.0D);
|
|
||||||
List var4 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, var3);
|
|
||||||
|
|
||||||
if (var4 != null && !var4.isEmpty()) {
|
|
||||||
Iterator var5 = var4.iterator();
|
|
||||||
|
|
||||||
while (var5.hasNext()) {
|
|
||||||
EntityLiving var6 = (EntityLiving) var5.next();
|
|
||||||
double var7 = this.getDistanceSqToEntity(var6);
|
|
||||||
|
|
||||||
if (var7 < 16.0D) {
|
|
||||||
double var9 = 1.0D - Math.sqrt(var7) / 4.0D;
|
|
||||||
|
|
||||||
if (var6 == par1MovingObjectPosition.entityHit) {
|
|
||||||
var9 = 1.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
Iterator var11 = var2.iterator();
|
|
||||||
|
|
||||||
while (var11.hasNext()) {
|
|
||||||
PotionEffect var12 = (PotionEffect) var11.next();
|
|
||||||
int var13 = var12.getPotionID();
|
|
||||||
|
|
||||||
if (Potion.potionTypes[var13].isInstant()) {
|
|
||||||
Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9);
|
|
||||||
} else {
|
|
||||||
int var14 = (int) (var9 * (double) var12.getDuration() + 0.5D);
|
|
||||||
|
|
||||||
if (var14 > 20) {
|
|
||||||
var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), this.getPotionDamage());
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,10 +45,7 @@ public class EntitySheep extends EntityAnimal {
|
||||||
* burn.
|
* burn.
|
||||||
*/
|
*/
|
||||||
public void onLivingUpdate() {
|
public void onLivingUpdate() {
|
||||||
if (this.worldObj.isRemote) {
|
this.sheepTimer = Math.max(0, this.sheepTimer - 1);
|
||||||
this.sheepTimer = Math.max(0, this.sheepTimer - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onLivingUpdate();
|
super.onLivingUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,18 +105,6 @@ public class EntitySheep extends EntityAnimal {
|
||||||
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
||||||
|
|
||||||
if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) {
|
if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setSheared(true);
|
|
||||||
int var3 = 1 + this.rand.nextInt(3);
|
|
||||||
|
|
||||||
for (int var4 = 0; var4 < var3; ++var4) {
|
|
||||||
EntityItem var5 = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F);
|
|
||||||
var5.motionY += (double) (this.rand.nextFloat() * 0.05F);
|
|
||||||
var5.motionX += (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
|
||||||
var5.motionZ += (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var2.damageItem(1, par1EntityPlayer);
|
var2.damageItem(1, par1EntityPlayer);
|
||||||
this.playSound("mob.sheep.shear", 1.0F, 1.0F);
|
this.playSound("mob.sheep.shear", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,64 +103,6 @@ public class EntitySilverfish extends EntityMob {
|
||||||
super.onUpdate();
|
super.onUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateEntityActionState() {
|
|
||||||
super.updateEntityActionState();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
int var1;
|
|
||||||
int var2;
|
|
||||||
int var3;
|
|
||||||
int var5;
|
|
||||||
|
|
||||||
if (this.allySummonCooldown > 0) {
|
|
||||||
--this.allySummonCooldown;
|
|
||||||
|
|
||||||
if (this.allySummonCooldown == 0) {
|
|
||||||
var1 = MathHelper.floor_double(this.posX);
|
|
||||||
var2 = MathHelper.floor_double(this.posY);
|
|
||||||
var3 = MathHelper.floor_double(this.posZ);
|
|
||||||
boolean var4 = false;
|
|
||||||
|
|
||||||
for (var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) {
|
|
||||||
for (int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) {
|
|
||||||
for (int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) {
|
|
||||||
int var8 = this.worldObj.getBlockId(var1 + var6, var2 + var5, var3 + var7);
|
|
||||||
|
|
||||||
if (var8 == Block.silverfish.blockID) {
|
|
||||||
this.worldObj.destroyBlock(var1 + var6, var2 + var5, var3 + var7, false);
|
|
||||||
Block.silverfish.onBlockDestroyedByPlayer(this.worldObj, var1 + var6, var2 + var5, var3 + var7, 0);
|
|
||||||
|
|
||||||
if (this.rand.nextBoolean()) {
|
|
||||||
var4 = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.entityToAttack == null && !this.hasPath()) {
|
|
||||||
var1 = MathHelper.floor_double(this.posX);
|
|
||||||
var2 = MathHelper.floor_double(this.posY + 0.5D);
|
|
||||||
var3 = MathHelper.floor_double(this.posZ);
|
|
||||||
int var9 = this.rand.nextInt(6);
|
|
||||||
var5 = this.worldObj.getBlockId(var1 + Facing.offsetsXForSide[var9], var2 + Facing.offsetsYForSide[var9], var3 + Facing.offsetsZForSide[var9]);
|
|
||||||
|
|
||||||
if (BlockSilverfish.getPosingIdByMetadata(var5)) {
|
|
||||||
this.worldObj.setBlock(var1 + Facing.offsetsXForSide[var9], var2 + Facing.offsetsYForSide[var9], var3 + Facing.offsetsZForSide[var9], Block.silverfish.blockID, BlockSilverfish.getMetadataForBlockType(var5), 3);
|
|
||||||
this.spawnExplosionParticle();
|
|
||||||
this.setDead();
|
|
||||||
} else {
|
|
||||||
this.updateWanderPath();
|
|
||||||
}
|
|
||||||
} else if (this.entityToAttack != null && !this.hasPath()) {
|
|
||||||
this.entityToAttack = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a coordinate in and returns a weight to determine how likely this
|
* Takes a coordinate in and returns a weight to determine how likely this
|
||||||
* creature will try to path to the block. Args: x, y, z
|
* creature will try to path to the block. Args: x, y, z
|
||||||
|
|
|
@ -94,33 +94,7 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob {
|
||||||
* burn.
|
* burn.
|
||||||
*/
|
*/
|
||||||
public void onLivingUpdate() {
|
public void onLivingUpdate() {
|
||||||
if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {
|
if (this.getSkeletonType() == 1) {
|
||||||
float var1 = this.getBrightness(1.0F);
|
|
||||||
|
|
||||||
if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) {
|
|
||||||
boolean var2 = true;
|
|
||||||
ItemStack var3 = this.getCurrentItemOrArmor(4);
|
|
||||||
|
|
||||||
if (var3 != null) {
|
|
||||||
if (var3.isItemStackDamageable()) {
|
|
||||||
var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2));
|
|
||||||
|
|
||||||
if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) {
|
|
||||||
this.renderBrokenItemStack(var3);
|
|
||||||
this.setCurrentItemOrArmor(4, (ItemStack) null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var2 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var2) {
|
|
||||||
this.setFire(8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldObj.isRemote && this.getSkeletonType() == 1) {
|
|
||||||
this.setSize(0.72F, 2.34F);
|
this.setSize(0.72F, 2.34F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,16 +250,4 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob {
|
||||||
super.writeEntityToNBT(par1NBTTagCompound);
|
super.writeEntityToNBT(par1NBTTagCompound);
|
||||||
par1NBTTagCompound.setByte("SkeletonType", (byte) this.getSkeletonType());
|
par1NBTTagCompound.setByte("SkeletonType", (byte) this.getSkeletonType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor.
|
|
||||||
* Params: Item, slot
|
|
||||||
*/
|
|
||||||
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) {
|
|
||||||
super.setCurrentItemOrArmor(par1, par2ItemStack);
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && par1 == 0) {
|
|
||||||
this.setCombatTask();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,10 +80,6 @@ public class EntitySlime extends EntityLiving implements IMob {
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) {
|
|
||||||
this.isDead = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
|
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
|
||||||
this.field_70812_c = this.field_70811_b;
|
this.field_70812_c = this.field_70811_b;
|
||||||
boolean var1 = this.onGround;
|
boolean var1 = this.onGround;
|
||||||
|
@ -112,10 +108,8 @@ public class EntitySlime extends EntityLiving implements IMob {
|
||||||
|
|
||||||
this.func_70808_l();
|
this.func_70808_l();
|
||||||
|
|
||||||
if (this.worldObj.isRemote) {
|
var2 = this.getSlimeSize();
|
||||||
var2 = this.getSlimeSize();
|
this.setSize(0.6F * (float) var2, 0.6F * (float) var2);
|
||||||
this.setSize(0.6F * (float) var2, 0.6F * (float) var2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateEntityActionState() {
|
protected void updateEntityActionState() {
|
||||||
|
@ -167,28 +161,6 @@ public class EntitySlime extends EntityLiving implements IMob {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Will get destroyed next tick.
|
|
||||||
*/
|
|
||||||
public void setDead() {
|
|
||||||
int var1 = this.getSlimeSize();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0) {
|
|
||||||
int var2 = 2 + this.rand.nextInt(3);
|
|
||||||
|
|
||||||
for (int var3 = 0; var3 < var2; ++var3) {
|
|
||||||
float var4 = ((float) (var3 % 2) - 0.5F) * (float) var1 / 4.0F;
|
|
||||||
float var5 = ((float) (var3 / 2) - 0.5F) * (float) var1 / 4.0F;
|
|
||||||
EntitySlime var6 = this.createInstance();
|
|
||||||
var6.setSlimeSize(var1 / 2);
|
|
||||||
var6.setLocationAndAngles(this.posX + (double) var4, this.posY + 0.5D, this.posZ + (double) var5, this.rand.nextFloat() * 360.0F, 0.0F);
|
|
||||||
this.worldObj.spawnEntityInWorld(var6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by a player entity when they collide with an entity
|
* Called by a player entity when they collide with an entity
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,48 +20,6 @@ public class EntitySmallFireball extends EntityFireball {
|
||||||
* Called when this EntityFireball hits a block or entity.
|
* Called when this EntityFireball hits a block or entity.
|
||||||
*/
|
*/
|
||||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (par1MovingObjectPosition.entityHit != null) {
|
|
||||||
if (!par1MovingObjectPosition.entityHit.isImmuneToFire() && par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5)) {
|
|
||||||
par1MovingObjectPosition.entityHit.setFire(5);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int var2 = par1MovingObjectPosition.blockX;
|
|
||||||
int var3 = par1MovingObjectPosition.blockY;
|
|
||||||
int var4 = par1MovingObjectPosition.blockZ;
|
|
||||||
|
|
||||||
switch (par1MovingObjectPosition.sideHit) {
|
|
||||||
case 0:
|
|
||||||
--var3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
++var3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
--var4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
++var4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
--var2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
++var2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.worldObj.isAirBlock(var2, var3, var4)) {
|
|
||||||
this.worldObj.setBlock(var2, var3, var4, Block.fire.blockID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,9 +30,5 @@ public class EntitySnowball extends EntityThrowable {
|
||||||
for (int var3 = 0; var3 < 8; ++var3) {
|
for (int var3 = 0; var3 < 8; ++var3) {
|
||||||
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,17 +12,6 @@ public class EntitySpider extends EntityMob {
|
||||||
this.dataWatcher.addObject(16, new Byte((byte) 0));
|
this.dataWatcher.addObject(16, new Byte((byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to update the entity's position/logic.
|
|
||||||
*/
|
|
||||||
public void onUpdate() {
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setBesideClimbableBlock(this.isCollidedHorizontally);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxHealth() {
|
public int getMaxHealth() {
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,12 +128,6 @@ public class EntitySquid extends EntityWaterMob {
|
||||||
this.field_70871_bB *= 0.99F;
|
this.field_70871_bB *= 0.99F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.motionX = (double) (this.randomMotionVecX * this.randomMotionSpeed);
|
|
||||||
this.motionY = (double) (this.randomMotionVecY * this.randomMotionSpeed);
|
|
||||||
this.motionZ = (double) (this.randomMotionVecZ * this.randomMotionSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
this.renderYawOffset += (-((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI - this.renderYawOffset) * 0.1F;
|
this.renderYawOffset += (-((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI - this.renderYawOffset) * 0.1F;
|
||||||
this.rotationYaw = this.renderYawOffset;
|
this.rotationYaw = this.renderYawOffset;
|
||||||
|
@ -141,14 +135,6 @@ public class EntitySquid extends EntityWaterMob {
|
||||||
this.squidPitch += (-((float) Math.atan2((double) var1, this.motionY)) * 180.0F / (float) Math.PI - this.squidPitch) * 0.1F;
|
this.squidPitch += (-((float) Math.atan2((double) var1, this.motionY)) * 180.0F / (float) Math.PI - this.squidPitch) * 0.1F;
|
||||||
} else {
|
} else {
|
||||||
this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.field_70867_h)) * (float) Math.PI * 0.25F;
|
this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.field_70867_h)) * (float) Math.PI * 0.25F;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.motionX = 0.0D;
|
|
||||||
this.motionY -= 0.08D;
|
|
||||||
this.motionY *= 0.9800000190734863D;
|
|
||||||
this.motionZ = 0.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.squidPitch = (float) ((double) this.squidPitch + (double) (-90.0F - this.squidPitch) * 0.02D);
|
this.squidPitch = (float) ((double) this.squidPitch + (double) (-90.0F - this.squidPitch) * 0.02D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,10 +70,6 @@ public class EntityTNTPrimed extends Entity {
|
||||||
|
|
||||||
if (this.fuse-- <= 0) {
|
if (this.fuse-- <= 0) {
|
||||||
this.setDead();
|
this.setDead();
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.explode();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,36 +160,6 @@ public abstract class EntityThrowable extends Entity implements IProjectile {
|
||||||
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
Entity var4 = null;
|
|
||||||
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
|
||||||
double var6 = 0.0D;
|
|
||||||
EntityLiving var8 = this.getThrower();
|
|
||||||
|
|
||||||
for (int var9 = 0; var9 < var5.size(); ++var9) {
|
|
||||||
Entity var10 = (Entity) var5.get(var9);
|
|
||||||
|
|
||||||
if (var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) {
|
|
||||||
float var11 = 0.3F;
|
|
||||||
AxisAlignedBB var12 = var10.boundingBox.expand((double) var11, (double) var11, (double) var11);
|
|
||||||
MovingObjectPosition var13 = var12.calculateIntercept(var16, var2);
|
|
||||||
|
|
||||||
if (var13 != null) {
|
|
||||||
double var14 = var16.distanceTo(var13.hitVec);
|
|
||||||
|
|
||||||
if (var14 < var6 || var6 == 0.0D) {
|
|
||||||
var4 = var10;
|
|
||||||
var6 = var14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var4 != null) {
|
|
||||||
var3 = new MovingObjectPosition(var4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3 != null) {
|
if (var3 != null) {
|
||||||
if (var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) {
|
if (var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) {
|
||||||
this.setInPortal();
|
this.setInPortal();
|
||||||
|
|
|
@ -103,11 +103,6 @@ public class EntityVillager extends EntityAgeable implements INpc, IMerchant {
|
||||||
boolean var3 = var2 != null && var2.itemID == Item.monsterPlacer.itemID;
|
boolean var3 = var2 != null && var2.itemID == Item.monsterPlacer.itemID;
|
||||||
|
|
||||||
if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) {
|
if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.setCustomer(par1EntityPlayer);
|
|
||||||
par1EntityPlayer.displayGUIMerchant(this, this.func_94057_bL());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return super.interact(par1EntityPlayer);
|
return super.interact(par1EntityPlayer);
|
||||||
|
|
|
@ -70,60 +70,6 @@ public class EntityWitch extends EntityMob implements IRangedAttackMob {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called frequently so the entity can update its state every tick as required.
|
|
||||||
* For example, zombies and skeletons use this to react to sunlight and start to
|
|
||||||
* burn.
|
|
||||||
*/
|
|
||||||
public void onLivingUpdate() {
|
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
if (this.getAggressive()) {
|
|
||||||
if (this.witchAttackTimer-- <= 0) {
|
|
||||||
this.setAggressive(false);
|
|
||||||
ItemStack var1 = this.getHeldItem();
|
|
||||||
this.setCurrentItemOrArmor(0, (ItemStack) null);
|
|
||||||
|
|
||||||
if (var1 != null && var1.itemID == Item.potion.itemID) {
|
|
||||||
List var2 = Item.potion.getEffects(var1);
|
|
||||||
|
|
||||||
if (var2 != null) {
|
|
||||||
Iterator var3 = var2.iterator();
|
|
||||||
|
|
||||||
while (var3.hasNext()) {
|
|
||||||
PotionEffect var4 = (PotionEffect) var3.next();
|
|
||||||
this.addPotionEffect(new PotionEffect(var4));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
short var5 = -1;
|
|
||||||
|
|
||||||
if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) {
|
|
||||||
var5 = 16307;
|
|
||||||
} else if (this.rand.nextFloat() < 0.05F && this.health < this.getMaxHealth()) {
|
|
||||||
var5 = 16341;
|
|
||||||
} else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) {
|
|
||||||
var5 = 16274;
|
|
||||||
} else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) {
|
|
||||||
var5 = 16274;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var5 > -1) {
|
|
||||||
this.setCurrentItemOrArmor(0, new ItemStack(Item.potion, 1, var5));
|
|
||||||
this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration();
|
|
||||||
this.setAggressive(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.rand.nextFloat() < 7.5E-4F) {
|
|
||||||
this.worldObj.setEntityState(this, (byte) 15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onLivingUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleHealthUpdate(byte par1) {
|
public void handleHealthUpdate(byte par1) {
|
||||||
if (par1 == 15) {
|
if (par1 == 15) {
|
||||||
for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) {
|
for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) {
|
||||||
|
|
|
@ -90,39 +90,11 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged
|
||||||
* burn.
|
* burn.
|
||||||
*/
|
*/
|
||||||
public void onLivingUpdate() {
|
public void onLivingUpdate() {
|
||||||
if (!this.worldObj.isRemote) {
|
|
||||||
this.dataWatcher.updateObject(16, Integer.valueOf(this.health));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.motionY *= 0.6000000238418579D;
|
this.motionY *= 0.6000000238418579D;
|
||||||
double var4;
|
double var4;
|
||||||
double var6;
|
double var6;
|
||||||
double var8;
|
double var8;
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) {
|
|
||||||
Entity var1 = this.worldObj.getEntityByID(this.getWatchedTargetId(0));
|
|
||||||
|
|
||||||
if (var1 != null) {
|
|
||||||
if (this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) {
|
|
||||||
if (this.motionY < 0.0D) {
|
|
||||||
this.motionY = 0.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.motionY += (0.5D - this.motionY) * 0.6000000238418579D;
|
|
||||||
}
|
|
||||||
|
|
||||||
double var2 = var1.posX - this.posX;
|
|
||||||
var4 = var1.posZ - this.posZ;
|
|
||||||
var6 = var2 * var2 + var4 * var4;
|
|
||||||
|
|
||||||
if (var6 > 9.0D) {
|
|
||||||
var8 = (double) MathHelper.sqrt_double(var6);
|
|
||||||
this.motionX += (var2 / var8 * 0.5D - this.motionX) * 0.6000000238418579D;
|
|
||||||
this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * 0.6000000238418579D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) {
|
if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) {
|
||||||
this.rotationYaw = (float) Math.atan2(this.motionZ, this.motionX) * (180F / (float) Math.PI) - 90.0F;
|
this.rotationYaw = (float) Math.atan2(this.motionZ, this.motionX) * (180F / (float) Math.PI) - 90.0F;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user