diff --git a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java index bd50e42..8120073 100644 --- a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java +++ b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java @@ -4,7 +4,7 @@ public class ConfigConstants { 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 forkMe = "https://github.com/LAX1DUDE/eaglercraft"; diff --git a/src/main/java/net/minecraft/src/Block.java b/src/main/java/net/minecraft/src/Block.java index 6441110..bae98a4 100644 --- a/src/main/java/net/minecraft/src/Block.java +++ b/src/main/java/net/minecraft/src/Block.java @@ -645,19 +645,6 @@ public class Block { * 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) { - 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. */ 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 */ 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)); - } - } } /** diff --git a/src/main/java/net/minecraft/src/BlockAnvil.java b/src/main/java/net/minecraft/src/BlockAnvil.java index 3efd15d..23abc10 100644 --- a/src/main/java/net/minecraft/src/BlockAnvil.java +++ b/src/main/java/net/minecraft/src/BlockAnvil.java @@ -89,12 +89,7 @@ public class BlockAnvil extends BlockSand { * 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) { - if (par1World.isRemote) { - return true; - } else { - par5EntityPlayer.displayGUIAnvil(par2, par3, par4); - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockBasePressurePlate.java b/src/main/java/net/minecraft/src/BlockBasePressurePlate.java index 42dbcd6..ea17b2b 100644 --- a/src/main/java/net/minecraft/src/BlockBasePressurePlate.java +++ b/src/main/java/net/minecraft/src/BlockBasePressurePlate.java @@ -1,7 +1,5 @@ package net.minecraft.src; -import java.util.Random; - public abstract class BlockBasePressurePlate extends Block { 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 * off, it turns it on, and vice versa. diff --git a/src/main/java/net/minecraft/src/BlockBeacon.java b/src/main/java/net/minecraft/src/BlockBeacon.java index 506128b..dd435c8 100644 --- a/src/main/java/net/minecraft/src/BlockBeacon.java +++ b/src/main/java/net/minecraft/src/BlockBeacon.java @@ -21,17 +21,7 @@ public class BlockBeacon extends BlockContainer { * 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) { - if (par1World.isRemote) { - return true; - } else { - TileEntityBeacon var10 = (TileEntityBeacon) par1World.getBlockTileEntity(par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIBeacon(var10); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockBed.java b/src/main/java/net/minecraft/src/BlockBed.java index 043da76..32a1e05 100644 --- a/src/main/java/net/minecraft/src/BlockBed.java +++ b/src/main/java/net/minecraft/src/BlockBed.java @@ -19,82 +19,7 @@ public class BlockBed extends BlockDirectional { * 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) { - if (par1World.isRemote) { - 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; - } - } + 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) { par1World.setBlockToAir(par2, par3, par4); - - if (!par1World.isRemote) { - this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); - } } } diff --git a/src/main/java/net/minecraft/src/BlockBrewingStand.java b/src/main/java/net/minecraft/src/BlockBrewingStand.java index d67b1a9..afae5e8 100644 --- a/src/main/java/net/minecraft/src/BlockBrewingStand.java +++ b/src/main/java/net/minecraft/src/BlockBrewingStand.java @@ -66,17 +66,7 @@ public class BlockBrewingStand extends BlockContainer { * 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) { - if (par1World.isRemote) { - return true; - } else { - TileEntityBrewingStand var10 = (TileEntityBrewingStand) par1World.getBlockTileEntity(par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIBrewingStand(var10); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockButton.java b/src/main/java/net/minecraft/src/BlockButton.java index 7a9adb2..8062dfc 100644 --- a/src/main/java/net/minecraft/src/BlockButton.java +++ b/src/main/java/net/minecraft/src/BlockButton.java @@ -247,27 +247,6 @@ public abstract class BlockButton extends Block { 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 */ @@ -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); } - /** - * 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) { int var5 = par1World.getBlockMetadata(par2, par3, par4); int var6 = var5 & 7; diff --git a/src/main/java/net/minecraft/src/BlockCauldron.java b/src/main/java/net/minecraft/src/BlockCauldron.java index 5d3765a..e872cdd 100644 --- a/src/main/java/net/minecraft/src/BlockCauldron.java +++ b/src/main/java/net/minecraft/src/BlockCauldron.java @@ -91,51 +91,7 @@ public class BlockCauldron extends 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) { - if (par1World.isRemote) { - 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; - } - } - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockChest.java b/src/main/java/net/minecraft/src/BlockChest.java index ff295a0..8261074 100644 --- a/src/main/java/net/minecraft/src/BlockChest.java +++ b/src/main/java/net/minecraft/src/BlockChest.java @@ -145,88 +145,6 @@ public class BlockChest extends BlockContainer { * Turns the adjacent chests to a double chest. */ 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.) */ 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; - } else { - IInventory var10 = this.getInventory(par1World, par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIChest(var10); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockCommandBlock.java b/src/main/java/net/minecraft/src/BlockCommandBlock.java index 4b0c973..096777a 100644 --- a/src/main/java/net/minecraft/src/BlockCommandBlock.java +++ b/src/main/java/net/minecraft/src/BlockCommandBlock.java @@ -15,26 +15,6 @@ public class BlockCommandBlock extends BlockContainer { 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 */ diff --git a/src/main/java/net/minecraft/src/BlockCrops.java b/src/main/java/net/minecraft/src/BlockCrops.java index a0d8bbf..96a23ad 100644 --- a/src/main/java/net/minecraft/src/BlockCrops.java +++ b/src/main/java/net/minecraft/src/BlockCrops.java @@ -138,25 +138,6 @@ public class BlockCrops extends BlockFlower { 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. */ diff --git a/src/main/java/net/minecraft/src/BlockDeadBush.java b/src/main/java/net/minecraft/src/BlockDeadBush.java index ff6aae7..e82e0f5 100644 --- a/src/main/java/net/minecraft/src/BlockDeadBush.java +++ b/src/main/java/net/minecraft/src/BlockDeadBush.java @@ -23,16 +23,4 @@ public class BlockDeadBush extends BlockFlower { public int idDropped(int par1, Random par2Random, int par3) { 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); - } - } } diff --git a/src/main/java/net/minecraft/src/BlockDetectorRail.java b/src/main/java/net/minecraft/src/BlockDetectorRail.java index 770c11d..b830934 100644 --- a/src/main/java/net/minecraft/src/BlockDetectorRail.java +++ b/src/main/java/net/minecraft/src/BlockDetectorRail.java @@ -1,7 +1,6 @@ package net.minecraft.src; import java.util.List; -import java.util.Random; public class BlockDetectorRail extends BlockRailBase { private Icon[] iconArray; @@ -26,33 +25,6 @@ public class BlockDetectorRail extends BlockRailBase { 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 * specified side. If isBlockNormalCube returns true, standard redstone diff --git a/src/main/java/net/minecraft/src/BlockDispenser.java b/src/main/java/net/minecraft/src/BlockDispenser.java index 4e743aa..a6de785 100644 --- a/src/main/java/net/minecraft/src/BlockDispenser.java +++ b/src/main/java/net/minecraft/src/BlockDispenser.java @@ -34,31 +34,6 @@ public class BlockDispenser extends BlockContainer { * chooses west to be direction if all surrounding blocks are opaque. */ 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.) */ 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; - } else { - TileEntityDispenser var10 = (TileEntityDispenser) par1World.getBlockTileEntity(par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIDispenser(var10); - } - - return true; - } + return true; } 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 * block. diff --git a/src/main/java/net/minecraft/src/BlockDoor.java b/src/main/java/net/minecraft/src/BlockDoor.java index bf93fe7..ded39b1 100644 --- a/src/main/java/net/minecraft/src/BlockDoor.java +++ b/src/main/java/net/minecraft/src/BlockDoor.java @@ -281,11 +281,7 @@ public class BlockDoor extends Block { } } - if (var7) { - if (!par1World.isRemote) { - this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); - } - } else { + if (!var7) { boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID) { diff --git a/src/main/java/net/minecraft/src/BlockDragonEgg.java b/src/main/java/net/minecraft/src/BlockDragonEgg.java index a36bbea..97f1af9 100644 --- a/src/main/java/net/minecraft/src/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/src/BlockDragonEgg.java @@ -82,24 +82,18 @@ public class BlockDragonEgg extends Block { int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16); if (par1World.getBlockId(var6, var7, var8) == 0) { - if (!par1World.isRemote) { - par1World.setBlock(var6, var7, var8, this.blockID, par1World.getBlockMetadata(par2, par3, par4), 2); - par1World.setBlockToAir(par2, par3, par4); - } else { - short var9 = 128; + short var9 = 128; - for (int var10 = 0; var10 < var9; ++var10) { - double var11 = par1World.rand.nextDouble(); - float var13 = (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; - 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 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); - } + for (int var10 = 0; var10 < var9; ++var10) { + double var11 = par1World.rand.nextDouble(); + float var13 = (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; + 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 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); } - return; } } diff --git a/src/main/java/net/minecraft/src/BlockEnchantmentTable.java b/src/main/java/net/minecraft/src/BlockEnchantmentTable.java index 571b6f4..31ff12d 100644 --- a/src/main/java/net/minecraft/src/BlockEnchantmentTable.java +++ b/src/main/java/net/minecraft/src/BlockEnchantmentTable.java @@ -79,13 +79,7 @@ public class BlockEnchantmentTable extends BlockContainer { * 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) { - if (par1World.isRemote) { - 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; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockEndPortal.java b/src/main/java/net/minecraft/src/BlockEndPortal.java index 7d8828f..912d70f 100644 --- a/src/main/java/net/minecraft/src/BlockEndPortal.java +++ b/src/main/java/net/minecraft/src/BlockEndPortal.java @@ -71,16 +71,6 @@ public class BlockEndPortal extends BlockContainer { 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 * for display diff --git a/src/main/java/net/minecraft/src/BlockEnderChest.java b/src/main/java/net/minecraft/src/BlockEnderChest.java index 95fae4b..104abc9 100644 --- a/src/main/java/net/minecraft/src/BlockEnderChest.java +++ b/src/main/java/net/minecraft/src/BlockEnderChest.java @@ -85,22 +85,7 @@ public class BlockEnderChest extends BlockContainer { * 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) { - InventoryEnderChest var10 = par5EntityPlayer.getInventoryEnderChest(); - 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; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockFarmland.java b/src/main/java/net/minecraft/src/BlockFarmland.java index a72838e..9b0891d 100644 --- a/src/main/java/net/minecraft/src/BlockFarmland.java +++ b/src/main/java/net/minecraft/src/BlockFarmland.java @@ -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 * to z+1) diff --git a/src/main/java/net/minecraft/src/BlockFenceGate.java b/src/main/java/net/minecraft/src/BlockFenceGate.java index c59a0f4..713c49f 100644 --- a/src/main/java/net/minecraft/src/BlockFenceGate.java +++ b/src/main/java/net/minecraft/src/BlockFenceGate.java @@ -105,28 +105,6 @@ public class BlockFenceGate extends BlockDirectional { 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. */ diff --git a/src/main/java/net/minecraft/src/BlockFurnace.java b/src/main/java/net/minecraft/src/BlockFurnace.java index 2186687..41b68f9 100644 --- a/src/main/java/net/minecraft/src/BlockFurnace.java +++ b/src/main/java/net/minecraft/src/BlockFurnace.java @@ -45,31 +45,6 @@ public class BlockFurnace extends BlockContainer { * set a blocks direction */ 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.) */ 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; - } else { - TileEntityFurnace var10 = (TileEntityFurnace) par1World.getBlockTileEntity(par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIFurnace(var10); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockGrass.java b/src/main/java/net/minecraft/src/BlockGrass.java index ad29c0b..7eefe0a 100644 --- a/src/main/java/net/minecraft/src/BlockGrass.java +++ b/src/main/java/net/minecraft/src/BlockGrass.java @@ -94,22 +94,6 @@ public class BlockGrass extends Block { * Ticks the block if it's been scheduled */ 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); - } - } - } - } } /** diff --git a/src/main/java/net/minecraft/src/BlockHopper.java b/src/main/java/net/minecraft/src/BlockHopper.java index 7456e6a..f5b49e6 100644 --- a/src/main/java/net/minecraft/src/BlockHopper.java +++ b/src/main/java/net/minecraft/src/BlockHopper.java @@ -88,17 +88,7 @@ public class BlockHopper extends BlockContainer { * 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) { - if (par1World.isRemote) { - return true; - } else { - TileEntityHopper var10 = getHopperTile(par1World, par2, par3, par4); - - if (var10 != null) { - par5EntityPlayer.displayGUIHopper(var10); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockJukeBox.java b/src/main/java/net/minecraft/src/BlockJukeBox.java index 10a54fb..1aecbee 100644 --- a/src/main/java/net/minecraft/src/BlockJukeBox.java +++ b/src/main/java/net/minecraft/src/BlockJukeBox.java @@ -32,42 +32,12 @@ public class BlockJukeBox extends BlockContainer { * 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) { - 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. */ 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 */ 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); - } } /** diff --git a/src/main/java/net/minecraft/src/BlockLeaves.java b/src/main/java/net/minecraft/src/BlockLeaves.java index bf78d5d..4ec383d 100644 --- a/src/main/java/net/minecraft/src/BlockLeaves.java +++ b/src/main/java/net/minecraft/src/BlockLeaves.java @@ -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 * for display @@ -213,52 +126,6 @@ public class BlockLeaves extends BlockLeavesBase { * 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) { - 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); - } } /** diff --git a/src/main/java/net/minecraft/src/BlockLever.java b/src/main/java/net/minecraft/src/BlockLever.java index 8ee423e..5880962 100644 --- a/src/main/java/net/minecraft/src/BlockLever.java +++ b/src/main/java/net/minecraft/src/BlockLever.java @@ -241,34 +241,7 @@ public class BlockLever extends 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) { - if (par1World.isRemote) { - 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; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockMycelium.java b/src/main/java/net/minecraft/src/BlockMycelium.java index 03c5be6..a58b474 100644 --- a/src/main/java/net/minecraft/src/BlockMycelium.java +++ b/src/main/java/net/minecraft/src/BlockMycelium.java @@ -50,22 +50,6 @@ public class BlockMycelium extends Block { * Ticks the block if it's been scheduled */ 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); - } - } - } - } } /** diff --git a/src/main/java/net/minecraft/src/BlockNetherStalk.java b/src/main/java/net/minecraft/src/BlockNetherStalk.java index 6a487e0..513914e 100644 --- a/src/main/java/net/minecraft/src/BlockNetherStalk.java +++ b/src/main/java/net/minecraft/src/BlockNetherStalk.java @@ -63,21 +63,6 @@ public class BlockNetherStalk extends BlockFlower { * 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) { - 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)); - } - } } /** diff --git a/src/main/java/net/minecraft/src/BlockNote.java b/src/main/java/net/minecraft/src/BlockNote.java index d7156b9..cfec154 100644 --- a/src/main/java/net/minecraft/src/BlockNote.java +++ b/src/main/java/net/minecraft/src/BlockNote.java @@ -30,31 +30,7 @@ public class BlockNote extends BlockContainer { * 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) { - if (par1World.isRemote) { - 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); - } - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/BlockPistonBase.java b/src/main/java/net/minecraft/src/BlockPistonBase.java index b305e4a..eb1e7f7 100644 --- a/src/main/java/net/minecraft/src/BlockPistonBase.java +++ b/src/main/java/net/minecraft/src/BlockPistonBase.java @@ -94,30 +94,12 @@ public class BlockPistonBase extends Block { public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) { int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLiving); 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 */ 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 */ 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 (!this.tryExtend(par1World, par2, par3, par4, par6)) { return false; diff --git a/src/main/java/net/minecraft/src/BlockPistonMoving.java b/src/main/java/net/minecraft/src/BlockPistonMoving.java index 9e6adaa..3caed66 100644 --- a/src/main/java/net/minecraft/src/BlockPistonMoving.java +++ b/src/main/java/net/minecraft/src/BlockPistonMoving.java @@ -80,12 +80,7 @@ public class BlockPistonMoving extends BlockContainer { * 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) { - if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { - par1World.setBlockToAir(par2, par3, par4); - return true; - } else { - return false; - } + return false; } /** @@ -99,13 +94,6 @@ public class BlockPistonMoving extends BlockContainer { * 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) { - 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 */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { - if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { - ; - } } /** diff --git a/src/main/java/net/minecraft/src/BlockPotato.java b/src/main/java/net/minecraft/src/BlockPotato.java index 2d85627..b157276 100644 --- a/src/main/java/net/minecraft/src/BlockPotato.java +++ b/src/main/java/net/minecraft/src/BlockPotato.java @@ -37,19 +37,6 @@ public class BlockPotato extends BlockCrops { 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 * with the given IconRegister. This is the only chance you get to register diff --git a/src/main/java/net/minecraft/src/BlockPumpkin.java b/src/main/java/net/minecraft/src/BlockPumpkin.java index 2edb20f..299b7ec 100644 --- a/src/main/java/net/minecraft/src/BlockPumpkin.java +++ b/src/main/java/net/minecraft/src/BlockPumpkin.java @@ -30,19 +30,6 @@ public class BlockPumpkin extends BlockDirectional { 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.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) { 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); } diff --git a/src/main/java/net/minecraft/src/BlockRailBase.java b/src/main/java/net/minecraft/src/BlockRailBase.java index d1210cd..c59f4cd 100644 --- a/src/main/java/net/minecraft/src/BlockRailBase.java +++ b/src/main/java/net/minecraft/src/BlockRailBase.java @@ -109,60 +109,8 @@ public abstract class BlockRailBase 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) { - 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) { } @@ -170,9 +118,6 @@ public abstract class BlockRailBase extends Block { * Completely recalculates the track shape based on neighboring tracks */ 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); - } } /** diff --git a/src/main/java/net/minecraft/src/BlockRedstoneLight.java b/src/main/java/net/minecraft/src/BlockRedstoneLight.java index d10a699..fdc8348 100644 --- a/src/main/java/net/minecraft/src/BlockRedstoneLight.java +++ b/src/main/java/net/minecraft/src/BlockRedstoneLight.java @@ -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. */ diff --git a/src/main/java/net/minecraft/src/BlockRedstoneWire.java b/src/main/java/net/minecraft/src/BlockRedstoneWire.java index 09d24dd..2b76af7 100644 --- a/src/main/java/net/minecraft/src/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/src/BlockRedstoneWire.java @@ -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 * 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. */ diff --git a/src/main/java/net/minecraft/src/BlockSand.java b/src/main/java/net/minecraft/src/BlockSand.java index 6f85b3a..0a33bd6 100644 --- a/src/main/java/net/minecraft/src/BlockSand.java +++ b/src/main/java/net/minecraft/src/BlockSand.java @@ -31,15 +31,6 @@ public class BlockSand extends Block { 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 */ @@ -47,13 +38,7 @@ public class BlockSand extends Block { if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) { byte var8 = 32; - 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 { + if (!(!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8))) { par1World.setBlockToAir(par2, par3, par4); while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) { diff --git a/src/main/java/net/minecraft/src/BlockSilverfish.java b/src/main/java/net/minecraft/src/BlockSilverfish.java index 3109da3..9f42406 100644 --- a/src/main/java/net/minecraft/src/BlockSilverfish.java +++ b/src/main/java/net/minecraft/src/BlockSilverfish.java @@ -29,22 +29,6 @@ public class BlockSilverfish extends Block { 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. */ diff --git a/src/main/java/net/minecraft/src/BlockSkull.java b/src/main/java/net/minecraft/src/BlockSkull.java index 71a5ac4..275ec7a 100644 --- a/src/main/java/net/minecraft/src/BlockSkull.java +++ b/src/main/java/net/minecraft/src/BlockSkull.java @@ -132,21 +132,6 @@ public class BlockSkull extends BlockContainer { * as appropriate */ 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 */ 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) { diff --git a/src/main/java/net/minecraft/src/BlockStem.java b/src/main/java/net/minecraft/src/BlockStem.java index 0ee4f12..6240408 100644 --- a/src/main/java/net/minecraft/src/BlockStem.java +++ b/src/main/java/net/minecraft/src/BlockStem.java @@ -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)))); } - /** - * 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. */ diff --git a/src/main/java/net/minecraft/src/BlockTNT.java b/src/main/java/net/minecraft/src/BlockTNT.java index 113d79f..66a4769 100644 --- a/src/main/java/net/minecraft/src/BlockTNT.java +++ b/src/main/java/net/minecraft/src/BlockTNT.java @@ -54,11 +54,6 @@ public class BlockTNT extends Block { * Called upon the block being destroyed by an explosion */ 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) { - 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. */ diff --git a/src/main/java/net/minecraft/src/BlockTallGrass.java b/src/main/java/net/minecraft/src/BlockTallGrass.java index 9e28510..e470a72 100644 --- a/src/main/java/net/minecraft/src/BlockTallGrass.java +++ b/src/main/java/net/minecraft/src/BlockTallGrass.java @@ -71,18 +71,6 @@ public class BlockTallGrass extends BlockFlower { 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). */ diff --git a/src/main/java/net/minecraft/src/BlockTrapDoor.java b/src/main/java/net/minecraft/src/BlockTrapDoor.java index 4c3770c..50b0fb0 100644 --- a/src/main/java/net/minecraft/src/BlockTrapDoor.java +++ b/src/main/java/net/minecraft/src/BlockTrapDoor.java @@ -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 * returning a ray trace hit. Args: world, x, y, z, startVec, endVec diff --git a/src/main/java/net/minecraft/src/BlockTripWire.java b/src/main/java/net/minecraft/src/BlockTripWire.java index 8f77e4e..a6f5c6b 100644 --- a/src/main/java/net/minecraft/src/BlockTripWire.java +++ b/src/main/java/net/minecraft/src/BlockTripWire.java @@ -123,17 +123,6 @@ public class BlockTripWire extends Block { 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) { 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) { int var5 = par1World.getBlockMetadata(par2, par3, par4); boolean var6 = (var5 & 1) == 1; diff --git a/src/main/java/net/minecraft/src/BlockVine.java b/src/main/java/net/minecraft/src/BlockVine.java index 0020b0a..c323f1a 100644 --- a/src/main/java/net/minecraft/src/BlockVine.java +++ b/src/main/java/net/minecraft/src/BlockVine.java @@ -211,124 +211,6 @@ public class BlockVine extends Block { 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, * side, hitX, hitY, hitZ, block metadata @@ -369,16 +251,4 @@ public class BlockVine extends Block { public int quantityDropped(Random par1Random) { 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); - } - } } diff --git a/src/main/java/net/minecraft/src/BlockWorkbench.java b/src/main/java/net/minecraft/src/BlockWorkbench.java index 11cc82d..65c741d 100644 --- a/src/main/java/net/minecraft/src/BlockWorkbench.java +++ b/src/main/java/net/minecraft/src/BlockWorkbench.java @@ -32,11 +32,6 @@ public class BlockWorkbench extends 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) { - if (par1World.isRemote) { - return true; - } else { - par5EntityPlayer.displayGUIWorkbench(par2, par3, par4); - return true; - } + return true; } } diff --git a/src/main/java/net/minecraft/src/Chunk.java b/src/main/java/net/minecraft/src/Chunk.java index 1a67d39..0af10be 100644 --- a/src/main/java/net/minecraft/src/Chunk.java +++ b/src/main/java/net/minecraft/src/Chunk.java @@ -516,18 +516,10 @@ public class Chunk { int var12 = this.xPosition * 16 + par1; 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); if (var8 != 0) { - if (!this.worldObj.isRemote) { - 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); - } + this.worldObj.removeBlockTileEntity(var12, par2, var13); } if (var10.getExtBlockID(par1, par2 & 15, par3) != par4) { @@ -552,10 +544,6 @@ public class Chunk { TileEntity var14; if (par4 != 0) { - if (!this.worldObj.isRemote) { - Block.blocksList[par4].onBlockAdded(this.worldObj, var12, par2, var13); - } - if (Block.blocksList[par4] instanceof ITileEntityProvider) { var14 = this.getChunkBlockTileEntity(par1, par2, par3); diff --git a/src/main/java/net/minecraft/src/ContainerEnchantment.java b/src/main/java/net/minecraft/src/ContainerEnchantment.java index 9637ef8..bc617d7 100644 --- a/src/main/java/net/minecraft/src/ContainerEnchantment.java +++ b/src/main/java/net/minecraft/src/ContainerEnchantment.java @@ -79,49 +79,6 @@ public class ContainerEnchantment extends Container { if (var2 != null && var2.isItemEnchantable()) { 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 { for (var3 = 0; var3 < 3; ++var3) { this.enchantLevels[var3] = 0; @@ -138,56 +95,12 @@ public class ContainerEnchantment extends Container { ItemStack var3 = this.tableInventory.getStackInSlot(0); 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; } else { 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) { 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; diff --git a/src/main/java/net/minecraft/src/ContainerMerchant.java b/src/main/java/net/minecraft/src/ContainerMerchant.java index c7aab62..5ecf290 100644 --- a/src/main/java/net/minecraft/src/ContainerMerchant.java +++ b/src/main/java/net/minecraft/src/ContainerMerchant.java @@ -115,19 +115,5 @@ public class ContainerMerchant extends Container { super.onCraftGuiClosed(par1EntityPlayer); this.theMerchant.setCustomer((EntityPlayer) null); 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); - } - } } } diff --git a/src/main/java/net/minecraft/src/ContainerRepair.java b/src/main/java/net/minecraft/src/ContainerRepair.java index fcb9b77..d459332 100644 --- a/src/main/java/net/minecraft/src/ContainerRepair.java +++ b/src/main/java/net/minecraft/src/ContainerRepair.java @@ -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) { 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; diff --git a/src/main/java/net/minecraft/src/ContainerWorkbench.java b/src/main/java/net/minecraft/src/ContainerWorkbench.java index 686d3d8..082c493 100644 --- a/src/main/java/net/minecraft/src/ContainerWorkbench.java +++ b/src/main/java/net/minecraft/src/ContainerWorkbench.java @@ -44,23 +44,6 @@ public class ContainerWorkbench extends Container { 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) { 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; } diff --git a/src/main/java/net/minecraft/src/Entity.java b/src/main/java/net/minecraft/src/Entity.java index b85580f..1d38d4a 100644 --- a/src/main/java/net/minecraft/src/Entity.java +++ b/src/main/java/net/minecraft/src/Entity.java @@ -394,23 +394,7 @@ public abstract class Entity { this.handleWaterMovement(); - if (this.worldObj.isRemote) { - 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; - } - } + this.fire = 0; if (this.handleLavaMovement()) { this.setOnFireFromLava(); @@ -421,11 +405,6 @@ public abstract class Entity { this.kill(); } - if (!this.worldObj.isRemote) { - this.setFlag(0, this.fire > 0); - this.setFlag(2, this.ridingEntity != null); - } - this.firstUpdate = false; this.worldObj.theProfiler.endSection(); } @@ -1616,13 +1595,6 @@ public abstract class Entity { if (this.timeUntilPortal > 0) { this.timeUntilPortal = this.getPortalCooldown(); } 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; } } diff --git a/src/main/java/net/minecraft/src/EntityAgeable.java b/src/main/java/net/minecraft/src/EntityAgeable.java index 3dd961a..6873dd1 100644 --- a/src/main/java/net/minecraft/src/EntityAgeable.java +++ b/src/main/java/net/minecraft/src/EntityAgeable.java @@ -6,42 +6,6 @@ public abstract class EntityAgeable extends EntityCreature { 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() { super.entityInit(); this.dataWatcher.addObject(12, new Integer(0)); @@ -90,20 +54,7 @@ public abstract class EntityAgeable extends EntityCreature { */ public void onLivingUpdate() { super.onLivingUpdate(); - - 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); - } - } + this.func_98054_a(this.isChild()); } /** diff --git a/src/main/java/net/minecraft/src/EntityArrow.java b/src/main/java/net/minecraft/src/EntityArrow.java index b18837a..405d3ca 100644 --- a/src/main/java/net/minecraft/src/EntityArrow.java +++ b/src/main/java/net/minecraft/src/EntityArrow.java @@ -271,10 +271,6 @@ public class EntityArrow extends Entity implements IProjectile { if (var4.entityHit instanceof EntityLiving) { EntityLiving var25 = (EntityLiving) var4.entityHit; - if (!this.worldObj.isRemote) { - var25.setArrowCountInEntity(var25.getArrowCountInEntity() + 1); - } - if (this.knockbackStrength > 0) { 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 * on. used for spiders and wolves to prevent them from trampling crops diff --git a/src/main/java/net/minecraft/src/EntityBat.java b/src/main/java/net/minecraft/src/EntityBat.java index 5b8974c..0d20147 100644 --- a/src/main/java/net/minecraft/src/EntityBat.java +++ b/src/main/java/net/minecraft/src/EntityBat.java @@ -190,10 +190,6 @@ public class EntityBat extends EntityAmbientCreature { if (this.isEntityInvulnerable()) { return false; } else { - if (!this.worldObj.isRemote && this.getIsBatHanging()) { - this.setIsBatHanging(false); - } - return super.attackEntityFrom(par1DamageSource, par2); } } diff --git a/src/main/java/net/minecraft/src/EntityBlaze.java b/src/main/java/net/minecraft/src/EntityBlaze.java index d12943a..1093e46 100644 --- a/src/main/java/net/minecraft/src/EntityBlaze.java +++ b/src/main/java/net/minecraft/src/EntityBlaze.java @@ -57,45 +57,6 @@ public class EntityBlaze extends EntityMob { 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 * each mob to define their attack. diff --git a/src/main/java/net/minecraft/src/EntityBoat.java b/src/main/java/net/minecraft/src/EntityBoat.java index 23a69e1..41deaac 100644 --- a/src/main/java/net/minecraft/src/EntityBoat.java +++ b/src/main/java/net/minecraft/src/EntityBoat.java @@ -90,26 +90,6 @@ public class EntityBoat extends Entity { public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { if (this.isEntityInvulnerable()) { 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 { return true; } @@ -231,7 +211,7 @@ public class EntityBoat extends Entity { double var12; double var25; - if (this.worldObj.isRemote && this.field_70279_a) { + if (this.field_70279_a) { if (this.boatPosRotationIncrements > 0) { var6 = this.posX + (this.boatX - this.posX) / (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); - 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 { + if (!(this.isCollidedHorizontally && var23 > 0.2D)) { this.motionX *= 0.9900000095367432D; this.motionY *= 0.949999988079071D; this.motionZ *= 0.9900000095367432D; @@ -346,41 +313,6 @@ public class EntityBoat extends Entity { this.rotationYaw = (float) ((double) this.rotationYaw + var14); 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. */ public boolean interact(EntityPlayer par1EntityPlayer) { - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { - return true; - } else { - if (!this.worldObj.isRemote) { - par1EntityPlayer.mountEntity(this); - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/EntityChicken.java b/src/main/java/net/minecraft/src/EntityChicken.java index 09c6ea8..c42b5c0 100644 --- a/src/main/java/net/minecraft/src/EntityChicken.java +++ b/src/main/java/net/minecraft/src/EntityChicken.java @@ -59,12 +59,6 @@ public class EntityChicken extends EntityAnimal { } 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; - } } /** diff --git a/src/main/java/net/minecraft/src/EntityCreeper.java b/src/main/java/net/minecraft/src/EntityCreeper.java index 8ce04b0..ba0122d 100644 --- a/src/main/java/net/minecraft/src/EntityCreeper.java +++ b/src/main/java/net/minecraft/src/EntityCreeper.java @@ -99,18 +99,6 @@ public class EntityCreeper extends EntityMob { if (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(); - } } } diff --git a/src/main/java/net/minecraft/src/EntityDragon.java b/src/main/java/net/minecraft/src/EntityDragon.java index 291a9de..fdcdb5e 100644 --- a/src/main/java/net/minecraft/src/EntityDragon.java +++ b/src/main/java/net/minecraft/src/EntityDragon.java @@ -113,18 +113,11 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt * burn. */ public void onLivingUpdate() { - float var1; - float var2; + float var1 = MathHelper.cos(this.animTime * (float) Math.PI * 2.0F); + float var2 = MathHelper.cos(this.prevAnimTime * (float) Math.PI * 2.0F); - if (!this.worldObj.isRemote) { - this.dataWatcher.updateObject(16, Integer.valueOf(this.health)); - } 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); - } + 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; @@ -167,105 +160,16 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt double var26; float var31; - if (this.worldObj.isRemote) { - if (this.newPosRotationIncrements > 0) { - var26 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements; - var4 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements; - var6 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements; - var8 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw); - 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.newPosRotationIncrements; - this.setPosition(var26, var4, var6); - 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; + if (this.newPosRotationIncrements > 0) { + var26 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements; + var4 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements; + var6 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements; + var8 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw); + 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.newPosRotationIncrements; + this.setPosition(var26, var4, var6); + this.setRotation(this.rotationYaw, this.rotationPitch); } this.renderYawOffset = this.rotationYaw; @@ -292,12 +196,6 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt 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); - 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[] var9 = this.getMovementOffsets(0, 1.0F); 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, 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() { if (this.healingEnderCrystal != null) { if (this.healingEnderCrystal.isDead) { - if (!this.worldObj.isRemote) { - this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion) null), 10); - } - this.healingEnderCrystal = null; } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { 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); } - 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.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(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntityEgg.java b/src/main/java/net/minecraft/src/EntityEgg.java index 2494c58..216c6b8 100644 --- a/src/main/java/net/minecraft/src/EntityEgg.java +++ b/src/main/java/net/minecraft/src/EntityEgg.java @@ -21,28 +21,8 @@ public class EntityEgg extends EntityThrowable { 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) { this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } - - if (!this.worldObj.isRemote) { - this.setDead(); - } } } diff --git a/src/main/java/net/minecraft/src/EntityEnderCrystal.java b/src/main/java/net/minecraft/src/EntityEnderCrystal.java index d46b2b1..1d11474 100644 --- a/src/main/java/net/minecraft/src/EntityEnderCrystal.java +++ b/src/main/java/net/minecraft/src/EntityEnderCrystal.java @@ -82,18 +82,6 @@ public class EntityEnderCrystal extends Entity { if (this.isEntityInvulnerable()) { return false; } 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; } } diff --git a/src/main/java/net/minecraft/src/EntityEnderEye.java b/src/main/java/net/minecraft/src/EntityEnderEye.java index 20f7e8d..0624483 100644 --- a/src/main/java/net/minecraft/src/EntityEnderEye.java +++ b/src/main/java/net/minecraft/src/EntityEnderEye.java @@ -115,28 +115,6 @@ public class EntityEnderEye extends Entity { this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 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; 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.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); - } - } - } } /** diff --git a/src/main/java/net/minecraft/src/EntityEnderman.java b/src/main/java/net/minecraft/src/EntityEnderman.java index 0ce6b8f..a5bff0f 100644 --- a/src/main/java/net/minecraft/src/EntityEnderman.java +++ b/src/main/java/net/minecraft/src/EntityEnderman.java @@ -107,54 +107,11 @@ public class EntityEnderman extends EntityMob { this.moveSpeed = this.entityToAttack != null ? 6.5F : 0.3F; 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) { 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); } - 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()) { this.entityToAttack = null; this.setScreaming(false); @@ -172,26 +129,6 @@ public class EntityEnderman extends EntityMob { 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(); } diff --git a/src/main/java/net/minecraft/src/EntityExpBottle.java b/src/main/java/net/minecraft/src/EntityExpBottle.java index 7ae60e7..9355410 100644 --- a/src/main/java/net/minecraft/src/EntityExpBottle.java +++ b/src/main/java/net/minecraft/src/EntityExpBottle.java @@ -34,17 +34,5 @@ public class EntityExpBottle extends EntityThrowable { * Called when this EntityThrowable hits a block or entity. */ 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(); - } } } diff --git a/src/main/java/net/minecraft/src/EntityFallingSand.java b/src/main/java/net/minecraft/src/EntityFallingSand.java index 26aa0e8..0672bbc 100644 --- a/src/main/java/net/minecraft/src/EntityFallingSand.java +++ b/src/main/java/net/minecraft/src/EntityFallingSand.java @@ -96,67 +96,6 @@ public class EntityFallingSand extends Entity { this.motionX *= 0.9800000190734863D; this.motionY *= 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(); - } - } } } diff --git a/src/main/java/net/minecraft/src/EntityFireball.java b/src/main/java/net/minecraft/src/EntityFireball.java index 837670b..8cb7758 100644 --- a/src/main/java/net/minecraft/src/EntityFireball.java +++ b/src/main/java/net/minecraft/src/EntityFireball.java @@ -70,120 +70,116 @@ public abstract class EntityFireball extends Entity { * Called to update the entity's position/logic. */ 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))) { - this.setDead(); + super.onUpdate(); + 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 { - super.onUpdate(); - 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); + ++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); } /** diff --git a/src/main/java/net/minecraft/src/EntityFireworkRocket.java b/src/main/java/net/minecraft/src/EntityFireworkRocket.java index dc2d156..8588846 100644 --- a/src/main/java/net/minecraft/src/EntityFireworkRocket.java +++ b/src/main/java/net/minecraft/src/EntityFireworkRocket.java @@ -110,28 +110,21 @@ public class EntityFireworkRocket extends Entity { ++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); } - - if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { - this.worldObj.setEntityState(this, (byte) 17); - this.setDead(); - } } public void handleHealthUpdate(byte par1) { - if (par1 == 17 && this.worldObj.isRemote) { - ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); - NBTTagCompound var3 = null; + ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); + NBTTagCompound var3 = null; - if (var2 != null && var2.hasTagCompound()) { - var3 = var2.getTagCompound().getCompoundTag("Fireworks"); - } - - this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); + if (var2 != null && var2.hasTagCompound()) { + var3 = var2.getTagCompound().getCompoundTag("Fireworks"); } + this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); + super.handleHealthUpdate(par1); } diff --git a/src/main/java/net/minecraft/src/EntityFishHook.java b/src/main/java/net/minecraft/src/EntityFishHook.java index 212dcc9..f5657cb 100644 --- a/src/main/java/net/minecraft/src/EntityFishHook.java +++ b/src/main/java/net/minecraft/src/EntityFishHook.java @@ -167,26 +167,6 @@ public class EntityFishHook extends Entity { this.setPosition(var21, var22, var23); this.setRotation(this.rotationYaw, this.rotationPitch); } 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) { --this.shake; @@ -388,44 +368,7 @@ public class EntityFishHook extends Entity { } public int catchFish() { - if (this.worldObj.isRemote) { - 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; - } + return 0; } /** diff --git a/src/main/java/net/minecraft/src/EntityGhast.java b/src/main/java/net/minecraft/src/EntityGhast.java index cb2ec52..ad54fc5 100644 --- a/src/main/java/net/minecraft/src/EntityGhast.java +++ b/src/main/java/net/minecraft/src/EntityGhast.java @@ -48,10 +48,6 @@ public class EntityGhast extends EntityFlying implements IMob { } protected void updateEntityActionState() { - if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { - this.setDead(); - } - this.despawnEntity(); this.prevAttackCounter = this.attackCounter; double var1 = this.waypointX - this.posX; @@ -129,15 +125,6 @@ public class EntityGhast extends EntityFlying implements IMob { --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)); - } - } } /** diff --git a/src/main/java/net/minecraft/src/EntityHanging.java b/src/main/java/net/minecraft/src/EntityHanging.java index 188a5ab..3d6056e 100644 --- a/src/main/java/net/minecraft/src/EntityHanging.java +++ b/src/main/java/net/minecraft/src/EntityHanging.java @@ -99,14 +99,6 @@ public abstract class EntityHanging extends Entity { * Called to update the entity's position/logic. */ 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()) { return false; } 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; } } @@ -215,20 +191,12 @@ public abstract class EntityHanging extends Entity { * Tries to moves the entity by the passed in displacement. Args: x, y, z */ 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 */ 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(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntityItem.java b/src/main/java/net/minecraft/src/EntityItem.java index c94ba2d..9be09fc 100644 --- a/src/main/java/net/minecraft/src/EntityItem.java +++ b/src/main/java/net/minecraft/src/EntityItem.java @@ -84,10 +84,6 @@ public class EntityItem extends Entity { this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); } - - if (!this.worldObj.isRemote) { - this.searchForOtherItemsNearby(); - } } float var2 = 0.98F; @@ -110,10 +106,6 @@ public class EntityItem extends Entity { } ++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. */ @@ -285,18 +242,6 @@ public class EntityItem extends Entity { 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, * will log an error but still return an ItemStack containing Block.stone) diff --git a/src/main/java/net/minecraft/src/EntityItemFrame.java b/src/main/java/net/minecraft/src/EntityItemFrame.java index 7de14ed..60d5810 100644 --- a/src/main/java/net/minecraft/src/EntityItemFrame.java +++ b/src/main/java/net/minecraft/src/EntityItemFrame.java @@ -110,20 +110,6 @@ public class EntityItemFrame extends EntityHanging { * into the saddle on a pig. */ 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; } } diff --git a/src/main/java/net/minecraft/src/EntityLargeFireball.java b/src/main/java/net/minecraft/src/EntityLargeFireball.java index ad9d3c1..319819a 100644 --- a/src/main/java/net/minecraft/src/EntityLargeFireball.java +++ b/src/main/java/net/minecraft/src/EntityLargeFireball.java @@ -19,14 +19,6 @@ public class EntityLargeFireball extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ 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(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntityLightningBolt.java b/src/main/java/net/minecraft/src/EntityLightningBolt.java index 546c47c..feee0a2 100644 --- a/src/main/java/net/minecraft/src/EntityLightningBolt.java +++ b/src/main/java/net/minecraft/src/EntityLightningBolt.java @@ -27,26 +27,6 @@ public class EntityLightningBolt extends EntityWeatherEffect { this.lightningState = 2; this.boltVertex = this.rand.nextLong(); 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.lightningState = 1; 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.worldObj.isRemote) { - 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); - } - } + this.worldObj.lastLightningBolt = 2; } } diff --git a/src/main/java/net/minecraft/src/EntityLiving.java b/src/main/java/net/minecraft/src/EntityLiving.java index dbb09ef..62759a2 100644 --- a/src/main/java/net/minecraft/src/EntityLiving.java +++ b/src/main/java/net/minecraft/src/EntityLiving.java @@ -486,9 +486,7 @@ public abstract class EntityLiving extends Entity { this.attackEntityFrom(DamageSource.inWall, 1); } - if (this.isImmuneToFire() || this.worldObj.isRemote) { - this.extinguish(); - } + this.extinguish(); boolean var1 = this instanceof EntityPlayer && ((EntityPlayer) this).capabilities.disableDamage; @@ -569,16 +567,6 @@ public abstract class EntityLiving extends Entity { if (this.deathTime == 20) { 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(); for (var1 = 0; var1 < 20; ++var1) { @@ -796,98 +784,7 @@ public abstract class EntityLiving extends Entity { * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { - if (this.isEntityInvulnerable()) { - 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; - } - } + return false; } /** @@ -1060,27 +957,6 @@ public abstract class EntityLiving extends Entity { 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); } @@ -1246,7 +1122,7 @@ public abstract class EntityLiving extends Entity { 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) { this.motionY = -0.1D; } else { @@ -1492,77 +1368,8 @@ public abstract class EntityLiving extends Entity { this.landMovementFactor = var11; this.worldObj.theProfiler.endSection(); this.worldObj.theProfiler.startSection("push"); - - if (!this.worldObj.isRemote) { - this.func_85033_bc(); - } - this.worldObj.theProfiler.endSection(); 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(); } @@ -1943,34 +1750,14 @@ public abstract class EntityLiving extends Entity { Integer var2 = (Integer) var1.next(); PotionEffect var3 = (PotionEffect) this.activePotionsMap.get(var2); - if (!var3.onUpdate(this)) { - if (!this.worldObj.isRemote) { - var1.remove(); - this.onFinishedPotionEffect(var3); - } - } else if (var3.getDuration() % 600 == 0) { + if (var3.onUpdate(this)) { this.onChangedPotionEffect(var3); } } int var12; - if (this.potionsNeedUpdate) { - 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; - } + this.potionsNeedUpdate = false; var12 = this.dataWatcher.getWatchableObjectInt(8); boolean var13 = this.dataWatcher.getWatchableObjectByte(9) > 0; @@ -1999,17 +1786,6 @@ public abstract class EntityLiving extends Entity { } 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() { diff --git a/src/main/java/net/minecraft/src/EntityMinecart.java b/src/main/java/net/minecraft/src/EntityMinecart.java index 0088259..53b2ab1 100644 --- a/src/main/java/net/minecraft/src/EntityMinecart.java +++ b/src/main/java/net/minecraft/src/EntityMinecart.java @@ -131,33 +131,7 @@ public abstract class EntityMinecart extends Entity { * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { - if (!this.worldObj.isRemote && !this.isDead) { - 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; - } + return true; } public void killMinecart(DamageSource par1DamageSource) { @@ -219,92 +193,20 @@ public abstract class EntityMinecart extends Entity { if (this.posY < -64.0D) { this.kill(); } - - int var2; - if (this.worldObj.isRemote) { - if (this.turnProgress > 0) { - double var19 = this.posX + (this.minecartX - this.posX) / (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 var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); - 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.turnProgress; - this.setPosition(var19, var21, var5); - this.setRotation(this.rotationYaw, this.rotationPitch); - } else { - 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; - } - + if (this.turnProgress > 0) { + double var19 = this.posX + (this.minecartX - this.posX) / (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 var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); + 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.turnProgress; + this.setPosition(var19, var21, var5); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + this.setPosition(this.posX, this.posY, this.posZ); 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 */ 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); - } - } - } - } } /** diff --git a/src/main/java/net/minecraft/src/EntityMinecartContainer.java b/src/main/java/net/minecraft/src/EntityMinecartContainer.java index 02a2612..c56771c 100644 --- a/src/main/java/net/minecraft/src/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/src/EntityMinecartContainer.java @@ -240,10 +240,6 @@ public abstract class EntityMinecartContainer extends EntityMinecart implements * into the saddle on a pig. */ public boolean interact(EntityPlayer par1EntityPlayer) { - if (!this.worldObj.isRemote) { - par1EntityPlayer.displayGUIChest(this); - } - return true; } diff --git a/src/main/java/net/minecraft/src/EntityMinecartEmpty.java b/src/main/java/net/minecraft/src/EntityMinecartEmpty.java index db40762..eb39bbb 100644 --- a/src/main/java/net/minecraft/src/EntityMinecartEmpty.java +++ b/src/main/java/net/minecraft/src/EntityMinecartEmpty.java @@ -16,10 +16,6 @@ public class EntityMinecartEmpty extends EntityMinecart { } else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer) { return false; } else { - if (!this.worldObj.isRemote) { - par1EntityPlayer.mountEntity(this); - } - return true; } } diff --git a/src/main/java/net/minecraft/src/EntityMinecartHopper.java b/src/main/java/net/minecraft/src/EntityMinecartHopper.java index 04e7b1a..7a60744 100644 --- a/src/main/java/net/minecraft/src/EntityMinecartHopper.java +++ b/src/main/java/net/minecraft/src/EntityMinecartHopper.java @@ -35,10 +35,6 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements Hop * into the saddle on a pig. */ public boolean interact(EntityPlayer par1EntityPlayer) { - if (!this.worldObj.isRemote) { - par1EntityPlayer.displayGUIHopperMinecart(this); - } - return true; } @@ -95,26 +91,6 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements Hop 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() { if (TileEntityHopper.suckItemsIntoHopper(this)) { return true; diff --git a/src/main/java/net/minecraft/src/EntityMinecartTNT.java b/src/main/java/net/minecraft/src/EntityMinecartTNT.java index e50fa37..fc3d947 100644 --- a/src/main/java/net/minecraft/src/EntityMinecartTNT.java +++ b/src/main/java/net/minecraft/src/EntityMinecartTNT.java @@ -56,16 +56,6 @@ public class EntityMinecartTNT extends EntityMinecart { * Makes the minecart explode. */ 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() { 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() { diff --git a/src/main/java/net/minecraft/src/EntityMob.java b/src/main/java/net/minecraft/src/EntityMob.java index ad3c500..137ba18 100644 --- a/src/main/java/net/minecraft/src/EntityMob.java +++ b/src/main/java/net/minecraft/src/EntityMob.java @@ -24,17 +24,6 @@ public abstract class EntityMob extends EntityCreature implements IMob { 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 * isn't interested in attacking (Animals, Spiders at day, peaceful PigZombies). diff --git a/src/main/java/net/minecraft/src/EntityPig.java b/src/main/java/net/minecraft/src/EntityPig.java index 559a2fa..e05b1fd 100644 --- a/src/main/java/net/minecraft/src/EntityPig.java +++ b/src/main/java/net/minecraft/src/EntityPig.java @@ -82,21 +82,6 @@ public class EntityPig extends EntityAnimal { 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. */ diff --git a/src/main/java/net/minecraft/src/EntityPlayer.java b/src/main/java/net/minecraft/src/EntityPlayer.java index 45dbb5d..4285239 100644 --- a/src/main/java/net/minecraft/src/EntityPlayer.java +++ b/src/main/java/net/minecraft/src/EntityPlayer.java @@ -180,10 +180,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende public void clearItemInUse() { this.itemInUse = null; this.itemInUseCount = 0; - - if (!this.worldObj.isRemote) { - this.setEating(false); - } } public boolean isBlocking() { @@ -201,10 +197,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { this.updateItemUse(var1, 5); } - - if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) { - this.onItemUseFinish(); - } } else { this.clearItemInUse(); } @@ -220,14 +212,7 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende if (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) { ++this.sleepTimer; @@ -238,11 +223,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende 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) { this.extinguish(); } @@ -297,10 +277,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende if (this.ridingEntity == 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) { return false; } else { - if (this.isPlayerSleeping() && !this.worldObj.isRemote) { - this.wakeUpPlayer(true, true, false); - } - if (par1DamageSource.isDifficultyScaled()) { if (this.worldObj.difficultySetting == 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. */ 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.yOffset = 0.2F; @@ -1217,10 +1162,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende this.playerLocation = new ChunkCoordinates(par1, par2, par3); this.motionX = this.motionZ = this.motionY = 0.0D; - if (!this.worldObj.isRemote) { - this.worldObj.updateAllPlayersSleepingFlag(); - } - return EnumStatus.OK; } @@ -1268,10 +1209,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende this.sleeping = false; - if (!this.worldObj.isRemote && par2) { - this.worldObj.updateAllPlayersSleepingFlag(); - } - if (par1) { this.sleepTimer = 0; } else { @@ -1625,11 +1562,6 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende * increases exhaustion level by supplied amount */ 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) { this.itemInUse = par1ItemStack; this.itemInUseCount = par2; - - if (!this.worldObj.isRemote) { - this.setEating(true); - } } } diff --git a/src/main/java/net/minecraft/src/EntityPotion.java b/src/main/java/net/minecraft/src/EntityPotion.java index e157083..b83125f 100644 --- a/src/main/java/net/minecraft/src/EntityPotion.java +++ b/src/main/java/net/minecraft/src/EntityPotion.java @@ -72,51 +72,6 @@ public class EntityPotion extends EntityThrowable { * Called when this EntityThrowable hits a block or entity. */ 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(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntitySheep.java b/src/main/java/net/minecraft/src/EntitySheep.java index 1712f99..e83196a 100644 --- a/src/main/java/net/minecraft/src/EntitySheep.java +++ b/src/main/java/net/minecraft/src/EntitySheep.java @@ -45,10 +45,7 @@ public class EntitySheep extends EntityAnimal { * burn. */ 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(); } @@ -108,18 +105,6 @@ public class EntitySheep extends EntityAnimal { ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); 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); this.playSound("mob.sheep.shear", 1.0F, 1.0F); } diff --git a/src/main/java/net/minecraft/src/EntitySilverfish.java b/src/main/java/net/minecraft/src/EntitySilverfish.java index ada150a..11ddb6f 100644 --- a/src/main/java/net/minecraft/src/EntitySilverfish.java +++ b/src/main/java/net/minecraft/src/EntitySilverfish.java @@ -103,64 +103,6 @@ public class EntitySilverfish extends EntityMob { 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 * creature will try to path to the block. Args: x, y, z diff --git a/src/main/java/net/minecraft/src/EntitySkeleton.java b/src/main/java/net/minecraft/src/EntitySkeleton.java index 96dd9ef..65ba06f 100644 --- a/src/main/java/net/minecraft/src/EntitySkeleton.java +++ b/src/main/java/net/minecraft/src/EntitySkeleton.java @@ -94,33 +94,7 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { * burn. */ public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { - 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) { + if (this.getSkeletonType() == 1) { this.setSize(0.72F, 2.34F); } @@ -276,16 +250,4 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { super.writeEntityToNBT(par1NBTTagCompound); 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(); - } - } } diff --git a/src/main/java/net/minecraft/src/EntitySlime.java b/src/main/java/net/minecraft/src/EntitySlime.java index 2a0b620..7d5fe05 100644 --- a/src/main/java/net/minecraft/src/EntitySlime.java +++ b/src/main/java/net/minecraft/src/EntitySlime.java @@ -80,10 +80,6 @@ public class EntitySlime extends EntityLiving implements IMob { * Called to update the entity's position/logic. */ 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_70812_c = this.field_70811_b; boolean var1 = this.onGround; @@ -112,10 +108,8 @@ public class EntitySlime extends EntityLiving implements IMob { this.func_70808_l(); - if (this.worldObj.isRemote) { - var2 = this.getSlimeSize(); - this.setSize(0.6F * (float) var2, 0.6F * (float) var2); - } + var2 = this.getSlimeSize(); + this.setSize(0.6F * (float) var2, 0.6F * (float) var2); } protected void updateEntityActionState() { @@ -167,28 +161,6 @@ public class EntitySlime extends EntityLiving implements IMob { 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 */ diff --git a/src/main/java/net/minecraft/src/EntitySmallFireball.java b/src/main/java/net/minecraft/src/EntitySmallFireball.java index 4d8c1ab..dae37bd 100644 --- a/src/main/java/net/minecraft/src/EntitySmallFireball.java +++ b/src/main/java/net/minecraft/src/EntitySmallFireball.java @@ -20,48 +20,6 @@ public class EntitySmallFireball extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ 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(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntitySnowball.java b/src/main/java/net/minecraft/src/EntitySnowball.java index fdf2215..24f1531 100644 --- a/src/main/java/net/minecraft/src/EntitySnowball.java +++ b/src/main/java/net/minecraft/src/EntitySnowball.java @@ -30,9 +30,5 @@ public class EntitySnowball extends EntityThrowable { for (int var3 = 0; var3 < 8; ++var3) { this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } - - if (!this.worldObj.isRemote) { - this.setDead(); - } } } diff --git a/src/main/java/net/minecraft/src/EntitySpider.java b/src/main/java/net/minecraft/src/EntitySpider.java index 6da6d3e..ee2e27f 100644 --- a/src/main/java/net/minecraft/src/EntitySpider.java +++ b/src/main/java/net/minecraft/src/EntitySpider.java @@ -12,17 +12,6 @@ public class EntitySpider extends EntityMob { 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() { return 16; } diff --git a/src/main/java/net/minecraft/src/EntitySquid.java b/src/main/java/net/minecraft/src/EntitySquid.java index 1bdb8fc..d3a5348 100644 --- a/src/main/java/net/minecraft/src/EntitySquid.java +++ b/src/main/java/net/minecraft/src/EntitySquid.java @@ -128,12 +128,6 @@ public class EntitySquid extends EntityWaterMob { 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); this.renderYawOffset += (-((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI - this.renderYawOffset) * 0.1F; 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; } else { 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); } } diff --git a/src/main/java/net/minecraft/src/EntityTNTPrimed.java b/src/main/java/net/minecraft/src/EntityTNTPrimed.java index 875b3f4..67dc9ba 100644 --- a/src/main/java/net/minecraft/src/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/src/EntityTNTPrimed.java @@ -70,10 +70,6 @@ public class EntityTNTPrimed extends Entity { if (this.fuse-- <= 0) { this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } } else { this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); } diff --git a/src/main/java/net/minecraft/src/EntityThrowable.java b/src/main/java/net/minecraft/src/EntityThrowable.java index e5685dc..91a646a 100644 --- a/src/main/java/net/minecraft/src/EntityThrowable.java +++ b/src/main/java/net/minecraft/src/EntityThrowable.java @@ -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); } - 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.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) { this.setInPortal(); diff --git a/src/main/java/net/minecraft/src/EntityVillager.java b/src/main/java/net/minecraft/src/EntityVillager.java index 874ae84..d4d51bf 100644 --- a/src/main/java/net/minecraft/src/EntityVillager.java +++ b/src/main/java/net/minecraft/src/EntityVillager.java @@ -103,11 +103,6 @@ public class EntityVillager extends EntityAgeable implements INpc, IMerchant { boolean var3 = var2 != null && var2.itemID == Item.monsterPlacer.itemID; if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { - if (!this.worldObj.isRemote) { - this.setCustomer(par1EntityPlayer); - par1EntityPlayer.displayGUIMerchant(this, this.func_94057_bL()); - } - return true; } else { return super.interact(par1EntityPlayer); diff --git a/src/main/java/net/minecraft/src/EntityWitch.java b/src/main/java/net/minecraft/src/EntityWitch.java index 4b869b8..bc90811 100644 --- a/src/main/java/net/minecraft/src/EntityWitch.java +++ b/src/main/java/net/minecraft/src/EntityWitch.java @@ -70,60 +70,6 @@ public class EntityWitch extends EntityMob implements IRangedAttackMob { 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) { if (par1 == 15) { for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) { diff --git a/src/main/java/net/minecraft/src/EntityWither.java b/src/main/java/net/minecraft/src/EntityWither.java index de7eef2..7617eb1 100644 --- a/src/main/java/net/minecraft/src/EntityWither.java +++ b/src/main/java/net/minecraft/src/EntityWither.java @@ -90,39 +90,11 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged * burn. */ public void onLivingUpdate() { - if (!this.worldObj.isRemote) { - this.dataWatcher.updateObject(16, Integer.valueOf(this.health)); - } - this.motionY *= 0.6000000238418579D; double var4; double var6; 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) { this.rotationYaw = (float) Math.atan2(this.motionZ, this.motionX) * (180F / (float) Math.PI) - 90.0F; } diff --git a/src/main/java/net/minecraft/src/EntityWitherSkull.java b/src/main/java/net/minecraft/src/EntityWitherSkull.java index 5519f89..8ed13da 100644 --- a/src/main/java/net/minecraft/src/EntityWitherSkull.java +++ b/src/main/java/net/minecraft/src/EntityWitherSkull.java @@ -48,36 +48,6 @@ public class EntityWitherSkull extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote) { - if (par1MovingObjectPosition.entityHit != null) { - if (this.shootingEntity != null) { - if (par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8) && !par1MovingObjectPosition.entityHit.isEntityAlive()) { - this.shootingEntity.heal(5); - } - } else { - par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 5); - } - - if (par1MovingObjectPosition.entityHit instanceof EntityLiving) { - byte var2 = 0; - - if (this.worldObj.difficultySetting > 1) { - if (this.worldObj.difficultySetting == 2) { - var2 = 10; - } else if (this.worldObj.difficultySetting == 3) { - var2 = 40; - } - } - - if (var2 > 0) { - ((EntityLiving) par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); - } - } - } - - this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); - this.setDead(); - } } /** diff --git a/src/main/java/net/minecraft/src/EntityWolf.java b/src/main/java/net/minecraft/src/EntityWolf.java index 31c141c..c45a99c 100644 --- a/src/main/java/net/minecraft/src/EntityWolf.java +++ b/src/main/java/net/minecraft/src/EntityWolf.java @@ -128,22 +128,6 @@ public class EntityWolf extends EntityTameable { return -1; } - /** - * 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() { - super.onLivingUpdate(); - - if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { - this.field_70928_h = true; - this.timeWolfIsShaking = 0.0F; - this.prevTimeWolfIsShaking = 0.0F; - this.worldObj.setEntityState(this, (byte) 8); - } - } - /** * Called to update the entity's position/logic. */ diff --git a/src/main/java/net/minecraft/src/EntityXPOrb.java b/src/main/java/net/minecraft/src/EntityXPOrb.java index 460bd6e..4597372 100644 --- a/src/main/java/net/minecraft/src/EntityXPOrb.java +++ b/src/main/java/net/minecraft/src/EntityXPOrb.java @@ -206,21 +206,6 @@ public class EntityXPOrb extends Entity { this.xpValue = par1NBTTagCompound.getShort("Value"); } - /** - * Called by a player entity when they collide with an entity - */ - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - if (!this.worldObj.isRemote) { - if (this.field_70532_c == 0 && par1EntityPlayer.xpCooldown == 0) { - par1EntityPlayer.xpCooldown = 2; - this.playSound("random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); - par1EntityPlayer.onItemPickup(this, 1); - par1EntityPlayer.addExperience(this.xpValue); - this.setDead(); - } - } - } - /** * Returns the XP value of this XP orb. */ diff --git a/src/main/java/net/minecraft/src/EntityZombie.java b/src/main/java/net/minecraft/src/EntityZombie.java index 2b34b41..5cdf1af 100644 --- a/src/main/java/net/minecraft/src/EntityZombie.java +++ b/src/main/java/net/minecraft/src/EntityZombie.java @@ -89,57 +89,6 @@ public class EntityZombie extends EntityMob { this.getDataWatcher().updateObject(13, Byte.valueOf((byte) (par1 ? 1 : 0))); } - /** - * 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.isDaytime() && !this.worldObj.isRemote && !this.isChild()) { - 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); - } - } - } - - super.onLivingUpdate(); - } - - /** - * Called to update the entity's position/logic. - */ - public void onUpdate() { - if (!this.worldObj.isRemote && this.isConverting()) { - int var1 = this.getConversionTimeBoost(); - this.conversionTime -= var1; - - if (this.conversionTime <= 0) { - this.convertToVillager(); - } - } - - super.onUpdate(); - } - public boolean attackEntityAsMob(Entity par1Entity) { boolean var2 = super.attackEntityAsMob(par1Entity); @@ -341,10 +290,6 @@ public class EntityZombie extends EntityMob { par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); } - if (!this.worldObj.isRemote) { - this.startConversion(this.rand.nextInt(2401) + 3600); - } - return true; } else { return false; diff --git a/src/main/java/net/minecraft/src/ItemAppleGold.java b/src/main/java/net/minecraft/src/ItemAppleGold.java index 60dcefb..2f2d177 100644 --- a/src/main/java/net/minecraft/src/ItemAppleGold.java +++ b/src/main/java/net/minecraft/src/ItemAppleGold.java @@ -20,13 +20,7 @@ public class ItemAppleGold extends ItemFood { } protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par1ItemStack.getItemDamage() > 0) { - if (!par2World.isRemote) { - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 3)); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); - par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); - } - } else { + if (par1ItemStack.getItemDamage() <= 0) { super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); } } diff --git a/src/main/java/net/minecraft/src/ItemBed.java b/src/main/java/net/minecraft/src/ItemBed.java index fbecbca..df71887 100644 --- a/src/main/java/net/minecraft/src/ItemBed.java +++ b/src/main/java/net/minecraft/src/ItemBed.java @@ -12,50 +12,6 @@ public class ItemBed extends Item { * false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (par3World.isRemote) { - return true; - } else if (par7 != 1) { - return false; - } else { - ++par5; - BlockBed var11 = (BlockBed) Block.bed; - int var12 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - byte var13 = 0; - byte var14 = 0; - - if (var12 == 0) { - var14 = 1; - } - - if (var12 == 1) { - var13 = -1; - } - - if (var12 == 2) { - var14 = -1; - } - - if (var12 == 3) { - var13 = 1; - } - - if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4 + var13, par5, par6 + var14, par7, par1ItemStack)) { - if (par3World.isAirBlock(par4, par5, par6) && par3World.isAirBlock(par4 + var13, par5, par6 + var14) && par3World.doesBlockHaveSolidTopSurface(par4, par5 - 1, par6) - && par3World.doesBlockHaveSolidTopSurface(par4 + var13, par5 - 1, par6 + var14)) { - par3World.setBlock(par4, par5, par6, var11.blockID, var12, 3); - - if (par3World.getBlockId(par4, par5, par6) == var11.blockID) { - par3World.setBlock(par4 + var13, par5, par6 + var14, var11.blockID, var12 + 8, 3); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } + return true; } } diff --git a/src/main/java/net/minecraft/src/ItemBoat.java b/src/main/java/net/minecraft/src/ItemBoat.java index b3a5ab8..44d0eb7 100644 --- a/src/main/java/net/minecraft/src/ItemBoat.java +++ b/src/main/java/net/minecraft/src/ItemBoat.java @@ -75,10 +75,6 @@ public class ItemBoat extends Item { return par1ItemStack; } - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(var35); - } - if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } diff --git a/src/main/java/net/minecraft/src/ItemBow.java b/src/main/java/net/minecraft/src/ItemBow.java index d97c953..2c30cc5 100644 --- a/src/main/java/net/minecraft/src/ItemBow.java +++ b/src/main/java/net/minecraft/src/ItemBow.java @@ -61,10 +61,6 @@ public class ItemBow extends Item { } else { par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); } - - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(var8); - } } } diff --git a/src/main/java/net/minecraft/src/ItemBucketMilk.java b/src/main/java/net/minecraft/src/ItemBucketMilk.java index a771ae2..46b4c3f 100644 --- a/src/main/java/net/minecraft/src/ItemBucketMilk.java +++ b/src/main/java/net/minecraft/src/ItemBucketMilk.java @@ -12,10 +12,6 @@ public class ItemBucketMilk extends Item { --par1ItemStack.stackSize; } - if (!par2World.isRemote) { - par3EntityPlayer.clearActivePotions(); - } - return par1ItemStack.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : par1ItemStack; } diff --git a/src/main/java/net/minecraft/src/ItemDye.java b/src/main/java/net/minecraft/src/ItemDye.java index a92093a..23624d0 100644 --- a/src/main/java/net/minecraft/src/ItemDye.java +++ b/src/main/java/net/minecraft/src/ItemDye.java @@ -45,10 +45,6 @@ public class ItemDye extends Item { } else { if (par1ItemStack.getItemDamage() == 15) { if (func_96604_a(par1ItemStack, par3World, par4, par5, par6)) { - if (!par3World.isRemote) { - par3World.playAuxSFX(2005, par4, par5, par6, 0); - } - return true; } } else if (par1ItemStack.getItemDamage() == 3) { @@ -101,11 +97,6 @@ public class ItemDye extends Item { int var5 = par1World.getBlockId(par2, par3, par4); if (var5 == Block.sapling.blockID) { - if (!par1World.isRemote) { - - --par0ItemStack.stackSize; - } - return true; } else if (var5 != Block.mushroomBrown.blockID && var5 != Block.mushroomRed.blockID) { if (var5 != Block.melonStem.blockID && var5 != Block.pumpkinStem.blockID) { @@ -113,11 +104,6 @@ public class ItemDye extends Item { if (par1World.getBlockMetadata(par2, par3, par4) == 7) { return false; } else { - if (!par1World.isRemote) { - ((BlockCrops) Block.blocksList[var5]).fertilize(par1World, par2, par3, par4); - --par0ItemStack.stackSize; - } - return true; } } else { @@ -133,71 +119,20 @@ public class ItemDye extends Item { if (var8 >= 2) { return false; } else { - if (!par1World.isRemote) { - ++var8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var8 << 2 | var7, 2); - --par0ItemStack.stackSize; - } - return true; } } else if (var5 != Block.grass.blockID) { return false; } else { - if (!par1World.isRemote) { - --par0ItemStack.stackSize; - label102: - - for (var6 = 0; var6 < 128; ++var6) { - var7 = par2; - var8 = par3 + 1; - int var9 = par4; - - for (int var10 = 0; var10 < var6 / 16; ++var10) { - var7 += itemRand.nextInt(3) - 1; - var8 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2; - var9 += itemRand.nextInt(3) - 1; - - if (par1World.getBlockId(var7, var8 - 1, var9) != Block.grass.blockID || par1World.isBlockNormalCube(var7, var8, var9)) { - continue label102; - } - } - - if (par1World.getBlockId(var7, var8, var9) == 0) { - if (itemRand.nextInt(10) != 0) { - if (Block.tallGrass.canBlockStay(par1World, var7, var8, var9)) { - par1World.setBlock(var7, var8, var9, Block.tallGrass.blockID, 1, 3); - } - } else if (itemRand.nextInt(3) != 0) { - if (Block.plantYellow.canBlockStay(par1World, var7, var8, var9)) { - par1World.setBlock(var7, var8, var9, Block.plantYellow.blockID); - } - } else if (Block.plantRed.canBlockStay(par1World, var7, var8, var9)) { - par1World.setBlock(var7, var8, var9, Block.plantRed.blockID); - } - } - } - } - return true; } } } else if (par1World.getBlockMetadata(par2, par3, par4) == 7) { return false; } else { - if (!par1World.isRemote) { - ((BlockStem) Block.blocksList[var5]).fertilizeStem(par1World, par2, par3, par4); - --par0ItemStack.stackSize; - } - return true; } } else { - if (!par1World.isRemote) { - - --par0ItemStack.stackSize; - } - return true; } } diff --git a/src/main/java/net/minecraft/src/ItemEgg.java b/src/main/java/net/minecraft/src/ItemEgg.java index 55243d5..06988a5 100644 --- a/src/main/java/net/minecraft/src/ItemEgg.java +++ b/src/main/java/net/minecraft/src/ItemEgg.java @@ -18,10 +18,6 @@ public class ItemEgg extends Item { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer)); - } - return par1ItemStack; } } diff --git a/src/main/java/net/minecraft/src/ItemEnderEye.java b/src/main/java/net/minecraft/src/ItemEnderEye.java index 9e6ed67..b11e8c7 100644 --- a/src/main/java/net/minecraft/src/ItemEnderEye.java +++ b/src/main/java/net/minecraft/src/ItemEnderEye.java @@ -16,103 +16,7 @@ public class ItemEnderEye extends Item { int var12 = par3World.getBlockMetadata(par4, par5, par6); if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) { - if (par3World.isRemote) { - return true; - } else { - par3World.setBlockMetadataWithNotify(par4, par5, par6, var12 + 4, 2); - --par1ItemStack.stackSize; - int var13; - - for (var13 = 0; var13 < 16; ++var13) { - double var14 = (double) ((float) par4 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); - double var16 = (double) ((float) par5 + 0.8125F); - double var18 = (double) ((float) par6 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); - double var20 = 0.0D; - double var22 = 0.0D; - double var24 = 0.0D; - par3World.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); - } - - var13 = var12 & 3; - int var26 = 0; - int var15 = 0; - boolean var27 = false; - boolean var17 = true; - int var28 = Direction.rotateRight[var13]; - int var19; - int var21; - int var23; - int var29; - int var30; - - for (var19 = -2; var19 <= 2; ++var19) { - var29 = par4 + Direction.offsetX[var28] * var19; - var21 = par6 + Direction.offsetZ[var28] * var19; - var30 = par3World.getBlockId(var29, par5, var21); - - if (var30 == Block.endPortalFrame.blockID) { - var23 = par3World.getBlockMetadata(var29, par5, var21); - - if (!BlockEndPortalFrame.isEnderEyeInserted(var23)) { - var17 = false; - break; - } - - var15 = var19; - - if (!var27) { - var26 = var19; - var27 = true; - } - } - } - - if (var17 && var15 == var26 + 2) { - for (var19 = var26; var19 <= var15; ++var19) { - var29 = par4 + Direction.offsetX[var28] * var19; - var21 = par6 + Direction.offsetZ[var28] * var19; - var29 += Direction.offsetX[var13] * 4; - var21 += Direction.offsetZ[var13] * 4; - var30 = par3World.getBlockId(var29, par5, var21); - var23 = par3World.getBlockMetadata(var29, par5, var21); - - if (var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) { - var17 = false; - break; - } - } - - for (var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { - for (var29 = 1; var29 <= 3; ++var29) { - var21 = par4 + Direction.offsetX[var28] * var19; - var30 = par6 + Direction.offsetZ[var28] * var19; - var21 += Direction.offsetX[var13] * var29; - var30 += Direction.offsetZ[var13] * var29; - var23 = par3World.getBlockId(var21, par5, var30); - int var31 = par3World.getBlockMetadata(var21, par5, var30); - - if (var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) { - var17 = false; - break; - } - } - } - - if (var17) { - for (var19 = var26; var19 <= var15; ++var19) { - for (var29 = 1; var29 <= 3; ++var29) { - var21 = par4 + Direction.offsetX[var28] * var19; - var30 = par6 + Direction.offsetZ[var28] * var19; - var21 += Direction.offsetX[var13] * var29; - var30 += Direction.offsetZ[var13] * var29; - par3World.setBlock(var21, par5, var30, Block.endPortal.blockID, 0, 2); - } - } - } - } - - return true; - } + return true; } else { return false; } @@ -133,22 +37,6 @@ public class ItemEnderEye extends Item { } } - if (!par2World.isRemote) { - ChunkPosition var7 = par2World.findClosestStructure("Stronghold", (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); - - if (var7 != null) { - EntityEnderEye var6 = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double) par3EntityPlayer.yOffset, par3EntityPlayer.posZ); - var6.moveTowards((double) var7.x, var7.y, (double) var7.z); - par2World.spawnEntityInWorld(var6); - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - par2World.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ, 0); - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return par1ItemStack; } } diff --git a/src/main/java/net/minecraft/src/ItemEnderPearl.java b/src/main/java/net/minecraft/src/ItemEnderPearl.java index fbb38ca..6bb4507 100644 --- a/src/main/java/net/minecraft/src/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/src/ItemEnderPearl.java @@ -20,10 +20,6 @@ public class ItemEnderPearl extends Item { --par1ItemStack.stackSize; par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer)); - } - return par1ItemStack; } } diff --git a/src/main/java/net/minecraft/src/ItemExpBottle.java b/src/main/java/net/minecraft/src/ItemExpBottle.java index 4d8be50..8c820b9 100644 --- a/src/main/java/net/minecraft/src/ItemExpBottle.java +++ b/src/main/java/net/minecraft/src/ItemExpBottle.java @@ -21,10 +21,6 @@ public class ItemExpBottle extends Item { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityExpBottle(par2World, par3EntityPlayer)); - } - return par1ItemStack; } } diff --git a/src/main/java/net/minecraft/src/ItemFireball.java b/src/main/java/net/minecraft/src/ItemFireball.java index 0141c65..e305840 100644 --- a/src/main/java/net/minecraft/src/ItemFireball.java +++ b/src/main/java/net/minecraft/src/ItemFireball.java @@ -12,49 +12,6 @@ public class ItemFireball extends Item { * false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (par3World.isRemote) { - return true; - } else { - if (par7 == 0) { - --par5; - } - - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { - int var11 = par3World.getBlockId(par4, par5, par6); - - if (var11 == 0) { - par3World.playSoundEffect((double) par4 + 0.5D, (double) par5 + 0.5D, (double) par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - par3World.setBlock(par4, par5, par6, Block.fire.blockID); - } - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - - return true; - } - } + return true; } } diff --git a/src/main/java/net/minecraft/src/ItemFirework.java b/src/main/java/net/minecraft/src/ItemFirework.java index 41cad57..bb1e407 100644 --- a/src/main/java/net/minecraft/src/ItemFirework.java +++ b/src/main/java/net/minecraft/src/ItemFirework.java @@ -14,18 +14,7 @@ public class ItemFirework extends Item { * false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (!par3World.isRemote) { - EntityFireworkRocket var11 = new EntityFireworkRocket(par3World, (double) ((float) par4 + par8), (double) ((float) par5 + par9), (double) ((float) par6 + par10), par1ItemStack); - par3World.spawnEntityInWorld(var11); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - - return true; - } else { - return false; - } + return false; } /** diff --git a/src/main/java/net/minecraft/src/ItemFishingRod.java b/src/main/java/net/minecraft/src/ItemFishingRod.java index ec57aba..6d629be 100644 --- a/src/main/java/net/minecraft/src/ItemFishingRod.java +++ b/src/main/java/net/minecraft/src/ItemFishingRod.java @@ -37,10 +37,6 @@ public class ItemFishingRod extends Item { } else { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityFishHook(par2World, par3EntityPlayer)); - } - par3EntityPlayer.swingItem(); } diff --git a/src/main/java/net/minecraft/src/ItemFood.java b/src/main/java/net/minecraft/src/ItemFood.java index e69a018..0cfb9d4 100644 --- a/src/main/java/net/minecraft/src/ItemFood.java +++ b/src/main/java/net/minecraft/src/ItemFood.java @@ -54,9 +54,6 @@ public class ItemFood extends Item { } protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); - } } /** diff --git a/src/main/java/net/minecraft/src/ItemHangingEntity.java b/src/main/java/net/minecraft/src/ItemHangingEntity.java index 2f0cbae..2f43c91 100644 --- a/src/main/java/net/minecraft/src/ItemHangingEntity.java +++ b/src/main/java/net/minecraft/src/ItemHangingEntity.java @@ -27,10 +27,6 @@ public class ItemHangingEntity extends Item { return false; } else { if (var12 != null && var12.onValidSurface()) { - if (!par3World.isRemote) { - par3World.spawnEntityInWorld(var12); - } - --par1ItemStack.stackSize; } diff --git a/src/main/java/net/minecraft/src/ItemHoe.java b/src/main/java/net/minecraft/src/ItemHoe.java index 2e24f6f..83a3dab 100644 --- a/src/main/java/net/minecraft/src/ItemHoe.java +++ b/src/main/java/net/minecraft/src/ItemHoe.java @@ -30,13 +30,7 @@ public class ItemHoe extends Item { par3World.playSoundEffect((double) ((float) par4 + 0.5F), (double) ((float) par5 + 0.5F), (double) ((float) par6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); - if (par3World.isRemote) { - return true; - } else { - par3World.setBlock(par4, par5, par6, var13.blockID); - par1ItemStack.damageItem(1, par2EntityPlayer); - return true; - } + return true; } } } diff --git a/src/main/java/net/minecraft/src/ItemMap.java b/src/main/java/net/minecraft/src/ItemMap.java index 80645a7..cb9d068 100644 --- a/src/main/java/net/minecraft/src/ItemMap.java +++ b/src/main/java/net/minecraft/src/ItemMap.java @@ -25,20 +25,6 @@ public class ItemMap extends ItemMapBase { public MapData getMapData(ItemStack par1ItemStack, World par2World) { String var3 = "map_" + par1ItemStack.getItemDamage(); MapData var4 = (MapData) par2World.loadItemData(MapData.class, var3); - - if (var4 == null && !par2World.isRemote) { - par1ItemStack.setItemDamage(par2World.getUniqueDataId("map")); - var3 = "map_" + par1ItemStack.getItemDamage(); - var4 = new MapData(var3); - var4.scale = 3; - int var5 = 128 * (1 << var4.scale); - var4.xCenter = Math.round((float) par2World.getWorldInfo().getSpawnX() / (float) var5) * var5; - var4.zCenter = Math.round((float) (par2World.getWorldInfo().getSpawnZ() / var5)) * var5; - var4.dimension = (byte) par2World.provider.dimensionId; - var4.markDirty(); - par2World.setItemData(var3, var4); - } - return var4; } @@ -223,18 +209,6 @@ public class ItemMap extends ItemMapBase { * check if is on a player hand and update it's contents. */ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (!par2World.isRemote) { - MapData var6 = this.getMapData(par1ItemStack, par2World); - - if (par3Entity instanceof EntityPlayer) { - EntityPlayer var7 = (EntityPlayer) par3Entity; - var6.updateVisiblePlayers(var7, par1ItemStack); - } - - if (par5) { - this.updateMapData(par2World, par3Entity, var6); - } - } } /** diff --git a/src/main/java/net/minecraft/src/ItemMinecart.java b/src/main/java/net/minecraft/src/ItemMinecart.java index 33a2cf6..1c9f797 100644 --- a/src/main/java/net/minecraft/src/ItemMinecart.java +++ b/src/main/java/net/minecraft/src/ItemMinecart.java @@ -19,16 +19,6 @@ public class ItemMinecart extends Item { int var11 = par3World.getBlockId(par4, par5, par6); if (BlockRailBase.isRailBlock(var11)) { - if (!par3World.isRemote) { - EntityMinecart var12 = EntityMinecart.createMinecart(par3World, (double) ((float) par4 + 0.5F), (double) ((float) par5 + 0.5F), (double) ((float) par6 + 0.5F), this.minecartType); - - if (par1ItemStack.hasDisplayName()) { - var12.func_96094_a(par1ItemStack.getDisplayName()); - } - - par3World.spawnEntityInWorld(var12); - } - --par1ItemStack.stackSize; return true; } else { diff --git a/src/main/java/net/minecraft/src/ItemMonsterPlacer.java b/src/main/java/net/minecraft/src/ItemMonsterPlacer.java index 19ef3ec..82ff4e9 100644 --- a/src/main/java/net/minecraft/src/ItemMonsterPlacer.java +++ b/src/main/java/net/minecraft/src/ItemMonsterPlacer.java @@ -45,33 +45,7 @@ public class ItemMonsterPlacer extends Item { * false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (par3World.isRemote) { - return true; - } else { - int var11 = par3World.getBlockId(par4, par5, par6); - par4 += Facing.offsetsXForSide[par7]; - par5 += Facing.offsetsYForSide[par7]; - par6 += Facing.offsetsZForSide[par7]; - double var12 = 0.0D; - - if (par7 == 1 && Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { - var12 = 0.5D; - } - - Entity var14 = spawnCreature(par3World, par1ItemStack.getItemDamage(), (double) par4 + 0.5D, (double) par5 + var12, (double) par6 + 0.5D); - - if (var14 != null) { - if (var14 instanceof EntityLiving && par1ItemStack.hasDisplayName()) { - ((EntityLiving) var14).func_94058_c(par1ItemStack.getDisplayName()); - } - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - - return true; - } + return true; } /** diff --git a/src/main/java/net/minecraft/src/ItemPotion.java b/src/main/java/net/minecraft/src/ItemPotion.java index 1b92a8a..63ec70e 100644 --- a/src/main/java/net/minecraft/src/ItemPotion.java +++ b/src/main/java/net/minecraft/src/ItemPotion.java @@ -68,19 +68,6 @@ public class ItemPotion extends Item { --par1ItemStack.stackSize; } - if (!par2World.isRemote) { - List var4 = this.getEffects(par1ItemStack); - - if (var4 != null) { - Iterator var5 = var4.iterator(); - - while (var5.hasNext()) { - PotionEffect var6 = (PotionEffect) var5.next(); - par3EntityPlayer.addPotionEffect(new PotionEffect(var6)); - } - } - } - if (!par3EntityPlayer.capabilities.isCreativeMode) { if (par1ItemStack.stackSize <= 0) { return new ItemStack(Item.glassBottle); @@ -119,10 +106,6 @@ public class ItemPotion extends Item { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityPotion(par2World, par3EntityPlayer, par1ItemStack)); - } - return par1ItemStack; } else { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); diff --git a/src/main/java/net/minecraft/src/ItemRecord.java b/src/main/java/net/minecraft/src/ItemRecord.java index 2da2b78..1fc835e 100644 --- a/src/main/java/net/minecraft/src/ItemRecord.java +++ b/src/main/java/net/minecraft/src/ItemRecord.java @@ -33,14 +33,7 @@ public class ItemRecord extends Item { */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0) { - if (par3World.isRemote) { - return true; - } else { - ((BlockJukeBox) Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack); - par3World.playAuxSFXAtEntity((EntityPlayer) null, 1005, par4, par5, par6, this.itemID); - --par1ItemStack.stackSize; - return true; - } + return true; } else { return false; } diff --git a/src/main/java/net/minecraft/src/ItemSnowball.java b/src/main/java/net/minecraft/src/ItemSnowball.java index 1a9d868..87c9afa 100644 --- a/src/main/java/net/minecraft/src/ItemSnowball.java +++ b/src/main/java/net/minecraft/src/ItemSnowball.java @@ -18,10 +18,6 @@ public class ItemSnowball extends Item { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); - } - return par1ItemStack; } } diff --git a/src/main/java/net/minecraft/src/SlotFurnace.java b/src/main/java/net/minecraft/src/SlotFurnace.java index 75b617e..34fa8f3 100644 --- a/src/main/java/net/minecraft/src/SlotFurnace.java +++ b/src/main/java/net/minecraft/src/SlotFurnace.java @@ -54,30 +54,6 @@ public class SlotFurnace extends Slot { protected void onCrafting(ItemStack par1ItemStack) { par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); - if (!this.thePlayer.worldObj.isRemote) { - int var2 = this.field_75228_b; - float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack.itemID); - int var4; - - if (var3 == 0.0F) { - var2 = 0; - } else if (var3 < 1.0F) { - var4 = MathHelper.floor_float((float) var2 * var3); - - if (var4 < MathHelper.ceiling_float_int((float) var2 * var3) && (float) Math.random() < (float) var2 * var3 - (float) var4) { - ++var4; - } - - var2 = var4; - } - - while (var2 > 0) { - var4 = EntityXPOrb.getXPSplit(var2); - var2 -= var4; - this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, var4)); - } - } - this.field_75228_b = 0; if (par1ItemStack.itemID == Item.ingotIron.itemID) { diff --git a/src/main/java/net/minecraft/src/SlotRepair.java b/src/main/java/net/minecraft/src/SlotRepair.java index 4b807ab..5cb842b 100644 --- a/src/main/java/net/minecraft/src/SlotRepair.java +++ b/src/main/java/net/minecraft/src/SlotRepair.java @@ -57,22 +57,5 @@ class SlotRepair extends Slot { } this.anvil.maximumCost = 0; - - if (!par1EntityPlayer.capabilities.isCreativeMode && !this.theWorld.isRemote && this.theWorld.getBlockId(this.blockPosX, this.blockPosY, this.blockPosZ) == Block.anvil.blockID && par1EntityPlayer.getRNG().nextFloat() < 0.12F) { - int var6 = this.theWorld.getBlockMetadata(this.blockPosX, this.blockPosY, this.blockPosZ); - int var4 = var6 & 3; - int var5 = var6 >> 2; - ++var5; - - if (var5 > 2) { - this.theWorld.setBlockToAir(this.blockPosX, this.blockPosY, this.blockPosZ); - this.theWorld.playAuxSFX(1020, this.blockPosX, this.blockPosY, this.blockPosZ, 0); - } else { - this.theWorld.setBlockMetadataWithNotify(this.blockPosX, this.blockPosY, this.blockPosZ, var4 | var5 << 2, 2); - this.theWorld.playAuxSFX(1021, this.blockPosX, this.blockPosY, this.blockPosZ, 0); - } - } else if (!this.theWorld.isRemote) { - this.theWorld.playAuxSFX(1021, this.blockPosX, this.blockPosY, this.blockPosZ, 0); - } } } diff --git a/src/main/java/net/minecraft/src/TileEntityBeacon.java b/src/main/java/net/minecraft/src/TileEntityBeacon.java index 2af943d..44a3e6b 100644 --- a/src/main/java/net/minecraft/src/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/src/TileEntityBeacon.java @@ -36,35 +36,6 @@ public class TileEntityBeacon extends TileEntity implements IInventory { } private void addEffectsToPlayers() { - if (this.isBeaconActive && this.levels > 0 && !this.worldObj.isRemote && this.primaryEffect > 0) { - double var1 = (double) (this.levels * 10 + 10); - byte var3 = 0; - - if (this.levels >= 4 && this.primaryEffect == this.secondaryEffect) { - var3 = 1; - } - - AxisAlignedBB var4 = AxisAlignedBB.getAABBPool().getAABB((double) this.xCoord, (double) this.yCoord, (double) this.zCoord, (double) (this.xCoord + 1), (double) (this.yCoord + 1), (double) (this.zCoord + 1)).expand(var1, var1, - var1); - var4.maxY = (double) this.worldObj.getHeight(); - List var5 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, var4); - Iterator var6 = var5.iterator(); - EntityPlayer var7; - - while (var6.hasNext()) { - var7 = (EntityPlayer) var6.next(); - var7.addPotionEffect(new PotionEffect(this.primaryEffect, 180, var3, true)); - } - - if (this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) { - var6 = var5.iterator(); - - while (var6.hasNext()) { - var7 = (EntityPlayer) var6.next(); - var7.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true)); - } - } - } } /** diff --git a/src/main/java/net/minecraft/src/TileEntityChest.java b/src/main/java/net/minecraft/src/TileEntityChest.java index 1063715..bb8c167 100644 --- a/src/main/java/net/minecraft/src/TileEntityChest.java +++ b/src/main/java/net/minecraft/src/TileEntityChest.java @@ -291,26 +291,6 @@ public class TileEntityChest extends TileEntity implements IInventory { ++this.ticksSinceSync; float var1; - if (!this.worldObj.isRemote && this.numUsingPlayers != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) { - this.numUsingPlayers = 0; - var1 = 5.0F; - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().getAABB((double) ((float) this.xCoord - var1), (double) ((float) this.yCoord - var1), (double) ((float) this.zCoord - var1), - (double) ((float) (this.xCoord + 1) + var1), (double) ((float) (this.yCoord + 1) + var1), (double) ((float) (this.zCoord + 1) + var1))); - Iterator var3 = var2.iterator(); - - while (var3.hasNext()) { - EntityPlayer var4 = (EntityPlayer) var3.next(); - - if (var4.openContainer instanceof ContainerChest) { - IInventory var5 = ((ContainerChest) var4.openContainer).getLowerChestInventory(); - - if (var5 == this || var5 instanceof InventoryLargeChest && ((InventoryLargeChest) var5).isPartOfLargeChest(this)) { - ++this.numUsingPlayers; - } - } - } - } - this.prevLidAngle = this.lidAngle; var1 = 0.1F; double var11; diff --git a/src/main/java/net/minecraft/src/TileEntityDaylightDetector.java b/src/main/java/net/minecraft/src/TileEntityDaylightDetector.java index d791fce..aaf50e7 100644 --- a/src/main/java/net/minecraft/src/TileEntityDaylightDetector.java +++ b/src/main/java/net/minecraft/src/TileEntityDaylightDetector.java @@ -7,12 +7,5 @@ public class TileEntityDaylightDetector extends TileEntity { * implementation. */ public void updateEntity() { - if (this.worldObj != null && !this.worldObj.isRemote && this.worldObj.getTotalWorldTime() % 20L == 0L) { - this.blockType = this.getBlockType(); - - if (this.blockType != null && this.blockType instanceof BlockDaylightDetector) { - ((BlockDaylightDetector) this.blockType).updateLightLevel(this.worldObj, this.xCoord, this.yCoord, this.zCoord); - } - } } } diff --git a/src/main/java/net/minecraft/src/TileEntityFurnace.java b/src/main/java/net/minecraft/src/TileEntityFurnace.java index 5f575b2..701856f 100644 --- a/src/main/java/net/minecraft/src/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/src/TileEntityFurnace.java @@ -202,52 +202,9 @@ public class TileEntityFurnace extends TileEntity implements ISidedInventory { * implementation. */ public void updateEntity() { - boolean var1 = this.furnaceBurnTime > 0; - boolean var2 = false; - if (this.furnaceBurnTime > 0) { --this.furnaceBurnTime; } - - if (!this.worldObj.isRemote) { - if (this.furnaceBurnTime == 0 && this.canSmelt()) { - this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); - - if (this.furnaceBurnTime > 0) { - var2 = true; - - if (this.furnaceItemStacks[1] != null) { - --this.furnaceItemStacks[1].stackSize; - - if (this.furnaceItemStacks[1].stackSize == 0) { - Item var3 = this.furnaceItemStacks[1].getItem().getContainerItem(); - this.furnaceItemStacks[1] = var3 != null ? new ItemStack(var3) : null; - } - } - } - } - - if (this.isBurning() && this.canSmelt()) { - ++this.furnaceCookTime; - - if (this.furnaceCookTime == 200) { - this.furnaceCookTime = 0; - this.smeltItem(); - var2 = true; - } - } else { - this.furnaceCookTime = 0; - } - - if (var1 != this.furnaceBurnTime > 0) { - var2 = true; - BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); - } - } - - if (var2) { - this.onInventoryChanged(); - } } /** diff --git a/src/main/java/net/minecraft/src/TileEntityHopper.java b/src/main/java/net/minecraft/src/TileEntityHopper.java index 71c63d8..338b6c3 100644 --- a/src/main/java/net/minecraft/src/TileEntityHopper.java +++ b/src/main/java/net/minecraft/src/TileEntityHopper.java @@ -188,32 +188,10 @@ public class TileEntityHopper extends TileEntity implements Hopper { * implementation. */ public void updateEntity() { - if (this.worldObj != null && !this.worldObj.isRemote) { - --this.transferCooldown; - - if (!this.isCoolingDown()) { - this.setTransferCooldown(0); - this.func_98045_j(); - } - } } public boolean func_98045_j() { - if (this.worldObj != null && !this.worldObj.isRemote) { - if (!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata())) { - boolean var1 = this.insertItemToInventory() | suckItemsIntoHopper(this); - - if (var1) { - this.setTransferCooldown(8); - this.onInventoryChanged(); - return true; - } - } - - return false; - } else { - return false; - } + return false; } /** diff --git a/src/main/java/net/minecraft/src/TileEntityMobSpawner.java b/src/main/java/net/minecraft/src/TileEntityMobSpawner.java index 376375b..1168d59 100644 --- a/src/main/java/net/minecraft/src/TileEntityMobSpawner.java +++ b/src/main/java/net/minecraft/src/TileEntityMobSpawner.java @@ -23,7 +23,7 @@ public class TileEntityMobSpawner extends TileEntity { public void updateEntity() { super.updateEntity(); - if(worldObj.isRemote && worldObj.rand.nextFloat() < 0.2f) { + if(worldObj.rand.nextFloat() < 0.2f) { worldObj.spawnParticle("flame", this.xCoord + worldObj.rand.nextFloat(), this.yCoord + worldObj.rand.nextFloat(), this.zCoord + worldObj.rand.nextFloat(), 0.0D, 0.0D, 0.0D); worldObj.spawnParticle("flame", this.xCoord + worldObj.rand.nextFloat(), this.yCoord + worldObj.rand.nextFloat(), this.zCoord + worldObj.rand.nextFloat(), 0.0D, 0.0D, 0.0D); } diff --git a/src/main/java/net/minecraft/src/World.java b/src/main/java/net/minecraft/src/World.java index 01f84dd..b92a86c 100644 --- a/src/main/java/net/minecraft/src/World.java +++ b/src/main/java/net/minecraft/src/World.java @@ -343,18 +343,9 @@ public abstract class World implements IBlockAccess { this.theProfiler.endSection(); if (var9) { - if ((par6 & 2) != 0 && (!this.isRemote || (par6 & 4) == 0)) { + if ((par6 & 2) != 0 && (par6 & 4) == 0) { this.markBlockForUpdate(par1, par2, par3); } - - if (!this.isRemote && (par6 & 1) != 0) { - this.notifyBlockChange(par1, par2, par3, var8); - Block var10 = Block.blocksList[par4]; - - if (var10 != null && var10.hasComparatorInputOverride()) { - this.func_96440_m(par1, par2, par3, par4); - } - } } return var9; @@ -412,18 +403,9 @@ public abstract class World implements IBlockAccess { if (var9) { int var10 = var6.getBlockID(var7, par2, var8); - if ((par5 & 2) != 0 && (!this.isRemote || (par5 & 4) == 0)) { + if ((par5 & 2) != 0 && (par5 & 4) == 0) { this.markBlockForUpdate(par1, par2, par3); } - - if (!this.isRemote && (par5 & 1) != 0) { - this.notifyBlockChange(par1, par2, par3, var10); - Block var11 = Block.blocksList[var10]; - - if (var11 != null && var11.hasComparatorInputOverride()) { - this.func_96440_m(par1, par2, par3, var10); - } - } } return var9; @@ -566,14 +548,6 @@ public abstract class World implements IBlockAccess { * x, y, z, blockID */ public void notifyBlockOfNeighborChange(int par1, int par2, int par3, int par4) { - if (!this.isRemote) { - int var5 = this.getBlockId(par1, par2, par3); - Block var6 = Block.blocksList[var5]; - - if (var6 != null) { - var6.onNeighborBlockChange(this, par1, par2, par3, par4); - } - } } /** @@ -2427,27 +2401,6 @@ public abstract class World implements IBlockAccess { protected void moodSoundAndLightCheck(int par1, int par2, Chunk par3Chunk) { this.theProfiler.endStartSection("moodSound"); - - if (this.ambientTickCountdown == 0 && !this.isRemote) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - int var4 = this.updateLCG >> 2; - int var5 = var4 & 15; - int var6 = var4 >> 8 & 15; - int var7 = var4 >> 16 & 127; - int var8 = par3Chunk.getBlockID(var5, var7, var6); - var5 += par1; - var6 += par2; - - if (var8 == 0 && this.getFullBlockLightValue(var5, var7, var6) <= this.rand.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var5, var7, var6) <= 0) { - EntityPlayer var9 = this.getClosestPlayer((double) var5 + 0.5D, (double) var7 + 0.5D, (double) var6 + 0.5D, 8.0D); - - if (var9 != null && var9.getDistanceSq((double) var5 + 0.5D, (double) var7 + 0.5D, (double) var6 + 0.5D) > 4.0D) { - this.playSoundEffect((double) var5 + 0.5D, (double) var7 + 0.5D, (double) var6 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); - this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; - } - } - } - this.theProfiler.endStartSection("checkLight"); par3Chunk.enqueueRelightChecks(); }