diff --git a/.gitignore b/.gitignore index 3494948897..af4f887fbc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /logs/ /*.pyc /forge-*/ +/patches-old/ diff --git a/fml-src-2.2.106.176.zip b/fml-src-2.2.106.176.zip deleted file mode 100644 index fd8ec057cc..0000000000 Binary files a/fml-src-2.2.106.176.zip and /dev/null differ diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch deleted file mode 100644 index f91441fa6c..0000000000 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ /dev/null @@ -1,133 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1960,86 +1960,54 @@ - */ - public void usePortal(int par1) - { -+ usePortal(par1, new Teleporter()); -+ } -+ -+ public void usePortal(int par1, Teleporter teleporter) -+ { - int var2 = this.thePlayer.dimension; - this.thePlayer.dimension = par1; - this.theWorld.setEntityDead(this.thePlayer); - this.thePlayer.isDead = false; -+ WorldProvider pNew = WorldProvider.getProviderForDimension(par1); -+ WorldProvider pOld = WorldProvider.getProviderForDimension(var2); - double var3 = this.thePlayer.posX; - double var5 = this.thePlayer.posZ; -- double var7 = 1.0D; -- -- if (var2 > -1 && this.thePlayer.dimension == -1) -- { -- var7 = 0.125D; -- } -- else if (var2 == -1 && this.thePlayer.dimension > -1) -- { -- var7 = 8.0D; -- } -- -+ double var7 = pOld.getMovementFactor() / pNew.getMovementFactor(); - var3 *= var7; - var5 *= var7; -- World var9; -- -- if (this.thePlayer.dimension == -1) -- { -- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch); -- -- if (this.thePlayer.isEntityAlive()) -- { -- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false); -- } -+ World var9 = new World(theWorld, pNew); - -- var9 = null; -- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension)); -- this.changeWorld(var9, "Entering the Nether", this.thePlayer); -- } -- else if (this.thePlayer.dimension == 0) -+ if (this.thePlayer.isEntityAlive()) - { -- if (this.thePlayer.isEntityAlive()) -- { -- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch); -- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false); -- } -- -- var9 = null; -- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension)); -- -- if (var2 == -1) -- { -- this.changeWorld(var9, "Leaving the Nether", this.thePlayer); -- } -- else -- { -- this.changeWorld(var9, "Leaving the End", this.thePlayer); -- } -+ this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false); - } -- else -+ -+ if (thePlayer.dimension == 1) - { -- var9 = null; -- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension)); - ChunkCoordinates var10 = var9.getEntrancePortalLocation(); - var3 = (double)var10.posX; - this.thePlayer.posY = (double)var10.posY; - var5 = (double)var10.posZ; -- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, 90.0F, 0.0F); -- -- if (this.thePlayer.isEntityAlive()) -- { -- var9.updateEntityWithOptionalForce(this.thePlayer, false); -- } -- -- this.changeWorld(var9, "Entering the End", this.thePlayer); -+ } -+ -+ if (thePlayer.dimension == 0) -+ { -+ changeWorld(var9, pOld.getDepartMessage(), thePlayer); -+ } -+ else -+ { -+ changeWorld(var9, pNew.getWelcomeMessage(), thePlayer); - } - - this.thePlayer.worldObj = this.theWorld; - System.out.println("Teleported to " + this.theWorld.worldProvider.worldType); - -- if (this.thePlayer.isEntityAlive() && var2 < 1) -+ if (this.thePlayer.isEntityAlive()) - { - this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch); - this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false); -- (new Teleporter()).placeInPortal(this.theWorld, this.thePlayer); -+ teleporter.placeInPortal(this.theWorld, this.thePlayer); - } - } - -@@ -2324,6 +2292,11 @@ - { - this.usePortal(0); - } -+ -+ if (!this.theWorld.isRemote && this.theWorld.worldProvider.canRespawnHere()) -+ { -+ par2 = this.theWorld.worldProvider.worldType; //Fix for vanilla always re-spawning to the over world. -+ } - - ChunkCoordinates var4 = null; - ChunkCoordinates var5 = null; -@@ -2591,6 +2564,7 @@ - var0.addData("java_version", System.getProperty("java.version")); - var0.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); - var0.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); -+ var0.addData("client_brand", "forge"); - var0.sendReport(); - } - } diff --git a/patches/minecraft/net/minecraft/src/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/src/AnvilChunkLoader.java.patch deleted file mode 100644 index 2a5b909851..0000000000 --- a/patches/minecraft/net/minecraft/src/AnvilChunkLoader.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/AnvilChunkLoader.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/AnvilChunkLoader.java 0000-00-00 00:00:00.000000000 -0000 -@@ -10,6 +10,8 @@ - import java.util.List; - import java.util.Set; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class AnvilChunkLoader implements IThreadedFileIO, IChunkLoader - { - private List field_48451_a = new ArrayList(); -@@ -88,6 +90,7 @@ - } - - var5.removeUnknownBlocks(); -+ ForgeHooks.onChunkLoadData(par1World, var5, par4NBTTagCompound); - return var5; - } - } -@@ -103,6 +106,7 @@ - var3.setTag("Level", var4); - this.writeChunkToNBT(par2Chunk, par1World, var4); - this.func_48446_a(par2Chunk.getChunkCoordIntPair(), var3); -+ ForgeHooks.onChunkSaveData(par1World, par2Chunk, var3); - } - catch (Exception var5) - { diff --git a/patches/minecraft/net/minecraft/src/AnvilSaveHandler.java.patch b/patches/minecraft/net/minecraft/src/AnvilSaveHandler.java.patch deleted file mode 100644 index b467c15e4b..0000000000 --- a/patches/minecraft/net/minecraft/src/AnvilSaveHandler.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/AnvilSaveHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/AnvilSaveHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -18,15 +18,9 @@ - File var2 = this.getSaveDirectory(); - File var3; - -- if (par1WorldProvider instanceof WorldProviderHell) -+ if (par1WorldProvider.getSaveFolder() != null) - { -- var3 = new File(var2, "DIM-1"); -- var3.mkdirs(); -- return new AnvilChunkLoader(var3); -- } -- else if (par1WorldProvider instanceof WorldProviderEnd) -- { -- var3 = new File(var2, "DIM1"); -+ var3 = new File(var2, par1WorldProvider.getSaveFolder()); - var3.mkdirs(); - return new AnvilChunkLoader(var3); - } diff --git a/patches/minecraft/net/minecraft/src/Block.java.patch b/patches/minecraft/net/minecraft/src/Block.java.patch deleted file mode 100644 index e069f12fd6..0000000000 --- a/patches/minecraft/net/minecraft/src/Block.java.patch +++ /dev/null @@ -1,712 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,9 +1,12 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ITextureProvider; -+ - import java.util.ArrayList; - import java.util.Random; - --public class Block -+public class Block implements ITextureProvider - { - public static final StepSound soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F); - public static final StepSound soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F); -@@ -257,6 +260,7 @@ - lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0; - canBlockGrass[par1] = !par2Material.getCanBlockGrass(); - } -+ isDefaultTexture = (getTextureFile() != null && getTextureFile().equalsIgnoreCase("/terrain.png")); - } - - /** -@@ -397,7 +401,7 @@ - - public boolean hasTileEntity() - { -- return this.isBlockContainer; -+ return hasTileEntity(0); - } - - /** -@@ -418,7 +422,7 @@ - */ - public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { -- return par1IBlockAccess.getBrightness(par2, par3, par4, lightValue[this.blockID]); -+ return par1IBlockAccess.getBrightness(par2, par3, par4, getLightValue(par1IBlockAccess, par2, par3, par4)); - } - - /** -@@ -426,7 +430,7 @@ - */ - public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { -- return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, lightValue[this.blockID]); -+ return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, getLightValue(par1IBlockAccess, par2, par3, par4)); - } - - /** -@@ -583,11 +587,14 @@ - } - - /** -- * Defines whether or not a play can break the block with current tool. -+ * Deprecated in favor of a metadata sensitive version -+ * @param entityplayer Entity attacking the block -+ * @return - */ -+ @Deprecated - public float blockStrength(EntityPlayer par1EntityPlayer) - { -- return this.blockHardness < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / this.blockHardness / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F); -+ return blockStrength(par1EntityPlayer, 0); - } - - /** -@@ -607,16 +614,12 @@ - { - int var8 = this.quantityDroppedWithBonus(par7, par1World.rand); - -- for (int var9 = 0; var9 < var8; ++var9) -+ ArrayList items = getBlockDropped(par1World, par2, par3, par4, par5, par7); -+ for (ItemStack item : items) - { - 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))); -- } -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, item); - } - } - } -@@ -929,7 +932,7 @@ - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - par2EntityPlayer.addExhaustion(0.025F); - -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory)) -+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory)) - { - ItemStack var8 = this.createStackedBlock(par6); - -@@ -1058,6 +1061,614 @@ - */ - public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {} - -+ /* =================================================== FORGE START =====================================*/ -+ protected static int blockFireSpreadSpeed[] = new int[blocksList.length]; -+ protected static int blockFlammability[] = new int[blocksList.length]; -+ protected String currentTexture = "/terrain.png"; -+ public boolean isDefaultTexture = true; -+ -+ /** -+ * Get a light value for this block, normal ranges are between 0 and 15 -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return The light value -+ */ -+ public int getLightValue(IBlockAccess world, int x, int y, int z) -+ { -+ return lightValue[blockID]; -+ } -+ -+ /** -+ * Checks if a player or entity can use this block to 'climb' like a ladder. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block should act like a ladder -+ */ -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Return true if the block is a normal, solid cube. This -+ * determines indirect power state, entity ejection from blocks, and a few -+ * others. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is a full cube -+ */ -+ public boolean isBlockNormalCube(World world, int x, int y, int z) -+ { -+ return blockMaterial.isOpaque() && renderAsNormalBlock(); -+ } -+ -+ /** -+ * Checks if the block is a solid face on the given side, used by placement logic. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @param size The side to check -+ * @return True if the block is solid on the specified side. -+ */ -+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, int side) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if (this instanceof BlockStep) -+ { -+ return (((meta & 8) == 8 && (side == 1)) || isOpaqueCube()); -+ } -+ else if (this instanceof BlockFarmland) -+ { -+ return (side != 1 && side != 0); -+ } -+ else if (this instanceof BlockStairs) -+ { -+ boolean flipped = ((meta & 4) != 0); -+ return ((meta & 3) + side == 5) || (side == 1 && flipped); -+ } -+ return isBlockNormalCube(world, x, y, z); -+ } -+ -+ /** -+ * Determines if a new block can be replace the space occupied by this one, -+ * Used in the player's placement code to make the block act like water, and lava. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is replaceable by another block -+ */ -+ public boolean isBlockReplaceable(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block should set fire and deal fire damage -+ * to entities coming into contact with it. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block should deal damage -+ */ -+ public boolean isBlockBurning(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines this block should be treated as an air block -+ * by the rest of the code. This method is primarily -+ * useful for creating pure logic-blocks that will be invisible -+ * to the player and otherwise interact as air would. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block considered air -+ */ -+ public boolean isAirBlock(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Metadata sensitive version of the default getHardness function. -+ * -+ * @param meta The block's current metatdata -+ * @return Block hardness -+ */ -+ public float getHardness(int meta) -+ { -+ return blockHardness; -+ } -+ -+ /** -+ * Determines this block's strength against being destroyed by a player. -+ * -+ * @param world The current world -+ * @param player The player damaging the block, may be null -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return A value -+ */ -+ public float blockStrength(World world, EntityPlayer player, int x, int y, int z) -+ { -+ return blockStrength(player, world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Determines this block's strength against being destroyed by a player. -+ * -+ * @param player The player damaging the block, may be null -+ * @param meta The block's current metadata -+ * @return The larger the value, the faster it breaks. -+ */ -+ public float blockStrength(EntityPlayer player, int meta) -+ { -+ return ForgeHooks.blockStrength(this, player, meta); -+ } -+ -+ /** -+ * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed. -+ * -+ * @param player The player damaging the block, may be null -+ * @param meta The block's current metadata -+ * @return True tospawn the drops -+ */ -+ public boolean canHarvestBlock(EntityPlayer player, int meta) -+ { -+ return ForgeHooks.canHarvestBlock(this, player, meta); -+ } -+ -+ /** -+ * Called when a player removes a block. This is responsible for -+ * actually destroying the block, and the block is intact at time of call. -+ * This is called regardless of whether the player can harvest the block or -+ * not. -+ * -+ * Return true if the block is actually destroyed. -+ * -+ * Note: When used in multiplayer, this is called on both client and -+ * server sides! -+ * -+ * @param world The current world -+ * @param player The player damaging the block, may be null -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is actually destroyed. -+ */ -+ public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z) -+ { -+ return world.setBlockWithNotify(x, y, z, 0); -+ } -+ -+ /** -+ * Called when a new CreativeContainer is opened, populate the list -+ * with all of the items for this block you want a player in creative mode -+ * to have access to. -+ * -+ * @param itemList The list of items to display on the creative inventory. -+ */ -+ public void addCreativeItems(ArrayList itemList) -+ { -+ } -+ -+ /** -+ * Chance that fire will spread and consume this block. -+ * 300 being a 100% chance, 0, being a 0% chance. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire -+ */ -+ public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, int face) -+ { -+ return blockFlammability[blockID]; -+ } -+ -+ /** -+ * Called when fire is updating, checks if a block face can catch fire. -+ * -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return True if the face can be on fire, false otherwise. -+ */ -+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, int face) -+ { -+ return getFlammability(world, x, y, z, metadata, face) > 0; -+ } -+ -+ /** -+ * Called when fire is updating on a neighbor block. -+ * The higher the number returned, the faster fire will spread around this block. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return A number that is used to determine the speed of fire growth around the block -+ */ -+ public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, int face) -+ { -+ return blockFireSpreadSpeed[blockID]; -+ } -+ -+ /** -+ * Currently only called by fire when it is on top of this block. -+ * Returning true will prevent the fire from naturally dying during updating. -+ * Also prevents firing from dying from rain. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return -+ */ -+ public boolean isFireSource(World world, int x, int y, int z, int metadata, int face) -+ { -+ if (blockID == Block.netherrack.blockID && face == 0) -+ { -+ return true; -+ } -+ if ((world.worldProvider instanceof WorldProviderEnd) && blockID == Block.bedrock.blockID && face == 0) -+ { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Called by BlockFire to setup the burn values of vanilla blocks. -+ * @param id The block id -+ * @param encouragement How much the block encourages fire to spread -+ * @param flammability how easy a block is to catch fire -+ */ -+ public static void setBurnProperties(int id, int encouragement, int flammability) -+ { -+ blockFireSpreadSpeed[id] = encouragement; -+ blockFlammability[id] = flammability; -+ } -+ -+ /** -+ * Called throughout the code as a replacement for block instanceof BlockContainer -+ * Moving this to the Block base class allows for mods that wish to extend vinella -+ * blocks, and also want to have a tile entity on that block, may. -+ * -+ * Return true from this function to specify this block has a tile entity. -+ * -+ * @param metadata Metadata of the current block -+ * @return True if block has a tile entity, false otherwise -+ */ -+ public boolean hasTileEntity(int metadata) -+ { -+ return isBlockContainer; -+ } -+ -+ /** -+ * Called throughout the code as a replacement for BlockContainer.getBlockEntity -+ * Return the same thing you would from that function. -+ * This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer. -+ * -+ * @param metadata The Metadata of the current block -+ * @return A instance of a class extending TileEntity -+ */ -+ public TileEntity getTileEntity(int metadata) -+ { -+ if (this instanceof BlockContainer) -+ { -+ return ((BlockContainer)this).getBlockEntity(metadata); -+ } -+ return null; -+ } -+ -+ /** -+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) -+ * version in 1.1. -+ * -+ * @param meta Blocks Metadata -+ * @param fortune Current item fortune level -+ * @param random Random number generator -+ * @return The number of items to drop -+ */ -+ public int quantityDropped(int meta, int fortune, Random random) -+ { -+ return quantityDroppedWithBonus(fortune, random); -+ } -+ -+ /** -+ * This returns a complete list of items dropped from this block. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param Y Y Position -+ * @param Z Z Position -+ * @param metadata Current metadata -+ * @param fortune Breakers fortune level -+ * @return A ArrayList containing all items this block drops -+ */ -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ -+ int count = quantityDropped(metadata, fortune, world.rand); -+ for(int i = 0; i < count; i++) -+ { -+ int id = idDropped(metadata, world.rand, 0); -+ if (id > 0) -+ { -+ ret.add(new ItemStack(id, 1, damageDropped(metadata))); -+ } -+ } -+ return ret; -+ } -+ -+ /** -+ * Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops. -+ * -+ * @param world The world -+ * @param player The player doing the harvesting -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param metadata The metadata -+ * @return True if the block can be directly harvested using silk touch -+ */ -+ public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) -+ { -+ if (this instanceof BlockGlass) -+ { -+ return true; -+ } -+ return renderAsNormalBlock() && !hasTileEntity(metadata); -+ } -+ -+ /** -+ * Determines if a specified mob type can spawn on this block, returning false will -+ * prevent any mob from spawning on the block. -+ * -+ * @param type The Mob Category Type -+ * @param world The current world -+ * @param x The X Position -+ * @param y The Y Position -+ * @param z The Z Position -+ * @return True to allow a mob of the specified category to spawn, false to prevent it. -+ */ -+ public boolean canCreatureSpawn(EnumCreatureType type, World world, int x, int y, int z) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if (this instanceof BlockStep) -+ { -+ if (mod_MinecraftForge.SPAWNER_ALLOW_ON_INVERTED) -+ { -+ return (((meta & 8) == 8) || isOpaqueCube()); -+ } -+ else -+ { -+ return isNormalCube(this.blockID); -+ } -+ } -+ else if (this instanceof BlockStairs) -+ { -+ if (mod_MinecraftForge.SPAWNER_ALLOW_ON_INVERTED) -+ { -+ return ((meta & 4) != 0); -+ } -+ else -+ { -+ return isNormalCube(this.blockID); -+ } -+ } -+ return isBlockSolidOnSide(world, x, y, z, 1); -+ } -+ -+ /** -+ * Determines if this block is classified as a Bed, Allowing -+ * players to sleep in it, though the block has to specifically -+ * perform the sleeping functionality in it's activated event. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @return True to treat this as a bed -+ */ -+ public boolean isBed(World world, int x, int y, int z, EntityLiving player) -+ { -+ return blockID == Block.bed.blockID; -+ } -+ -+ /** -+ * Returns the position that the player is moved to upon -+ * waking up, or respawning at the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @return The spawn position -+ */ -+ public ChunkCoordinates getBedSpawnPosition(World world, int x, int y, int z, EntityPlayer player) -+ { -+ return BlockBed.getNearestEmptyChunkCoordinates(world, x, y, z, 0); -+ } -+ -+ /** -+ * Called when a user either starts or stops sleeping in the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @param occupied True if we are occupying the bed, or false if they are stopping use of the bed -+ */ -+ public void setBedOccupied(World world, int x, int y, int z, EntityPlayer player, boolean occupied) -+ { -+ BlockBed.setBedOccupied(world, x, y, z, occupied); -+ } -+ -+ /** -+ * Returns the direction of the block. Same values that -+ * are returned by BlockDirectional -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return Bed direction -+ */ -+ public int getBedDirection(IBlockAccess world, int x, int y, int z) -+ { -+ return BlockBed.getDirection(world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Determines if the current block is the foot half of the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return True if the current block is the foot side of a bed. -+ */ -+ public boolean isBedFoot(IBlockAccess world, int x, int y, int z) -+ { -+ return BlockBed.isBlockFootOfBed(world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Called when a leaf should start its decay process. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ */ -+ public void beginLeavesDecay(World world, int x, int y, int z){} -+ -+ /** -+ * Determines if this block can prevent leaves connected to it from decaying. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if the presence this block can prevent leaves from decaying. -+ */ -+ public boolean canSustainLeaves(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if this block is considered leaves. -+ */ -+ public boolean isLeaves(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Used during tree growth to determine if newly generated leaves can replace this block. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if this block can be replaced by growing leaves. -+ */ -+ public boolean canBeReplacedByLeaves(World world, int x, int y, int z) -+ { -+ return !Block.opaqueCubeLookup[this.blockID]; -+ } -+ -+ /** -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if the block is wood (logs) -+ */ -+ public boolean isWood(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if the current block is replaceable by Ore veins during world generation. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return True to allow this block to be replaced by a ore -+ */ -+ public boolean isGenMineableReplaceable(World world, int x, int y, int z) -+ { -+ return blockID == stone.blockID; -+ } -+ -+ /** -+ * Grabs the current texture file used for this block -+ */ -+ @Override -+ public String getTextureFile() -+ { -+ return currentTexture; -+ } -+ -+ /** -+ * Sets the current texture file for this block, used when rendering. -+ * Default is "/terrain.png" -+ * -+ * @param texture The texture file -+ */ -+ public void setTextureFile(String texture) -+ { -+ currentTexture = texture; -+ isDefaultTexture = false; -+ } -+ - static - { - Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setItemName("cloth"); diff --git a/patches/minecraft/net/minecraft/src/BlockButton.java.patch b/patches/minecraft/net/minecraft/src/BlockButton.java.patch deleted file mode 100644 index c495d57ba3..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockButton.java.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000 -@@ -49,7 +49,10 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -- return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); -+ return (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) || -+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) || -+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) || -+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)); - } - - /** -@@ -57,7 +60,10 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2); - } - - /** -@@ -70,19 +76,19 @@ - int var7 = var6 & 8; - var6 &= 7; - -- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } -- else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ else if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } -- else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ else if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } -- else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ else if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -99,7 +105,11 @@ - */ - private int getOrientation(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? 1 : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? 2 : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? 3 : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? 4 : 1))); -+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) return 1; -+ if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) return 2; -+ if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) return 3; -+ if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) return 4; -+ return 1; - } - - /** -@@ -113,22 +123,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; - -- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } diff --git a/patches/minecraft/net/minecraft/src/BlockChest.java.patch b/patches/minecraft/net/minecraft/src/BlockChest.java.patch deleted file mode 100644 index 688391b5ec..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockChest.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -497,7 +497,7 @@ - { - return true; - } -- else if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) -+ else if (par1World.isBlockSolidOnSide(par2, par3 + 1, par4, 0)) - { - return true; - } -@@ -505,19 +505,19 @@ - { - return true; - } -- else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) -+ else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, 0) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) - { - return true; - } -- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) -+ else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, 0) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) - { - return true; - } -- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) -+ else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, 0) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) - { - return true; - } -- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) -+ else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, 0) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) - { - return true; - } diff --git a/patches/minecraft/net/minecraft/src/BlockContainer.java.patch b/patches/minecraft/net/minecraft/src/BlockContainer.java.patch deleted file mode 100644 index 98ace699fb..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockContainer.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -20,7 +20,7 @@ - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { - super.onBlockAdded(par1World, par2, par3, par4); -- par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity()); -+ par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity(par1World.getBlockMetadata(par2, par3, par4))); - } - - /** -@@ -51,4 +51,14 @@ - var7.receiveClientEvent(par5, par6); - } - } -+ -+ /** -+ * Metadata-sensitive version, to fix 1.8.1 regression. -+ * @param meta The current Metadata -+ * @return And instance of the TileEntity class for this block -+ */ -+ public TileEntity getBlockEntity(int meta) -+ { -+ return getBlockEntity(); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockCrops.java.patch b/patches/minecraft/net/minecraft/src/BlockCrops.java.patch deleted file mode 100644 index 745d739e31..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockCrops.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,7 @@ - package net.minecraft.src; - - import java.util.Random; -+import java.util.ArrayList; - - public class BlockCrops extends BlockFlower - { -@@ -135,25 +136,26 @@ - 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) -+ } -+ -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ if (metadata == 7) - { -- int var8 = 3 + par7; -- -- for (int var9 = 0; var9 < var8; ++var9) -+ ret.add(new ItemStack(Item.wheat)); -+ } -+ -+ for (int n = 0; n < 3 + fortune; n++) -+ { -+ if (world.rand.nextInt(15) <= metadata) - { -- if (par1World.rand.nextInt(15) <= par5) -- { -- float var10 = 0.7F; -- float var11 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- float var12 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- float var13 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(Item.seeds)); -- var14.delayBeforeCanPickup = 10; -- par1World.spawnEntityInWorld(var14); -- } -+ ret.add(new ItemStack(Item.seeds)); - } - } -+ -+ return ret; - } - - /** diff --git a/patches/minecraft/net/minecraft/src/BlockDoor.java.patch b/patches/minecraft/net/minecraft/src/BlockDoor.java.patch deleted file mode 100644 index d79b6fc74b..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockDoor.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -243,7 +243,7 @@ - { - if (this.blockMaterial == Material.iron) - { -- return true; -+ return false; - } - else - { -@@ -325,7 +325,7 @@ - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - var7 = true; -@@ -378,7 +378,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par3 >= 255 ? false : par1World.isBlockNormalCube(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); -+ return par3 >= 255 ? false : par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); - } - - /** diff --git a/patches/minecraft/net/minecraft/src/BlockFire.java.patch b/patches/minecraft/net/minecraft/src/BlockFire.java.patch deleted file mode 100644 index 6a8aa5f506..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockFire.java.patch +++ /dev/null @@ -1,275 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000 -@@ -25,6 +25,8 @@ - */ - public void initializeBlock() - { -+ abilityToCatchFire = Block.blockFlammability; -+ chanceToEncourageFire = Block.blockFireSpreadSpeed; - this.setBurnRate(Block.planks.blockID, 5, 20); - this.setBurnRate(Block.fence.blockID, 5, 20); - this.setBurnRate(Block.stairCompactPlanks.blockID, 5, 20); -@@ -44,8 +46,7 @@ - */ - private void setBurnRate(int par1, int par2, int par3) - { -- this.chanceToEncourageFire[par1] = par2; -- this.abilityToCatchFire[par1] = par3; -+ Block.setBurnProperties(par1, par2, par3); - } - - /** -@@ -103,8 +104,9 @@ - */ - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { -- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; -- -+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; -+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), 0)); -+ - if (par1World.worldProvider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) - { - var6 = true; -@@ -132,12 +134,12 @@ - - if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) || var7 > 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || var7 > 3) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } - } -- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0) -+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, 1) && var7 == 15 && par5Random.nextInt(4) == 0) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -151,12 +153,12 @@ - var9 = -50; - } - -- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, 4); -+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, 5); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, 1); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, 0); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, 3); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, 2); - - for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10) - { -@@ -203,10 +205,22 @@ - } - } - } -- -+ -+ /** Deprecated for a side-sensitive version */ -+ @Deprecated - private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7) - { -- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; -+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, 0); -+ } -+ -+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, int face) -+ { -+ int var8 = 0; -+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)]; -+ if (block != null) -+ { -+ var8 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face); -+ } - - if (par6Random.nextInt(par5) < var8) - { -@@ -240,7 +254,12 @@ - */ - private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) - { -- return this.canBlockCatchFire(par1World, par2 + 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2 - 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 - 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 + 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3, par4 - 1) ? true : this.canBlockCatchFire(par1World, par2, par3, par4 + 1))))); -+ return canBlockCatchFire(par1World, par2 + 1, par3, par4, 4) || -+ canBlockCatchFire(par1World, par2 - 1, par3, par4, 5) || -+ canBlockCatchFire(par1World, par2, par3 - 1, par4, 1) || -+ canBlockCatchFire(par1World, par2, par3 + 1, par4, 0) || -+ canBlockCatchFire(par1World, par2, par3, par4 - 1, 3) || -+ canBlockCatchFire(par1World, par2, par3, par4 + 1, 2); - } - - /** -@@ -256,12 +275,12 @@ - } - else - { -- int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5); -- var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6); -+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5, 4); -+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6, 5); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6, 1); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6, 0); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6, 3); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6, 2); - return var6; - } - } -@@ -276,21 +295,24 @@ - - /** - * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z -+ * Deprecated for a side-sensitive version - */ -+ @Deprecated - public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { -- return this.chanceToEncourageFire[par1IBlockAccess.getBlockId(par2, par3, par4)] > 0; -+ return canBlockCatchFire(par1IBlockAccess, par2, par3, par4, 0); - } - - /** - * Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the - * current number passed in it will return its number instead of the passed in one. Args: world, x, y, z, - * curChanceToEncourageFire -+ * Deprecated for a side-sensitive version - */ -+ @Deprecated - public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5) - { -- int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)]; -- return var6 > par5 ? var6 : par5; -+ return getChanceToEncourageFire(par1World, par2, par3, par4, par5, 0); - } - - /** -@@ -298,7 +320,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || this.canNeighborBurn(par1World, par2, par3, par4); -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || this.canNeighborBurn(par1World, par2, par3, par4); - } - - /** -@@ -307,7 +329,7 @@ - */ - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -320,7 +342,7 @@ - { - if (par1World.worldProvider.worldType > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4)) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -346,9 +368,9 @@ - float var8; - float var9; - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4, 1)) - { -- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) -+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, 5)) - { - for (var6 = 0; var6 < 2; ++var6) - { -@@ -359,7 +381,7 @@ - } - } - -- if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4)) -+ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4, 4)) - { - for (var6 = 0; var6 < 2; ++var6) - { -@@ -370,7 +392,7 @@ - } - } - -- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1)) -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1, 3)) - { - for (var6 = 0; var6 < 2; ++var6) - { -@@ -381,7 +403,7 @@ - } - } - -- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1)) -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1, 2)) - { - for (var6 = 0; var6 < 2; ++var6) - { -@@ -392,7 +414,7 @@ - } - } - -- if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4)) -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4, 0)) - { - for (var6 = 0; var6 < 2; ++var6) - { -@@ -414,4 +436,46 @@ - } - } - } -+ -+ /** -+ * Side sensitive version that calls the block function. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param face The side the fire is coming from -+ * @return True if the face can catch fire. -+ */ -+ public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, int face) -+ { -+ Block block = Block.blocksList[world.getBlockId(x, y, z)]; -+ if (block != null) -+ { -+ return block.isFlammable(world, x, y, z, world.getBlockMetadata(x, y, z), face); -+ } -+ return false; -+ } -+ -+ /** -+ * Side sensitive version that calls the block function. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param oldChance The previous maximum chance. -+ * @param face The side the fire is coming from -+ * @return The chance of the block catching fire, or oldChance if it is higher -+ */ -+ public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, int face) -+ { -+ int newChance = 0; -+ Block block = Block.blocksList[world.getBlockId(x, y, z)]; -+ if (block != null) -+ { -+ newChance = block.getFireSpreadSpeed(world, x, y, z, world.getBlockMetadata(x, y, z), face); -+ } -+ return (newChance > oldChance ? newChance : oldChance); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockLadder.java.patch b/patches/minecraft/net/minecraft/src/BlockLadder.java.patch deleted file mode 100644 index dceb7d8720..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockLadder.java.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000 -@@ -102,7 +102,10 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2); - } - - /** -@@ -113,22 +116,22 @@ - { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - -- if ((var6 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if ((var6 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 2; - } - -- if ((var6 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if ((var6 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if ((var6 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if ((var6 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 4; - } - -- if ((var6 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if ((var6 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 5; - } -@@ -145,22 +148,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; - -- if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (var6 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var7 = true; - } - -- if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (var6 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var7 = true; - } - -- if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (var6 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var7 = true; - } - -- if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (var6 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var7 = true; - } -@@ -181,4 +184,10 @@ - { - return 1; - } -+ -+ @Override -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/src/BlockLeaves.java.patch deleted file mode 100644 index 8ce3640ee4..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockLeaves.java.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockLeaves.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockLeaves.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockLeaves extends BlockLeavesBase -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockLeaves extends BlockLeavesBase implements IShearable - { - /** - * The base index in terrain.png corresponding to the fancy version of the leaf texture. This is stored so we can -@@ -88,10 +91,9 @@ - { - int var10 = par1World.getBlockId(par2 + var7, par3 + var8, par4 + var9); - -- if (var10 == Block.leaves.blockID) -+ if (Block.blocksList[var10] != null) - { -- int var11 = par1World.getBlockMetadata(par2 + var7, par3 + var8, par4 + var9); -- par1World.setBlockMetadata(par2 + var7, par3 + var8, par4 + var9, var11 | 8); -+ Block.blocksList[var10].beginLeavesDecay(par1World, par2 + var7, par3 + var8, par4 + var9); - } - } - } -@@ -136,12 +138,14 @@ - for (var14 = -var7; var14 <= var7; ++var14) - { - var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14); -- -- if (var15 == Block.wood.blockID) -+ -+ Block block = Block.blocksList[var15]; -+ -+ if (block != null && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) - { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } -- else if (var15 == Block.leaves.blockID) -+ else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) - { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } -@@ -268,15 +272,7 @@ - */ - 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.shiftedIndex) -- { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3)); -- } -- else -- { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -- } -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } - - /** -@@ -320,4 +316,30 @@ - { - super.onEntityWalking(par1World, par2, par3, par4, par5Entity); - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); -+ return ret; -+ } -+ -+ @Override -+ public void beginLeavesDecay(World world, int x, int y, int z) -+ { -+ world.setBlockMetadata(x, y, z, world.getBlockMetadata(x, y, z) | 8); -+ } -+ -+ @Override -+ public boolean isLeaves(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockLever.java.patch b/patches/minecraft/net/minecraft/src/BlockLever.java.patch deleted file mode 100644 index ddc55de842..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockLever.java.patch +++ /dev/null @@ -1,100 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 -@@ -46,7 +46,11 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -- return par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)))); -+ return (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) || -+ (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) || -+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) || -+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) || -+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)); - } - - /** -@@ -54,7 +58,11 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : par1World.isBlockNormalCube(par2, par3 - 1, par4)))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) || -+ par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1); - } - - /** -@@ -68,27 +76,27 @@ - var6 &= 7; - var6 = -1; - -- if (par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - var6 = 5 + par1World.rand.nextInt(2); - } - -- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } - -- if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } - -- if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -115,32 +123,32 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; - -- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 5) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && var6 == 5) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 6) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && var6 == 6) - { - var7 = true; - } diff --git a/patches/minecraft/net/minecraft/src/BlockLog.java.patch b/patches/minecraft/net/minecraft/src/BlockLog.java.patch deleted file mode 100644 index cadd98aed2..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockLog.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockLog.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockLog.java 0000-00-00 00:00:00.000000000 -0000 -@@ -53,14 +53,9 @@ - { - int var10 = par1World.getBlockId(par2 + var7, par3 + var8, par4 + var9); - -- if (var10 == Block.leaves.blockID) -+ if (Block.blocksList[var10] != null) - { -- int var11 = par1World.getBlockMetadata(par2 + var7, par3 + var8, par4 + var9); -- -- if ((var11 & 8) == 0) -- { -- par1World.setBlockMetadata(par2 + var7, par3 + var8, par4 + var9, var11 | 8); -- } -+ Block.blocksList[var10].beginLeavesDecay(par1World, par2 + var7, par3 + var8, par4 + var9); - } - } - } -@@ -83,4 +78,16 @@ - { - return par1; - } -+ -+ @Override -+ public boolean canSustainLeaves(World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public boolean isWood(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockNetherStalk.java.patch b/patches/minecraft/net/minecraft/src/BlockNetherStalk.java.patch deleted file mode 100644 index 86daf4fb0c..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockNetherStalk.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - - public class BlockNetherStalk extends BlockFlower -@@ -71,25 +72,25 @@ - */ - 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); -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ } -+ -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ int var8 = 1; - -- if (par7 > 0) -- { -- var8 += par1World.rand.nextInt(par7 + 1); -- } -- } -+ if (metadata >= 3) -+ { -+ var8 = 2 + world.rand.nextInt(3) + (fortune > 0 ? world.rand.nextInt(fortune + 1) : 0); -+ } - -- for (int var9 = 0; var9 < var8; ++var9) -- { -- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds)); -- } -+ for (int var9 = 0; var9 < var8; ++var9) -+ { -+ ret.add(new ItemStack(Item.netherStalkSeeds)); - } -+ return ret; - } - - /** diff --git a/patches/minecraft/net/minecraft/src/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/src/BlockPistonBase.java.patch deleted file mode 100644 index 25faf60be7..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockPistonBase.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000 -@@ -368,7 +368,7 @@ - return false; - } - -- return !(Block.blocksList[par0] instanceof BlockContainer); -+ return !(Block.blocksList[par0] != null && Block.blocksList[par0].hasTileEntity(par1World.getBlockMetadata(par2, par3, par4))); - } - } - diff --git a/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch b/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch deleted file mode 100644 index d43c96d574..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -@@ -61,7 +61,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID; -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID; - } - - /** -@@ -77,7 +77,7 @@ - { - boolean var6 = false; - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && par1World.getBlockId(par2, par3 - 1, par4) != Block.fence.blockID) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && par1World.getBlockId(par2, par3 - 1, par4) != Block.fence.blockID) - { - var6 = true; - } diff --git a/patches/minecraft/net/minecraft/src/BlockRail.java.patch b/patches/minecraft/net/minecraft/src/BlockRail.java.patch deleted file mode 100644 index ca4c9ccde6..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockRail.java.patch +++ /dev/null @@ -1,213 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,19 @@ - { - /** Power related rails have this field at true. */ - private final boolean isPowered; -+ -+ /** -+ * Forge: Moved render type to a field and a setter. -+ * This allows for a mod to change the render type -+ * for vanilla rails, and any mod rails that extend -+ * this class. -+ */ -+ private int renderType = 9; -+ -+ public void setRenderType(int value) -+ { -+ renderType = value; -+ } - - /** - * Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or -@@ -14,7 +27,7 @@ - public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3) - { - int var4 = par0World.getBlockId(par1, par2, par3); -- return var4 == Block.rail.blockID || var4 == Block.railPowered.blockID || var4 == Block.railDetector.blockID; -+ return Block.blocksList[var4] instanceof BlockRail; - } - - /** -@@ -22,7 +35,7 @@ - */ - public static final boolean isRailBlock(int par0) - { -- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID; -+ return Block.blocksList[par0] instanceof BlockRail; - } - - protected BlockRail(int par1, int par2, boolean par3) -@@ -118,7 +131,7 @@ - */ - public int getRenderType() - { -- return 9; -+ return renderType; - } - - /** -@@ -134,7 +147,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4); -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1); - } - - /** -@@ -171,27 +184,27 @@ - - boolean var8 = false; - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - var8 = true; - } - -- if (var7 == 2 && !par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (var7 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 1)) - { - var8 = true; - } - -- if (var7 == 3 && !par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (var7 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 1)) - { - var8 = true; - } - -- if (var7 == 4 && !par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (var7 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 1)) - { - var8 = true; - } - -- if (var7 == 5 && !par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (var7 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 1)) - { - var8 = true; - } -@@ -391,10 +404,120 @@ - } - - /** -- * Return true if the blocks passed is a power related rail. -+ * This function is no longer called by Minecraft - */ -+ @Deprecated - static boolean isPoweredBlockRail(BlockRail par0BlockRail) - { - return par0BlockRail.isPowered; - } -+ -+ /** -+ * Return true if the rail can make corners. -+ * Used by placement logic. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the rail can make corners. -+ */ -+ public boolean isFlexibleRail(World world, int y, int x, int z) -+ { -+ return !isPowered; -+ } -+ -+ /** -+ * Returns true if the rail can make up and down slopes. -+ * Used by placement logic. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the rail can make slopes. -+ */ -+ public boolean canMakeSlopes(World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ /** -+ * Return the rails metadata (without the power bit if the rail uses one). -+ * Can be used to make the cart think the rail something other than it is, -+ * for example when making diamond junctions or switches. -+ * The cart parameter will often be null unless it it called from EntityMinecart. -+ * -+ * Valid rail metadata is defined as follows: -+ * 0x0: flat track going North-South -+ * 0x1: flat track going West-East -+ * 0x2: track ascending to the East -+ * 0x3: track ascending to the West -+ * 0x4: track ascending to the North -+ * 0x5: track ascending to the South -+ * 0x6: WestNorth corner (connecting East and South) -+ * 0x7: EastNorth corner (connecting West and South) -+ * 0x8: EastSouth corner (connecting West and North) -+ * 0x9: WestSouth corner (connecting East and North) -+ * -+ * All directions are Notch defined. -+ * In MC Beta 1.8.3 the Sun rises in the North. -+ * In MC 1.0.0 the Sun rises in the East. -+ * -+ * @param world The world. -+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. -+ * @param y The rail X coordinate. -+ * @param x The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return The metadata. -+ */ -+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if(isPowered) -+ { -+ meta = meta & 7; -+ } -+ return meta; -+ } -+ -+ /** -+ * Returns the max speed of the rail at the specified position. -+ * @param world The world. -+ * @param cart The cart on the rail, may be null. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return The max speed of the current rail. -+ */ -+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) -+ { -+ return 0.4f; -+ } -+ -+ /** -+ * This function is called by any minecart that passes over this rail. -+ * It is called once per update tick that the minecart is on the rail. -+ * @param world The world. -+ * @param cart The cart on the rail. -+ * @param y The rail X coordinate. -+ * @param x The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ */ -+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z) -+ { -+ } -+ -+ /** -+ * Return true if this rail uses the 4th bit as a power bit. -+ * Avoid using this function when getBasicRailMetadata() can be used instead. -+ * The only reason to use this function is if you wish to change the rails metadata. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the 4th bit is a power bit. -+ */ -+ public boolean hasPowerBit(World world, int x, int y, int z) -+ { -+ return isPowered; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch b/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch deleted file mode 100644 index 4070829981..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -@@ -33,7 +33,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); -+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); - } - - /** -@@ -41,7 +41,7 @@ - */ - public boolean canBlockStay(World par1World, int par2, int par3, int par4) - { -- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canBlockStay(par1World, par2, par3, par4); -+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canBlockStay(par1World, par2, par3, par4); - } - - /** diff --git a/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch deleted file mode 100644 index 0d5b43466f..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,6 +5,8 @@ - import java.util.Random; - import java.util.Set; - -+import net.minecraft.src.forge.IConnectRedstone; -+ - public class BlockRedstoneWire extends Block - { - /** -@@ -76,7 +78,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; - } - - /** -@@ -548,6 +550,10 @@ - } - else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID) - { -+ if (Block.blocksList[var5] instanceof IConnectRedstone) -+ { -+ return ((IConnectRedstone)Block.blocksList[var5]).canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4); -+ } - return Block.blocksList[var5].canProvidePower() && par4 != -1; - } - else diff --git a/patches/minecraft/net/minecraft/src/BlockSnow.java.patch b/patches/minecraft/net/minecraft/src/BlockSnow.java.patch deleted file mode 100644 index 81e3128488..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockSnow.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -54,7 +54,8 @@ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { - int var5 = par1World.getBlockId(par2, par3 - 1, par4); -- return var5 != 0 && (var5 == Block.leaves.blockID || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; -+ Block block = Block.blocksList[var5]; -+ return block != null && (block.isLeaves(par1World, par2, par3 - 1, par4) || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; - } - - /** -@@ -73,7 +74,6 @@ - { - if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) - { -- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlockWithNotify(par2, par3, par4, 0); - return false; - } -@@ -89,15 +89,7 @@ - */ - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) - { -- int var7 = Item.snowball.shiftedIndex; -- float var8 = 0.7F; -- double var9 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- double var11 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- double var13 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- EntityItem var15 = new EntityItem(par1World, (double)par3 + var9, (double)par4 + var11, (double)par5 + var13, new ItemStack(var7, 1, 0)); -- var15.delayBeforeCanPickup = 10; -- par1World.spawnEntityInWorld(var15); -- par1World.setBlockWithNotify(par3, par4, par5, 0); -+ dropBlockAsItem(par1World, par3, par4, par5, par6, 0); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - } - -@@ -114,7 +106,7 @@ - */ - public int quantityDropped(Random par1Random) - { -- return 0; -+ return 1; - } - - /** -@@ -124,7 +116,6 @@ - { - if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) - { -- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlockWithNotify(par2, par3, par4, 0); - } - } diff --git a/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch deleted file mode 100644 index a50abc718e..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,12 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockTallGrass extends BlockFlower -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockTallGrass extends BlockFlower implements IShearable - { - protected BlockTallGrass(int par1, int par2) - { -@@ -49,7 +53,7 @@ - */ - public int idDropped(int par1, Random par2Random, int par3) - { -- return par2Random.nextInt(8) == 0 ? Item.seeds.shiftedIndex : -1; -+ return -1; - } - - /** -@@ -66,14 +70,37 @@ - */ - 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.shiftedIndex) -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ } -+ -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int meta, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ if (world.rand.nextInt(8) != 0) - { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); -+ return ret; - } -- else -+ -+ ItemStack item = ForgeHooks.getGrassSeed(world); -+ if (item != null) - { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ ret.add(item); - } -+ return ret; -+ } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); -+ return ret; - } - } diff --git a/patches/minecraft/net/minecraft/src/BlockTorch.java.patch b/patches/minecraft/net/minecraft/src/BlockTorch.java.patch deleted file mode 100644 index f5855479f3..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockTorch.java.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -@@ -49,7 +49,7 @@ - */ - private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) - { -- if (par1World.isBlockNormalCubeDefault(par2, par3, par4, true)) -+ if (par1World.isBlockSolidOnSide(par2, par3, par4, 1)) - { - return true; - } -@@ -83,7 +83,11 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) || -+ canPlaceTorchOn(par1World, par2, par3 - 1, par4); - } - - /** -@@ -99,22 +103,22 @@ - var6 = 5; - } - -- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } - -- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) -+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) -+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } - -- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) -+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -140,19 +144,19 @@ - */ - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { -- if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) -+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 1); - } -- else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) -+ else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); - } -- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) -+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); - } -- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) -+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); - } -@@ -175,22 +179,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; - -- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } diff --git a/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch deleted file mode 100644 index 417c2cee28..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,9 @@ - - public class BlockTrapDoor extends Block - { -+ /** Set this to allow trapdoors to remain free-floating */ -+ public static boolean disableValidation = false; -+ - protected BlockTrapDoor(int par1, Material par2Material) - { - super(par1, par2Material); -@@ -183,7 +186,7 @@ - --var7; - } - -- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8))) -+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, (var6 & 3) + 2))) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -@@ -244,6 +247,10 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -+ if (disableValidation) -+ { -+ return true; -+ } - if (par5 == 0) - { - return false; -@@ -274,7 +281,7 @@ - --par2; - } - -- return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)); -+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)) || par1World.isBlockSolidOnSide(par2, par3, par4, 1); - } - } - -@@ -289,6 +296,11 @@ - */ - private static boolean isValidSupportBlock(int par0) - { -+ if (disableValidation) -+ { -+ return true; -+ } -+ - if (par0 <= 0) - { - return false; diff --git a/patches/minecraft/net/minecraft/src/BlockVine.java.patch b/patches/minecraft/net/minecraft/src/BlockVine.java.patch deleted file mode 100644 index 2804799a29..0000000000 --- a/patches/minecraft/net/minecraft/src/BlockVine.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockVine extends Block -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockVine extends Block implements IShearable - { - public BlockVine(int par1) - { -@@ -424,14 +427,26 @@ - */ - 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.shiftedIndex) -- { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0)); -- } -- else -- { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -- } -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, 0)); -+ return ret; -+ } -+ -+ @Override -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return true; - } - } diff --git a/patches/minecraft/net/minecraft/src/Chunk.java.patch b/patches/minecraft/net/minecraft/src/Chunk.java.patch deleted file mode 100644 index 1b6cbdb921..0000000000 --- a/patches/minecraft/net/minecraft/src/Chunk.java.patch +++ /dev/null @@ -1,371 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 -@@ -8,6 +8,8 @@ - import java.util.Map; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class Chunk - { - /** -@@ -120,7 +122,9 @@ - { - for (int var8 = 0; var8 < var5; ++var8) - { -- byte var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8]; -+ /* FORGE: The following change, a cast from unsigned byte to int, -+ * fixes a vanilla bug when generating new chunks that contain a block ID > 127 */ -+ int var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8] & 0xFF; - - if (var9 != 0) - { -@@ -139,6 +143,48 @@ - } - - /** -+ * Metadata sensitive Chunk constructor for use in new ChunkProviders that -+ * use metadata sensitive blocks during generation. -+ * -+ * @param world The world this chunk belongs to -+ * @param ids A ByteArray containing all the BlockID's to set this chunk to -+ * @param metadata A ByteArray containing all the metadata to set this chunk to -+ * @param chunkX The chunk's X position -+ * @param chunkZ The Chunk's Z position -+ */ -+ public Chunk(World world, byte[] ids, byte[] metadata, int chunkX, int chunkZ) -+ { -+ this(world, chunkX, chunkZ); -+ int height = ids.length / 256; -+ -+ for (int x = 0; x < 16; ++x) -+ { -+ for (int z = 0; z < 16; ++z) -+ { -+ for (int y = 0; y < height; ++y) -+ { -+ int index = x << 11 | z << 7 | y; -+ int id = ids[index] & 0xFF; -+ int meta = metadata[index] & 0x0F; -+ -+ if (id != 0) -+ { -+ int chunkY = y >> 4; -+ -+ if (storageArrays[chunkY] == null) -+ { -+ storageArrays[chunkY] = new ExtendedBlockStorage(chunkY << 4); -+ } -+ -+ storageArrays[chunkY].setExtBlockID(x, y & 15, z, id); -+ storageArrays[chunkY].setExtBlockMetadata(x, y & 15, z, meta); -+ } -+ } -+ } -+ } -+ } -+ -+ /** - * Checks whether the chunk is at the X/Z location specified - */ - public boolean isAtLocation(int par1, int par2) -@@ -505,7 +551,7 @@ - */ - public int getBlockID(int par1, int par2, int par3) - { -- if (par2 >> 4 >= this.storageArrays.length) -+ if (par2 >> 4 >= this.storageArrays.length || par2 >> 4 < 0) - { - return 0; - } -@@ -521,7 +567,7 @@ - */ - public int getBlockMetadata(int par1, int par2, int par3) - { -- if (par2 >> 4 >= this.storageArrays.length) -+ if (par2 >> 4 >= this.storageArrays.length || par2 >> 4 < 0) - { - return 0; - } -@@ -561,6 +607,11 @@ - } - else - { -+ if (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0) -+ { -+ return false; -+ } -+ - ExtendedBlockStorage var9 = this.storageArrays[par2 >> 4]; - boolean var10 = false; - -@@ -585,7 +636,7 @@ - { - Block.blocksList[var8].onBlockRemoval(this.worldObj, var11, par2, var12); - } -- else if (Block.blocksList[var8] instanceof BlockContainer && var8 != par4) -+ if (Block.blocksList[var8] != null && Block.blocksList[var8].hasTileEntity(getBlockMetadata(par1, par2, par3))) - { - this.worldObj.removeBlockTileEntity(var11, par2, var12); - } -@@ -629,32 +680,23 @@ - Block.blocksList[par4].onBlockAdded(this.worldObj, var11, par2, var12); - } - -- if (Block.blocksList[par4] instanceof BlockContainer) -+ if (Block.blocksList[par4] != null && Block.blocksList[par4].hasTileEntity(par5)) - { - var13 = this.getChunkBlockTileEntity(par1, par2, par3); - - if (var13 == null) - { -- var13 = ((BlockContainer)Block.blocksList[par4]).getBlockEntity(); -+ var13 = Block.blocksList[par4].getTileEntity(par5); - this.worldObj.setBlockTileEntity(var11, par2, var12, var13); - } - - if (var13 != null) - { - var13.updateContainingBlockInfo(); -+ var13.blockMetadata = par5; - } - } - } -- else if (var8 > 0 && Block.blocksList[var8] instanceof BlockContainer) -- { -- var13 = this.getChunkBlockTileEntity(par1, par2, par3); -- -- if (var13 != null) -- { -- var13.updateContainingBlockInfo(); -- } -- } -- - this.isModified = true; - return true; - } -@@ -666,7 +708,7 @@ - */ - public boolean setBlockMetadata(int par1, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ ExtendedBlockStorage var5 = (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0 ? null : storageArrays[par2 >> 4]); - - if (var5 == null) - { -@@ -686,7 +728,7 @@ - var5.setExtBlockMetadata(par1, par2 & 15, par3, par4); - int var7 = var5.getExtBlockID(par1, par2 & 15, par3); - -- if (var7 > 0 && Block.blocksList[var7] instanceof BlockContainer) -+ if (var7 > 0 && Block.blocksList[var7] != null && Block.blocksList[var7].hasTileEntity(var5.getExtBlockMetadata(par1, par2 & 15, par3))) - { - TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3); - -@@ -707,7 +749,7 @@ - */ - public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par3 >> 4]; -+ ExtendedBlockStorage var5 = (par3 >> 4 >= storageArrays.length || par3 >> 4 < 0 ? null : storageArrays[par3 >> 4]); - return var5 == null ? par1EnumSkyBlock.defaultLightValue : (par1EnumSkyBlock == EnumSkyBlock.Sky ? var5.getExtSkylightValue(par2, par3 & 15, par4) : (par1EnumSkyBlock == EnumSkyBlock.Block ? var5.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue)); - } - -@@ -717,6 +759,11 @@ - */ - public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) - { -+ if (par3 >> 4 >= storageArrays.length || par3 >> 4 < 0) -+ { -+ return; -+ } -+ - ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4]; - - if (var6 == null) -@@ -750,7 +797,7 @@ - */ - public int getBlockLightValue(int par1, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ ExtendedBlockStorage var5 = (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0 ? null : storageArrays[par2 >> 4]); - - if (var5 == null) - { -@@ -852,34 +899,33 @@ - { - ChunkPosition var4 = new ChunkPosition(par1, par2, par3); - TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4); -+ -+ if (var5 != null && var5.isInvalid()) -+ { -+ chunkTileEntityMap.remove(var4); -+ var5 = null; -+ } - - if (var5 == null) - { - int var6 = this.getBlockID(par1, par2, par3); -- -- if (var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) -+ int meta = getBlockMetadata(par1, par2, par3); -+ -+ if (var6 <= 0 || Block.blocksList[var6] == null || !Block.blocksList[var6].hasTileEntity(meta)) - { - return null; - } - - if (var5 == null) - { -- var5 = ((BlockContainer)Block.blocksList[var6]).getBlockEntity(); -+ var5 = Block.blocksList[var6].getTileEntity(meta); - this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, var5); - } - - var5 = (TileEntity)this.chunkTileEntityMap.get(var4); - } - -- if (var5 != null && var5.isInvalid()) -- { -- this.chunkTileEntityMap.remove(var4); -- return null; -- } -- else -- { -- return var5; -- } -+ return var5; - } - - /** -@@ -894,7 +940,7 @@ - - if (this.isChunkLoaded) - { -- this.worldObj.loadedTileEntityList.add(par1TileEntity); -+ this.worldObj.addTileEntity(par1TileEntity); - } - } - -@@ -909,8 +955,14 @@ - par4TileEntity.yCoord = par2; - par4TileEntity.zCoord = this.zPosition * 16 + par3; - -- if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof BlockContainer) -+ int id = getBlockID(par1, par2, par3); -+ if (id > 0 && Block.blocksList[id] != null && Block.blocksList[id].hasTileEntity(getBlockMetadata(par1, par2, par3))) - { -+ TileEntity old = (TileEntity)chunkTileEntityMap.get(var5); -+ if (old != null) -+ { -+ old.invalidate(); -+ } - par4TileEntity.validate(); - this.chunkTileEntityMap.put(var5, par4TileEntity); - } -@@ -946,6 +998,7 @@ - { - this.worldObj.addLoadedEntities(this.entityLists[var1]); - } -+ ForgeHooks.onChunkLoad(worldObj, this); - } - - /** -@@ -966,6 +1019,7 @@ - { - this.worldObj.unloadEntities(this.entityLists[var3]); - } -+ ForgeHooks.onChunkUnload(worldObj, this); - } - - /** -@@ -982,8 +1036,8 @@ - */ - public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List) - { -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - - if (var4 < 0) - { -@@ -1030,8 +1084,8 @@ - */ - public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List) - { -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - - if (var4 < 0) - { -@@ -1228,6 +1282,16 @@ - - public void func_48494_a(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) - { -+ -+ Iterator iterator = chunkTileEntityMap.values().iterator(); -+ while(iterator.hasNext()) -+ { -+ TileEntity tileEntity = (TileEntity)iterator.next(); -+ tileEntity.updateContainingBlockInfo(); -+ tileEntity.getBlockMetadata(); -+ tileEntity.getBlockType(); -+ } -+ - int var5 = 0; - int var6; - -@@ -1324,12 +1388,26 @@ - } - - this.generateHeightMap(); -- Iterator var10 = this.chunkTileEntityMap.values().iterator(); -- -- while (var10.hasNext()) -+ -+ List invalidList = new ArrayList(); -+ iterator = chunkTileEntityMap.values().iterator(); -+ while (iterator.hasNext()) -+ { -+ TileEntity tileEntity = (TileEntity)iterator.next(); -+ int x = tileEntity.xCoord & 15; -+ int y = tileEntity.yCoord; -+ int z = tileEntity.zCoord & 15; -+ Block block = tileEntity.getBlockType(); -+ if (block == null || block.blockID != getBlockID(x, y, z) || tileEntity.getBlockMetadata() != getBlockMetadata(x, y, z)) -+ { -+ invalidList.add(tileEntity); -+ } -+ tileEntity.updateContainingBlockInfo(); -+ } -+ -+ for (TileEntity tileEntity : invalidList) - { -- TileEntity var9 = (TileEntity)var10.next(); -- var9.updateContainingBlockInfo(); -+ tileEntity.invalidate(); - } - } - -@@ -1438,4 +1516,18 @@ - } - } - } -+ -+ /** FORGE: Used to remove only invalid TileEntities */ -+ public void cleanChunkBlockTileEntity(int x, int y, int z) -+ { -+ ChunkPosition position = new ChunkPosition(x, y, z); -+ if (isChunkLoaded) -+ { -+ TileEntity entity = (TileEntity)chunkTileEntityMap.get(position); -+ if (entity != null && entity.isInvalid()) -+ { -+ chunkTileEntityMap.remove(position); -+ } -+ } -+ } - } diff --git a/patches/minecraft/net/minecraft/src/ChunkProvider.java.patch b/patches/minecraft/net/minecraft/src/ChunkProvider.java.patch deleted file mode 100644 index 719674ca36..0000000000 --- a/patches/minecraft/net/minecraft/src/ChunkProvider.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ChunkProvider.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ChunkProvider.java 0000-00-00 00:00:00.000000000 -0000 -@@ -8,6 +8,8 @@ - - import cpw.mods.fml.client.FMLClientHandler; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ChunkProvider implements IChunkProvider - { - /** A set of dropped chunks. Currently not used in single player. */ -@@ -53,6 +55,11 @@ - */ - public void dropChunk(int par1, int par2) - { -+ if(!ForgeHooks.canUnloadChunk(worldObj.getChunkFromChunkCoords(par1, par2))) -+ { -+ return; -+ } -+ - ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); - int var4 = par1 * 16 + 8 - var3.posX; - int var5 = par2 * 16 + 8 - var3.posZ; diff --git a/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch b/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch deleted file mode 100644 index cec26e26b0..0000000000 --- a/patches/minecraft/net/minecraft/src/ContainerCreative.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000 -@@ -68,17 +68,20 @@ - this.itemList.add(new ItemStack(var2[var12], 1, var13)); - } - -- for (var12 = 256; var12 < Item.itemsList.length; ++var12) -+ for (Block block : Block.blocksList) - { -- if (Item.itemsList[var12] != null && Item.itemsList[var12].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[var12].shiftedIndex != Item.monsterPlacer.shiftedIndex) -+ if (block != null) - { -- this.itemList.add(new ItemStack(Item.itemsList[var12])); -+ block.addCreativeItems((ArrayList)itemList); - } - } -- -- for (var12 = 1; var12 < 16; ++var12) -+ -+ for (Item item : Item.itemsList) - { -- this.itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, var12)); -+ if (item != null && !(item instanceof ItemBlock)) -+ { -+ item.addCreativeItems((ArrayList)itemList); -+ } - } - - Iterator var15 = EntityList.entityEggs.keySet().iterator(); diff --git a/patches/minecraft/net/minecraft/src/ContainerFurnace.java.patch b/patches/minecraft/net/minecraft/src/ContainerFurnace.java.patch deleted file mode 100644 index e5c448f456..0000000000 --- a/patches/minecraft/net/minecraft/src/ContainerFurnace.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ContainerFurnace.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ContainerFurnace.java 0000-00-00 00:00:00.000000000 -0000 -@@ -108,7 +108,7 @@ - } - else if (par1 != 1 && par1 != 0) - { -- if (FurnaceRecipes.smelting().getSmeltingResult(var4.getItem().shiftedIndex) != null) -+ if (FurnaceRecipes.smelting().getSmeltingResult(var4) != null) - { - if (!this.mergeItemStack(var4, 0, 1, false)) - { diff --git a/patches/minecraft/net/minecraft/src/CraftingManager.java.patch b/patches/minecraft/net/minecraft/src/CraftingManager.java.patch deleted file mode 100644 index 79d6c843b8..0000000000 --- a/patches/minecraft/net/minecraft/src/CraftingManager.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -242,7 +242,7 @@ - } - } - -- if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isDamageable()) -+ if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isRepairable()) - { - Item var11 = Item.itemsList[var3.itemID]; - int var10 = var11.getMaxDamage() - var3.getItemDamageForDisplay(); diff --git a/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch deleted file mode 100644 index 1e562af333..0000000000 --- a/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch +++ /dev/null @@ -1,149 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,10 +1,14 @@ - package net.minecraft.src; - - import java.util.ArrayList; -+import java.util.Hashtable; - import java.util.List; -+import java.util.Map.Entry; - import java.util.Random; - import org.lwjgl.opengl.GL11; - -+import net.minecraft.src.forge.*; -+ - public class EffectRenderer - { - /** Reference to the World object. */ -@@ -15,6 +19,8 @@ - /** RNG. */ - private Random rand = new Random(); - -+ private Hashtable> effectList = new Hashtable>(); -+ - public EffectRenderer(World par1World, RenderEngine par2RenderEngine) - { - if (par1World != null) -@@ -57,6 +63,24 @@ - } - } - } -+ -+ for (String key : effectList.keySet()) -+ { -+ ArrayList entry = effectList.get(key); -+ for (int y = 0; y < entry.size(); y++) -+ { -+ EntityFX var3 = entry.get(y); -+ var3.onUpdate(); -+ if (var3.isDead) -+ { -+ entry.remove(y--); -+ } -+ } -+ if (effectList.size() == 0) -+ { -+ effectList.remove(key); -+ } -+ } - } - - /** -@@ -109,6 +133,23 @@ - var10.draw(); - } - } -+ -+ Tessellator tessallator = Tessellator.instance; -+ -+ for (Entry> entry : effectList.entrySet()) -+ { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, renderer.getTexture(entry.getKey())); -+ tessallator.startDrawingQuads(); -+ for (EntityFX entryfx : entry.getValue()) -+ { -+ if (entryfx.getFXLayer() != 3) -+ { -+ tessallator.setBrightness(entryfx.getBrightnessForRender(par2)); -+ entryfx.renderParticle(tessallator, par2, var3, var7, var4, var5, var6); -+ } -+ } -+ tessallator.draw(); -+ } - } - - public void func_1187_b(Entity par1Entity, float par2) -@@ -141,6 +182,12 @@ - { - this.fxLayers[var2].clear(); - } -+ -+ for (ArrayList entry : effectList.values()) -+ { -+ entry.clear(); -+ } -+ effectList.clear(); - } - - public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) -@@ -160,7 +207,7 @@ - double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7; - double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7; - int var17 = this.rand.nextInt(6); -- this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_4041_a(par1, par2, par3)); -+ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_4041_a(par1, par2, par3), var6); - } - } - } -@@ -212,12 +259,49 @@ - var8 = (double)par1 + var6.maxX + (double)var7; - } - -- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_4041_a(par1, par2, par3).multiplyVelocity(0.2F).func_405_d(0.6F)); -+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_4041_a(par1, par2, par3).multiplyVelocity(0.2F).func_405_d(0.6F), var6); - } - } - - public String getStatistics() - { -- return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); -+ int size = 0; -+ for (List x : fxLayers) -+ { -+ size += x.size(); -+ } -+ for (ArrayList entry : effectList.values()) -+ { -+ size += entry.size(); -+ } -+ return Integer.toString(size); -+ } -+ -+ public void addEffect(EntityFX effect, Object effectObject) -+ { -+ if (effectObject == null || !(effect instanceof EntityDiggingFX || effect instanceof EntityBreakingFX)) -+ { -+ addEffect(effect); -+ return; -+ } -+ -+ String texture = "/terrain.png"; -+ if (effect.getFXLayer() == 0) -+ { -+ texture = "/particles.png"; -+ } -+ else if (effect.getFXLayer() == 2) -+ { -+ texture = "/gui/items.png"; -+ } -+ texture = ForgeHooksClient.getTexture(texture, effectObject); -+ -+ ArrayList set = effectList.get(texture); -+ if (set == null) -+ { -+ set = new ArrayList(); -+ effectList.put(texture, set); -+ } -+ set.add(effect); - } - } diff --git a/patches/minecraft/net/minecraft/src/Enchantment.java.patch b/patches/minecraft/net/minecraft/src/Enchantment.java.patch deleted file mode 100644 index 4b9d4dfad2..0000000000 --- a/patches/minecraft/net/minecraft/src/Enchantment.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000 -@@ -191,4 +191,14 @@ - String var2 = StatCollector.translateToLocal(this.getName()); - return var2 + " " + StatCollector.translateToLocal("enchantment.level." + par1); - } -+ -+ /** -+ * Called to determine if this enchantment can be applied to a ItemStack -+ * @param item The ItemStack that the enchantment might be put on -+ * @return True if the item is valid, false otherwise -+ */ -+ public boolean canEnchantItem(ItemStack item) -+ { -+ return type.canEnchantItem(item.getItem()); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/src/EnchantmentHelper.java.patch deleted file mode 100644 index c5b228dfa3..0000000000 --- a/patches/minecraft/net/minecraft/src/EnchantmentHelper.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000 -@@ -357,7 +357,7 @@ - { - Enchantment var7 = var4[var6]; - -- if (var7 != null && var7.type.canEnchantItem(var2)) -+ if (var7 != null && var7.canEnchantItem(par1ItemStack)) - { - for (int var8 = var7.getMinLevel(); var8 <= var7.getMaxLevel(); ++var8) - { diff --git a/patches/minecraft/net/minecraft/src/Entity.java.patch b/patches/minecraft/net/minecraft/src/Entity.java.patch deleted file mode 100644 index d5636f99c6..0000000000 --- a/patches/minecraft/net/minecraft/src/Entity.java.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.List; - import java.util.Random; - -@@ -173,6 +174,11 @@ - */ - public boolean ignoreFrustumCheck; - public boolean isAirBorne; -+ -+ /** Forge: Used to store custom data for each entity. */ -+ private NBTTagCompound customEntityData; -+ protected boolean captureDrops = false; -+ protected ArrayList capturedDrops = new ArrayList(); - - public Entity(World par1World) - { -@@ -214,6 +220,29 @@ - } - - protected abstract void entityInit(); -+ -+ /** -+ * Returns a NBTTagCompound that can be used to store custom data for this entity. -+ * It will be written, and read from disc, so it persists over world saves. -+ * @return A NBTTagCompound -+ */ -+ public NBTTagCompound getEntityData() -+ { -+ if (customEntityData == null) -+ { -+ customEntityData = new NBTTagCompound(); -+ } -+ return customEntityData; -+ } -+ -+ /** -+ * Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position. -+ * @return false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation. -+ */ -+ public boolean shouldRiderSit() -+ { -+ return true; -+ } - - public DataWatcher getDataWatcher() - { -@@ -1318,6 +1347,10 @@ - par1NBTTagCompound.setShort("Fire", (short)this.fire); - par1NBTTagCompound.setShort("Air", (short)this.getAir()); - par1NBTTagCompound.setBoolean("OnGround", this.onGround); -+ if (customEntityData != null) -+ { -+ par1NBTTagCompound.setCompoundTag("ForgeData", customEntityData); -+ } - this.writeEntityToNBT(par1NBTTagCompound); - } - -@@ -1359,6 +1392,10 @@ - this.onGround = par1NBTTagCompound.getBoolean("OnGround"); - this.setPosition(this.posX, this.posY, this.posZ); - this.setRotation(this.rotationYaw, this.rotationPitch); -+ if (par1NBTTagCompound.hasKey("ForgeData")) -+ { -+ customEntityData = par1NBTTagCompound.getCompoundTag("ForgeData"); -+ } - this.readEntityFromNBT(par1NBTTagCompound); - } - -@@ -1444,7 +1481,14 @@ - { - EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); - var3.delayBeforeCanPickup = 10; -- this.worldObj.spawnEntityInWorld(var3); -+ if (captureDrops) -+ { -+ capturedDrops.add(var3); -+ } -+ else -+ { -+ this.worldObj.spawnEntityInWorld(var3); -+ } - return var3; - } - -@@ -1717,7 +1761,7 @@ - */ - public boolean isRiding() - { -- return this.ridingEntity != null || this.getFlag(2); -+ return (this.ridingEntity != null && ridingEntity.shouldRiderSit()) || this.getFlag(2); - } - - /** diff --git a/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch deleted file mode 100644 index 707208bf2f..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,7 +2,7 @@ - - public class EntityEnderman extends EntityMob - { -- private static boolean[] canCarryBlocks = new boolean[256]; -+ private static boolean[] canCarryBlocks = new boolean[Block.blocksList.length]; - - /** Is the enderman attacking another entity? */ - public boolean isAttacking = false; diff --git a/patches/minecraft/net/minecraft/src/EntityItem.java.patch b/patches/minecraft/net/minecraft/src/EntityItem.java.patch deleted file mode 100644 index 9131373037..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityItem.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,8 @@ - - import cpw.mods.fml.client.FMLClientHandler; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class EntityItem extends Entity - { - /** The item stack of this EntityItem. */ -@@ -172,7 +174,21 @@ - if (!this.worldObj.isRemote) - { - int var2 = this.item.stackSize; -- -+ -+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(par1EntityPlayer, this)) -+ { -+ FMLClientHandler.instance().notifyItemPickup(this, par1EntityPlayer); -+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ par1EntityPlayer.onItemPickup(this, var2); -+ if (item.stackSize <= 0) -+ { -+ setDead(); -+ } -+ return; -+ } -+ -+ var2 = item.stackSize; -+ - if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(this.item)) - { - FMLClientHandler.instance().notifyItemPickup(this, par1EntityPlayer); diff --git a/patches/minecraft/net/minecraft/src/EntityLiving.java.patch b/patches/minecraft/net/minecraft/src/EntityLiving.java.patch deleted file mode 100644 index aac2f39b69..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityLiving.java.patch +++ /dev/null @@ -1,150 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - import java.util.List; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public abstract class EntityLiving extends Entity - { - public int heartsHalvesLife = 20; -@@ -59,7 +61,7 @@ - * in each step in the damage calculations, this is set to the 'carryover' that would result if someone was damaged - * .25 hearts (for example), and added to the damage in the next step - */ -- protected int carryoverDamage; -+ public int carryoverDamage; - - /** Number of ticks since this EntityLiving last produced its sound */ - private int livingSoundTime; -@@ -303,6 +305,7 @@ - public void setAttackTarget(EntityLiving par1EntityLiving) - { - this.attackTarget = par1EntityLiving; -+ ForgeHooks.onEntityLivingSetAttackTarget(this, par1EntityLiving); - } - - public boolean func_48100_a(Class par1Class) -@@ -359,6 +362,7 @@ - { - this.entityLivingToAttack = par1EntityLiving; - this.revengeTimer = this.entityLivingToAttack != null ? 60 : 0; -+ ForgeHooks.onEntityLivingSetAttackTarget(this, par1EntityLiving); - } - - protected void entityInit() -@@ -641,7 +645,12 @@ - * Called to update the entity's position/logic. - */ - public void onUpdate() -- { -+ { -+ if (ForgeHooks.onEntityLivingUpdate(this)) -+ { -+ return; -+ } -+ - super.onUpdate(); - - if (this.arrowHitTempCounter > 0) -@@ -834,6 +843,11 @@ - */ - public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) - { -+ if (ForgeHooks.onEntityLivingAttacked(this, par1DamageSource, par2)) -+ { -+ return false; -+ } -+ - if (this.worldObj.isRemote) - { - return false; -@@ -1012,6 +1026,12 @@ - */ - protected void damageEntity(DamageSource par1DamageSource, int par2) - { -+ par2 = ForgeHooks.onEntityLivingHurt(this, par1DamageSource, par2); -+ if (par2 == 0) -+ { -+ return; -+ } -+ - par2 = this.applyArmorCalculations(par1DamageSource, par2); - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - this.health -= par2; -@@ -1075,6 +1095,11 @@ - */ - public void onDeath(DamageSource par1DamageSource) - { -+ if (ForgeHooks.onEntityLivingDeath(this, par1DamageSource)) -+ { -+ return; -+ } -+ - Entity var2 = par1DamageSource.getEntity(); - - if (this.scoreValue >= 0 && var2 != null) -@@ -1098,13 +1123,17 @@ - var3 = EnchantmentHelper.getLootingModifier(((EntityPlayer)var2).inventory); - } - -+ captureDrops = true; -+ capturedDrops.clear(); -+ int var4 = 0; -+ - if (!this.isChild()) - { - this.dropFewItems(this.recentlyHit > 0, var3); - - if (this.recentlyHit > 0) - { -- int var4 = this.rand.nextInt(200) - var3; -+ var4 = this.rand.nextInt(200) - var3; - - if (var4 < 5) - { -@@ -1112,6 +1141,13 @@ - } - } - } -+ -+ captureDrops = false; -+ ForgeHooks.onEntityLivingDrops(this, par1DamageSource, capturedDrops, var3, recentlyHit > 0, var4); -+ for (EntityItem item : capturedDrops) -+ { -+ worldObj.spawnEntityInWorld(item); -+ } - } - - this.worldObj.setEntityState(this, (byte)3); -@@ -1155,6 +1191,11 @@ - */ - protected void fall(float par1) - { -+ if (ForgeHooks.onEntityLivingFall(this, par1)) -+ { -+ return; -+ } -+ - super.fall(par1); - int var2 = (int)Math.ceil((double)(par1 - 3.0F)); - -@@ -1342,7 +1383,7 @@ - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - int var4 = this.worldObj.getBlockId(var1, var2, var3); -- return var4 == Block.ladder.blockID || var4 == Block.vine.blockID; -+ return Block.blocksList[var4] != null && Block.blocksList[var4].isLadder(worldObj, var1, var2, var3); - } - - /** -@@ -1613,6 +1654,8 @@ - } - - this.isAirBorne = true; -+ -+ ForgeHooks.onEntityLivingJump(this); - } - - /** diff --git a/patches/minecraft/net/minecraft/src/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/src/EntityMinecart.java.patch deleted file mode 100644 index 97b0b58c10..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityMinecart.java.patch +++ /dev/null @@ -1,975 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,30 +1,50 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.List; - -+import net.minecraft.src.forge.*; -+ - public class EntityMinecart extends Entity implements IInventory - { - /** Array of item stacks stored in minecart (for storage minecarts). */ -- private ItemStack[] cargoItems; -- private int fuel; -- private boolean field_856_i; -+ protected ItemStack[] cargoItems; -+ protected int fuel; -+ protected boolean field_856_i; - - /** The type of minecart, 2 for powered, 1 for storage. */ - public int minecartType; - public double pushX; - public double pushZ; -- private static final int[][][] field_855_j = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; -+ protected static final int[][][] field_855_j = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; - - /** appears to be the progress of the turn */ -- private int turnProgress; -- private double minecartX; -- private double minecartY; -- private double minecartZ; -- private double minecartYaw; -- private double minecartPitch; -- private double velocityX; -- private double velocityY; -- private double velocityZ; -+ protected int turnProgress; -+ protected double minecartX; -+ protected double minecartY; -+ protected double minecartZ; -+ protected double minecartYaw; -+ protected double minecartPitch; -+ protected double velocityX; -+ protected double velocityY; -+ protected double velocityZ; -+ -+ /* Forge: Minecart Compatibility Layer Integration. */ -+ public static float defaultMaxSpeedRail = 0.4f; -+ public static float defaultMaxSpeedGround = 0.4f; -+ public static float defaultMaxSpeedAirLateral = 0.4f; -+ public static float defaultMaxSpeedAirVertical = -1f; -+ public static double defaultDragAir = 0.94999998807907104D; -+ protected boolean canUseRail = true; -+ protected boolean canBePushed = true; -+ private static IMinecartCollisionHandler collisionHandler = null; -+ -+ /* Instance versions of the above physics properties */ -+ protected float maxSpeedRail; -+ protected float maxSpeedGround; -+ protected float maxSpeedAirLateral; -+ protected float maxSpeedAirVertical; -+ protected double dragAir; - - public EntityMinecart(World par1World) - { -@@ -35,6 +55,18 @@ - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.7F); - this.yOffset = this.height / 2.0F; -+ -+ maxSpeedRail = defaultMaxSpeedRail; -+ maxSpeedGround = defaultMaxSpeedGround; -+ maxSpeedAirLateral = defaultMaxSpeedAirLateral; -+ maxSpeedAirVertical = defaultMaxSpeedAirVertical; -+ dragAir = defaultDragAir; -+ } -+ -+ public EntityMinecart(World world, int type) -+ { -+ this(world); -+ minecartType = type; - } - - /** -@@ -60,6 +92,10 @@ - */ - public AxisAlignedBB getCollisionBox(Entity par1Entity) - { -+ if (getCollisionHandler() != null) -+ { -+ return getCollisionHandler().getCollisionBox(this, par1Entity); -+ } - return par1Entity.boundingBox; - } - -@@ -68,6 +104,10 @@ - */ - public AxisAlignedBB getBoundingBox() - { -+ if (getCollisionHandler() != null) -+ { -+ return getCollisionHandler().getBoundingBox(this); -+ } - return null; - } - -@@ -76,7 +116,7 @@ - */ - public boolean canBePushed() - { -- return true; -+ return canBePushed; - } - - public EntityMinecart(World par1World, double par2, double par4, double par6, int par8) -@@ -120,48 +160,7 @@ - } - - this.setDead(); -- this.dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F); -- -- if (this.minecartType == 1) -- { -- EntityMinecart var3 = this; -- -- for (int var4 = 0; var4 < var3.getSizeInventory(); ++var4) -- { -- ItemStack var5 = var3.getStackInSlot(var4); -- -- if (var5 != null) -- { -- float var6 = this.rand.nextFloat() * 0.8F + 0.1F; -- float var7 = this.rand.nextFloat() * 0.8F + 0.1F; -- float var8 = this.rand.nextFloat() * 0.8F + 0.1F; -- -- while (var5.stackSize > 0) -- { -- int var9 = this.rand.nextInt(21) + 10; -- -- if (var9 > var5.stackSize) -- { -- var9 = var5.stackSize; -- } -- -- var5.stackSize -= var9; -- EntityItem var10 = new EntityItem(this.worldObj, this.posX + (double)var6, this.posY + (double)var7, this.posZ + (double)var8, new ItemStack(var5.itemID, var9, var5.getItemDamage())); -- float var11 = 0.05F; -- var10.motionX = (double)((float)this.rand.nextGaussian() * var11); -- var10.motionY = (double)((float)this.rand.nextGaussian() * var11 + 0.2F); -- var10.motionZ = (double)((float)this.rand.nextGaussian() * var11); -- this.worldObj.spawnEntityInWorld(var10); -- } -- } -- } -- -- this.dropItemWithOffset(Block.chest.blockID, 1, 0.0F); -- } -- else if (this.minecartType == 2) -- { -- this.dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F); -- } -+ dropCartAsItem(); - } - - return true; -@@ -254,7 +253,7 @@ - this.kill(); - } - -- if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) -+ if (this.isMinecartPowered() && this.rand.nextInt(4) == 0 && minecartType == 2 && getClass() == EntityMinecart.class) - { - this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); - } -@@ -309,49 +308,26 @@ - double var6 = 0.0078125D; - int var8 = this.worldObj.getBlockId(var1, var2, var3); - -- if (BlockRail.isRailBlock(var8)) -+ if (canUseRail() && BlockRail.isRailBlock(var8)) - { - Vec3D var9 = this.func_514_g(this.posX, this.posY, this.posZ); -- int var10 = this.worldObj.getBlockMetadata(var1, var2, var3); -+ int var10 = ((BlockRail)Block.blocksList[var8]).getBasicRailMetadata(worldObj, this, var1, var2, var3); - this.posY = (double)var2; - boolean var11 = false; - boolean var12 = false; - - if (var8 == Block.railPowered.blockID) - { -- var11 = (var10 & 8) != 0; -+ var11 = (worldObj.getBlockMetadata(var1, var2, var3) & 8) != 0; - var12 = !var11; - } - -- if (((BlockRail)Block.blocksList[var8]).isPowered()) -- { -- var10 &= 7; -- } -- - if (var10 >= 2 && var10 <= 5) - { - this.posY = (double)(var2 + 1); - } -- -- if (var10 == 2) -- { -- this.motionX -= var6; -- } -- -- if (var10 == 3) -- { -- this.motionX += var6; -- } -- -- if (var10 == 4) -- { -- this.motionZ += var6; -- } -- -- if (var10 == 5) -- { -- this.motionZ -= var6; -- } -+ -+ adjustSlopeVelocities(var10); - - int[][] var13 = field_855_j[var10]; - double var14 = (double)(var13[1][0] - var13[0][0]); -@@ -370,7 +346,7 @@ - this.motionZ = var22 * var16 / var18; - double var24; - -- if (var12) -+ if (var12 && shouldDoRailFunctions()) - { - var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - -@@ -420,36 +396,8 @@ - this.posX = var26 + var14 * var24; - this.posZ = var28 + var16 * var24; - this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); -- var34 = this.motionX; -- var36 = this.motionZ; -- -- if (this.riddenByEntity != null) -- { -- var34 *= 0.75D; -- var36 *= 0.75D; -- } -- -- if (var34 < -var4) -- { -- var34 = -var4; -- } -- -- if (var34 > var4) -- { -- var34 = var4; -- } -- -- if (var36 < -var4) -- { -- var36 = -var4; -- } -- -- if (var36 > var4) -- { -- var36 = var4; -- } -- -- this.moveEntity(var34, 0.0D, var36); -+ -+ moveMinecartOnRail(var1, var2, var3); - - if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[0][0] && MathHelper.floor_double(this.posZ) - var3 == var13[0][2]) - { -@@ -460,41 +408,7 @@ - this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); - } - -- if (this.riddenByEntity != null) -- { -- this.motionX *= 0.996999979019165D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.996999979019165D; -- } -- else -- { -- if (this.minecartType == 2) -- { -- var38 = (double)MathHelper.sqrt_double(this.pushX * this.pushX + this.pushZ * this.pushZ); -- -- if (var38 > 0.01D) -- { -- this.pushX /= var38; -- this.pushZ /= var38; -- double var40 = 0.04D; -- this.motionX *= 0.800000011920929D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.800000011920929D; -- this.motionX += this.pushX * var40; -- this.motionZ += this.pushZ * var40; -- } -- else -- { -- this.motionX *= 0.8999999761581421D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.8999999761581421D; -- } -- } -- -- this.motionX *= 0.9599999785423279D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.9599999785423279D; -- } -+ applyDragAndPushForces(); - - Vec3D var52 = this.func_514_g(this.posX, this.posY, this.posZ); - -@@ -523,30 +437,15 @@ - } - - double var41; -- -- if (this.minecartType == 2) -+ -+ updatePushForces(); -+ -+ if(shouldDoRailFunctions()) - { -- var41 = (double)MathHelper.sqrt_double(this.pushX * this.pushX + this.pushZ * this.pushZ); -- -- if (var41 > 0.01D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) -- { -- this.pushX /= var41; -- this.pushZ /= var41; -- -- if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) -- { -- this.pushX = 0.0D; -- this.pushZ = 0.0D; -- } -- else -- { -- this.pushX = this.motionX; -- this.pushZ = this.motionZ; -- } -- } -+ ((BlockRail)Block.blocksList[var8]).onMinecartPass(worldObj, this, var1, var2, var3); - } - -- if (var11) -+ if (var11 && shouldDoRailFunctions()) - { - var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - -@@ -582,41 +481,7 @@ - } - else - { -- if (this.motionX < -var4) -- { -- this.motionX = -var4; -- } -- -- if (this.motionX > var4) -- { -- this.motionX = var4; -- } -- -- if (this.motionZ < -var4) -- { -- this.motionZ = -var4; -- } -- -- if (this.motionZ > var4) -- { -- this.motionZ = var4; -- } -- -- if (this.onGround) -- { -- this.motionX *= 0.5D; -- this.motionY *= 0.5D; -- this.motionZ *= 0.5D; -- } -- -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -- -- if (!this.onGround) -- { -- this.motionX *= 0.949999988079071D; -- this.motionY *= 0.949999988079071D; -- this.motionZ *= 0.949999988079071D; -- } -+ moveMinecartOffRail(var1, var2, var3); - } - - this.rotationPitch = 0.0F; -@@ -652,7 +517,18 @@ - } - - this.setRotation(this.rotationYaw, this.rotationPitch); -- List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); -+ -+ AxisAlignedBB box = null; -+ if (getCollisionHandler() != null) -+ { -+ box = getCollisionHandler().getMinecartCollisionBox(this); -+ } -+ else -+ { -+ box = boundingBox.expand(0.2D, 0.0D, 0.2D); -+ } -+ -+ List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); - - if (var15 != null && var15.size() > 0) - { -@@ -677,17 +553,8 @@ - this.riddenByEntity = null; - } - -- if (this.fuel > 0) -- { -- --this.fuel; -- } -- -- if (this.fuel <= 0) -- { -- this.pushX = this.pushZ = 0.0D; -- } -- -- this.setMinecartPowered(this.fuel > 0); -+ updateFuel(); -+ ForgeHooks.onMinecartUpdate(this, var1, var2, var3); - } - } - -@@ -710,12 +577,7 @@ - } - else - { -- int var13 = this.worldObj.getBlockMetadata(var9, var10, var11); -- -- if (((BlockRail)Block.blocksList[var12]).isPowered()) -- { -- var13 &= 7; -- } -+ int var13 = ((BlockRail)Block.blocksList[var12]).getBasicRailMetadata(worldObj, this, var9, var10, var11); - - par3 = (double)var10; - -@@ -761,14 +623,9 @@ - - if (BlockRail.isRailBlock(var10)) - { -- int var11 = this.worldObj.getBlockMetadata(var7, var8, var9); -+ int var11 = ((BlockRail)Block.blocksList[var10]).getBasicRailMetadata(worldObj, this, var7, var8, var9); - par3 = (double)var8; - -- if (((BlockRail)Block.blocksList[var10]).isPowered()) -- { -- var11 &= 7; -- } -- - if (var11 >= 2 && var11 <= 5) - { - par3 = (double)(var8 + 1); -@@ -833,13 +690,14 @@ - { - par1NBTTagCompound.setInteger("Type", this.minecartType); - -- if (this.minecartType == 2) -+ if (isPoweredCart()) - { - par1NBTTagCompound.setDouble("PushX", this.pushX); - par1NBTTagCompound.setDouble("PushZ", this.pushZ); -- par1NBTTagCompound.setShort("Fuel", (short)this.fuel); -+ par1NBTTagCompound.setInteger("Fuel", this.fuel); - } -- else if (this.minecartType == 1) -+ -+ if (getSizeInventory() > 0) - { - NBTTagList var2 = new NBTTagList(); - -@@ -865,13 +723,21 @@ - { - this.minecartType = par1NBTTagCompound.getInteger("Type"); - -- if (this.minecartType == 2) -+ if (isPoweredCart()) - { - this.pushX = par1NBTTagCompound.getDouble("PushX"); - this.pushZ = par1NBTTagCompound.getDouble("PushZ"); -- this.fuel = par1NBTTagCompound.getShort("Fuel"); -+ try -+ { -+ this.fuel = par1NBTTagCompound.getInteger("Fuel"); -+ } -+ catch (ClassCastException e) -+ { -+ this.fuel = par1NBTTagCompound.getShort("Fuel"); -+ } - } -- else if (this.minecartType == 1) -+ -+ if (getSizeInventory() > 0) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.cargoItems = new ItemStack[this.getSizeInventory()]; -@@ -899,11 +765,18 @@ - */ - public void applyEntityCollision(Entity par1Entity) - { -+ ForgeHooks.onMinecartEntityCollision(this, par1Entity); -+ if (getCollisionHandler() != null) -+ { -+ getCollisionHandler().onEntityCollision(this, par1Entity); -+ return; -+ } -+ - if (!this.worldObj.isRemote) - { - if (par1Entity != this.riddenByEntity) - { -- if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.minecartType == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) -+ if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) - { - par1Entity.mountEntity(this); - } -@@ -949,7 +822,7 @@ - double var18 = par1Entity.motionX + this.motionX; - double var20 = par1Entity.motionZ + this.motionZ; - -- if (((EntityMinecart)par1Entity).minecartType == 2 && this.minecartType != 2) -+ if (((EntityMinecart)par1Entity).isPoweredCart() && !isPoweredCart()) - { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; -@@ -957,7 +830,7 @@ - par1Entity.motionX *= 0.949999988079071D; - par1Entity.motionZ *= 0.949999988079071D; - } -- else if (((EntityMinecart)par1Entity).minecartType != 2 && this.minecartType == 2) -+ else if (!((EntityMinecart)par1Entity).isPoweredCart() && isPoweredCart()) - { - par1Entity.motionX *= 0.20000000298023224D; - par1Entity.motionZ *= 0.20000000298023224D; -@@ -992,7 +865,7 @@ - */ - public int getSizeInventory() - { -- return 27; -+ return (minecartType == 1 && getClass() == EntityMinecart.class ? 27 : 0); - } - - /** -@@ -1095,7 +968,12 @@ - */ - public boolean interact(EntityPlayer par1EntityPlayer) - { -- if (this.minecartType == 0) -+ if (!ForgeHooks.onMinecartInteract(this, par1EntityPlayer)) -+ { -+ return true; -+ } -+ -+ if (canBeRidden()) - { - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) - { -@@ -1107,14 +985,14 @@ - par1EntityPlayer.mountEntity(this); - } - } -- else if (this.minecartType == 1) -+ else if (getSizeInventory() > 0) - { - if (!this.worldObj.isRemote) - { - par1EntityPlayer.displayGUIChest(this); - } - } -- else if (this.minecartType == 2) -+ else if (this.minecartType == 2 && getClass() == EntityMinecart.class) - { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - -@@ -1173,7 +1051,7 @@ - /** - * Is this minecart powered (Fuel > 0) - */ -- protected boolean isMinecartPowered() -+ public boolean isMinecartPowered() - { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } -@@ -1226,4 +1104,373 @@ - { - return this.dataWatcher.getWatchableObjectInt(18); - } -+ -+ /** -+ * Drops the cart as a item. The exact item dropped is defined by getItemDropped(). -+ */ -+ public void dropCartAsItem() -+ { -+ for(ItemStack item : getItemsDropped()) -+ { -+ entityDropItem(item, 0); -+ } -+ } -+ -+ /** -+ * Override this to define which items your cart drops when broken. -+ * This does not include items contained in the inventory, -+ * that is handled elsewhere. -+ * @return A list of items dropped. -+ */ -+ public List getItemsDropped() -+ { -+ List items = new ArrayList(); -+ items.add(new ItemStack(Item.minecartEmpty)); -+ -+ switch(minecartType) -+ { -+ case 1: -+ items.add(new ItemStack(Block.chest)); -+ break; -+ case 2: -+ items.add(new ItemStack(Block.stoneOvenIdle)); -+ break; -+ } -+ return items; -+ } -+ -+ /** -+ * This function returns an ItemStack that represents this cart. -+ * This should be an ItemStack that can be used by the player to place the cart. -+ * This is the item that was registered with the cart via the registerMinecart function, -+ * but is not necessary the item the cart drops when destroyed. -+ * @return An ItemStack that can be used to place the cart. -+ */ -+ public ItemStack getCartItem() -+ { -+ return MinecraftForge.getItemForCart(this); -+ } -+ -+ /** -+ * Returns true if this cart is self propelled. -+ * @return True if powered. -+ */ -+ public boolean isPoweredCart() -+ { -+ return minecartType == 2 && getClass() == EntityMinecart.class; -+ } -+ -+ /** -+ * Returns true if this cart is a storage cart -+ * Some carts may have inventories but not be storage carts -+ * and some carts without inventories may be storage carts. -+ * @return True if this cart should be classified as a storage cart. -+ */ -+ public boolean isStorageCart() -+ { -+ return minecartType == 1 && getClass() == EntityMinecart.class; -+ } -+ -+ /** -+ * Returns true if this cart can be ridden by an Entity. -+ * @return True if this cart can be ridden. -+ */ -+ public boolean canBeRidden() -+ { -+ if(minecartType == 0 && getClass() == EntityMinecart.class) -+ { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Returns true if this cart can currently use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @return True if the minecart can use rails. -+ */ -+ public boolean canUseRail() -+ { -+ return canUseRail; -+ } -+ -+ /** -+ * Set whether the minecart can use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @param use Whether the minecart can currently use rails. -+ */ -+ public void setCanUseRail(boolean use) -+ { -+ canUseRail = use; -+ } -+ -+ /** -+ * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails. -+ * @return True if this cart should call IRail.onMinecartPass(). -+ */ -+ public boolean shouldDoRailFunctions() -+ { -+ return true; -+ } -+ -+ /** -+ * Simply returns the minecartType variable. -+ * @return minecartType -+ */ -+ public int getMinecartType() -+ { -+ return minecartType; -+ } -+ -+ /** -+ * Gets the current global Minecart Collision handler if none -+ * is registered, returns null -+ * @return The collision handler or null -+ */ -+ public static IMinecartCollisionHandler getCollisionHandler() -+ { -+ return collisionHandler; -+ } -+ -+ /** -+ * Sets the global Minecart Collision handler, overwrites any -+ * that is currently set. -+ * @param handler The new handler -+ */ -+ public static void setCollisionHandler(IMinecartCollisionHandler handler) -+ { -+ collisionHandler = handler; -+ } -+ -+ /** -+ * Carts should return their drag factor here -+ * @return The drag rate. -+ */ -+ protected double getDrag() -+ { -+ return riddenByEntity != null ? 0.99D : 0.96D; -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code applies drag and updates push forces. -+ */ -+ protected void applyDragAndPushForces() -+ { -+ if(isPoweredCart()) -+ { -+ double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); -+ if(d27 > 0.01D) -+ { -+ pushX /= d27; -+ pushZ /= d27; -+ double d29 = 0.04; -+ motionX *= 0.8D; -+ motionY *= 0.0D; -+ motionZ *= 0.8D; -+ motionX += pushX * d29; -+ motionZ += pushZ * d29; -+ } else -+ { -+ motionX *= 0.9D; -+ motionY *= 0.0D; -+ motionZ *= 0.9D; -+ } -+ } -+ motionX *= getDrag(); -+ motionY *= 0.0D; -+ motionZ *= getDrag(); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code updates push forces. -+ */ -+ protected void updatePushForces() -+ { -+ if(isPoweredCart()) -+ { -+ double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); -+ if(push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) -+ { -+ pushX /= push; -+ pushZ /= push; -+ if(pushX * motionX + pushZ * motionZ < 0.0D) -+ { -+ pushX = 0.0D; -+ pushZ = 0.0D; -+ } else -+ { -+ pushX = motionX; -+ pushZ = motionZ; -+ } -+ } -+ } -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when on a rail. -+ */ -+ protected void moveMinecartOnRail(int i, int j, int k) -+ { -+ int id = worldObj.getBlockId(i, j, k); -+ if (!BlockRail.isRailBlock(id)) -+ { -+ return; -+ } -+ float railMaxSpeed = ((BlockRail)Block.blocksList[id]).getRailMaxSpeed(worldObj, this, i, j, k); -+ -+ double maxSpeed = Math.min(railMaxSpeed, getMaxSpeedRail()); -+ double mX = motionX; -+ double mZ = motionZ; -+ if(riddenByEntity != null) -+ { -+ mX *= 0.75D; -+ mZ *= 0.75D; -+ } -+ if(mX < -maxSpeed) mX = -maxSpeed; -+ if(mX > maxSpeed) mX = maxSpeed; -+ if(mZ < -maxSpeed) mZ = -maxSpeed; -+ if(mZ > maxSpeed) mZ = maxSpeed; -+ moveEntity(mX, 0.0D, mZ); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when not on a rail. -+ */ -+ protected void moveMinecartOffRail(int i, int j, int k) -+ { -+ double d2 = getMaxSpeedGround(); -+ if(!onGround) -+ { -+ d2 = getMaxSpeedAirLateral(); -+ } -+ if(motionX < -d2) motionX = -d2; -+ if(motionX > d2) motionX = d2; -+ if(motionZ < -d2) motionZ = -d2; -+ if(motionZ > d2) motionZ = d2; -+ double moveY = motionY; -+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) -+ { -+ moveY = getMaxSpeedAirVertical(); -+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) -+ { -+ moveY = 0.15f; -+ motionY = moveY; -+ } -+ } -+ if(onGround) -+ { -+ motionX *= 0.5D; -+ motionY *= 0.5D; -+ motionZ *= 0.5D; -+ } -+ moveEntity(motionX, moveY, motionZ); -+ if(!onGround) -+ { -+ motionX *= getDragAir(); -+ motionY *= getDragAir(); -+ motionZ *= getDragAir(); -+ } -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code applies fuel consumption. -+ */ -+ protected void updateFuel() -+ { -+ if (fuel > 0) fuel--; -+ if (fuel <= 0) pushX = pushZ = 0.0D; -+ setMinecartPowered(fuel > 0); -+ } -+ -+ /** -+ * Moved to allow overrides, This code handle slopes affecting velocity. -+ * @param metadata The blocks position metadata -+ */ -+ protected void adjustSlopeVelocities(int metadata) -+ { -+ double acceleration = 0.0078125D; -+ if (metadata == 2) -+ { -+ motionX -= acceleration; -+ } -+ else if (metadata == 3) -+ { -+ motionX += acceleration; -+ } -+ else if (metadata == 4) -+ { -+ motionZ += acceleration; -+ } -+ else if (metadata == 5) -+ { -+ motionZ -= acceleration; -+ } -+ } -+ -+ /** -+ * Getters/setters for physics variables -+ */ -+ -+ /** -+ * Returns the carts max speed. -+ * Carts going faster than 1.1 cause issues with chunk loading. -+ * Carts cant traverse slopes or corners at greater than 0.5 - 0.6. -+ * This value is compared with the rails max speed to determine -+ * the carts current max speed. A normal rails max speed is 0.4. -+ * @return Carts max speed. -+ */ -+ public float getMaxSpeedRail() -+ { -+ return maxSpeedRail; -+ } -+ -+ public void setMaxSpeedRail(float value) -+ { -+ maxSpeedRail = value; -+ } -+ -+ public float getMaxSpeedGround() -+ { -+ return maxSpeedGround; -+ } -+ -+ public void setMaxSpeedGround(float value) -+ { -+ maxSpeedGround = value; -+ } -+ -+ public float getMaxSpeedAirLateral() -+ { -+ return maxSpeedAirLateral; -+ } -+ -+ public void setMaxSpeedAirLateral(float value) -+ { -+ maxSpeedAirLateral = value; -+ } -+ -+ public float getMaxSpeedAirVertical() -+ { -+ return maxSpeedAirVertical; -+ } -+ -+ public void setMaxSpeedAirVertical(float value) -+ { -+ maxSpeedAirVertical = value; -+ } -+ -+ public double getDragAir() -+ { -+ return dragAir; -+ } -+ -+ public void setDragAir(double value) -+ { -+ dragAir = value; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/src/EntityMooshroom.java.patch deleted file mode 100644 index 0be66a01b3..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityMooshroom.java.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,10 @@ - package net.minecraft.src; - --public class EntityMooshroom extends EntityCow -+import java.util.ArrayList; -+ -+import net.minecraft.src.forge.IShearable; -+ -+public class EntityMooshroom extends EntityCow implements IShearable - { - public EntityMooshroom(World par1World) - { -@@ -30,32 +34,7 @@ - return true; - } - } -- -- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0) -- { -- this.setDead(); -- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); -- -- if (!this.worldObj.isRemote) -- { -- EntityCow var3 = new EntityCow(this.worldObj); -- var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); -- var3.setEntityHealth(this.getHealth()); -- var3.renderYawOffset = this.renderYawOffset; -- this.worldObj.spawnEntityInWorld(var3); -- -- for (int var4 = 0; var4 < 5; ++var4) -- { -- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed))); -- } -- } -- -- return true; -- } -- else -- { -- return super.interact(par1EntityPlayer); -- } -+ return super.interact(par1EntityPlayer); - } - - /** -@@ -65,4 +44,29 @@ - { - return new EntityMooshroom(this.worldObj); - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) -+ { -+ return getGrowingAge() >= 0; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) -+ { -+ setDead(); -+ EntityCow entitycow = new EntityCow(worldObj); -+ entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); -+ entitycow.setEntityHealth(getHealth()); -+ entitycow.renderYawOffset = renderYawOffset; -+ worldObj.spawnEntityInWorld(entitycow); -+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); -+ -+ ArrayList ret = new ArrayList(); -+ for (int x = 0; x < 5; x++) -+ { -+ ret.add(new ItemStack(Block.mushroomRed)); -+ } -+ return ret; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/src/EntityOcelot.java.patch deleted file mode 100644 index 350405b261..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityOcelot.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityOcelot.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityOcelot.java 0000-00-00 00:00:00.000000000 -0000 -@@ -321,7 +321,8 @@ - - int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3); - -- if (var4 == Block.grass.blockID || var4 == Block.leaves.blockID) -+ Block block = Block.blocksList[var4]; -+ if (var4 == Block.grass.blockID || (block != null && block.isLeaves(worldObj, var1, var2 - 1, var3))) - { - return true; - } diff --git a/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch deleted file mode 100644 index 3cb4582d18..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch +++ /dev/null @@ -1,246 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -7,6 +7,8 @@ - import cpw.mods.fml.common.FMLCommonHandler; - import cpw.mods.fml.common.TickType; - -+import net.minecraft.src.forge.*; -+ - public abstract class EntityPlayer extends EntityLiving - { - /** Inventory of the player */ -@@ -215,6 +217,7 @@ - } - else - { -+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount); - if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) - { - this.updateItemUse(var1, 5); -@@ -624,7 +627,16 @@ - */ - public EntityItem dropOneItem() - { -- return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, 1), false); -+ ItemStack stack = inventory.getCurrentItem(); -+ if (stack == null) -+ { -+ return null; -+ } -+ if (stack.getItem().onDroppedByPlayer(stack, this)) -+ { -+ return dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false); -+ } -+ return null; - } - - /** -@@ -690,14 +702,22 @@ - - /** - * Returns how strong the player is against the specified block at this moment -+ * Deprecated in favor of the metadata-sensitive version - */ -+ @Deprecated - public float getCurrentPlayerStrVsBlock(Block par1Block) - { -- float var2 = this.inventory.getStrVsBlock(par1Block); -+ return getCurrentPlayerStrVsBlock(par1Block, 0); -+ } -+ -+ public float getCurrentPlayerStrVsBlock(Block par1Block, int meta) -+ { -+ ItemStack stack = inventory.getCurrentItem(); -+ float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta)); - float var3 = var2; - int var4 = EnchantmentHelper.getEfficiencyModifier(this.inventory); - -- if (var4 > 0 && this.inventory.canHarvestBlock(par1Block)) -+ if (var4 > 0 && ForgeHooks.canHarvestBlock(par1Block, this, meta)) - { - var3 = var2 + (float)(var4 * var4 + 1); - } -@@ -984,12 +1004,22 @@ - */ - protected void damageEntity(DamageSource par1DamageSource, int par2) - { -+ par2 = ForgeHooks.onEntityLivingHurt(this, par1DamageSource, par2); -+ if (par2 == 0) -+ { -+ return; -+ } -+ - if (!par1DamageSource.isUnblockable() && this.isBlocking()) - { - par2 = 1 + par2 >> 1; - } - -- par2 = this.applyArmorCalculations(par1DamageSource, par2); -+ par2 = ArmorProperties.ApplyArmor(this, inventory.armorInventory, par1DamageSource, par2); -+ if (par2 <= 0) -+ { -+ return; -+ } - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - this.addExhaustion(par1DamageSource.getHungerDamage()); - this.health -= par2; -@@ -1020,6 +1050,10 @@ - */ - public void useCurrentItemOnEntity(Entity par1Entity) - { -+ if (!ForgeHooks.onEntityInteract(this, par1Entity, false)) -+ { -+ return; -+ } - if (!par1Entity.interact(this)) - { - ItemStack var2 = this.getCurrentEquippedItem(); -@@ -1050,7 +1084,9 @@ - */ - public void destroyCurrentEquippedItem() - { -+ ItemStack orig = inventory.getCurrentItem(); - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); -+ ForgeHooks.onDestroyCurrentItem(this, orig); - } - - /** -@@ -1079,6 +1115,15 @@ - */ - public void attackTargetEntityWithCurrentItem(Entity par1Entity) - { -+ if (!ForgeHooks.onEntityInteract(this, par1Entity, true)) -+ { -+ return; -+ } -+ ItemStack stack = getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onLeftClickEntity(stack, this, par1Entity)) -+ { -+ return; -+ } - if (par1Entity.canAttackWithItem()) - { - int var2 = this.inventory.getDamageVsEntity(par1Entity); -@@ -1221,6 +1266,12 @@ - */ - public EnumStatus sleepInBedAt(int par1, int par2, int par3) - { -+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, par1, par2, par3); -+ if (customSleep != null) -+ { -+ return customSleep; -+ } -+ - if (!this.worldObj.isRemote) - { - if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1260,6 +1311,11 @@ - { - int var9 = this.worldObj.getBlockMetadata(par1, par2, par3); - int var5 = BlockBed.getDirection(var9); -+ Block block = Block.blocksList[worldObj.getBlockId(par1, par2, par3)]; -+ if (block != null) -+ { -+ var5 = block.getBedDirection(worldObj, par1, par2, par3); -+ } - float var10 = 0.5F; - float var7 = 0.5F; - -@@ -1329,11 +1385,12 @@ - this.resetHeight(); - ChunkCoordinates var4 = this.playerLocation; - ChunkCoordinates var5 = this.playerLocation; -+ Block block = (var4 == null ? null : Block.blocksList[worldObj.getBlockId(var4.posX, var4.posY, var4.posZ)]); - -- if (var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) -+ if (var4 != null && block != null && block.isBed(worldObj, var4.posX, var4.posY, var4.posZ, this)) - { -- BlockBed.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, false); -- var5 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, var4.posX, var4.posY, var4.posZ, 0); -+ block.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, this, false); -+ var5 = block.getBedSpawnPosition(worldObj, var4.posX, var4.posY, var4.posZ, this); - - if (var5 == null) - { -@@ -1370,7 +1427,9 @@ - */ - private boolean isInBed() - { -- return this.worldObj.getBlockId(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Block.bed.blockID; -+ ChunkCoordinates c = playerLocation; -+ int blockID = worldObj.getBlockId(c.posX, c.posY, c.posZ); -+ return Block.blocksList[blockID] != null && Block.blocksList[blockID].isBed(worldObj, c.posX, c.posY, c.posZ, this); - } - - /** -@@ -1385,13 +1444,15 @@ - var2.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - var2.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - -- if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) != Block.bed.blockID) -+ ChunkCoordinates c = par1ChunkCoordinates; -+ Block block = Block.blocksList[par0World.getBlockId(c.posX, c.posY, c.posZ)]; -+ if (block == null || !block.isBed(par0World, c.posX, c.posY, c.posZ, null)) - { - return null; - } - else - { -- ChunkCoordinates var3 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); -+ ChunkCoordinates var3 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null); - return var3; - } - } -@@ -1403,8 +1464,11 @@ - { - if (this.playerLocation != null) - { -- int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); -- int var2 = BlockBed.getDirection(var1); -+ int x = playerLocation.posX; -+ int y = playerLocation.posY; -+ int z = playerLocation.posZ; -+ Block block = Block.blocksList[worldObj.getBlockId(x, y, z)]; -+ int var2 = (block == null ? 0 : block.getBedDirection(worldObj, x, y, z)); - - switch (var2) - { -@@ -1694,6 +1758,7 @@ - return 101; - } - } -+ var3 = par1ItemStack.getItem().getIconIndex(par1ItemStack, par2, this, itemInUse, itemInUseCount); - } - - return var3; -@@ -1866,4 +1931,30 @@ - } - - public void func_50009_aI() {} -+ -+ /** -+ * Opens a Gui for the player. -+ * -+ * @param mod The mod associated with the gui -+ * @param ID The ID number for the Gui -+ * @param world The World -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ */ -+ public void openGui(BaseMod mod, int ID, World world, int x, int y, int z) -+ { -+ if (this instanceof EntityPlayerSP) -+ { -+ IGuiHandler handler = MinecraftForge.getGuiHandler(mod); -+ if (handler != null) -+ { -+ GuiScreen screen = (GuiScreen)handler.getGuiElement(ID, this, world, x, y, z); -+ if (screen != null) -+ { -+ ModLoader.getMinecraftInstance().displayGuiScreen(screen); -+ } -+ } -+ } -+ } - } diff --git a/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch deleted file mode 100644 index 85e093ea5a..0000000000 --- a/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch +++ /dev/null @@ -1,97 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,6 +5,8 @@ - import java.util.List; - import java.util.Random; - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooksClient; -+ - import org.lwjgl.input.Mouse; - import org.lwjgl.opengl.Display; - import org.lwjgl.opengl.GL11; -@@ -287,8 +289,15 @@ - */ - private void updateFovModifierHand() - { -- EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; -- this.fovMultiplierTemp = var1.getFOVMultiplier(); -+ if (mc.renderViewEntity instanceof EntityPlayerSP) -+ { -+ EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; -+ this.fovMultiplierTemp = var1.getFOVMultiplier(); -+ } -+ else -+ { -+ this.fovMultiplierTemp = mc.thePlayer.getFOVMultiplier(); -+ } - this.fovModifierHandPrev = this.fovModifierHand; - this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; - } -@@ -304,7 +313,7 @@ - } - else - { -- EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity; -+ EntityLiving var3 = (EntityLiving)this.mc.renderViewEntity; - float var4 = 70.0F; - - if (par2) -@@ -391,12 +400,14 @@ - - if (!this.mc.gameSettings.debugCamEnable) - { -- int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -- -- if (var10 == Block.bed.blockID) -+ int x = MathHelper.floor_double(var2.posX); -+ int y = MathHelper.floor_double(var2.posY); -+ int z = MathHelper.floor_double(var2.posZ); -+ Block block = Block.blocksList[mc.theWorld.getBlockId(x, y, z)]; -+ -+ if (block != null && block.isBed(mc.theWorld, x, y, z, var2)) - { -- int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -- int var12 = var11 & 3; -+ int var12 = block.getBedDirection(mc.theWorld, x, y, z); - GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F); - } - -@@ -1095,8 +1106,11 @@ - var20 = (EntityPlayer)var4; - GL11.glDisable(GL11.GL_ALPHA_TEST); - Profiler.endStartSection("outline"); -- var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -- var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ if (!ForgeHooksClient.onBlockHighlight(var5, var20, mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1)) -+ { -+ var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ } - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - } -@@ -1160,8 +1174,12 @@ - var20 = (EntityPlayer)var4; - GL11.glDisable(GL11.GL_ALPHA_TEST); - Profiler.endStartSection("outline"); -- var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -- var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ -+ if (!ForgeHooksClient.onBlockHighlight(var5, var20, mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1)) -+ { -+ var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1); -+ } - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - -@@ -1185,6 +1203,9 @@ - this.setupFog(1, par1); - GL11.glPopMatrix(); - } -+ -+ Profiler.endStartSection("fhooks"); -+ ForgeHooksClient.onRenderWorldLast(var5, par1); - - Profiler.endStartSection("hand"); - diff --git a/patches/minecraft/net/minecraft/src/EntitySheep.java.patch b/patches/minecraft/net/minecraft/src/EntitySheep.java.patch deleted file mode 100644 index 47a484a3ec..0000000000 --- a/patches/minecraft/net/minecraft/src/EntitySheep.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/EntitySheep.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/EntitySheep.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class EntitySheep extends EntityAnimal -+import net.minecraft.src.forge.IShearable; -+ -+public class EntitySheep extends EntityAnimal implements IShearable - { - /** - * Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. -@@ -129,27 +132,6 @@ - */ - public boolean interact(EntityPlayer par1EntityPlayer) - { -- ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -- -- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && !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); -- } -- - return super.interact(par1EntityPlayer); - } - -@@ -282,4 +264,23 @@ - this.setGrowingAge(var1); - } - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) -+ { -+ return !getSheared() && !isChild(); -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ setSheared(true); -+ int i = 1 + rand.nextInt(3); -+ for (int j = 0; j < i; j++) -+ { -+ ret.add(new ItemStack(Block.cloth.blockID, 1, getFleeceColor())); -+ } -+ return ret; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/Explosion.java.patch b/patches/minecraft/net/minecraft/src/Explosion.java.patch deleted file mode 100644 index a58ae71784..0000000000 --- a/patches/minecraft/net/minecraft/src/Explosion.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - import java.util.Random; - import java.util.Set; - -+import net.minecraft.src.forge.ISpecialResistance; -+ - public class Explosion - { - /** whether or not the explosion sets fire to blocks around it */ -@@ -72,7 +74,15 @@ - - if (var25 > 0) - { -- var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21; -+ if (Block.blocksList[var25] instanceof ISpecialResistance) -+ { -+ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[var25]; -+ var14 -= (isr.getSpecialExplosionResistance(worldObj, var22, var23, var24, explosionX, explosionY, explosionZ, exploder) + 0.3F) * var21; -+ } -+ else -+ { -+ var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21; -+ } - } - - if (var14 > 0.0F) diff --git a/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch deleted file mode 100644 index 999216541c..0000000000 --- a/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.Arrays; - import java.util.HashMap; - import java.util.Map; - -@@ -9,6 +10,7 @@ - - /** The list of smelting results. */ - private Map smeltingList = new HashMap(); -+ private Map metaSmeltingList = new HashMap(); - - /** - * Used to call methods addSmelting and getSmeltingResult. -@@ -47,7 +49,9 @@ - - /** - * Returns the smelting result of an item. -+ * Deprecated in favor of a metadata sensitive version - */ -+ @Deprecated - public ItemStack getSmeltingResult(int par1) - { - return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); -@@ -57,4 +61,34 @@ - { - return this.smeltingList; - } -+ -+ /** -+ * Add a metadata-sensitive furnace recipe -+ * @param itemID The Item ID -+ * @param metadata The Item Metadata -+ * @param itemstack The ItemStack for the result -+ */ -+ public void addSmelting(int itemID, int metadata, ItemStack itemstack) -+ { -+ metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); -+ } -+ -+ /** -+ * Used to get the resulting ItemStack form a source ItemStack -+ * @param item The Source ItemStack -+ * @return The result ItemStack -+ */ -+ public ItemStack getSmeltingResult(ItemStack item) -+ { -+ if (item == null) -+ { -+ return null; -+ } -+ ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); -+ if (ret != null) -+ { -+ return ret; -+ } -+ return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/GuiAchievements.java.patch b/patches/minecraft/net/minecraft/src/GuiAchievements.java.patch deleted file mode 100644 index c1249e2262..0000000000 --- a/patches/minecraft/net/minecraft/src/GuiAchievements.java.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/GuiAchievements.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/GuiAchievements.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,11 @@ - package net.minecraft.src; - -+import java.util.LinkedList; -+import java.util.List; - import java.util.Random; -+ -+import net.minecraft.src.forge.MinecraftForge; -+ - import org.lwjgl.input.Mouse; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -@@ -40,6 +45,10 @@ - /** Whether the Mouse Button is down or not */ - private int isMouseButtonDown = 0; - private StatFileWriter statFileWriter; -+ -+ private int currentPage = -1; -+ private GuiSmallButton button; -+ private LinkedList minecraftAchievements = new LinkedList(); - - public GuiAchievements(StatFileWriter par1StatFileWriter) - { -@@ -48,6 +57,15 @@ - short var3 = 141; - this.field_27116_m = this.guiMapX = this.field_27112_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12); - this.field_27115_n = this.guiMapY = this.field_27111_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2); -+ -+ minecraftAchievements.clear(); -+ for (Object achievement : AchievementList.achievementList) -+ { -+ if (!MinecraftForge.isAchievementInPages((Achievement)achievement)) -+ { -+ minecraftAchievements.add((Achievement)achievement); -+ } -+ } - } - - /** -@@ -57,6 +75,8 @@ - { - this.controlList.clear(); - this.controlList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, StatCollector.translateToLocal("gui.done"))); -+ button = new GuiSmallButton(2, (width - achievementsPaneWidth) / 2 + 24, height / 2 + 74, 125, 20, getAchievementPageTitle(currentPage)); -+ this.controlList.add(button); - } - - /** -@@ -69,6 +89,16 @@ - this.mc.displayGuiScreen((GuiScreen)null); - this.mc.setIngameFocus(); - } -+ -+ if (par1GuiButton.id == 2) -+ { -+ currentPage++; -+ if (currentPage >= MinecraftForge.getAchievementPages().size()) -+ { -+ currentPage = -1; -+ } -+ button.displayString = getAchievementPageTitle(currentPage); -+ } - - super.actionPerformed(par1GuiButton); - } -@@ -289,11 +319,12 @@ - int var27; - int var30; - -- for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22) -+ List achievementList = (currentPage == -1 ? minecraftAchievements : MinecraftForge.getAchievementPage(currentPage).getAchievements()); -+ for (var22 = 0; var22 < achievementList.size(); ++var22) - { -- Achievement var33 = (Achievement)AchievementList.achievementList.get(var22); -+ Achievement var33 = achievementList.get(var22); - -- if (var33.parentAchievement != null) -+ if (var33.parentAchievement != null && achievementList.contains(var33.parentAchievement)) - { - var24 = var33.displayColumn * 24 - var4 + 11 + var10; - var25 = var33.displayRow * 24 - var5 + 11 + var11; -@@ -327,9 +358,9 @@ - int var42; - int var41; - -- for (var24 = 0; var24 < AchievementList.achievementList.size(); ++var24) -+ for (var24 = 0; var24 < achievementList.size(); ++var24) - { -- Achievement var35 = (Achievement)AchievementList.achievementList.get(var24); -+ Achievement var35 = achievementList.get(var24); - var26 = var35.displayColumn * 24 - var4; - var27 = var35.displayRow * 24 - var5; - -@@ -453,4 +484,12 @@ - { - return true; - } -+ -+ /** -+ * FORGE: Gets the name for an achievement page by its index -+ */ -+ public static String getAchievementPageTitle(int index) -+ { -+ return index == -1 ? "Minecraft" : MinecraftForge.getAchievementPage(index).getName(); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/GuiControls.java.patch b/patches/minecraft/net/minecraft/src/GuiControls.java.patch deleted file mode 100644 index bd0a90a637..0000000000 --- a/patches/minecraft/net/minecraft/src/GuiControls.java.patch +++ /dev/null @@ -1,144 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.GuiControlsScrollPanel; -+ - public class GuiControls extends GuiScreen - { - /** -@@ -15,6 +17,8 @@ - - /** The ID of the button that has been pressed. */ - private int buttonId = -1; -+ -+ private GuiControlsScrollPanel scrollPane; - - public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) - { -@@ -32,15 +36,12 @@ - */ - public void initGui() - { -+ scrollPane = new GuiControlsScrollPanel(this, options, mc); - StringTranslate var1 = StringTranslate.getInstance(); - int var2 = this.func_20080_j(); - -- for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3) -- { -- this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3))); -- } -- -- this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done"))); -+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, var1.translateKey("gui.done"))); -+ scrollPane.registerScrollButtons(controlList, 7, 8); - this.screenTitle = var1.translateKey("controls.title"); - } - -@@ -49,20 +50,10 @@ - */ - protected void actionPerformed(GuiButton par1GuiButton) - { -- for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) -- { -- ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2); -- } -- - if (par1GuiButton.id == 200) - { - this.mc.displayGuiScreen(this.parentScreen); - } -- else -- { -- this.buttonId = par1GuiButton.id; -- par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; -- } - } - - /** -@@ -70,17 +61,7 @@ - */ - protected void mouseClicked(int par1, int par2, int par3) - { -- if (this.buttonId >= 0) -- { -- this.options.setKeyBinding(this.buttonId, -100 + par3); -- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); -- this.buttonId = -1; -- KeyBinding.resetKeyBindingArrayAndHash(); -- } -- else -- { -- super.mouseClicked(par1, par2, par3); -- } -+ super.mouseClicked(par1, par2, par3); - } - - /** -@@ -88,14 +69,7 @@ - */ - protected void keyTyped(char par1, int par2) - { -- if (this.buttonId >= 0) -- { -- this.options.setKeyBinding(this.buttonId, par2); -- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); -- this.buttonId = -1; -- KeyBinding.resetKeyBindingArrayAndHash(); -- } -- else -+ if (scrollPane.keyTyped(par1, par2)) - { - super.keyTyped(par1, par2); - } -@@ -107,47 +81,8 @@ - public void drawScreen(int par1, int par2, float par3) - { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); -- int var4 = this.func_20080_j(); -- int var5 = 0; -- -- while (var5 < this.options.keyBindings.length) -- { -- boolean var6 = false; -- int var7 = 0; -- -- while (true) -- { -- if (var7 < this.options.keyBindings.length) -- { -- if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode) -- { -- ++var7; -- continue; -- } -- -- var6 = true; -- } -- -- if (this.buttonId == var5) -- { -- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<"; -- } -- else if (var6) -- { -- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5); -- } -- else -- { -- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5); -- } -- -- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); -- ++var5; -- break; -- } -- } -- -+ scrollPane.drawScreen(par1, par2, par3); -+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff); - super.drawScreen(par1, par2, par3); - } - } diff --git a/patches/minecraft/net/minecraft/src/GuiIngame.java.patch b/patches/minecraft/net/minecraft/src/GuiIngame.java.patch deleted file mode 100644 index dd83c48095..0000000000 --- a/patches/minecraft/net/minecraft/src/GuiIngame.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000 -@@ -9,6 +9,8 @@ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+import net.minecraft.src.forge.*; -+ - public class GuiIngame extends Gui - { - private static RenderItem itemRenderer = new RenderItem(); -@@ -142,7 +144,19 @@ - - var46 = var7 - 39; - var22 = var46 - 10; -- var23 = this.mc.thePlayer.getTotalArmorValue(); -+ var23 = 0; -+ for (int x = 0; x < mc.thePlayer.inventory.armorInventory.length; x++) -+ { -+ ItemStack stack = mc.thePlayer.inventory.armorInventory[x]; -+ if (stack != null && stack.getItem() instanceof ISpecialArmor) -+ { -+ var23 += ((ISpecialArmor)stack.getItem()).getArmorDisplay(mc.thePlayer, stack, x); -+ } -+ else if (stack != null && stack.getItem() instanceof ItemArmor) -+ { -+ var23 += ((ItemArmor)stack.getItem()).damageReduceAmount; -+ } -+ } - int var24 = -1; - - if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) diff --git a/patches/minecraft/net/minecraft/src/Item.java.patch b/patches/minecraft/net/minecraft/src/Item.java.patch deleted file mode 100644 index 99ce28209a..0000000000 --- a/patches/minecraft/net/minecraft/src/Item.java.patch +++ /dev/null @@ -1,234 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,9 +1,12 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.List; - import java.util.Random; - --public class Item -+import net.minecraft.src.forge.ITextureProvider; -+ -+public class Item implements ITextureProvider - { - /** The RNG used by the Item subclasses. */ - protected static Random itemRand = new Random(); -@@ -188,14 +191,17 @@ - - /** full name of item from language file */ - private String itemName; -- -+ -+ /** FORGE: To disable repair recipes. */ -+ protected boolean canRepair = true; -+ - protected Item(int par1) - { - this.shiftedIndex = 256 + par1; - - if (itemsList[256 + par1] != null) - { -- System.out.println("CONFLICT @ " + par1); -+ System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this); - } - - itemsList[256 + par1] = this; -@@ -551,7 +557,7 @@ - float var17 = MathHelper.sin(-var5 * 0.017453292F); - float var18 = var15 * var16; - float var20 = var14 * var16; -- double var21 = 5.0D; -+ double var21 = ModLoader.getMinecraftInstance().playerController.getBlockReachDistance(); - Vec3D var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); - MovingObjectPosition var24 = par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); - return var24; -@@ -579,4 +585,188 @@ - { - StatList.initStats(); - } -+ -+ /* =========================================================== FORGE START ===============================================================*/ -+ public boolean isDefaultTexture = true; -+ private String currentTexture = "/gui/items.png"; -+ /** -+ * Called when a new CreativeContainer is opened, populate the list -+ * with all of the items for this item you want a player in creative mode -+ * to have access to. -+ * -+ * @param itemList The list of items currently in the creative inventory -+ */ -+ public void addCreativeItems(ArrayList itemList) -+ { -+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex) -+ { -+ itemList.add(new ItemStack(this, 1)); -+ } -+ } -+ -+ /** -+ * Called when a player drops the item into the world, -+ * returning false from this will prevent the item from -+ * being removed from the players inventory and spawning -+ * in the world -+ * -+ * @param player The player that dropped the item -+ * @param item The item stack, before the item is removed. -+ */ -+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) -+ { -+ return true; -+ } -+ -+ /** -+ * This is called when the item is used, before the block is activated. -+ * @param stack The Item Stack -+ * @param player The Player that used the item -+ * @param world The Current World -+ * @param X Target X Position -+ * @param Y Target Y Position -+ * @param Z Target Z Position -+ * @param side The side of the target hit -+ * @return Return true to prevent any further processing. -+ */ -+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side) -+ { -+ return false; -+ } -+ -+ /** -+ * Metadata-sensitive version of getStrVsBlock -+ * @param itemstack The Item Stack -+ * @param block The block the item is trying to break -+ * @param metadata The items current metadata -+ * @return The damage strength -+ */ -+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata) -+ { -+ return getStrVsBlock(itemstack, block); -+ } -+ -+ /** -+ * Called by CraftingManager to determine if an item is reparable. -+ * @return True if reparable -+ */ -+ public boolean isRepairable() -+ { -+ return canRepair && isDamageable(); -+ } -+ -+ /** -+ * Call to disable repair recipes. -+ * @return The current Item instance -+ */ -+ public Item setNoRepair() -+ { -+ canRepair = false; -+ return this; -+ } -+ -+ /** -+ * Called before a block is broken. Return true to prevent default block harvesting. -+ * -+ * Note: In SMP, this is called on both client and server sides! -+ * -+ * @param itemstack The current ItemStack -+ * @param X The X Position -+ * @param Y The X Position -+ * @param Z The X Position -+ * @param player The Player that is wielding the item -+ * @return True to prevent harvesting, false to continue as normal -+ */ -+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) -+ { -+ return false; -+ } -+ -+ /** -+ * Called each tick while using an item. -+ * @param stack The Item being used -+ * @param player The Player using the item -+ * @param count The amount of time in tick the item has been used for continuously -+ */ -+ public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count) -+ { -+ } -+ -+ /** -+ * Called when the player Left Clicks (attacks) an entity. -+ * Processed before damage is done, if return value is true further processing is canceled -+ * and the entity is not attacked. -+ * -+ * @param stack The Item being used -+ * @param player The player that is attacking -+ * @param entity The entity being attacked -+ * @return True to cancel the rest of the interaction. -+ */ -+ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) -+ { -+ return false; -+ } -+ -+ /** -+ * Player, Render pass, and item usage sensitive version of getIconIndex. -+ * -+ * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null) -+ * @param renderPass The pass to get the icon for, 0 is default. -+ * @param player The player holding the item -+ * @param usingItem The item the player is actively using. Can be null if not using anything. -+ * @param useRemaining The ticks remaining for the active item. -+ * @return The icon index -+ */ -+ public int getIconIndex(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) -+ { -+ /* -+ * Here is an example usage for Vanilla bows. -+ if (usingItem != null && usingItem.getItem().shiftedIndex == Item.bow.shiftedIndex) -+ { -+ int k = usingItem.getMaxItemUseDuration() - useRemaining; -+ if (k >= 18) return 133; -+ if (k > 13) return 117; -+ if (k > 0) return 101; -+ } -+ */ -+ return getIconIndex(stack); -+ } -+ -+ /** -+ * Returns the number of render passes/layers this item has. -+ * Usually equates to ItemRenderer.renderItem being called for this many passes. -+ * Does not get called unless requiresMultipleRenderPasses() is true; -+ * -+ * @param metadata The item's metadata -+ * @return The number of passes to run. -+ */ -+ public int getRenderPasses(int metadata) -+ { -+ return requiresMultipleRenderPasses() ? 2 : 1; -+ } -+ -+ /** -+ * Grabs the current texture file used for this block -+ */ -+ @Override -+ public String getTextureFile() -+ { -+ if (this instanceof ItemBlock) -+ { -+ return Block.blocksList[((ItemBlock)this).getBlockID()].getTextureFile(); -+ } -+ return currentTexture; -+ } -+ -+ /** -+ * Sets the current texture file for this item, used when rendering. -+ * Default is "/gui/items.png" -+ * -+ * @param texture The texture file -+ */ -+ public void setTextureFile(String texture) -+ { -+ currentTexture = texture; -+ isDefaultTexture = false; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/ItemBlock.java.patch b/patches/minecraft/net/minecraft/src/ItemBlock.java.patch deleted file mode 100644 index ebb6e48cf6..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemBlock.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000 -@@ -32,7 +32,8 @@ - { - par7 = 1; - } -- else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) -+ else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID -+ && (Block.blocksList[var8] != null && !Block.blocksList[var8].isBlockReplaceable(par3World, par4, par5, par6))) - { - if (par7 == 0) - { diff --git a/patches/minecraft/net/minecraft/src/ItemBow.java.patch b/patches/minecraft/net/minecraft/src/ItemBow.java.patch deleted file mode 100644 index a7bb61ae4b..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemBow.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemBow extends Item - { - public ItemBow(int par1) -@@ -14,6 +16,11 @@ - */ - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) - { -+ if (ForgeHooks.onArrowLoose(par1ItemStack, par2World, par3EntityPlayer, getMaxItemUseDuration(par1ItemStack) - par4)) -+ { -+ return; -+ } -+ - boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; - - if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) -@@ -103,6 +110,12 @@ - */ - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { -+ ItemStack stack = ForgeHooks.onArrowNock(par1ItemStack, par2World, par3EntityPlayer); -+ if (stack != null) -+ { -+ return stack; -+ } -+ - if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) - { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); diff --git a/patches/minecraft/net/minecraft/src/ItemBucket.java.patch b/patches/minecraft/net/minecraft/src/ItemBucket.java.patch deleted file mode 100644 index ff562cc6a8..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemBucket.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.MinecraftForge; -+ - public class ItemBucket extends Item - { - /** field for checking if the bucket has been filled. */ -@@ -47,6 +49,12 @@ - { - return par1ItemStack; - } -+ -+ ItemStack stack = MinecraftForge.fillCustomBucket(par2World, var13, var14, var15); -+ if (stack != null) -+ { -+ return stack; -+ } - - if (par2World.getBlockMaterial(var13, var14, var15) == Material.water && par2World.getBlockMetadata(var13, var14, var15) == 0) - { diff --git a/patches/minecraft/net/minecraft/src/ItemDye.java.patch b/patches/minecraft/net/minecraft/src/ItemDye.java.patch deleted file mode 100644 index 498521a5fb..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemDye.java.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,9 @@ - package net.minecraft.src; - -+import java.util.ArrayList; -+ -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemDye extends Item - { - /** List of dye color names */ -@@ -43,6 +47,15 @@ - if (par1ItemStack.getItemDamage() == 15) - { - int var8 = par3World.getBlockId(par4, par5, par6); -+ -+ if (ForgeHooks.onUseBonemeal(par3World, var8, par4, par5, par6)) -+ { -+ if (!par3World.isRemote) -+ { -+ par1ItemStack.stackSize--; -+ } -+ return true; -+ } - - if (var8 == Block.sapling.blockID) - { -@@ -116,15 +129,15 @@ - { - if (itemRand.nextInt(10) != 0) - { -+ if (mod_MinecraftForge.DISABLE_DARK_ROOMS && !Block.tallGrass.canBlockStay(par3World, var10, var11, var12)) -+ { -+ continue; -+ } - par3World.setBlockAndMetadataWithNotify(var10, var11, var12, Block.tallGrass.blockID, 1); - } -- else if (itemRand.nextInt(3) != 0) -- { -- par3World.setBlockWithNotify(var10, var11, var12, Block.plantYellow.blockID); -- } - else - { -- par3World.setBlockWithNotify(var10, var11, var12, Block.plantRed.blockID); -+ ForgeHooks.plantGrassPlant(par3World, var10, var11, var12); - } - } - } -@@ -155,4 +168,20 @@ - } - } - } -+ -+ /** -+ * Called when a new CreativeContainer is opened, populate the list -+ * with all of the items for this item you want a player in creative mode -+ * to have access to. -+ * -+ * @param itemList The list of items currently in the creative inventory -+ */ -+ @Override -+ public void addCreativeItems(ArrayList itemList) -+ { -+ for (int x = 0; x < 16; x++) -+ { -+ itemList.add(new ItemStack(this, 1, x)); -+ } -+ } - } diff --git a/patches/minecraft/net/minecraft/src/ItemHoe.java.patch b/patches/minecraft/net/minecraft/src/ItemHoe.java.patch deleted file mode 100644 index b9b457e808..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemHoe.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemHoe.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemHoe.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemHoe extends Item - { - public ItemHoe(int par1, EnumToolMaterial par2EnumToolMaterial) -@@ -21,6 +23,11 @@ - } - else - { -+ if (ForgeHooks.onUseHoe(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6)) -+ { -+ par1ItemStack.damageItem(1, par2EntityPlayer); -+ return true; -+ } - int var8 = par3World.getBlockId(par4, par5, par6); - int var9 = par3World.getBlockId(par4, par5 + 1, par6); - diff --git a/patches/minecraft/net/minecraft/src/ItemMap.java.patch b/patches/minecraft/net/minecraft/src/ItemMap.java.patch deleted file mode 100644 index 875518d5ed..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemMap.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 -@@ -83,7 +83,7 @@ - byte var23 = 0; - byte var24 = 0; - byte var25 = 0; -- int[] var26 = new int[256]; -+ int[] var26 = new int[Block.blocksList.length]; - Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22); - int var28 = var21 & 15; - int var29 = var22 & 15; -@@ -173,7 +173,7 @@ - var33 = 0; - var34 = 0; - -- for (var35 = 0; var35 < 256; ++var35) -+ for (var35 = 0; var35 < Block.blocksList.length; ++var35) - { - if (var26[var35] > var33) - { diff --git a/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch deleted file mode 100644 index 720b105cd2..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemRenderer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemRenderer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,12 @@ - package net.minecraft.src; - - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooksClient; -+import net.minecraft.src.forge.IItemRenderer; -+import net.minecraft.src.forge.MinecraftForgeClient; -+import static net.minecraft.src.forge.IItemRenderer.ItemRenderType.*; -+import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.*; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -@@ -35,22 +41,21 @@ - public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) - { - GL11.glPushMatrix(); -+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, EQUIPPED); - -- if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) -+ if (customRenderer != null) -+ { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); -+ ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack); -+ } -+ else if (par2ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) - { -- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png")); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); - this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); - } - else - { -- if (par2ItemStack.itemID < 256) -- { -- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png")); -- } -- else -- { -- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png")); -- } -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); - - Tessellator var4 = Tessellator.instance; - int var5 = par1EntityLiving.getItemIcon(par2ItemStack, par3); -@@ -246,8 +251,10 @@ - float var11; - float var13; - -- if (var14 != null && var14.itemID == Item.map.shiftedIndex) -+ if (var14 != null && var14.getItem() instanceof ItemMap) - { -+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(var14, FIRST_PERSON_MAP); -+ - GL11.glPushMatrix(); - var7 = 0.8F; - var17 = var3.getSwingProgress(par1); -@@ -313,8 +320,15 @@ - var26.addVertexWithUV((double)(128 + var27), (double)(0 - var27), 0.0D, 1.0D, 0.0D); - var26.addVertexWithUV((double)(0 - var27), (double)(0 - var27), 0.0D, 0.0D, 0.0D); - var26.draw(); -- MapData var23 = Item.map.getMapData(var14, this.mc.theWorld); -- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var23); -+ MapData var23 = ((ItemMap)var14.getItem()).getMapData(var14, this.mc.theWorld); -+ if (custom == null) -+ { -+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var23); -+ } -+ else -+ { -+ custom.renderItem(FIRST_PERSON_MAP, var14, mc.thePlayer, mc.renderEngine, var23); -+ } - GL11.glPopMatrix(); - } - else if (var14 != null) -@@ -414,12 +428,15 @@ - if (var14.getItem().requiresMultipleRenderPasses()) - { - this.renderItem(var3, var14, 0); -- var9 = Item.itemsList[var14.itemID].getColorFromDamage(var14.getItemDamage(), 1); -- var10 = (float)(var9 >> 16 & 255) / 255.0F; -- var11 = (float)(var9 >> 8 & 255) / 255.0F; -- var12 = (float)(var9 & 255) / 255.0F; -- GL11.glColor4f(var6 * var10, var6 * var11, var6 * var12, 1.0F); -- this.renderItem(var3, var14, 1); -+ for (int x = 1; x < var14.getItem().getRenderPasses(var14.getItemDamage()); x++) -+ { -+ var9 = Item.itemsList[var14.itemID].getColorFromDamage(var14.getItemDamage(), x); -+ var10 = (float)(var9 >> 16 & 255) / 255.0F; -+ var11 = (float)(var9 >> 8 & 255) / 255.0F; -+ var12 = (float)(var9 & 255) / 255.0F; -+ GL11.glColor4f(var6 * var10, var6 * var11, var6 * var12, 1.0F); -+ this.renderItem(var3, var14, x); -+ } - } - else - { diff --git a/patches/minecraft/net/minecraft/src/ItemShears.java.patch b/patches/minecraft/net/minecraft/src/ItemShears.java.patch deleted file mode 100644 index 343de9a58e..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemShears.java.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,8 @@ - package net.minecraft.src; - -+import java.util.ArrayList; -+import net.minecraft.src.forge.IShearable; -+ - public class ItemShears extends Item - { - public ItemShears(int par1) -@@ -11,13 +14,12 @@ - - public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) - { -- if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID) -+ if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID && !(Block.blocksList[par2] instanceof IShearable)) - { - return super.onBlockDestroyed(par1ItemStack, par2, par3, par4, par5, par6EntityLiving); - } - else - { -- par1ItemStack.damageItem(1, par6EntityLiving); - return true; - } - } -@@ -38,4 +40,62 @@ - { - return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F; - } -+ -+ @Override -+ public void useItemOnEntity(ItemStack itemstack, EntityLiving entity) -+ { -+ if (entity.worldObj.isRemote) -+ { -+ return; -+ } -+ if (entity instanceof IShearable) -+ { -+ IShearable target = (IShearable)entity; -+ if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) -+ { -+ ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); -+ for(ItemStack stack : drops) -+ { -+ EntityItem ent = entity.entityDropItem(stack, 1.0F); -+ ent.motionY += entity.rand.nextFloat() * 0.05F; -+ ent.motionX += (entity.rand.nextFloat() - entity.rand.nextFloat()) * 0.1F; -+ ent.motionZ += (entity.rand.nextFloat() - entity.rand.nextFloat()) * 0.1F; -+ } -+ itemstack.damageItem(1, entity); -+ } -+ } -+ } -+ -+ @Override -+ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) -+ { -+ if (player.worldObj.isRemote) -+ { -+ return false; -+ } -+ int id = player.worldObj.getBlockId(x, y, z); -+ if (Block.blocksList[id] != null && Block.blocksList[id] instanceof IShearable) -+ { -+ IShearable target = (IShearable)Block.blocksList[id]; -+ if (target.isShearable(itemstack, player.worldObj, x, y, z)) -+ { -+ ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); -+ for(ItemStack stack : drops) -+ { -+ float f = 0.7F; -+ double d = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ double d1 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ double d2 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack); -+ entityitem.delayBeforeCanPickup = 10; -+ player.worldObj.spawnEntityInWorld(entityitem); -+ } -+ itemstack.damageItem(1, player); -+ player.addStat(StatList.mineBlockStatArray[id], 1); -+ } -+ } -+ return false; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/ItemTool.java.patch b/patches/minecraft/net/minecraft/src/ItemTool.java.patch deleted file mode 100644 index b7b67bb67a..0000000000 --- a/patches/minecraft/net/minecraft/src/ItemTool.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,13 +1,15 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemTool extends Item - { - /** Array of blocks the tool has extra effect against. */ - private Block[] blocksEffectiveAgainst; -- protected float efficiencyOnProperMaterial = 4.0F; -+ public float efficiencyOnProperMaterial = 4.0F; - - /** Damage versus entities. */ -- private int damageVsEntity; -+ public int damageVsEntity; - - /** The material this tool is made from. */ - protected EnumToolMaterial toolMaterial; -@@ -79,4 +81,15 @@ - { - return this.toolMaterial.getEnchantability(); - } -+ -+ /** FORGE: Overridden to allow custom tool effectiveness */ -+ @Override -+ public float getStrVsBlock(ItemStack stack, Block block, int meta) -+ { -+ if (ForgeHooks.isToolEffective(stack, block, meta)) -+ { -+ return efficiencyOnProperMaterial; -+ } -+ return getStrVsBlock(stack, block); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch b/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch deleted file mode 100644 index 6f0af78f8d..0000000000 --- a/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -@@ -25,6 +25,9 @@ - - /** The hit entity */ - public Entity entityHit; -+ -+ /** Used to determine what sub-segment is hit */ -+ public int subHit = -1; - - public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3D par5Vec3D) - { diff --git a/patches/minecraft/net/minecraft/src/NetClientHandler.java.patch b/patches/minecraft/net/minecraft/src/NetClientHandler.java.patch deleted file mode 100644 index 134198f16c..0000000000 --- a/patches/minecraft/net/minecraft/src/NetClientHandler.java.patch +++ /dev/null @@ -1,155 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -14,9 +14,16 @@ - import java.util.List; - import java.util.Map; - import java.util.Random; -+import java.util.logging.Level; - - import cpw.mods.fml.client.FMLClientHandler; - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ForgeHooksClient; -+import net.minecraft.src.forge.MessageManager; -+import net.minecraft.src.forge.ModCompatibilityClient; -+import net.minecraft.src.forge.packets.ForgePacket; -+import java.io.UnsupportedEncodingException; - - public class NetClientHandler extends NetHandler - { -@@ -50,6 +57,8 @@ - this.mc = par1Minecraft; - Socket var4 = new Socket(InetAddress.getByName(par2Str), par3); - this.netManager = new NetworkManager(var4, "Client", this); -+ -+ ForgeHooks.onConnect(netManager); - } - - /** -@@ -78,6 +87,7 @@ - this.currentServerMaxPlayers = par1Packet1Login.maxPlayers; - ((PlayerControllerMP)this.mc.playerController).setCreative(par1Packet1Login.serverMode == 1); - FMLClientHandler.instance().handleServerLogin(par1Packet1Login, this, netManager); -+ ForgeHooksClient.onLogin(par1Packet1Login, this, netManager); - } - - public void handlePickupSpawn(Packet21PickupSpawn par1Packet21PickupSpawn) -@@ -182,6 +192,19 @@ - { - var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, Block.dragonEgg.blockID); - } -+ -+ try -+ { -+ var8 = ModCompatibilityClient.mlmpVehicleSpawn(par1Packet23VehicleSpawn.type, -+ worldClient, var2, var4, var6, -+ getEntityByID(par1Packet23VehicleSpawn.throwerEntityId), var8); -+ } -+ catch (Exception e) -+ { -+ ModLoader.getLogger().throwing("NetClientHandler", "handleVehicleSpawn", e); -+ ModLoader.throwException(String.format("Error initalizing entity of type %d", par1Packet23VehicleSpawn.type), e); -+ return; -+ } - - if (var8 != null) - { -@@ -438,7 +461,7 @@ - { - short var6 = var4.readShort(); - short var7 = var4.readShort(); -- int var8 = (var7 & 4095) >> 4; -+ int var8 = (var7 & 0xFFF0) >> 4; //4096 fix, And vanilla bug fix - int var9 = var7 & 15; - int var10 = var6 >> 12 & 15; - int var11 = var6 >> 8 & 15; -@@ -486,7 +509,7 @@ - - public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) - { -- this.netManager.networkShutdown("disconnect.kicked", new Object[0]); -+ this.netManager.networkShutdown("disconnect.kicked", par1Packet255KickDisconnect.reason); - this.disconnected = true; - this.mc.changeWorld1((World)null); - this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason})); -@@ -550,8 +573,12 @@ - - public void handleChat(Packet3Chat par1Packet3Chat) - { -- FMLClientHandler.instance().handleChatPacket(par1Packet3Chat); -- this.mc.ingameGUI.addChatMessage(par1Packet3Chat.message); -+ par1Packet3Chat.message = ForgeHooks.onClientChatRecv(par1Packet3Chat.message); -+ if (par1Packet3Chat.message != null) -+ { -+ FMLClientHandler.instance().handleChatPacket(par1Packet3Chat); -+ this.mc.ingameGUI.addChatMessage(par1Packet3Chat.message); -+ } - } - - public void handleAnimation(Packet18Animation par1Packet18Animation) -@@ -641,7 +668,7 @@ - } - else if (par1Packet2Handshake.username.equals("-")) - { -- this.addToSendQueue(new Packet1Login(this.mc.session.username, 29)); -+ this.addToSendQueue(ForgeHooksClient.onSendLogin(new Packet1Login(this.mc.session.username, 29))); - } - else - { -@@ -654,7 +681,7 @@ - - if (var6.equalsIgnoreCase("ok")) - { -- this.addToSendQueue(new Packet1Login(this.mc.session.username, 29)); -+ this.addToSendQueue(ForgeHooksClient.onSendLogin(new Packet1Login(this.mc.session.username, 29))); - } - else - { -@@ -835,6 +862,9 @@ - case 5: - var2.displayGUIBrewingStand(new TileEntityBrewingStand()); - var2.craftingInventory.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ default: -+ ModCompatibilityClient.mlmpOpenWindow(par1Packet100OpenWindow); - } - } - -@@ -941,6 +971,19 @@ - { - ((TileEntityMobSpawner)var2).setMobID(EntityList.getStringFromID(par1Packet132TileEntityData.customParam1)); - } -+ else if (var2 != null) -+ { -+ var2.onDataPacket(netManager, par1Packet132TileEntityData); -+ } -+ else -+ { -+ Packet132TileEntityData pkt = par1Packet132TileEntityData; -+ ModLoader.getLogger().log(Level.WARNING, String.format( -+ "Received a TileEntityData packet for a location that did not have a TileEntity: (%d, %d, %d) %d: %d, %d, %d", -+ pkt.xPosition, pkt.yPosition, pkt.zPosition, -+ pkt.actionType, -+ pkt.customParam1, pkt.customParam2, pkt.customParam3)); -+ } - } - } - -@@ -1014,6 +1057,10 @@ - { - ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); - } -+ else if (ForgeHooks.onItemDataPacket(netManager, par1Packet131MapData)) -+ { -+ ; -+ } - else - { - System.out.println("Unknown itemid: " + par1Packet131MapData.uniqueID); -@@ -1120,5 +1167,6 @@ - public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) - { - FMLClientHandler.instance().handlePacket250(par1Packet250CustomPayload); -+ ForgeHooksClient.onCustomPayload(par1Packet250CustomPayload, netManager); - } - } diff --git a/patches/minecraft/net/minecraft/src/NetworkManager.java.patch b/patches/minecraft/net/minecraft/src/NetworkManager.java.patch deleted file mode 100644 index e892a033e2..0000000000 --- a/patches/minecraft/net/minecraft/src/NetworkManager.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -11,6 +11,8 @@ - import java.util.Collections; - import java.util.List; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class NetworkManager - { - /** Synchronization object used for read and write threads. */ -@@ -307,6 +309,7 @@ - { - ; - } -+ ForgeHooks.onDisconnect(this, par1Str, par2ArrayOfObj); - } - } - -@@ -430,4 +433,14 @@ - { - return par0NetworkManager.writeThread; - } -+ -+ /** -+ * Retrieves the current associated network handler. -+ * Added so modders don't have to use reflection. -+ * @return The current registered Network Handler -+ */ -+ public NetHandler getNetHandler() -+ { -+ return netHandler; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch b/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch deleted file mode 100644 index d4c5ac62e0..0000000000 --- a/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 -@@ -4,6 +4,8 @@ - import java.io.DataOutputStream; - import java.io.IOException; - -+import net.minecraft.src.forge.ForgeHooksClient; -+ - public class Packet53BlockChange extends Packet - { - /** Block X position. */ -@@ -34,7 +36,14 @@ - this.xPosition = par1DataInputStream.readInt(); - this.yPosition = par1DataInputStream.read(); - this.zPosition = par1DataInputStream.readInt(); -- this.type = par1DataInputStream.read(); -+ if (ForgeHooksClient.enable4096) -+ { -+ this.type = par1DataInputStream.readInt(); -+ } -+ else -+ { -+ this.type = par1DataInputStream.read(); -+ } - this.metadata = par1DataInputStream.read(); - } - -@@ -46,7 +55,14 @@ - par1DataOutputStream.writeInt(this.xPosition); - par1DataOutputStream.write(this.yPosition); - par1DataOutputStream.writeInt(this.zPosition); -- par1DataOutputStream.write(this.type); -+ if (ForgeHooksClient.enable4096) -+ { -+ par1DataOutputStream.writeInt(this.type); -+ } -+ else -+ { -+ par1DataOutputStream.write(this.type); -+ } - par1DataOutputStream.write(this.metadata); - } - -@@ -63,6 +79,6 @@ - */ - public int getPacketSize() - { -- return 11; -+ return ForgeHooksClient.enable4096 ? 14 : 11; - } - } diff --git a/patches/minecraft/net/minecraft/src/PlayerController.java.patch b/patches/minecraft/net/minecraft/src/PlayerController.java.patch deleted file mode 100644 index f7e3de2c60..0000000000 --- a/patches/minecraft/net/minecraft/src/PlayerController.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/PlayerController.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,7 @@ - package net.minecraft.src; - - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooks; - - public abstract class PlayerController - { -@@ -39,7 +40,7 @@ - { - var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12)); - int var7 = var5.getBlockMetadata(par1, par2, par3); -- boolean var8 = var5.setBlockWithNotify(par1, par2, par3, 0); -+ boolean var8 = var6.removeBlockByPlayer(var5, mc.thePlayer, par1, par2, par3); - - if (var8) - { -@@ -86,6 +87,7 @@ - if (var5.stackSize == 0) - { - par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; -+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, var5); - } - - return true; diff --git a/patches/minecraft/net/minecraft/src/PlayerControllerCreative.java.patch b/patches/minecraft/net/minecraft/src/PlayerControllerCreative.java.patch deleted file mode 100644 index 3d86ace050..0000000000 --- a/patches/minecraft/net/minecraft/src/PlayerControllerCreative.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000 -@@ -52,6 +52,11 @@ - */ - public static void clickBlockCreative(Minecraft par0Minecraft, PlayerController par1PlayerController, int par2, int par3, int par4, int par5) - { -+ ItemStack itemstack = par0Minecraft.thePlayer.getCurrentEquippedItem(); -+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, par2, par3, par4, par0Minecraft.thePlayer)) -+ { -+ return; -+ } - if (!par0Minecraft.theWorld.func_48457_a(par0Minecraft.thePlayer, par2, par3, par4, par5)) - { - par1PlayerController.onPlayerDestroyBlock(par2, par3, par4, par5); -@@ -63,6 +68,13 @@ - */ - public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) - { -+ if (par3ItemStack != null && -+ par3ItemStack.getItem() != null && -+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return true; -+ } -+ - int var8 = par2World.getBlockId(par4, par5, par6); - - if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer)) diff --git a/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch deleted file mode 100644 index b87ef269cd..0000000000 --- a/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/PlayerControllerMP.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerMP.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,7 @@ - package net.minecraft.src; - - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooks; - - public class PlayerControllerMP extends PlayerController - { -@@ -75,6 +76,11 @@ - */ - public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) - { -+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, mc.thePlayer)) -+ { -+ return false; -+ } - if (this.creativeMode) - { - return super.onPlayerDestroyBlock(par1, par2, par3, par4); -@@ -121,7 +127,7 @@ - Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer); - } - -- if (var5 > 0 && Block.blocksList[var5].blockStrength(this.mc.thePlayer) >= 1.0F) -+ if (var5 > 0 && Block.blocksList[var5].blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3) >= 1.0F) - { - this.onPlayerDestroyBlock(par1, par2, par3, par4); - } -@@ -177,7 +183,7 @@ - } - - Block var6 = Block.blocksList[var5]; -- this.curBlockDamageMP += var6.blockStrength(this.mc.thePlayer); -+ this.curBlockDamageMP += var6.blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3); - - if (this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) - { -@@ -263,6 +269,14 @@ - { - this.syncCurrentPlayItem(); - this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem())); -+ -+ if (par3ItemStack != null && -+ par3ItemStack.getItem() != null && -+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return true; -+ } -+ - int var8 = par2World.getBlockId(par4, par5, par6); - - if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer)) -@@ -284,7 +298,15 @@ - } - else - { -- return par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7); -+ if (!par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return false; -+ } -+ if (par3ItemStack.stackSize <= 0) -+ { -+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, par3ItemStack); -+ } -+ return true; - } - } - diff --git a/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch b/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch deleted file mode 100644 index a0bdfb6565..0000000000 --- a/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/PlayerControllerSP.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerSP.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,7 @@ - package net.minecraft.src; - - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooks; - - public class PlayerControllerSP extends PlayerController - { -@@ -35,11 +36,17 @@ - */ - public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) - { -+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, mc.thePlayer)) -+ { -+ return false; -+ } -+ - int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); - int var6 = this.mc.theWorld.getBlockMetadata(par1, par2, par3); - boolean var7 = super.onPlayerDestroyBlock(par1, par2, par3, par4); - ItemStack var8 = this.mc.thePlayer.getCurrentEquippedItem(); -- boolean var9 = this.mc.thePlayer.canHarvestBlock(Block.blocksList[var5]); -+ boolean var9 = Block.blocksList[var5].canHarvestBlock(mc.thePlayer, var6); - - if (var8 != null) - { -@@ -75,7 +82,7 @@ - Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer); - } - -- if (var5 > 0 && Block.blocksList[var5].blockStrength(this.mc.thePlayer) >= 1.0F) -+ if (var5 > 0 && Block.blocksList[var5].blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3) >= 1.0F) - { - this.onPlayerDestroyBlock(par1, par2, par3, par4); - } -@@ -117,7 +124,7 @@ - } - - Block var6 = Block.blocksList[var5]; -- this.curBlockDamage += var6.blockStrength(this.mc.thePlayer); -+ this.curBlockDamage += var6.blockStrength(mc.theWorld, this.mc.thePlayer, par1, par2, par3); - - if (this.blockDestroySoundCounter % 4.0F == 0.0F && var6 != null) - { -@@ -195,8 +202,34 @@ - */ - public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) - { -+ if (par3ItemStack != null && -+ par3ItemStack.getItem() != null && -+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return true; -+ } -+ - int var8 = par2World.getBlockId(par4, par5, par6); -- return var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer) ? true : (par3ItemStack == null ? false : par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7)); -+ if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer)) -+ { -+ return true; -+ } -+ -+ if (par3ItemStack == null) -+ { -+ return false; -+ } -+ -+ if (!par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return false; -+ } -+ -+ if (par3ItemStack.stackSize <= 0) -+ { -+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, par3ItemStack); -+ } -+ return true; - } - - public boolean func_35642_f() diff --git a/patches/minecraft/net/minecraft/src/RailLogic.java.patch b/patches/minecraft/net/minecraft/src/RailLogic.java.patch deleted file mode 100644 index 8e40775ceb..0000000000 --- a/patches/minecraft/net/minecraft/src/RailLogic.java.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,7 +3,7 @@ - import java.util.ArrayList; - import java.util.List; - --class RailLogic -+public class RailLogic - { - /** Reference to the World object. */ - private World worldObj; -@@ -18,6 +18,7 @@ - private List connectedTracks; - - final BlockRail rail; -+ private final boolean canMakeSlopes; - - public RailLogic(BlockRail par1BlockRail, World par2World, int par3, int par4, int par5) - { -@@ -28,18 +29,12 @@ - this.trackY = par4; - this.trackZ = par5; - int var6 = par2World.getBlockId(par3, par4, par5); -- int var7 = par2World.getBlockMetadata(par3, par4, par5); -- -- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[var6])) -- { -- this.isPoweredRail = true; -- var7 &= -9; -- } -- else -- { -- this.isPoweredRail = false; -- } -- -+ -+ BlockRail target = (BlockRail)Block.blocksList[var6]; -+ int var7 = target.getBasicRailMetadata(par2World, null, par3, par4, par5); -+ isPoweredRail = !target.isFlexibleRail(par2World, par3, par4, par5); -+ canMakeSlopes = target.canMakeSlopes(par2World, par3, par4, par5); -+ - this.setConnections(var7); - } - -@@ -258,7 +253,7 @@ - } - } - -- if (var6 == 0) -+ if (var6 == 0 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1)) - { -@@ -271,7 +266,7 @@ - } - } - -- if (var6 == 1) -+ if (var6 == 1 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ)) - { -@@ -422,7 +417,7 @@ - } - } - -- if (var7 == 0) -+ if (var7 == 0 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1)) - { -@@ -435,7 +430,7 @@ - } - } - -- if (var7 == 1) -+ if (var7 == 1 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ)) - { -@@ -485,7 +480,7 @@ - /** - * get number of adjacent tracks - */ -- static int getNAdjacentTracks(RailLogic par0RailLogic) -+ public static int getNAdjacentTracks(RailLogic par0RailLogic) - { - return par0RailLogic.getAdjacentTracks(); - } diff --git a/patches/minecraft/net/minecraft/src/RenderBiped.java.patch b/patches/minecraft/net/minecraft/src/RenderBiped.java.patch deleted file mode 100644 index aadf06dc7f..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderBiped.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderBiped.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderBiped.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,10 @@ - package net.minecraft.src; - -+import static net.minecraft.src.forge.IItemRenderer.ItemRenderType.EQUIPPED; -+import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.BLOCK_3D; -+import net.minecraft.src.forge.IItemRenderer; -+import net.minecraft.src.forge.MinecraftForgeClient; -+ - import org.lwjgl.opengl.GL11; - - public class RenderBiped extends RenderLiving -@@ -32,7 +37,10 @@ - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - -- if (var3.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) -+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED); -+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D)); -+ -+ if (var3.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))) - { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -@@ -72,7 +80,10 @@ - - if (var3.getItem().requiresMultipleRenderPasses()) - { -- this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); -+ for (int x = 1; x < var3.getItem().getRenderPasses(var3.getItemDamage()); x++) -+ { -+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, x); -+ } - } - - GL11.glPopMatrix(); diff --git a/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch b/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch deleted file mode 100644 index 00d63342bc..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch +++ /dev/null @@ -1,140 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000 -@@ -456,9 +456,8 @@ - public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) - { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); -- int var7 = BlockBed.getDirection(var6); -- boolean var8 = BlockBed.isBlockFootOfBed(var6); -+ int var7 = par1Block.getBedDirection(blockAccess, par2, par3, par4); -+ boolean var8 = par1Block.isBedFoot(blockAccess, par2, par3, par4); - float var9 = 0.5F; - float var10 = 1.0F; - float var11 = 0.8F; -@@ -1386,7 +1385,7 @@ - double var30; - double var32; - -- if (!this.blockAccess.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4)) -+ if (!this.blockAccess.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, 1)) - { - float var36 = 0.2F; - float var19 = 0.0625F; -@@ -1406,7 +1405,7 @@ - var9 = var20; - } - -- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4)) -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4, 5)) - { - var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13); - var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15); -@@ -1418,7 +1417,7 @@ - var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13); - } - -- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4)) -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4, 4)) - { - var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13); - var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -@@ -1430,7 +1429,7 @@ - var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13); - } - -- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1)) -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1, 3)) - { - var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13); - var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15); -@@ -1442,7 +1441,7 @@ - var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13); - } - -- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1)) -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1, 2)) - { - var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13); - var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); -@@ -1454,7 +1453,7 @@ - var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13); - } - -- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4)) -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4, 0)) - { - var20 = (double)par2 + 0.5D + 0.5D; - var22 = (double)par2 + 0.5D - 0.5D; -@@ -3610,7 +3609,7 @@ - var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2); - this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27); - -- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) - { - this.colorRedTopLeft *= par5; - this.colorRedBottomLeft *= par5; -@@ -3733,7 +3732,7 @@ - var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3); - this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3)); - -- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) - { - this.colorRedTopLeft *= par5; - this.colorRedBottomLeft *= par5; -@@ -3856,7 +3855,7 @@ - var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4); - this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27); - -- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) - { - this.colorRedTopLeft *= par5; - this.colorRedBottomLeft *= par5; -@@ -3979,7 +3978,7 @@ - var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5); - this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27); - -- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0) - { - this.colorRedTopLeft *= par5; - this.colorRedBottomLeft *= par5; -@@ -4091,7 +4090,7 @@ - var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2); - this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28); - -- if (cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) - { - var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); - this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38); -@@ -4107,7 +4106,7 @@ - var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3); - this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28); - -- if (cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) - { - var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); - this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38); -@@ -4123,7 +4122,7 @@ - var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4); - this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28); - -- if (cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) - { - var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); - this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38); -@@ -4139,7 +4138,7 @@ - var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5); - this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28); - -- if (cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) -+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var28 == 3 && this.overrideBlockTexture < 0) - { - var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); - this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38); diff --git a/patches/minecraft/net/minecraft/src/RenderEngine.java.patch b/patches/minecraft/net/minecraft/src/RenderEngine.java.patch deleted file mode 100644 index e7043c2274..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderEngine.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 -@@ -27,6 +27,8 @@ - import cpw.mods.fml.client.FMLClientHandler; - import cpw.mods.fml.common.FMLCommonHandler; - -+import net.minecraft.src.forge.ForgeHooksClient; -+ - public class RenderEngine - { - /** Use mipmaps for all bound textures (unused at present) */ -@@ -59,7 +61,7 @@ - public boolean blurTexture = false; - - /** Texture pack */ -- private TexturePackList texturePack; -+ public TexturePackList texturePack; - - /** Missing texture image */ - private BufferedImage missingTextureImage = new BufferedImage(64, 64, 2); -@@ -169,6 +171,7 @@ - { - try - { -+ ForgeHooksClient.onTextureLoadPre(par1Str); - this.singleIntBuffer.clear(); - GLAllocation.generateTextureNames(this.singleIntBuffer); - int var6 = this.singleIntBuffer.get(0); -@@ -212,6 +215,7 @@ - } - - this.textureMap.put(par1Str, Integer.valueOf(var6)); -+ ForgeHooksClient.onTextureLoad(par1Str, var6); - return var6; - } - catch (Exception var5) diff --git a/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch deleted file mode 100644 index 00a5ba37a2..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000 -@@ -15,10 +15,10 @@ - public List tileEntities = new ArrayList(); - - /** A reference to the World object. */ -- private World worldObj; -+ public World worldObj; - - /** The RenderEngine instance used by RenderGlobal */ -- private RenderEngine renderEngine; -+ public RenderEngine renderEngine; - private List worldRenderersToUpdate = new ArrayList(); - private WorldRenderer[] sortedWorldRenderers; - private WorldRenderer[] worldRenderers; -@@ -30,10 +30,10 @@ - private int glRenderListBase; - - /** A reference to the Minecraft object. */ -- private Minecraft mc; -+ public Minecraft mc; - - /** Global render blocks */ -- private RenderBlocks globalRenderBlocks; -+ public RenderBlocks globalRenderBlocks; - - /** OpenGL occlusion query base */ - private IntBuffer glOcclusionQueryBase; -@@ -1835,6 +1835,7 @@ - double var17 = this.mc.renderViewEntity.posY - par4; - double var19 = this.mc.renderViewEntity.posZ - par6; - EntityFX var21 = null; -+ Object effectObject = null; - - if (par1Str.equals("hugeexplosion")) - { -@@ -1954,6 +1955,7 @@ - else if (par1Str.equals("snowballpoof")) - { - var21 = new EntityBreakingFX(this.worldObj, par2, par4, par6, Item.snowball); -+ effectObject = Item.snowball; - } - else if (par1Str.equals("dripWater")) - { -@@ -1970,6 +1972,7 @@ - else if (par1Str.equals("slime")) - { - var21 = new EntityBreakingFX(this.worldObj, par2, par4, par6, Item.slimeBall); -+ effectObject = Item.slimeBall; - } - else if (par1Str.equals("heart")) - { -@@ -1983,17 +1986,19 @@ - { - var24 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1)); - var21 = new EntityBreakingFX(this.worldObj, par2, par4, par6, par8, par10, par12, Item.itemsList[var24]); -+ effectObject = Item.itemsList[var24]; - } - else if (par1Str.startsWith("tilecrack_")) - { - var24 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1)); - var21 = new EntityDiggingFX(this.worldObj, par2, par4, par6, par8, par10, par12, Block.blocksList[var24], 0, 0); -+ effectObject = Block.blocksList[var24]; - } - } - - if (var21 != null) - { -- this.mc.effectRenderer.addEffect((EntityFX)var21); -+ this.mc.effectRenderer.addEffect((EntityFX)var21, effectObject); - } - - return (EntityFX)var21; diff --git a/patches/minecraft/net/minecraft/src/RenderItem.java.patch b/patches/minecraft/net/minecraft/src/RenderItem.java.patch deleted file mode 100644 index 26a5ae7562..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderItem.java.patch +++ /dev/null @@ -1,115 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderItem.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderItem.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,9 @@ - package net.minecraft.src; - - import java.util.Random; -+ -+import net.minecraft.src.forge.ForgeHooksClient; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -@@ -54,11 +57,15 @@ - float var19; - float var18; - float var23; -- -- if (var10.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) -+ -+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, var10, var11, var12, random, renderManager.renderEngine, renderBlocks)) -+ { -+ ; -+ } -+ else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) - { - GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F); -- this.loadTexture("/terrain.png"); -+ this.loadTexture(Block.blocksList[var10.itemID].getTextureFile()); - float var21 = 0.25F; - var15 = Block.blocksList[var10.itemID].getRenderType(); - -@@ -94,10 +101,11 @@ - if (var10.getItem().requiresMultipleRenderPasses()) - { - GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.loadTexture("/gui/items.png"); -+ this.loadTexture(Item.itemsList[var10.itemID].getTextureFile()); - -- for (var14 = 0; var14 <= 1; ++var14) -+ for (var14 = 0; var14 < var10.getItem().getRenderPasses(var10.getItemDamage()); ++var14) - { -+ this.random.setSeed(187L); //Fixes Vanilla bug where layers would not render aligns properly. - var15 = var10.getItem().func_46057_a(var10.getItemDamage(), var14); - var16 = 1.0F; - -@@ -117,15 +125,8 @@ - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - var14 = var10.getIconIndex(); -- -- if (var10.itemID < 256) -- { -- this.loadTexture("/terrain.png"); -- } -- else -- { -- this.loadTexture("/gui/items.png"); -- } -+ -+ this.loadTexture(var10.getItem().getTextureFile()); - - if (this.field_27004_a) - { -@@ -187,9 +188,9 @@ - float var12; - float var13; - -- if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType())) -+ if (Item.itemsList[par3] instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType())) - { -- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png")); -+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Block.blocksList[par3].getTextureFile())); - Block var15 = Block.blocksList[par3]; - GL11.glPushMatrix(); - GL11.glTranslatef((float)(par6 - 2), (float)(par7 + 3), -3.0F + this.zLevel); -@@ -221,9 +222,9 @@ - if (Item.itemsList[par3].requiresMultipleRenderPasses()) - { - GL11.glDisable(GL11.GL_LIGHTING); -- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png")); -+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile())); - -- for (var8 = 0; var8 <= 1; ++var8) -+ for (var8 = 0; var8 < Item.itemsList[par3].getRenderPasses(par4); ++var8) - { - int var9 = Item.itemsList[par3].func_46057_a(par4, var8); - var10 = Item.itemsList[par3].getColorFromDamage(par4, var8); -@@ -245,14 +246,7 @@ - { - GL11.glDisable(GL11.GL_LIGHTING); - -- if (par3 < 256) -- { -- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png")); -- } -- else -- { -- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png")); -- } -+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile())); - - var8 = Item.itemsList[par3].getColorFromDamage(par4, 0); - float var14 = (float)(var8 >> 16 & 255) / 255.0F; -@@ -279,7 +273,10 @@ - { - if (par3ItemStack != null) - { -- this.drawItemIntoGui(par1FontRenderer, par2RenderEngine, par3ItemStack.itemID, par3ItemStack.getItemDamage(), par3ItemStack.getIconIndex(), par4, par5); -+ if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, field_27004_a, zLevel, (float)par4, (float)par5)) -+ { -+ this.drawItemIntoGui(par1FontRenderer, par2RenderEngine, par3ItemStack.itemID, par3ItemStack.getItemDamage(), par3ItemStack.getIconIndex(), par4, par5); -+ } - - if (par3ItemStack != null && par3ItemStack.hasEffect()) - { diff --git a/patches/minecraft/net/minecraft/src/RenderManager.java.patch b/patches/minecraft/net/minecraft/src/RenderManager.java.patch deleted file mode 100644 index 8d58215ccf..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderManager.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -124,12 +124,14 @@ - - if (par4EntityLiving.isPlayerSleeping()) - { -- int var7 = par1World.getBlockId(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ)); -+ int x = MathHelper.floor_double(par4EntityLiving.posX); -+ int y = MathHelper.floor_double(par4EntityLiving.posY); -+ int z = MathHelper.floor_double(par4EntityLiving.posZ); -+ Block block = Block.blocksList[par1World.getBlockId(x, y, z)]; - -- if (var7 == Block.bed.blockID) -+ if (block != null && block.isBed(par1World, x, y, z, par4EntityLiving)) - { -- int var8 = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ)); -- int var9 = var8 & 3; -+ int var9 = block.getBedDirection(par1World, x, y, z); - this.playerViewY = (float)(var9 * 90 + 180); - this.playerViewX = 0.0F; - } diff --git a/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch deleted file mode 100644 index cb3ab266a4..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderPlayer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderPlayer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -4,8 +4,13 @@ - import java.util.Arrays; - import java.util.List; - -+import static net.minecraft.src.forge.IItemRenderer.ItemRenderType.EQUIPPED; -+import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.BLOCK_3D; - import net.minecraft.client.Minecraft; - import org.lwjgl.opengl.GL11; -+import net.minecraft.src.forge.IArmorTextureProvider; -+import net.minecraft.src.forge.IItemRenderer; -+import net.minecraft.src.forge.MinecraftForgeClient; - - public class RenderPlayer extends RenderLiving - { -@@ -36,7 +41,14 @@ - if (var5 instanceof ItemArmor) - { - ItemArmor var6 = (ItemArmor)var5; -- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"); -+ if (var5 instanceof IArmorTextureProvider) -+ { -+ loadTexture(((IArmorTextureProvider)var5).getArmorTextureFile(var4)); -+ } -+ else -+ { -+ this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"); -+ } - ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate; - var7.bipedHead.showModel = par2 == 0; - var7.bipedHeadwear.showModel = par2 == 0; -@@ -163,12 +175,15 @@ - super.renderEquippedItems(par1EntityPlayer, par2); - ItemStack var3 = par1EntityPlayer.inventory.armorItemInSlot(3); - -- if (var3 != null && var3.getItem().shiftedIndex < 256) -+ if (var3 != null && var3.getItem() instanceof ItemBlock) - { - GL11.glPushMatrix(); - this.modelBipedMain.bipedHead.postRender(0.0625F); - -- if (RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) -+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED); -+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D)); -+ -+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) - { - float var4 = 0.625F; - GL11.glTranslatef(0.0F, -0.25F, 0.0F); -@@ -269,8 +284,11 @@ - { - var20 = var21.getItemUseAction(); - } -- -- if (var21.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType())) -+ -+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var21, EQUIPPED); -+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var21, BLOCK_3D)); -+ -+ if (var21.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType()))) - { - var6 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -@@ -323,7 +341,7 @@ - - if (var21.getItem().requiresMultipleRenderPasses()) - { -- for (int var25 = 0; var25 <= 1; ++var25) -+ for (int var25 = 0; var25 < var21.getItem().getRenderPasses(var21.getItemDamage()); ++var25) - { - int var24 = var21.getItem().getColorFromDamage(var21.getItemDamage(), var25); - float var26 = (float)(var24 >> 16 & 255) / 255.0F; diff --git a/patches/minecraft/net/minecraft/src/RenderSnowMan.java.patch b/patches/minecraft/net/minecraft/src/RenderSnowMan.java.patch deleted file mode 100644 index 3386b2db06..0000000000 --- a/patches/minecraft/net/minecraft/src/RenderSnowMan.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/RenderSnowMan.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/RenderSnowMan.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,10 @@ - package net.minecraft.src; - -+import static net.minecraft.src.forge.IItemRenderer.ItemRenderType.EQUIPPED; -+import static net.minecraft.src.forge.IItemRenderer.ItemRendererHelper.BLOCK_3D; -+import net.minecraft.src.forge.IItemRenderer; -+import net.minecraft.src.forge.MinecraftForgeClient; -+ - import org.lwjgl.opengl.GL11; - - public class RenderSnowMan extends RenderLiving -@@ -19,12 +24,15 @@ - super.renderEquippedItems(par1EntitySnowman, par2); - ItemStack var3 = new ItemStack(Block.pumpkin, 1); - -- if (var3 != null && var3.getItem().shiftedIndex < 256) -+ if (var3 != null && var3.getItem() instanceof ItemBlock) - { - GL11.glPushMatrix(); - this.snowmanModel.field_40305_c.postRender(0.0625F); - -- if (RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) -+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED); -+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D)); -+ -+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) - { - float var4 = 0.625F; - GL11.glTranslatef(0.0F, -0.34375F, 0.0F); diff --git a/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch deleted file mode 100644 index d7c69e9db3..0000000000 --- a/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,9 @@ - - import cpw.mods.fml.client.FMLClientHandler; - -+import cpw.mods.fml.client.FMLClientHandler; -+import net.minecraft.src.forge.ForgeHooks; -+ - public class SlotCrafting extends Slot - { - /** The craft matrix inventory linked to this result slot. */ -@@ -99,6 +102,7 @@ - public void onPickupFromSlot(ItemStack par1ItemStack) - { - FMLClientHandler.instance().onItemCrafted(thePlayer, par1ItemStack, craftMatrix); -+ ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix); - this.func_48434_c(par1ItemStack); - - for (int var2 = 0; var2 < this.craftMatrix.getSizeInventory(); ++var2) diff --git a/patches/minecraft/net/minecraft/src/SoundManager.java.patch b/patches/minecraft/net/minecraft/src/SoundManager.java.patch deleted file mode 100644 index 1d2071033f..0000000000 --- a/patches/minecraft/net/minecraft/src/SoundManager.java.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/SoundManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/SoundManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,9 @@ - - import java.io.File; - import java.util.Random; -+ -+import net.minecraft.src.forge.ForgeHooksClient; -+import net.minecraft.src.forge.ModCompatibilityClient; - import paulscode.sound.SoundSystem; - import paulscode.sound.SoundSystemConfig; - import paulscode.sound.codecs.CodecJOrbis; -@@ -36,10 +39,12 @@ - /** RNG. */ - private Random rand = new Random(); - private int ticksBeforeMusic; -+ -+ public static int MUSIC_INTERVAL = 12000; - - public SoundManager() - { -- this.ticksBeforeMusic = this.rand.nextInt(12000); -+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL); - } - - /** -@@ -54,6 +59,8 @@ - { - this.tryToSetLibraryAndCodecs(); - } -+ ModCompatibilityClient.audioModLoad(this); -+ ForgeHooksClient.onLoadSoundSettings(this); - } - - /** -@@ -73,6 +80,8 @@ - SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); - SoundSystemConfig.setCodec("mus", CodecMus.class); - SoundSystemConfig.setCodec("wav", CodecWav.class); -+ ModCompatibilityClient.audioModAddCodecs(); -+ ForgeHooksClient.onSetupAudio(this); - sndSystem = new SoundSystem(); - this.options.soundVolume = var1; - this.options.musicVolume = var2; -@@ -161,10 +170,12 @@ - } - - SoundPoolEntry var1 = this.soundPoolMusic.getRandomSound(); -+ var1 = ModCompatibilityClient.audioModPickBackgroundMusic(this, var1); -+ var1 = ForgeHooksClient.onPlayBackgroundMusic(this, var1); - - if (var1 != null) - { -- this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000; -+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL) + MUSIC_INTERVAL; - sndSystem.backgroundMusic("BgMusic", var1.soundUrl, var1.soundName, false); - sndSystem.setVolume("BgMusic", this.options.musicVolume); - sndSystem.play("BgMusic"); -@@ -214,6 +225,7 @@ - if (par1Str != null) - { - SoundPoolEntry var8 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str); -+ var8 = ForgeHooksClient.onPlayStreaming(this, var8, par1Str, par2, par3, par4); - - if (var8 != null && par5 > 0.0F) - { -@@ -239,6 +251,7 @@ - if (loaded && this.options.soundVolume != 0.0F) - { - SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str); -+ var7 = ForgeHooksClient.onPlaySound(this, var7, par1Str, par2, par3, par4, par5, par6); - - if (var7 != null && par5 > 0.0F) - { -@@ -274,6 +287,7 @@ - if (loaded && this.options.soundVolume != 0.0F) - { - SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str); -+ var4 = ForgeHooksClient.onPlaySoundEffect(this, var4, par1Str, par2, par3); - - if (var4 != null) - { -@@ -293,4 +307,25 @@ - } - } - } -+ -+ /** Getters for private class members **/ -+ public static SoundSystem getSoundSystem() -+ { -+ return sndSystem; -+ } -+ -+ public SoundPool getSoundsPool() -+ { -+ return soundPoolSounds; -+ } -+ -+ public SoundPool getStreamingPool() -+ { -+ return soundPoolStreaming; -+ } -+ -+ public SoundPool getMusicPool() -+ { -+ return soundPoolMusic; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/SoundPool.java.patch b/patches/minecraft/net/minecraft/src/SoundPool.java.patch deleted file mode 100644 index 19349d1549..0000000000 --- a/patches/minecraft/net/minecraft/src/SoundPool.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/SoundPool.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/SoundPool.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,7 @@ - - import java.io.File; - import java.net.MalformedURLException; -+import java.net.URL; - import java.util.ArrayList; - import java.util.HashMap; - import java.util.List; -@@ -33,6 +34,25 @@ - */ - public SoundPoolEntry addSound(String par1Str, File par2File) - { -+ try -+ { -+ return addSound(par1Str, par2File.toURI().toURL()); -+ } -+ catch (MalformedURLException ex) -+ { -+ ex.printStackTrace(); -+ throw new RuntimeException(ex); -+ } -+ } -+ /** -+ * URL version of addSound, as the back-end sound engine has full support for various types of URLs -+ * -+ * @param par1Str The name of the sound to add -+ * @param url The url of the sound resource -+ * @return A SoundPoolEntry for the newly added sound -+ */ -+ public SoundPoolEntry addSound(String par1Str, URL url) -+ { - try - { - String var3 = par1Str; -@@ -53,13 +73,13 @@ - this.nameToSoundPoolEntriesMapping.put(par1Str, new ArrayList()); - } - -- SoundPoolEntry var4 = new SoundPoolEntry(var3, par2File.toURI().toURL()); -+ SoundPoolEntry var4 = new SoundPoolEntry(var3, url); - ((List)this.nameToSoundPoolEntriesMapping.get(par1Str)).add(var4); - this.allSoundPoolEntries.add(var4); - ++this.numberOfSoundPoolEntries; - return var4; - } -- catch (MalformedURLException var5) -+ catch (Exception var5) - { - var5.printStackTrace(); - throw new RuntimeException(var5); diff --git a/patches/minecraft/net/minecraft/src/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/src/SpawnerAnimals.java.patch deleted file mode 100644 index 71e6785db6..0000000000 --- a/patches/minecraft/net/minecraft/src/SpawnerAnimals.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,10 +1,14 @@ - package net.minecraft.src; - -+import java.util.ArrayList; -+import java.util.Collections; - import java.util.HashMap; - import java.util.Iterator; - import java.util.List; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public final class SpawnerAnimals - { - /** The 17x17 area around the player where mobs can spawn */ -@@ -20,7 +24,7 @@ - { - Chunk var3 = par0World.getChunkFromChunkCoords(par1, par2); - int var4 = par1 * 16 + par0World.rand.nextInt(16); -- int var5 = par0World.rand.nextInt(var3 == null ? 128 : Math.max(128, var3.getTopFilledSegment())); -+ int var5 = par0World.rand.nextInt(var3 == null ? 128 : Math.max(128, var3.getTopFilledSegment() + 15)); //Vanilla Bug that causes mobs to not spawn on the topmost chunk with blocks. - int var6 = par2 * 16 + par0World.rand.nextInt(16); - return new ChunkPosition(var4, var5, var6); - } -@@ -78,6 +82,12 @@ - if ((!var34.getPeacefulCreature() || par2) && (var34.getPeacefulCreature() || par1) && par0World.countEntities(var34.getCreatureClass()) <= var34.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256) - { - Iterator var35 = eligibleChunksForSpawning.keySet().iterator(); -+ if (mod_MinecraftForge.SPAWNER_MAKE_MORE_RANDOM) -+ { -+ ArrayList tmp = new ArrayList(eligibleChunksForSpawning.keySet()); -+ Collections.shuffle(tmp); -+ var35 = tmp.iterator(); -+ } - label108: - - while (var35.hasNext()) -@@ -202,7 +212,8 @@ - else - { - int var5 = par1World.getBlockId(par2, par3 - 1, par4); -- return Block.isNormalCube(var5) && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); -+ boolean spawnBlock = (Block.blocksList[var5] != null && Block.blocksList[var5].canCreatureSpawn(par0EnumCreatureType, par1World, par2, par3 - 1, par4)); -+ return spawnBlock && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); - } - } - -@@ -211,6 +222,16 @@ - */ - private static void creatureSpecificInit(EntityLiving par0EntityLiving, World par1World, float par2, float par3, float par4) - { -+ if (ForgeHooks.onEntitySpawnSpecial(par0EntityLiving, par1World, par2, par3, par4)) //Deprecated in 1.2.5, remove in 1.3 -+ { -+ return; -+ } -+ -+ if (ForgeHooks.onEntityLivingSpawn(par0EntityLiving, par1World, par2, par3, par4)) -+ { -+ return; -+ } -+ - if (par0EntityLiving instanceof EntitySpider && par1World.rand.nextInt(100) == 0) - { - EntitySkeleton var7 = new EntitySkeleton(par1World); diff --git a/patches/minecraft/net/minecraft/src/StatList.java.patch b/patches/minecraft/net/minecraft/src/StatList.java.patch deleted file mode 100644 index 40656ca2dc..0000000000 --- a/patches/minecraft/net/minecraft/src/StatList.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 -@@ -166,9 +166,9 @@ - */ - private static StatBase[] initMinableStats(String par0Str, int par1) - { -- StatBase[] var2 = new StatBase[256]; -+ StatBase[] var2 = new StatBase[Block.blocksList.length]; - -- for (int var3 = 0; var3 < 256; ++var3) -+ for (int var3 = 0; var3 < Block.blocksList.length; ++var3) - { - if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) - { diff --git a/patches/minecraft/net/minecraft/src/Teleporter.java.patch b/patches/minecraft/net/minecraft/src/Teleporter.java.patch deleted file mode 100644 index 061c33b6cc..0000000000 --- a/patches/minecraft/net/minecraft/src/Teleporter.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Teleporter.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Teleporter.java 0000-00-00 00:00:00.000000000 -0000 -@@ -70,7 +70,7 @@ - { - double var15 = (double)var14 + 0.5D - par2Entity.posZ; - -- for (int var17 = 127; var17 >= 0; --var17) -+ for (int var17 = par1World.getHeight() - 1; var17 >= 0; --var17) //BugFix - { - if (par1World.getBlockId(var11, var17, var14) == Block.portal.blockID) - { -@@ -170,7 +170,7 @@ - var18 = (double)var17 + 0.5D - par2Entity.posZ; - label274: - -- for (var20 = 127; var20 >= 0; --var20) -+ for (var20 = par1World.getHeight() - 1; var20 >= 0; --var20) //BugFix - { - if (par1World.isAirBlock(var14, var20, var17)) - { -@@ -236,7 +236,7 @@ - var18 = (double)var17 + 0.5D - par2Entity.posZ; - label222: - -- for (var20 = 127; var20 >= 0; --var20) -+ for (var20 = par1World.getHeight() - 1; var20 >= 0; --var20) //BugFix - { - if (par1World.isAirBlock(var14, var20, var17)) - { -@@ -304,9 +304,9 @@ - var10 = 70; - } - -- if (var10 > 118) -+ if (var10 > par1World.getHeight() - 10) //BugFix - { -- var10 = 118; -+ var10 = par1World.getHeight() - 10; //BugFix - } - - var16 = var10; diff --git a/patches/minecraft/net/minecraft/src/Tessellator.java.patch b/patches/minecraft/net/minecraft/src/Tessellator.java.patch deleted file mode 100644 index 166c4b1d42..0000000000 --- a/patches/minecraft/net/minecraft/src/Tessellator.java.patch +++ /dev/null @@ -1,219 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,12 +5,20 @@ - import java.nio.FloatBuffer; - import java.nio.IntBuffer; - import java.nio.ShortBuffer; -+import java.util.Arrays; -+ - import org.lwjgl.opengl.ARBVertexBufferObject; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GLContext; - - public class Tessellator - { -+ private static int nativeBufferSize = 0x200000; -+ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6; -+ public static boolean renderingWorldRenderer = false; -+ public boolean defaultTexture = false; -+ private int rawBufferSize = 0; -+ public int textureID = 0; - /** - * Boolean used to check whether quads should be drawn as four triangles. Initialized to true and never changed. - */ -@@ -22,16 +30,16 @@ - private static boolean tryVBO = false; - - /** The byte buffer used for GL allocation. */ -- private ByteBuffer byteBuffer; -+ private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); - - /** The same memory as byteBuffer, but referenced as an integer buffer. */ -- private IntBuffer intBuffer; -+ private static IntBuffer intBuffer = byteBuffer.asIntBuffer(); - - /** The same memory as byteBuffer, but referenced as an float buffer. */ -- private FloatBuffer floatBuffer; -+ private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); - - /** Short buffer */ -- private ShortBuffer shortBuffer; -+ private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); - - /** Raw integer array. */ - private int[] rawBuffer; -@@ -80,37 +88,37 @@ - private boolean isColorDisabled = false; - - /** The draw mode currently being used by the tessellator. */ -- private int drawMode; -+ public int drawMode; - - /** - * An offset to be applied along the x-axis for all vertices in this draw call. - */ -- private double xOffset; -+ public double xOffset; - - /** - * An offset to be applied along the y-axis for all vertices in this draw call. - */ -- private double yOffset; -+ public double yOffset; - - /** - * An offset to be applied along the z-axis for all vertices in this draw call. - */ -- private double zOffset; -+ public double zOffset; - - /** The normal to be applied to the face being drawn. */ - private int normal; - - /** The static instance of the Tessellator. */ -- public static final Tessellator instance = new Tessellator(2097152); -+ public static Tessellator instance = new Tessellator(); - - /** Whether this tessellator is currently in draw mode. */ -- private boolean isDrawing = false; -+ public boolean isDrawing = false; - - /** Whether we are currently using VBO or not. */ -- private boolean useVBO = false; -+ private static boolean useVBO = false; - - /** An IntBuffer used to store the indices of vertex buffer objects. */ -- private IntBuffer vertexBuffers; -+ private static IntBuffer vertexBuffers; - - /** - * The index of the last VBO used. This is used in round-robin fashion, sequentially, through the vboCount vertex -@@ -119,27 +127,23 @@ - private int vboIndex = 0; - - /** Number of vertex buffer objects allocated for use. */ -- private int vboCount = 10; -- -- /** The size of the buffers used (in integers). */ -- private int bufferSize; -+ private static int vboCount = 10; - -- private Tessellator(int par1) -+ static - { -- this.bufferSize = par1; -- this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4); -- this.intBuffer = this.byteBuffer.asIntBuffer(); -- this.floatBuffer = this.byteBuffer.asFloatBuffer(); -- this.shortBuffer = this.byteBuffer.asShortBuffer(); -- this.rawBuffer = new int[par1]; -- this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -- -- if (this.useVBO) -+ instance.defaultTexture = true; -+ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -+ if (useVBO) - { -- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount); -- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers); -+ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); -+ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); - } - } -+ -+ public Tessellator() -+ { -+ this.rawBuffer = null; -+ } - - /** - * Draws the data set up in this tessellator and resets the state to prepare for new drawing. -@@ -154,12 +158,23 @@ - { - this.isDrawing = false; - -- if (this.vertexCount > 0) -+ int offs = 0; -+ while (offs < vertexCount) - { -+ int vtc = 0; -+ if (drawMode == 7 && convertQuadsToTriangles) -+ { -+ Math.min(vertexCount - offs, trivertsInBuffer); -+ } -+ else -+ { -+ vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5); -+ } - this.intBuffer.clear(); -- this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); -+ intBuffer.put(rawBuffer, offs * 8, vtc * 8); - this.byteBuffer.position(0); -- this.byteBuffer.limit(this.rawBufferIndex * 4); -+ byteBuffer.limit(vtc * 32); -+ offs += vtc; - - if (this.useVBO) - { -@@ -245,11 +260,11 @@ - - if (this.drawMode == 7 && convertQuadsToTriangles) - { -- GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, this.vertexCount); -+ GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, vtc); - } - else - { -- GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); -+ GL11.glDrawArrays(this.drawMode, 0, vtc); - } - - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); -@@ -276,7 +291,13 @@ - GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); - } - } -- -+ -+ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) -+ { -+ rawBufferSize = 0; -+ rawBuffer = null; -+ } -+ - int var1 = this.rawBufferIndex * 4; - this.reset(); - return var1; -@@ -439,6 +460,19 @@ - */ - public void addVertex(double par1, double par3, double par5) - { -+ if (rawBufferIndex >= rawBufferSize - 32) -+ { -+ if (rawBufferSize == 0) -+ { -+ rawBufferSize = 0x10000; -+ rawBuffer = new int[rawBufferSize]; -+ } -+ else -+ { -+ rawBufferSize *= 2; -+ rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize); -+ } -+ } - ++this.addedVertices; - - if (this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) -@@ -497,12 +531,6 @@ - this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); - this.rawBufferIndex += 8; - ++this.vertexCount; -- -- if (this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) -- { -- this.draw(); -- this.isDrawing = true; -- } - } - - /** diff --git a/patches/minecraft/net/minecraft/src/TileEntity.java.patch b/patches/minecraft/net/minecraft/src/TileEntity.java.patch deleted file mode 100644 index 631037287e..0000000000 --- a/patches/minecraft/net/minecraft/src/TileEntity.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -223,4 +223,29 @@ - public static void addNewTileEntityMapping(Class tileEntityClass, String id) { - addMapping(tileEntityClass, id); - } -+ -+ /** -+ * Determines if this TileEntity requires update calls. -+ * @return True if you want updateEntity() to be called, false if not -+ */ -+ public boolean canUpdate() -+ { -+ return true; -+ } -+ -+ /** -+ * Called when you receive a TileEntityData packet for the location this -+ * TileEntity is currently in. On the client, the NetworkManager will always -+ * be the remote server. On the server, it will be whomever is responsible for -+ * sending the packet. -+ * -+ * @param net The NetworkManager the packet originated from -+ * @param pkt The data packet -+ */ -+ public void onDataPacket(NetworkManager net, Packet132TileEntityData pkt){} -+ -+ /** -+ * Called when the chunk this TileEntity is on is Unloaded. -+ */ -+ public void onChunkUnload(){} - } diff --git a/patches/minecraft/net/minecraft/src/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/src/TileEntityBrewingStand.java.patch deleted file mode 100644 index cd69e22c1e..0000000000 --- a/patches/minecraft/net/minecraft/src/TileEntityBrewingStand.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,7 +2,9 @@ - - import java.util.List; - --public class TileEntityBrewingStand extends TileEntity implements IInventory -+import net.minecraft.src.forge.ISidedInventory; -+ -+public class TileEntityBrewingStand extends TileEntity implements IInventory, ISidedInventory - { - /** The itemstacks currently placed in the slots of the brewing stand */ - private ItemStack[] brewingItemStacks = new ItemStack[4]; -@@ -322,4 +324,16 @@ - - return var1; - } -+ -+ @Override -+ public int getStartInventorySide(int side) -+ { -+ return (side == 1 ? 3 : 0); -+ } -+ -+ @Override -+ public int getSizeInventorySide(int side) -+ { -+ return (side == 1 ? 1 : 3); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch deleted file mode 100644 index 29a559beab..0000000000 --- a/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,7 +3,10 @@ - import cpw.mods.fml.client.FMLClientHandler; - import cpw.mods.fml.common.FMLCommonHandler; - --public class TileEntityFurnace extends TileEntity implements IInventory -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ISidedInventory; -+ -+public class TileEntityFurnace extends TileEntity implements IInventory, ISidedInventory - { - /** - * The ItemStacks that hold the items currently being used in the furnace -@@ -275,8 +278,12 @@ - } - else - { -- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); -- return var1 == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(var1) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < var1.getMaxStackSize()))); -+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); -+ if (var1 == null) return false; -+ if (this.furnaceItemStacks[2] == null) return true; -+ if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false; -+ int result = furnaceItemStacks[2].stackSize + var1.stackSize; -+ return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize()); - } - } - -@@ -287,15 +294,25 @@ - { - if (this.canSmelt()) - { -- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); -+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); - - if (this.furnaceItemStacks[2] == null) - { - this.furnaceItemStacks[2] = var1.copy(); - } -- else if (this.furnaceItemStacks[2].itemID == var1.itemID) -+ else if (this.furnaceItemStacks[2].isItemEqual(var1)) - { -- ++this.furnaceItemStacks[2].stackSize; -+ //========================================================== -+ //Adding extra importance here, so this really small bug -+ //fix stops slipping through the cracks. -+ // -+ //Makes it so that items that result in multiple items are -+ //smelted correctly each time. -+ // -+ // -+ // -+ this.furnaceItemStacks[2].stackSize += var1.stackSize; -+ //========================================================== - } - - --this.furnaceItemStacks[0].stackSize; -@@ -320,12 +337,17 @@ - else - { - int var1 = par1ItemStack.getItem().shiftedIndex; -- if (var1 < 256 && Block.blocksList[var1].blockMaterial == Material.wood) return 300; -+ if (par1ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1].blockMaterial == Material.wood) return 300; - if (var1 == Item.stick.shiftedIndex) return 100; - if (var1 == Item.coal.shiftedIndex) return 1600; - if (var1 == Item.bucketLava.shiftedIndex) return 20000; - if (var1 == Block.sapling.blockID) return 100; - if (var1 == Item.blazeRod.shiftedIndex) return 2400; -+ int ret = ForgeHooks.getItemBurnTime(par1ItemStack); -+ if (ret > 0) -+ { -+ return ret; -+ } - return FMLCommonHandler.instance().fuelLookup(var1, par1ItemStack.getItemDamageForDisplay()); - } - } -@@ -349,4 +371,18 @@ - public void openChest() {} - - public void closeChest() {} -+ -+ @Override -+ public int getStartInventorySide(int side) -+ { -+ if (side == 0) return 1; -+ if (side == 1) return 0; -+ return 2; -+ } -+ -+ @Override -+ public int getSizeInventorySide(int side) -+ { -+ return 1; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch b/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch deleted file mode 100644 index 852dc8b756..0000000000 --- a/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/TileEntityRendererPiston.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/TileEntityRendererPiston.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,8 @@ - package net.minecraft.src; - - import net.minecraft.client.Minecraft; -+import net.minecraft.src.forge.ForgeHooksClient; -+ - import org.lwjgl.opengl.GL11; - - public class TileEntityRendererPiston extends TileEntitySpecialRenderer -@@ -29,7 +31,7 @@ - { - GL11.glShadeModel(GL11.GL_FLAT); - } -- -+ ForgeHooksClient.beforeBlockRender(var9, blockRenderer); - var10.startDrawingQuads(); - var10.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord + par1TileEntityPiston.getOffsetX(par8)), (double)((float)par4 - (float)par1TileEntityPiston.yCoord + par1TileEntityPiston.getOffsetY(par8)), (double)((float)par6 - (float)par1TileEntityPiston.zCoord + par1TileEntityPiston.getOffsetZ(par8))); - var10.setColorOpaque(1, 1, 1); -@@ -53,6 +55,7 @@ - - var10.setTranslation(0.0D, 0.0D, 0.0D); - var10.draw(); -+ ForgeHooksClient.afterBlockRender(var9, blockRenderer); - RenderHelper.enableStandardItemLighting(); - } - } diff --git a/patches/minecraft/net/minecraft/src/World.java.patch b/patches/minecraft/net/minecraft/src/World.java.patch deleted file mode 100644 index f3479118dc..0000000000 --- a/patches/minecraft/net/minecraft/src/World.java.patch +++ /dev/null @@ -1,380 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -@@ -9,8 +9,18 @@ - import java.util.Set; - import java.util.TreeSet; - -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ForgeHooksClient; -+ - public class World implements IBlockAccess - { -+ /** -+ * Used in the getEntitiesWithinAABB functions to expand the search area for entities. -+ * Modders should change this variable to a higher value if it is less then the radius -+ * of one of there entities. -+ */ -+ public static double MAX_ENTITY_RADIUS = 2.0D; -+ - /** - * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately - */ -@@ -79,7 +89,7 @@ - * Contains a timestamp from when the World object was created. Is used in the session.lock file - */ - private long lockTimestamp; -- protected int autosavePeriod; -+ public int autosavePeriod; - - /** Option > Difficulty setting (0 - 3) */ - public int difficultySetting; -@@ -214,6 +224,7 @@ - this.chunkProvider = this.createChunkProvider(); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); -+ ForgeHooks.onWorldLoad(this); - } - - public World(World par1World, WorldProvider par2WorldProvider) -@@ -259,6 +270,7 @@ - this.chunkProvider = this.createChunkProvider(); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); -+ ForgeHooks.onWorldLoad(this); - } - - public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings) -@@ -340,6 +352,7 @@ - - this.calculateInitialSkylight(); - this.calculateInitialWeather(); -+ ForgeHooks.onWorldLoad(this); - } - - /** -@@ -507,6 +520,7 @@ - } - - this.chunkProvider.saveChunks(par1, par2IProgressUpdate); -+ ForgeHooks.onWorldSave(this); - } - } - -@@ -559,7 +573,8 @@ - */ - public boolean isAirBlock(int par1, int par2, int par3) - { -- return this.getBlockId(par1, par2, par3) == 0; -+ int id = getBlockId(par1, par2, par3); -+ return id == 0 || Block.blocksList[id] == null || Block.blocksList[id].isAirBlock(this, par1, par2, par3); - } - - /** -@@ -1253,7 +1268,9 @@ - int var12 = this.getBlockMetadata(var8, var9, var10); - Block var13 = Block.blocksList[var11]; - -- if ((!par4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var11 > 0 && var13.canCollideCheck(var12, par3)) -+ if (var13 != null && //BugFix NPE on misconfigured block ids. -+ (!par4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && -+ var11 > 0 && var13.canCollideCheck(var12, par3)) - { - MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3D, par2Vec3D); - -@@ -1453,6 +1470,12 @@ - */ - public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) - { -+ par2Str = ForgeHooksClient.onPlaySoundAtEntity(par1Entity, par2Str, par3, par4); -+ if (par2Str == null) -+ { -+ return; -+ } -+ - for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) - { - ((IWorldAccess)this.worldAccesses.get(var5)).playSound(par2Str, par1Entity.posX, par1Entity.posY - (double)par1Entity.yOffset, par1Entity.posZ, par3, par4); -@@ -2068,7 +2091,7 @@ - - if (var7 != null) - { -- var7.removeChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15); -+ var7.cleanChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15); - } - } - } -@@ -2078,6 +2101,10 @@ - - if (!this.entityRemoval.isEmpty()) - { -+ for (Object tile : entityRemoval) -+ { -+ ((TileEntity)tile).onChunkUnload(); -+ } - this.loadedTileEntityList.removeAll(this.entityRemoval); - this.entityRemoval.clear(); - } -@@ -2098,18 +2125,18 @@ - { - this.loadedTileEntityList.add(var8); - } -- -+ } -+ else -+ { - if (this.chunkExists(var8.xCoord >> 4, var8.zCoord >> 4)) - { - Chunk var9 = this.getChunkFromChunkCoords(var8.xCoord >> 4, var8.zCoord >> 4); - - if (var9 != null) - { -- var9.setChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15, var8); -+ var9.cleanChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15); - } - } -- -- this.markBlockNeedsUpdate(var8.xCoord, var8.yCoord, var8.zCoord); - } - } - -@@ -2122,13 +2149,13 @@ - - public void addTileEntity(Collection par1Collection) - { -- if (this.scanningTileEntities) -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ for(Object entity : par1Collection) - { -- this.addedTileEntityList.addAll(par1Collection); -- } -- else -- { -- this.loadedTileEntityList.addAll(par1Collection); -+ if(((TileEntity)entity).canUpdate()) -+ { -+ dest.add(entity); -+ } - } - } - -@@ -2150,7 +2177,7 @@ - int var4 = MathHelper.floor_double(par1Entity.posZ); - byte var5 = 32; - -- if (!par2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5)) -+ if (!par2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5) || ForgeHooks.canUpdateEntity(par1Entity)) - { - par1Entity.lastTickPosX = par1Entity.posX; - par1Entity.lastTickPosY = par1Entity.posY; -@@ -2327,7 +2354,14 @@ - if (var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID) - { - return true; -- } -+ } -+ else -+ { -+ if(var11 > 0 && Block.blocksList[var11].isBlockBurning(this, var8, var9, var10)) -+ { -+ return true; -+ } -+ } - } - } - } -@@ -2631,25 +2665,19 @@ - */ - public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) - { -- if (par4TileEntity != null && !par4TileEntity.isInvalid()) -+ if (par4TileEntity == null || par4TileEntity.isInvalid()) - { -- if (this.scanningTileEntities) -- { -- par4TileEntity.xCoord = par1; -- par4TileEntity.yCoord = par2; -- par4TileEntity.zCoord = par3; -- this.addedTileEntityList.add(par4TileEntity); -- } -- else -- { -- this.loadedTileEntityList.add(par4TileEntity); -- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -- -- if (var5 != null) -- { -- var5.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); -- } -- } -+ return; -+ } -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ if (par4TileEntity.canUpdate()) -+ { -+ dest.add(par4TileEntity); -+ } -+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ if (chunk != null) -+ { -+ chunk.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); - } - } - -@@ -2658,27 +2686,10 @@ - */ - public void removeBlockTileEntity(int par1, int par2, int par3) - { -- TileEntity var4 = this.getBlockTileEntity(par1, par2, par3); -- -- if (var4 != null && this.scanningTileEntities) -+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ if (chunk != null) - { -- var4.invalidate(); -- this.addedTileEntityList.remove(var4); -- } -- else -- { -- if (var4 != null) -- { -- this.addedTileEntityList.remove(var4); -- this.loadedTileEntityList.remove(var4); -- } -- -- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -- -- if (var5 != null) -- { -- var5.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); -- } -+ chunk.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - } - -@@ -2704,7 +2715,8 @@ - */ - public boolean isBlockNormalCube(int par1, int par2, int par3) - { -- return Block.isNormalCube(this.getBlockId(par1, par2, par3)); -+ Block block = Block.blocksList[getBlockId(par1, par2, par3)]; -+ return block != null && block.isBlockNormalCube(this, par1, par2, par3); - } - - /** -@@ -2720,7 +2732,7 @@ - if (var5 != null && !var5.isEmpty()) - { - Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)]; -- return var6 == null ? false : var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock(); -+ return var6 == null ? false : isBlockNormalCube(par1, par2, par3); - } - else - { -@@ -2985,6 +2997,7 @@ - } - } - } -+ ForgeHooks.addActiveChunks(this, activeChunkSet); - - Profiler.endSection(); - -@@ -3308,7 +3321,7 @@ - - private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6) - { -- int var7 = Block.lightValue[par5]; -+ int var7 = (par5 == 0 || Block.blocksList[par5] == null ? 0 : Block.blocksList[par5].getLightValue(this, par2, par3, par4)); - int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6; - int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6; - int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6; -@@ -3668,10 +3681,10 @@ - public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) - { - this.entitiesWithinAABBExcludingEntity.clear(); -- int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); - - for (int var7 = var3; var7 <= var4; ++var7) - { -@@ -3692,10 +3705,10 @@ - */ - public List getEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB) - { -- int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); - ArrayList var7 = new ArrayList(); - - for (int var8 = var3; var8 <= var4; ++var8) -@@ -3840,7 +3853,10 @@ - { - var8 = null; - } -- -+ if (var8 != null && var8.isBlockReplaceable(this, par2, par3, par4)) -+ { -+ var8 = null; -+ } - return par1 > 0 && var8 == null && var9.canPlaceBlockOnSide(this, par2, par3, par4, par6); - } - } -@@ -4399,7 +4415,7 @@ - */ - public int getHeight() - { -- return 256; -+ return worldProvider.hasNoSky ? 128 : 256; //Nether is 128, overworld is 256, Bugfix related to Portal generation - } - - /** -@@ -4449,4 +4465,39 @@ - { - return this.worldInfo.getTerrainType().getHorizon(this); - } -+ -+ -+ /** -+ * Adds a single TileEntity to the world. -+ * TODO: Eloraam fully describe the bug this fixes. -+ * @param entity The TileEntity to be added. -+ */ -+ public void addTileEntity(TileEntity entity) -+ { -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ if(entity.canUpdate()) -+ { -+ dest.add(entity); -+ } -+ } -+ -+ /** -+ * Determine if the given block is considered solid on the -+ * specified side. Used by placement logic. -+ * -+ * @param X Block X Position -+ * @param Y Block Y Position -+ * @param Z Block Z Position -+ * @param side The Side in question -+ * @return True if the side is solid -+ */ -+ public boolean isBlockSolidOnSide(int X, int Y, int Z, int side) -+ { -+ Block block = Block.blocksList[getBlockId(X, Y, Z)]; -+ if(block == null) -+ { -+ return false; -+ } -+ return block.isBlockSolidOnSide(this, X, Y, Z, side); -+ } - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenBigMushroom.java.patch b/patches/minecraft/net/minecraft/src/WorldGenBigMushroom.java.patch deleted file mode 100644 index 972aefa276..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenBigMushroom.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenBigMushroom.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenBigMushroom.java 0000-00-00 00:00:00.000000000 -0000 -@@ -54,7 +54,9 @@ - { - var13 = par1World.getBlockId(var11, var9, var12); - -- if (var13 != 0 && var13 != Block.leaves.blockID) -+ Block block = Block.blocksList[var13]; -+ -+ if (var13 != 0 && block != null && !block.isLeaves(par1World, var11, var9, var12)) - { - var8 = false; - } -@@ -186,7 +188,9 @@ - var15 = 0; - } - -- if ((var15 != 0 || par4 >= par4 + var7 - 1) && !Block.opaqueCubeLookup[par1World.getBlockId(var13, var11, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var13, var11, var14)]; -+ -+ if ((var15 != 0 || par4 >= par4 + var7 - 1) && (block == null || block.canBeReplacedByLeaves(par1World, var13, var11, var14))) - { - this.setBlockAndMetadata(par1World, var13, var11, var14, Block.mushroomCapBrown.blockID + var6, var15); - } -@@ -198,7 +202,9 @@ - { - var12 = par1World.getBlockId(par3, par4 + var11, par5); - -- if (!Block.opaqueCubeLookup[var12]) -+ Block block = Block.blocksList[var12]; -+ -+ if (block == null || block.canBeReplacedByLeaves(par1World, par3, par4 + var11, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.mushroomCapBrown.blockID + var6, 10); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenDeadBush.java.patch b/patches/minecraft/net/minecraft/src/WorldGenDeadBush.java.patch deleted file mode 100644 index 728e5ab5f1..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenDeadBush.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenDeadBush.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenDeadBush.java 0000-00-00 00:00:00.000000000 -0000 -@@ -16,10 +16,16 @@ - { - int var11; - -- for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - for (int var7 = 0; var7 < 4; ++var7) - { diff --git a/patches/minecraft/net/minecraft/src/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/src/WorldGenDungeons.java.patch deleted file mode 100644 index 7d7e664d40..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenDungeons.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,8 @@ - - import java.util.Random; - -+import net.minecraft.src.forge.MinecraftForge; -+ - public class WorldGenDungeons extends WorldGenerator - { - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) -@@ -117,9 +119,9 @@ - - if (var16 != null) - { -- for (int var17 = 0; var17 < 8; ++var17) -+ for (int var17 = 0; var17 < MinecraftForge.getDungeonLootTries(); ++var17) - { -- ItemStack var18 = this.pickCheckLootItem(par2Random); -+ ItemStack var18 = MinecraftForge.getRandomDungeonLoot(par2Random); - - if (var18 != null) - { diff --git a/patches/minecraft/net/minecraft/src/WorldGenForest.java.patch b/patches/minecraft/net/minecraft/src/WorldGenForest.java.patch deleted file mode 100644 index 6290e9f656..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenForest.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenForest.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenForest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -43,7 +43,9 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 != 0 && (block != null && !block.isLeaves(par1World, var10, var8, var11))) - { - var7 = false; - } -@@ -82,7 +84,10 @@ - { - int var15 = var14 - par5; - -- if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var14)]; -+ -+ if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var12, var16, var14))) - { - this.setBlockAndMetadata(par1World, var12, var16, var14, Block.leaves.blockID, 2); - } -@@ -94,7 +99,9 @@ - { - var10 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var10 == 0 || var10 == Block.leaves.blockID) -+ Block block = Block.blocksList[var10]; -+ -+ if (var10 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var16, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 2); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/src/WorldGenHugeTrees.java.patch deleted file mode 100644 index 2e1ced6a99..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenHugeTrees.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenHugeTrees.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenHugeTrees.java 0000-00-00 00:00:00.000000000 -0000 -@@ -55,7 +55,12 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) -+ if (var12 != 0 && -+ (Block.blocksList[var12] != null && !Block.blocksList[var12].isLeaves(par1World, var10, var8, var11)) && -+ var12 != Block.grass.blockID && -+ var12 != Block.dirt.blockID && -+ (Block.blocksList[var12] != null && !Block.blocksList[var12].isWood(par1World, var10, var8, var11)) && -+ var12 != Block.sapling.blockID) - { - var7 = false; - } -@@ -103,7 +108,7 @@ - { - var11 = par1World.getBlockId(par3, par4 + var10, par5); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3, par4 + var10, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); - -@@ -125,7 +130,7 @@ - { - var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3 + 1, par4 + var10, par5)) - { - this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); - -@@ -145,7 +150,7 @@ - - var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5 + 1); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3 + 1, par4 + var10, par5 + 1)) - { - this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); - -@@ -165,7 +170,7 @@ - - var11 = par1World.getBlockId(par3, par4 + var10, par5 + 1); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3, par4 + var10, par5 + 1)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); - -@@ -216,7 +221,12 @@ - { - int var14 = var13 - par3; - -- if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1)) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) -+ Block block = Block.blocksList[par1World.getBlockId(var11, var8, var13)]; -+ -+ if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && -+ (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && -+ (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1)) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var11, var8, var13))) - { - this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/src/WorldGenMinable.java.patch deleted file mode 100644 index 534b0359ce..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenMinable.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenMinable.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenMinable.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,7 @@ - { - /** The block ID of the ore to be placed using this generator. */ - private int minableBlockId; -+ private int minableBlockMeta = 0; - - /** The number of blocks to generate. */ - private int numberOfBlocks; -@@ -15,6 +16,12 @@ - this.minableBlockId = par1; - this.numberOfBlocks = par2; - } -+ -+ public WorldGenMinable(int id, int meta, int number) -+ { -+ this(id, number); -+ minableBlockMeta = meta; -+ } - - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) - { -@@ -57,9 +64,10 @@ - { - double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D); - -- if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.getBlockId(var38, var41, var44) == Block.stone.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var38, var41, var44)]; -+ if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, var38, var41, var44))) - { -- par1World.setBlock(var38, var41, var44, this.minableBlockId); -+ par1World.setBlockAndMetadata(var38, var41, var44, this.minableBlockId, minableBlockMeta); - } - } - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenShrub.java.patch b/patches/minecraft/net/minecraft/src/WorldGenShrub.java.patch deleted file mode 100644 index 9952430f3d..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenShrub.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenShrub.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenShrub.java 0000-00-00 00:00:00.000000000 -0000 -@@ -17,10 +17,16 @@ - { - int var15; - -- for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - int var7 = par1World.getBlockId(par3, par4, par5); - -@@ -42,7 +48,9 @@ - { - int var14 = var13 - par5; - -- if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) -+ block = Block.blocksList[par1World.getBlockId(var11, var8, var13)]; -+ -+ if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && (block == null || block.canBeReplacedByLeaves(par1World, var11, var8, var13))) - { - this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.field_48197_a); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenSwamp.java.patch b/patches/minecraft/net/minecraft/src/WorldGenSwamp.java.patch deleted file mode 100644 index 31c67a3023..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenSwamp.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenSwamp.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenSwamp.java 0000-00-00 00:00:00.000000000 -0000 -@@ -44,7 +44,7 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID) -+ if (var12 != 0 && (Block.blocksList[var12] != null && !Block.blocksList[var12].isLeaves(par1World, var10, var8, var11))) - { - if (var12 != Block.waterStill.blockID && var12 != Block.waterMoving.blockID) - { -@@ -91,7 +91,10 @@ - { - int var15 = var14 - par5; - -- if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var14)]; -+ -+ if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var12, var16, var14))) - { - this.setBlock(par1World, var12, var16, var14, Block.leaves.blockID); - } -@@ -103,7 +106,9 @@ - { - var10 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) -+ Block block = Block.blocksList[var10]; -+ -+ if (var10 == 0 || (block != null && block.isLeaves(par1World, par3, par4 + var16, par5)) || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) - { - this.setBlock(par1World, par3, par4 + var16, par5, Block.wood.blockID); - } -@@ -118,7 +123,8 @@ - { - for (var13 = par5 - var11; var13 <= par5 + var11; ++var13) - { -- if (par1World.getBlockId(var12, var16, var13) == Block.leaves.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var13)]; -+ if (block != null && block.isLeaves(par1World, var12, var16, var13)) - { - if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0) - { diff --git a/patches/minecraft/net/minecraft/src/WorldGenTaiga1.java.patch b/patches/minecraft/net/minecraft/src/WorldGenTaiga1.java.patch deleted file mode 100644 index 7cd1ad8715..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenTaiga1.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenTaiga1.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenTaiga1.java 0000-00-00 00:00:00.000000000 -0000 -@@ -41,7 +41,9 @@ - { - var15 = par1World.getBlockId(var13, var11, var14); - -- if (var15 != 0 && var15 != Block.leaves.blockID) -+ Block block = Block.blocksList[var15]; -+ -+ if (var15 != 0 && (block == null || !block.isLeaves(par1World, var13, var11, var14))) - { - var10 = false; - } -@@ -77,7 +79,10 @@ - { - int var17 = var16 - par5; - -- if ((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var13, var16)]) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var13, var16)]; -+ -+ if ((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var14, var13, var16))) - { - this.setBlockAndMetadata(par1World, var14, var13, var16, Block.leaves.blockID, 1); - } -@@ -98,7 +103,9 @@ - { - var14 = par1World.getBlockId(par3, par4 + var13, par5); - -- if (var14 == 0 || var14 == Block.leaves.blockID) -+ Block block = Block.blocksList[var14]; -+ -+ if (var14 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var13, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var13, par5, Block.wood.blockID, 1); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenTaiga2.java.patch b/patches/minecraft/net/minecraft/src/WorldGenTaiga2.java.patch deleted file mode 100644 index cb2a785719..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenTaiga2.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenTaiga2.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenTaiga2.java 0000-00-00 00:00:00.000000000 -0000 -@@ -45,7 +45,9 @@ - { - var15 = par1World.getBlockId(var13, var11, var14); - -- if (var15 != 0 && var15 != Block.leaves.blockID) -+ Block block = Block.blocksList[var15]; -+ -+ if (var15 != 0 && block != null && !block.isLeaves(par1World, var13, var11, var14)) - { - var10 = false; - } -@@ -87,7 +89,9 @@ - { - int var20 = var19 - par5; - -- if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var17, var16, var19)]) -+ Block block = Block.blocksList[par1World.getBlockId(var17, var16, var19)]; -+ -+ if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && (block == null || block.canBeReplacedByLeaves(par1World, var17, var16, var19))) - { - this.setBlockAndMetadata(par1World, var17, var16, var19, Block.leaves.blockID, 1); - } -@@ -117,7 +121,9 @@ - { - var17 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var17 == 0 || var17 == Block.leaves.blockID) -+ Block block = Block.blocksList[var17]; -+ -+ if (var17 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var16, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 1); - } diff --git a/patches/minecraft/net/minecraft/src/WorldGenTallGrass.java.patch b/patches/minecraft/net/minecraft/src/WorldGenTallGrass.java.patch deleted file mode 100644 index d061ed8f54..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenTallGrass.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -@@ -18,10 +18,16 @@ - { - int var11; - -- for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - for (int var7 = 0; var7 < 128; ++var7) - { diff --git a/patches/minecraft/net/minecraft/src/WorldGenTrees.java.patch b/patches/minecraft/net/minecraft/src/WorldGenTrees.java.patch deleted file mode 100644 index 679b07c03f..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldGenTrees.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldGenTrees.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldGenTrees.java 0000-00-00 00:00:00.000000000 -0000 -@@ -64,7 +64,13 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 != 0 && -+ !block.isLeaves(par1World, var10, var8, var11) && -+ var12 != Block.grass.blockID && -+ var12 != Block.dirt.blockID && -+ !block.isWood(par1World, var10, var8, var11)) - { - var7 = false; - } -@@ -107,7 +113,10 @@ - { - int var17 = var16 - par5; - -- if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var11, var16)]) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var11, var16)]; -+ -+ if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var14, var11, var16))) - { - this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves); - } -@@ -119,7 +128,9 @@ - { - var12 = par1World.getBlockId(par3, par4 + var11, par5); - -- if (var12 == 0 || var12 == Block.leaves.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var11, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.wood.blockID, this.metaWood); - -@@ -159,7 +170,8 @@ - { - for (var15 = par5 - var13; var15 <= par5 + var13; ++var15) - { -- if (par1World.getBlockId(var14, var11, var15) == Block.leaves.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var11, var15)]; -+ if (block != null && block.isLeaves(par1World, var14, var11, var15)) - { - if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0) - { diff --git a/patches/minecraft/net/minecraft/src/WorldProvider.java.patch b/patches/minecraft/net/minecraft/src/WorldProvider.java.patch deleted file mode 100644 index a551f0826f..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldProvider.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.DimensionManager; -+ - public abstract class WorldProvider - { - /** world object being used */ -@@ -174,7 +176,7 @@ - - public static WorldProvider getProviderForDimension(int par0) - { -- return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null))); -+ return DimensionManager.createProviderFor(par0); - } - - /** -@@ -225,4 +227,36 @@ - { - return false; - } -+ -+ /** -+ * Returns the sub-folder of the world folder that this WorldProvider saves to. -+ * EXA: DIM1, DIM-1 -+ * @return The sub-folder name to save this world's chunks to. -+ */ -+ public abstract String getSaveFolder(); -+ -+ /** -+ * A message to display to the user when they transfer to this dimension. -+ * -+ * @return The message to be displayed -+ */ -+ public abstract String getWelcomeMessage(); -+ -+ /** -+ * A Message to display to the user when they transfer out of this dismension. -+ * -+ * @return The message to be displayed -+ */ -+ public abstract String getDepartMessage(); -+ -+ /** -+ * The dimensions movement factor. Relative to normal overworld. -+ * It is applied to the players position when they transfer dimensions. -+ * Exa: Nether movement is 8.0 -+ * @return The movement factor -+ */ -+ public double getMovementFactor() -+ { -+ return 1.0; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/WorldProviderEnd.java.patch b/patches/minecraft/net/minecraft/src/WorldProviderEnd.java.patch deleted file mode 100644 index 379b2ecc06..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldProviderEnd.java.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000 -@@ -115,4 +115,22 @@ - { - return true; - } -+ -+ @Override -+ public String getSaveFolder() -+ { -+ return "DIM1"; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return "Entering the End"; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return "Leaving the End"; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/WorldProviderHell.java.patch b/patches/minecraft/net/minecraft/src/WorldProviderHell.java.patch deleted file mode 100644 index 5fd187ea66..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldProviderHell.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000 -@@ -76,4 +76,28 @@ - { - return true; - } -+ -+ @Override -+ public String getSaveFolder() -+ { -+ return "DIM-1"; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return "Entering the Nether"; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return "Leaving the Nether"; -+ } -+ -+ @Override -+ public double getMovementFactor() -+ { -+ return 8.0; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/WorldProviderSurface.java.patch b/patches/minecraft/net/minecraft/src/WorldProviderSurface.java.patch deleted file mode 100644 index a61e158e5d..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldProviderSurface.java.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,4 +2,22 @@ - - public class WorldProviderSurface extends WorldProvider - { -+ -+ @Override -+ public String getSaveFolder() -+ { -+ return null; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return null; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return null; -+ } - } diff --git a/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch deleted file mode 100644 index c7002c9749..0000000000 --- a/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,6 +3,9 @@ - import java.util.ArrayList; - import java.util.HashSet; - import java.util.List; -+ -+import net.minecraft.src.forge.ForgeHooksClient; -+ - import org.lwjgl.opengl.GL11; - - public class WorldRenderer -@@ -10,7 +13,6 @@ - /** Reference to the World object. */ - public World worldObj; - private int glRenderList = -1; -- private static Tessellator tessellator = Tessellator.instance; - public static int chunksUpdated = 0; - public int posX; - public int posY; -@@ -179,11 +181,12 @@ - GL11.glTranslatef(-8.0F, -8.0F, -8.0F); - GL11.glScalef(var19, var19, var19); - GL11.glTranslatef(8.0F, 8.0F, 8.0F); -- tessellator.startDrawingQuads(); -- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); -+ ForgeHooksClient.beforeRenderPass(var11); -+ Tessellator.instance.startDrawingQuads(); -+ Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); - } - -- if (var11 == 0 && Block.blocksList[var18].hasTileEntity()) -+ if (var11 == 0 && Block.blocksList[var18] != null && Block.blocksList[var18].hasTileEntity(var9.getBlockMetadata(var17, var15, var16))) - { - TileEntity var23 = var9.getBlockTileEntity(var17, var15, var16); - -@@ -196,14 +199,17 @@ - Block var24 = Block.blocksList[var18]; - int var20 = var24.getRenderBlockPass(); - -- if (var20 != var11) -+ if (var20 > var11) - { - var12 = true; - } -- else if (var20 == var11) -+ if (!ForgeHooksClient.canRenderInPass(var24, var11)) - { -- var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16); -+ continue; - } -+ ForgeHooksClient.beforeBlockRender(var24, var10); -+ var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16); -+ ForgeHooksClient.afterBlockRender(var24, var10); - } - } - } -@@ -211,10 +217,11 @@ - - if (var14) - { -- this.bytesDrawn += tessellator.draw(); -+ ForgeHooksClient.afterRenderPass(var11); -+ this.bytesDrawn += Tessellator.instance.draw(); - GL11.glPopMatrix(); - GL11.glEndList(); -- tessellator.setTranslation(0.0D, 0.0D, 0.0D); -+ Tessellator.instance.setTranslation(0.0D, 0.0D, 0.0D); - } - else - { diff --git a/patches/minecraft_server/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft_server/net/minecraft/server/MinecraftServer.java.patch deleted file mode 100644 index c961262afb..0000000000 --- a/patches/minecraft_server/net/minecraft/server/MinecraftServer.java.patch +++ /dev/null @@ -1,247 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -9,6 +9,7 @@ - import java.util.Collections; - import java.util.EnumSet; - import java.util.HashMap; -+import java.util.Hashtable; - import java.util.Iterator; - import java.util.List; - import java.util.Random; -@@ -47,11 +48,13 @@ - import net.minecraft.src.ThreadServerApplication; - import net.minecraft.src.ThreadServerSleep; - import net.minecraft.src.Vec3D; -+import net.minecraft.src.World; - import net.minecraft.src.WorldManager; - import net.minecraft.src.WorldServer; - import net.minecraft.src.WorldServerMulti; - import net.minecraft.src.WorldSettings; - import net.minecraft.src.WorldType; -+import net.minecraft.src.forge.DimensionManager; - - public class MinecraftServer implements Runnable, ICommandListener, IServer - { -@@ -72,9 +75,10 @@ - public PropertyManager propertyManagerObj; - - /** The server world manager. */ -- public WorldServer[] worldMngr; -+ //public WorldServer[] worldMngr; - public long[] field_40027_f = new long[100]; -- public long[][] field_40028_g; -+ //public long[][] field_40028_g; -+ public Hashtable worldTickTimes = new Hashtable(); - - /** the server config manager for this server */ - public ServerConfigurationManager configManager; -@@ -102,7 +106,7 @@ - - /** A list containing all the commands entered. */ - private List commands = Collections.synchronizedList(new ArrayList()); -- public EntityTracker[] entityTracker = new EntityTracker[3]; -+ //public EntityTracker[] entityTracker = new EntityTracker[3]; - - /** True if the server is in online mode. */ - public boolean onlineMode; -@@ -132,6 +136,8 @@ - public long[] field_48082_x = new long[100]; - private RConThreadQuery rconQueryThread; - private RConThreadMain rconMainThread; -+ -+ public int spawnProtectionSize = 16; - - public MinecraftServer() - { -@@ -166,6 +172,7 @@ - this.allowFlight = this.propertyManagerObj.getBooleanProperty("allow-flight", false); - this.motd = this.propertyManagerObj.getStringProperty("motd", "A Minecraft Server"); - this.motd.replace('\u00a7', '$'); -+ spawnProtectionSize = this.propertyManagerObj.getIntProperty("spawn-protection-size", 16); - InetAddress var2 = null; - - if (this.hostname.length() > 0) -@@ -198,9 +205,11 @@ - - FMLServerHandler.instance().onLoadComplete(); - this.configManager = new ServerConfigurationManager(this); -+ /* - this.entityTracker[0] = new EntityTracker(this, 0); - this.entityTracker[1] = new EntityTracker(this, -1); - this.entityTracker[2] = new EntityTracker(this, 1); -+ */ - long var3 = System.nanoTime(); - String var5 = this.propertyManagerObj.getStringProperty("level-name", "world"); - String var6 = this.propertyManagerObj.getStringProperty("level-seed", ""); -@@ -268,53 +277,36 @@ - logger.info("Converting map!"); - par1ISaveFormat.convertMapFormat(par2Str, new ConvertProgressUpdater(this)); - } -- -+ /* - this.worldMngr = new WorldServer[3]; - this.field_40028_g = new long[this.worldMngr.length][100]; -+ */ - int var6 = this.propertyManagerObj.getIntProperty("gamemode", 0); - var6 = WorldSettings.validGameType(var6); - logger.info("Default game type: " + var6); - boolean var7 = this.propertyManagerObj.getBooleanProperty("generate-structures", true); - WorldSettings var8 = new WorldSettings(par3, var6, var7, false, par5WorldType); - AnvilSaveHandler var9 = new AnvilSaveHandler(new File("."), par2Str, true); -- -- for (int var10 = 0; var10 < this.worldMngr.length; ++var10) -- { -- byte var11 = 0; -- -- if (var10 == 1) -- { -- var11 = -1; -- } -- -- if (var10 == 2) -- { -- var11 = 1; -- } -- -- if (var10 == 0) -- { -- this.worldMngr[var10] = new WorldServer(this, var9, par2Str, var11, var8); -- } -- else -- { -- this.worldMngr[var10] = new WorldServerMulti(this, var9, par2Str, var11, var8, this.worldMngr[0]); -- } -- -- this.worldMngr[var10].addWorldAccess(new WorldManager(this, this.worldMngr[var10])); -- this.worldMngr[var10].difficultySetting = this.propertyManagerObj.getIntProperty("difficulty", 1); -- this.worldMngr[var10].setAllowedSpawnTypes(this.propertyManagerObj.getBooleanProperty("spawn-monsters", true), this.spawnPeacefulMobs); -- this.worldMngr[var10].getWorldInfo().setGameType(var6); -- this.configManager.setPlayerManager(this.worldMngr); -+ -+ WorldServer overWorld = new WorldServer(this, var9, par2Str, 0, var8); -+ for (Integer id : DimensionManager.getIDs()) -+ { -+ WorldServer world = (id == 0 ? overWorld : new WorldServerMulti(this, var9, par2Str, id, var8, overWorld)); -+ world.addWorldAccess(new WorldManager(this, world)); -+ world.difficultySetting = propertyManagerObj.getIntProperty("difficulty", 1); -+ world.setAllowedSpawnTypes(propertyManagerObj.getBooleanProperty("spawn-monsters", true), spawnPeacefulMobs); -+ world.getWorldInfo().setGameType(var6); -+ worldTickTimes.put(id, new long[100]); - } -+ configManager.setPlayerManager(new WorldServer[]{ overWorld }); - - short var22 = 196; - long var23 = System.currentTimeMillis(); - -- for (int var13 = 0; var13 < 1; ++var13) -+ for (Integer id : DimensionManager.getIDs()) - { -- logger.info("Preparing start region for level " + var13); -- WorldServer var14 = this.worldMngr[var13]; -+ logger.info("Preparing start region for level " + id); -+ WorldServer var14 = (WorldServer)DimensionManager.getWorld(id); - ChunkCoordinates var15 = var14.getSpawnPoint(); - - for (int var16 = -var22; var16 <= var22 && this.serverRunning; var16 += 16) -@@ -375,9 +367,9 @@ - { - logger.info("Saving chunks"); - -- for (int var1 = 0; var1 < this.worldMngr.length; ++var1) -+ for (World world : DimensionManager.getWorlds()) - { -- WorldServer var2 = this.worldMngr[var1]; -+ WorldServer var2 = (WorldServer)world; - var2.saveWorld(true, (IProgressUpdate)null); - var2.func_30006_w(); - } -@@ -395,13 +387,14 @@ - this.configManager.savePlayerStates(); - } - -- for (int var1 = 0; var1 < this.worldMngr.length; ++var1) -+ for (World world : DimensionManager.getWorlds()) - { -- WorldServer var2 = this.worldMngr[var1]; -+ WorldServer var2 = (WorldServer)world; - - if (var2 != null) - { - this.saveServerWorld(); -+ break; //Added because saveServerWorld() loops through all worlds anyways. - } - } - } -@@ -444,7 +437,7 @@ - var3 += var7; - var1 = var5; - -- if (this.worldMngr[0].isAllPlayersFullyAsleep()) -+ if (((WorldServer)DimensionManager.getWorld(0)).isAllPlayersFullyAsleep()) - { - this.doTick(); - var3 = 0L; -@@ -547,13 +540,13 @@ - Vec3D.initialize(); - ++this.deathTime; - -- for (var9 = 0; var9 < this.worldMngr.length; ++var9) -+ for (Integer id : DimensionManager.getIDs()) - { - long var10 = System.nanoTime(); - -- if (var9 == 0 || this.propertyManagerObj.getBooleanProperty("allow-nether", true)) -+ if (id == 0 || this.propertyManagerObj.getBooleanProperty("allow-nether", true)) - { -- WorldServer var7 = this.worldMngr[var9]; -+ WorldServer var7 = (WorldServer)DimensionManager.getWorld(id); - - if (this.deathTime % 20 == 0) - { -@@ -574,15 +567,15 @@ - } - } - -- this.field_40028_g[var9][this.deathTime % 100] = System.nanoTime() - var10; -+ worldTickTimes.get(id)[this.deathTime % 100] = System.nanoTime() - var10; - } - - this.networkServer.handleNetworkListenThread(); - this.configManager.onTick(); - -- for (var9 = 0; var9 < this.entityTracker.length; ++var9) -+ for (World world : DimensionManager.getWorlds()) - { -- this.entityTracker[var9].updateTrackedEntities(); -+ ((WorldServer)world).entityTracker.updateTrackedEntities(); - } - - for (var9 = 0; var9 < this.playersOnline.size(); ++var9) -@@ -697,7 +690,8 @@ - */ - public WorldServer getWorldManager(int par1) - { -- return par1 == -1 ? this.worldMngr[1] : (par1 == 1 ? this.worldMngr[2] : this.worldMngr[0]); -+ WorldServer ret = (WorldServer)DimensionManager.getWorld(par1); -+ return (ret != null ? ret : (WorldServer)DimensionManager.getWorld(0)); - } - - /** -@@ -705,7 +699,7 @@ - */ - public EntityTracker getEntityTracker(int par1) - { -- return par1 == -1 ? this.entityTracker[1] : (par1 == 1 ? this.entityTracker[2] : this.entityTracker[0]); -+ return getWorldManager(par1).entityTracker; - } - - /** -@@ -875,7 +869,7 @@ - */ - public String getServerBrand() - { -- return "fml"; -+ return "forge"; - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/AnvilChunkLoader.java.patch b/patches/minecraft_server/net/minecraft/src/AnvilChunkLoader.java.patch deleted file mode 100644 index fa005be0d6..0000000000 --- a/patches/minecraft_server/net/minecraft/src/AnvilChunkLoader.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/AnvilChunkLoader.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/AnvilChunkLoader.java 0000-00-00 00:00:00.000000000 -0000 -@@ -10,6 +10,8 @@ - import java.util.List; - import java.util.Set; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO - { - private List field_48469_a = new ArrayList(); -@@ -88,6 +90,7 @@ - } - - var5.removeUnknownBlocks(); -+ ForgeHooks.onChunkLoadData(par1World, var5, par4NBTTagCompound); - return var5; - } - } -@@ -103,6 +106,7 @@ - var3.setTag("Level", var4); - this.writeChunkToNBT(par2Chunk, par1World, var4); - this.func_48463_a(par2Chunk.getChunkCoordIntPair(), var3); -+ ForgeHooks.onChunkSaveData(par1World, par2Chunk, var3); - } - catch (Exception var5) - { diff --git a/patches/minecraft_server/net/minecraft/src/AnvilSaveHandler.java.patch b/patches/minecraft_server/net/minecraft/src/AnvilSaveHandler.java.patch deleted file mode 100644 index 6bf81620e5..0000000000 --- a/patches/minecraft_server/net/minecraft/src/AnvilSaveHandler.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/AnvilSaveHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/AnvilSaveHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -18,15 +18,9 @@ - File var2 = this.getWorldDirectory(); - File var3; - -- if (par1WorldProvider instanceof WorldProviderHell) -+ if (par1WorldProvider.getSaveFolder() != null) - { -- var3 = new File(var2, "DIM-1"); -- var3.mkdirs(); -- return new AnvilChunkLoader(var3); -- } -- else if (par1WorldProvider instanceof WorldProviderEnd) -- { -- var3 = new File(var2, "DIM1"); -+ var3 = new File(var2, par1WorldProvider.getSaveFolder()); - var3.mkdirs(); - return new AnvilChunkLoader(var3); - } diff --git a/patches/minecraft_server/net/minecraft/src/Block.java.patch b/patches/minecraft_server/net/minecraft/src/Block.java.patch deleted file mode 100644 index 4f3650dd67..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Block.java.patch +++ /dev/null @@ -1,695 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,7 +3,10 @@ - import java.util.ArrayList; - import java.util.Random; - --public class Block -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ITextureProvider; -+ -+public class Block implements ITextureProvider - { - public static final StepSound soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F); - public static final StepSound soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F); -@@ -257,6 +260,7 @@ - lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0; - canBlockGrass[par1] = !par2Material.getCanBlockGrass(); - } -+ isDefaultTexture = (getTextureFile() != null && getTextureFile().equalsIgnoreCase("/terrain.png")); - } - - /** -@@ -397,7 +401,7 @@ - - public boolean hasTileEntity() - { -- return this.isBlockContainer; -+ return hasTileEntity(0); - } - - /** -@@ -536,12 +540,16 @@ - return this.blockID; - } - -+ - /** -- * Defines whether or not a play can break the block with current tool. -+ * Deprecated in favor of a metadata sensitive version -+ * @param entityplayer Entity attacking the block -+ * @return - */ -+ @Deprecated - public float blockStrength(EntityPlayer par1EntityPlayer) - { -- return this.blockHardness < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / this.blockHardness / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F); -+ return blockStrength(par1EntityPlayer, 0); - } - - /** -@@ -560,17 +568,13 @@ - if (!par1World.isRemote) - { - int var8 = this.quantityDroppedWithBonus(par7, par1World.rand); -- -- for (int var9 = 0; var9 < var8; ++var9) -+ -+ ArrayList items = getBlockDropped(par1World, par2, par3, par4, par5, par7); -+ for (ItemStack item : items) - { - 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))); -- } -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, item); - } - } - } -@@ -853,7 +857,7 @@ - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - par2EntityPlayer.addExhaustion(0.025F); - -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory)) -+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory)) - { - ItemStack var8 = this.createStackedBlock(par6); - -@@ -974,6 +978,613 @@ - */ - public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {} - -+ /* =================================================== FORGE START =====================================*/ -+ protected static int blockFireSpreadSpeed[] = new int[blocksList.length]; -+ protected static int blockFlammability[] = new int[blocksList.length]; -+ protected String currentTexture = "/terrain.png"; -+ public boolean isDefaultTexture = true; -+ /** -+ * Get a light value for this block, normal ranges are between 0 and 15 -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return The light value -+ */ -+ public int getLightValue(IBlockAccess world, int x, int y, int z) -+ { -+ return lightValue[blockID]; -+ } -+ -+ /** -+ * Checks if a player or entity can use this block to 'climb' like a ladder. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block should act like a ladder -+ */ -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Return true if the block is a normal, solid cube. This -+ * determines indirect power state, entity ejection from blocks, and a few -+ * others. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is a full cube -+ */ -+ public boolean isBlockNormalCube(World world, int x, int y, int z) -+ { -+ return blockMaterial.isOpaque() && renderAsNormalBlock(); -+ } -+ -+ /** -+ * Checks if the block is a solid face on the given side, used by placement logic. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @param size The side to check -+ * @return True if the block is solid on the specified side. -+ */ -+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, int side) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if (this instanceof BlockStep) -+ { -+ return (((meta & 8) == 8 && (side == 1)) || isOpaqueCube()); -+ } -+ else if (this instanceof BlockFarmland) -+ { -+ return (side != 1 && side != 0); -+ } -+ else if (this instanceof BlockStairs) -+ { -+ boolean flipped = ((meta & 4) != 0); -+ return ((meta & 3) + side == 5) || (side == 1 && flipped); -+ } -+ return isBlockNormalCube(world, x, y, z); -+ } -+ -+ /** -+ * Determines if a new block can be replace the space occupied by this one, -+ * Used in the player's placement code to make the block act like water, and lava. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is replaceable by another block -+ */ -+ public boolean isBlockReplaceable(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block should set fire and deal fire damage -+ * to entities coming into contact with it. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block should deal damage -+ */ -+ public boolean isBlockBurning(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines this block should be treated as an air block -+ * by the rest of the code. This method is primarily -+ * useful for creating pure logic-blocks that will be invisible -+ * to the player and otherwise interact as air would. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block considered air -+ */ -+ public boolean isAirBlock(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Metadata sensitive version of the default getHardness function. -+ * -+ * @param meta The block's current metatdata -+ * @return Block hardness -+ */ -+ public float getHardness(int meta) -+ { -+ return blockHardness; -+ } -+ -+ /** -+ * Determines this block's strength against being destroyed by a player. -+ * -+ * @param world The current world -+ * @param player The player damaging the block, may be null -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return A value -+ */ -+ public float blockStrength(World world, EntityPlayer player, int x, int y, int z) -+ { -+ return blockStrength(player, world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Determines this block's strength against being destroyed by a player. -+ * -+ * @param player The player damaging the block, may be null -+ * @param meta The block's current metadata -+ * @return The larger the value, the faster it breaks. -+ */ -+ public float blockStrength(EntityPlayer player, int meta) -+ { -+ return ForgeHooks.blockStrength(this, player, meta); -+ } -+ -+ /** -+ * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed. -+ * -+ * @param player The player damaging the block, may be null -+ * @param meta The block's current metadata -+ * @return True tospawn the drops -+ */ -+ public boolean canHarvestBlock(EntityPlayer player, int meta) -+ { -+ return ForgeHooks.canHarvestBlock(this, player, meta); -+ } -+ -+ /** -+ * Called when a player removes a block. This is responsible for -+ * actually destroying the block, and the block is intact at time of call. -+ * This is called regardless of whether the player can harvest the block or -+ * not. -+ * -+ * Return true if the block is actually destroyed. -+ * -+ * Note: When used in multiplayer, this is called on both client and -+ * server sides! -+ * -+ * @param world The current world -+ * @param player The player damaging the block, may be null -+ * @param x X Position -+ * @param y Y position -+ * @param z Z position -+ * @return True if the block is actually destroyed. -+ */ -+ public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z) -+ { -+ return world.setBlockWithNotify(x, y, z, 0); -+ } -+ -+ /** -+ * Called when a new CreativeContainer is opened, populate the list -+ * with all of the items for this block you want a player in creative mode -+ * to have access to. -+ * -+ * @param itemList The list of items to display on the creative inventory. -+ */ -+ public void addCreativeItems(ArrayList itemList) -+ { -+ } -+ -+ /** -+ * Chance that fire will spread and consume this block. -+ * 300 being a 100% chance, 0, being a 0% chance. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire -+ */ -+ public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, int face) -+ { -+ return blockFlammability[blockID]; -+ } -+ -+ /** -+ * Called when fire is updating, checks if a block face can catch fire. -+ * -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return True if the face can be on fire, false otherwise. -+ */ -+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, int face) -+ { -+ return getFlammability(world, x, y, z, metadata, face) > 0; -+ } -+ -+ /** -+ * Called when fire is updating on a neighbor block. -+ * The higher the number returned, the faster fire will spread around this block. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return A number that is used to determine the speed of fire growth around the block -+ */ -+ public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, int face) -+ { -+ return blockFireSpreadSpeed[blockID]; -+ } -+ -+ /** -+ * Currently only called by fire when it is on top of this block. -+ * Returning true will prevent the fire from naturally dying during updating. -+ * Also prevents firing from dying from rain. -+ * -+ * @param world The current world -+ * @param x The blocks X position -+ * @param y The blocks Y position -+ * @param z The blocks Z position -+ * @param metadata The blocks current metadata -+ * @param face The face that the fire is coming from -+ * @return -+ */ -+ public boolean isFireSource(World world, int x, int y, int z, int metadata, int face) -+ { -+ if (blockID == Block.netherrack.blockID && face == 0) -+ { -+ return true; -+ } -+ if ((world.worldProvider instanceof WorldProviderEnd) && blockID == Block.bedrock.blockID && face == 0) -+ { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Called by BlockFire to setup the burn values of vanilla blocks. -+ * @param id The block id -+ * @param encouragement How much the block encourages fire to spread -+ * @param flammability how easy a block is to catch fire -+ */ -+ public static void setBurnProperties(int id, int encouragement, int flammability) -+ { -+ blockFireSpreadSpeed[id] = encouragement; -+ blockFlammability[id] = flammability; -+ } -+ -+ /** -+ * Called throughout the code as a replacement for block instanceof BlockContainer -+ * Moving this to the Block base class allows for mods that wish to extend vinella -+ * blocks, and also want to have a tile entity on that block, may. -+ * -+ * Return true from this function to specify this block has a tile entity. -+ * -+ * @param metadata Metadata of the current block -+ * @return True if block has a tile entity, false otherwise -+ */ -+ public boolean hasTileEntity(int metadata) -+ { -+ return isBlockContainer; -+ } -+ -+ /** -+ * Called throughout the code as a replacement for BlockContainer.getBlockEntity -+ * Return the same thing you would from that function. -+ * This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer. -+ * -+ * @param metadata The Metadata of the current block -+ * @return A instance of a class extending TileEntity -+ */ -+ public TileEntity getTileEntity(int metadata) -+ { -+ if (this instanceof BlockContainer) -+ { -+ return ((BlockContainer)this).getBlockEntity(metadata); -+ } -+ return null; -+ } -+ -+ /** -+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) -+ * version in 1.1. -+ * -+ * @param meta Blocks Metadata -+ * @param fortune Current item fortune level -+ * @param random Random number generator -+ * @return The number of items to drop -+ */ -+ public int quantityDropped(int meta, int fortune, Random random) -+ { -+ return quantityDroppedWithBonus(fortune, random); -+ } -+ -+ /** -+ * This returns a complete list of items dropped from this block. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param Y Y Position -+ * @param Z Z Position -+ * @param metadata Current metadata -+ * @param fortune Breakers fortune level -+ * @return A ArrayList containing all items this block drops -+ */ -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ -+ int count = quantityDropped(metadata, fortune, world.rand); -+ for(int i = 0; i < count; i++) -+ { -+ int id = idDropped(metadata, world.rand, 0); -+ if (id > 0) -+ { -+ ret.add(new ItemStack(id, 1, damageDropped(metadata))); -+ } -+ } -+ return ret; -+ } -+ -+ /** -+ * Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops. -+ * -+ * @param world The world -+ * @param player The player doing the harvesting -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param metadata The metadata -+ * @return True if the block can be directly harvested using silk touch -+ */ -+ public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) -+ { -+ if (this instanceof BlockGlass) -+ { -+ return true; -+ } -+ return renderAsNormalBlock() && !hasTileEntity(metadata); -+ } -+ -+ /** -+ * Determines if a specified mob type can spawn on this block, returning false will -+ * prevent any mob from spawning on the block. -+ * -+ * @param type The Mob Category Type -+ * @param world The current world -+ * @param x The X Position -+ * @param y The Y Position -+ * @param z The Z Position -+ * @return True to allow a mob of the specified category to spawn, false to prevent it. -+ */ -+ public boolean canCreatureSpawn(EnumCreatureType type, World world, int x, int y, int z) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if (this instanceof BlockStep) -+ { -+ if (mod_MinecraftForge.SPAWNER_ALLOW_ON_INVERTED) -+ { -+ return (((meta & 8) == 8) || isOpaqueCube()); -+ } -+ else -+ { -+ return isNormalCube(this.blockID); -+ } -+ } -+ else if (this instanceof BlockStairs) -+ { -+ if (mod_MinecraftForge.SPAWNER_ALLOW_ON_INVERTED) -+ { -+ return ((meta & 4) != 0); -+ } -+ else -+ { -+ return isNormalCube(this.blockID); -+ } -+ } -+ return isBlockSolidOnSide(world, x, y, z, 1); -+ } -+ -+ /** -+ * Determines if this block is classified as a Bed, Allowing -+ * players to sleep in it, though the block has to specifically -+ * perform the sleeping functionality in it's activated event. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @return True to treat this as a bed -+ */ -+ public boolean isBed(World world, int x, int y, int z, EntityLiving player) -+ { -+ return blockID == Block.bed.blockID; -+ } -+ -+ /** -+ * Returns the position that the player is moved to upon -+ * waking up, or respawning at the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @return The spawn position -+ */ -+ public ChunkCoordinates getBedSpawnPosition(World world, int x, int y, int z, EntityPlayer player) -+ { -+ return BlockBed.getNearestEmptyChunkCoordinates(world, x, y, z, 0); -+ } -+ -+ /** -+ * Called when a user either starts or stops sleeping in the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param player The player or camera entity, null in some cases. -+ * @param occupied True if we are occupying the bed, or false if they are stopping use of the bed -+ */ -+ public void setBedOccupied(World world, int x, int y, int z, EntityPlayer player, boolean occupied) -+ { -+ BlockBed.setBedOccupied(world, x, y, z, occupied); -+ } -+ -+ /** -+ * Returns the direction of the block. Same values that -+ * are returned by BlockDirectional -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return Bed direction -+ */ -+ public int getBedDirection(IBlockAccess world, int x, int y, int z) -+ { -+ return BlockBed.getDirection(world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Determines if the current block is the foot half of the bed. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return True if the current block is the foot side of a bed. -+ */ -+ public boolean isBedFoot(IBlockAccess world, int x, int y, int z) -+ { -+ return BlockBed.isBlockFootOfBed(world.getBlockMetadata(x, y, z)); -+ } -+ -+ /** -+ * Called when a leaf should start its decay process. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ */ -+ public void beginLeavesDecay(World world, int x, int y, int z){} -+ -+ /** -+ * Determines if this block can prevent leaves connected to it from decaying. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if the presence this block can prevent leaves from decaying. -+ */ -+ public boolean canSustainLeaves(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if this block is considered leaves. -+ */ -+ public boolean isLeaves(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Used during tree growth to determine if newly generated leaves can replace this block. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if this block can be replaced by growing leaves. -+ */ -+ public boolean canBeReplacedByLeaves(World world, int x, int y, int z) -+ { -+ return !Block.opaqueCubeLookup[this.blockID]; -+ } -+ -+ /** -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return true if the block is wood (logs) -+ */ -+ public boolean isWood(World world, int x, int y, int z) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if the current block is replaceable by Ore veins during world generation. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @return True to allow this block to be replaced by a ore -+ */ -+ public boolean isGenMineableReplaceable(World world, int x, int y, int z) -+ { -+ return blockID == stone.blockID; -+ } -+ -+ /** -+ * Grabs the current texture file used for this block -+ */ -+ @Override -+ public String getTextureFile() -+ { -+ return currentTexture; -+ } -+ -+ /** -+ * Sets the current texture file for this block, used when rendering. -+ * Default is "/terrain.png" -+ * -+ * @param texture The texture file -+ */ -+ public void setTextureFile(String texture) -+ { -+ currentTexture = texture; -+ isDefaultTexture = false; -+ } -+ - static - { - Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setItemName("cloth"); diff --git a/patches/minecraft_server/net/minecraft/src/BlockButton.java.patch b/patches/minecraft_server/net/minecraft/src/BlockButton.java.patch deleted file mode 100644 index 9322d4d542..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockButton.java.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000 -@@ -49,7 +49,10 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -- return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); -+ return (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) || -+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) || -+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) || -+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)); - } - - /** -@@ -57,7 +60,10 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2); - } - - /** -@@ -70,19 +76,19 @@ - int var7 = var6 & 8; - var6 &= 7; - -- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } -- else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ else if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } -- else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ else if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } -- else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ else if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -99,7 +105,11 @@ - */ - private int getOrientation(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? 1 : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? 2 : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? 3 : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? 4 : 1))); -+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) return 1; -+ if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) return 2; -+ if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) return 3; -+ if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) return 4; -+ return 1; - } - - /** -@@ -113,22 +123,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; - -- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch b/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch deleted file mode 100644 index 8e5d69cd90..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -371,7 +371,7 @@ - { - return true; - } -- else if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) -+ else if (par1World.isBlockSolidOnSide(par2, par3 + 1, par4, 0)) - { - return true; - } -@@ -379,19 +379,19 @@ - { - return true; - } -- else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) -+ else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, 0) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) - { - return true; - } -- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) -+ else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, 0) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) - { - return true; - } -- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) -+ else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, 0) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) - { - return true; - } -- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) -+ else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, 0) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) - { - return true; - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockContainer.java.patch b/patches/minecraft_server/net/minecraft/src/BlockContainer.java.patch deleted file mode 100644 index bfaff5aa6f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockContainer.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -20,7 +20,7 @@ - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { - super.onBlockAdded(par1World, par2, par3, par4); -- par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity()); -+ par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity(par1World.getBlockMetadata(par2, par3, par4))); - } - - /** -@@ -51,4 +51,14 @@ - var7.receiveClientEvent(par5, par6); - } - } -+ -+ /** -+ * Metatdata sensitive version of getBlockEntity -+ * @param metadata The Metatdata for the current block -+ * @return A instance of the TileEntity class associated with this block -+ */ -+ public TileEntity getBlockEntity(int metadata) -+ { -+ return getBlockEntity(); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch b/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch deleted file mode 100644 index 5bb566fd89..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,7 @@ - package net.minecraft.src; - - import java.util.Random; -+import java.util.ArrayList; - - public class BlockCrops extends BlockFlower - { -@@ -129,31 +130,23 @@ - return 6; - } - -- /** -- * 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) -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) - { -- super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); -- -- if (!par1World.isRemote) -+ ArrayList ret = new ArrayList(); -+ if (metadata == 7) - { -- int var8 = 3 + par7; -- -- for (int var9 = 0; var9 < var8; ++var9) -+ ret.add(new ItemStack(Item.wheat)); -+ } -+ -+ for (int n = 0; n < 3 + fortune; n++) -+ { -+ if (world.rand.nextInt(15) < metadata) - { -- if (par1World.rand.nextInt(15) <= par5) -- { -- float var10 = 0.7F; -- float var11 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- float var12 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- float var13 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F; -- EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(Item.seeds)); -- var14.delayBeforeCanPickup = 10; -- par1World.spawnEntityInWorld(var14); -- } -+ ret.add(new ItemStack(Item.seeds)); - } - } -+ return ret; - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch b/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch deleted file mode 100644 index 422183839b..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -167,7 +167,7 @@ - { - if (this.blockMaterial == Material.iron) - { -- return true; -+ return false; - } - else - { -@@ -249,7 +249,7 @@ - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - var7 = true; -@@ -302,7 +302,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par3 >= 255 ? false : par1World.isBlockNormalCube(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); -+ return par3 >= 255 ? false : par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/BlockFire.java.patch b/patches/minecraft_server/net/minecraft/src/BlockFire.java.patch deleted file mode 100644 index b3a6e6964d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockFire.java.patch +++ /dev/null @@ -1,227 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000 -@@ -25,6 +25,8 @@ - */ - public void initializeBlock() - { -+ abilityToCatchFire = Block.blockFlammability; -+ chanceToEncourageFire = Block.blockFireSpreadSpeed; - this.setBurnRate(Block.planks.blockID, 5, 20); - this.setBurnRate(Block.fence.blockID, 5, 20); - this.setBurnRate(Block.stairCompactPlanks.blockID, 5, 20); -@@ -44,8 +46,7 @@ - */ - private void setBurnRate(int par1, int par2, int par3) - { -- this.chanceToEncourageFire[par1] = par2; -- this.abilityToCatchFire[par1] = par3; -+ Block.setBurnProperties(par1, par2, par3); - } - - /** -@@ -103,7 +104,8 @@ - */ - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { -- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; -+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; -+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), 0)); - - if (par1World.worldProvider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) - { -@@ -132,12 +134,12 @@ - - if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) || var7 > 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || var7 > 3) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } - } -- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0) -+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, 1) && var7 == 15 && par5Random.nextInt(4) == 0) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -151,12 +153,12 @@ - var9 = -50; - } - -- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7); -- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, 4); -+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, 5); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, 1); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, 0); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, 3); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, 2); - - for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10) - { -@@ -204,9 +206,21 @@ - } - } - -+ /** Deprecated for a side-sensitive version */ -+ @Deprecated - private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7) - { -- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; -+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, 0); -+ } -+ -+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, int face) -+ { -+ int var8 = 0; -+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)]; -+ if (block != null) -+ { -+ var8 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face); -+ } - - if (par6Random.nextInt(par5) < var8) - { -@@ -240,7 +254,12 @@ - */ - private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) - { -- return this.canBlockCatchFire(par1World, par2 + 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2 - 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 - 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 + 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3, par4 - 1) ? true : this.canBlockCatchFire(par1World, par2, par3, par4 + 1))))); -+ return this.canBlockCatchFire(par1World, par2 + 1, par3, par4, 4) || -+ this.canBlockCatchFire(par1World, par2 - 1, par3, par4, 5) || -+ this.canBlockCatchFire(par1World, par2, par3 - 1, par4, 1) || -+ this.canBlockCatchFire(par1World, par2, par3 + 1, par4, 0) || -+ this.canBlockCatchFire(par1World, par2, par3, par4 - 1, 3) || -+ this.canBlockCatchFire(par1World, par2, par3, par4 + 1, 2); - } - - /** -@@ -256,15 +275,15 @@ - } - else - { -- int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5); -- var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6); -- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6); -+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5, 4); -+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6, 5); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6, 1); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6, 0); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6, 3); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6, 2); - return var6; - } -- } -+ } - - /** - * Returns if this block is collidable (only used by Fire). Args: x, y, z -@@ -276,21 +295,24 @@ - - /** - * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z -+ * Deprecated for a side-sensitive version - */ -+ @Deprecated - public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { -- return this.chanceToEncourageFire[par1IBlockAccess.getBlockId(par2, par3, par4)] > 0; -+ return canBlockCatchFire(par1IBlockAccess, par2, par3, par4, 0); - } - - /** - * Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the - * current number passed in it will return its number instead of the passed in one. Args: world, x, y, z, - * curChanceToEncourageFire -+ * Deprecated for a side-sensitive version - */ -+ @Deprecated - public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5) - { -- int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)]; -- return var6 > par5 ? var6 : par5; -+ return getChanceToEncourageFire(par1World, par2, par3, par4, par5, 0); - } - - /** -@@ -298,7 +320,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || this.canNeighborBurn(par1World, par2, par3, par4); -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || this.canNeighborBurn(par1World, par2, par3, par4); - } - - /** -@@ -307,7 +329,7 @@ - */ - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -320,7 +342,7 @@ - { - if (par1World.worldProvider.worldType > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4)) - { -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4)) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - } -@@ -330,4 +352,46 @@ - } - } - } -+ -+ /** -+ * Side sensitive version that calls the block function. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param face The side the fire is coming from -+ * @return True if the face can catch fire. -+ */ -+ public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, int face) -+ { -+ Block block = Block.blocksList[world.getBlockId(x, y, z)]; -+ if (block != null) -+ { -+ return block.isFlammable(world, x, y, z, world.getBlockMetadata(x, y, z), face); -+ } -+ return false; -+ } -+ -+ /** -+ * Side sensitive version that calls the block function. -+ * -+ * @param world The current world -+ * @param x X Position -+ * @param y Y Position -+ * @param z Z Position -+ * @param oldChance The previous maximum chance. -+ * @param face The side the fire is coming from -+ * @return The chance of the block catching fire, or oldChance if it is higher -+ */ -+ public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, int face) -+ { -+ int newChance = 0; -+ Block block = Block.blocksList[world.getBlockId(x, y, z)]; -+ if (block != null) -+ { -+ newChance = block.getFireSpreadSpeed(world, x, y, z, world.getBlockMetadata(x, y, z), face); -+ } -+ return (newChance > oldChance ? newChance : oldChance); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch b/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch deleted file mode 100644 index ee5f7f66cd..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000 -@@ -71,7 +71,10 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2); - } - - /** -@@ -82,22 +85,22 @@ - { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - -- if ((var6 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if ((var6 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 2; - } - -- if ((var6 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if ((var6 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if ((var6 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if ((var6 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 4; - } - -- if ((var6 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if ((var6 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 5; - } -@@ -114,22 +117,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; - -- if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (var6 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var7 = true; - } - -- if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (var6 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var7 = true; - } - -- if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (var6 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var7 = true; - } - -- if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (var6 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var7 = true; - } -@@ -150,4 +153,10 @@ - { - return 1; - } -+ -+ @Override -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockLeaves.java.patch b/patches/minecraft_server/net/minecraft/src/BlockLeaves.java.patch deleted file mode 100644 index 3ff4b62b66..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockLeaves.java.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockLeaves.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockLeaves.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockLeaves extends BlockLeavesBase -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockLeaves extends BlockLeavesBase implements IShearable - { - /** - * The base index in terrain.png corresponding to the fancy version of the leaf texture. This is stored so we can -@@ -36,10 +39,9 @@ - { - int var10 = par1World.getBlockId(par2 + var7, par3 + var8, par4 + var9); - -- if (var10 == Block.leaves.blockID) -+ if (Block.blocksList[var10] != null) - { -- int var11 = par1World.getBlockMetadata(par2 + var7, par3 + var8, par4 + var9); -- par1World.setBlockMetadata(par2 + var7, par3 + var8, par4 + var9, var11 | 8); -+ Block.blocksList[var10].beginLeavesDecay(par1World, par2 + var7, par3 + var8, par4 + var9); - } - } - } -@@ -84,12 +86,14 @@ - for (var14 = -var7; var14 <= var7; ++var14) - { - var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14); -+ -+ Block block = Block.blocksList[var15]; - -- if (var15 == Block.wood.blockID) -+ if (block != null && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) - { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } -- else if (var15 == Block.leaves.blockID) -+ else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) - { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } -@@ -216,15 +220,7 @@ - */ - 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.shiftedIndex) -- { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3)); -- } -- else -- { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -- } -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } - - /** -@@ -259,4 +255,30 @@ - { - super.onEntityWalking(par1World, par2, par3, par4, par5Entity); - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); -+ return ret; -+ } -+ -+ @Override -+ public void beginLeavesDecay(World world, int x, int y, int z) -+ { -+ world.setBlockMetadata(x, y, z, world.getBlockMetadata(x, y, z) | 8); -+ } -+ -+ @Override -+ public boolean isLeaves(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch b/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch deleted file mode 100644 index 368d83f056..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch +++ /dev/null @@ -1,100 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 -@@ -46,7 +46,11 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -- return par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)))); -+ return (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) || -+ (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) || -+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) || -+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) || -+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)); - } - - /** -@@ -54,7 +58,11 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : par1World.isBlockNormalCube(par2, par3 - 1, par4)))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) || -+ par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1); - } - - /** -@@ -68,27 +76,27 @@ - var6 &= 7; - var6 = -1; - -- if (par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - var6 = 5 + par1World.rand.nextInt(2); - } - -- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } - -- if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } - -- if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -115,32 +123,32 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; - -- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 5) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && var6 == 5) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 6) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && var6 == 6) - { - var7 = true; - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockLog.java.patch b/patches/minecraft_server/net/minecraft/src/BlockLog.java.patch deleted file mode 100644 index c417d1cde3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockLog.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockLog.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockLog.java 0000-00-00 00:00:00.000000000 -0000 -@@ -53,14 +53,9 @@ - { - int var10 = par1World.getBlockId(par2 + var7, par3 + var8, par4 + var9); - -- if (var10 == Block.leaves.blockID) -+ if (Block.blocksList[var10] != null) - { -- int var11 = par1World.getBlockMetadata(par2 + var7, par3 + var8, par4 + var9); -- -- if ((var11 & 8) == 0) -- { -- par1World.setBlockMetadata(par2 + var7, par3 + var8, par4 + var9, var11 | 8); -- } -+ Block.blocksList[var10].beginLeavesDecay(par1World, par2 + var7, par3 + var8, par4 + var9); - } - } - } -@@ -83,4 +78,16 @@ - { - return par1; - } -+ -+ @Override -+ public boolean canSustainLeaves(World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public boolean isWood(World world, int x, int y, int z) -+ { -+ return true; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockNetherStalk.java.patch b/patches/minecraft_server/net/minecraft/src/BlockNetherStalk.java.patch deleted file mode 100644 index 88c900e81d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockNetherStalk.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - - public class BlockNetherStalk extends BlockFlower -@@ -66,30 +67,20 @@ - return 6; - } - -- /** -- * 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) -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) - { -- if (!par1World.isRemote) -+ ArrayList ret = new ArrayList(); -+ int n = 1; -+ if (metadata >= 3) - { -- 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)); -- } -+ n = 2 + world.rand.nextInt(3) + (fortune > 0 ? world.rand.nextInt(fortune + 1) : 0); -+ } -+ for (int m = 0; m < n; m++) -+ { -+ ret.add(new ItemStack(Item.netherStalkSeeds)); - } -+ return ret; - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/BlockPistonBase.java.patch b/patches/minecraft_server/net/minecraft/src/BlockPistonBase.java.patch deleted file mode 100644 index 80dda47954..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockPistonBase.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000 -@@ -358,7 +358,7 @@ - return false; - } - -- return !(Block.blocksList[par0] instanceof BlockContainer); -+ return !(Block.blocksList[par0] != null && Block.blocksList[par0].hasTileEntity(par1World.getBlockMetadata(par2, par3, par4))); - } - } - diff --git a/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch b/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch deleted file mode 100644 index 21e68e8a39..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -@@ -61,7 +61,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID; -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID; - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch b/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch deleted file mode 100644 index b615ca8b7d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch +++ /dev/null @@ -1,212 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -@@ -8,13 +8,26 @@ - private final boolean isPowered; - - /** -+ * Forge: Moved render type to a field and a setter. -+ * This allows for a mod to change the render type -+ * for vanilla rails, and any mod rails that extend -+ * this class. -+ */ -+ private int renderType = 9; -+ -+ public void setRenderType(int value) -+ { -+ renderType = value; -+ } -+ -+ /** - * Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or - * detector). - */ - public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3) - { - int var4 = par0World.getBlockId(par1, par2, par3); -- return var4 == Block.rail.blockID || var4 == Block.railPowered.blockID || var4 == Block.railDetector.blockID; -+ return Block.blocksList[var4] instanceof BlockRail; - } - - /** -@@ -22,7 +35,7 @@ - */ - public static final boolean isRailBlock(int par0) - { -- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID; -+ return Block.blocksList[par0] instanceof BlockRail; - } - - protected BlockRail(int par1, int par2, boolean par3) -@@ -118,7 +131,7 @@ - */ - public int getRenderType() - { -- return 9; -+ return renderType; - } - - /** -@@ -134,7 +147,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4); -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1); - } - - /** -@@ -171,27 +184,27 @@ - - boolean var8 = false; - -- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4)) -+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) - { - var8 = true; - } - -- if (var7 == 2 && !par1World.isBlockNormalCube(par2 + 1, par3, par4)) -+ if (var7 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 1)) - { - var8 = true; - } - -- if (var7 == 3 && !par1World.isBlockNormalCube(par2 - 1, par3, par4)) -+ if (var7 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 1)) - { - var8 = true; - } - -- if (var7 == 4 && !par1World.isBlockNormalCube(par2, par3, par4 - 1)) -+ if (var7 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 1)) - { - var8 = true; - } - -- if (var7 == 5 && !par1World.isBlockNormalCube(par2, par3, par4 + 1)) -+ if (var7 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 1)) - { - var8 = true; - } -@@ -391,10 +404,120 @@ - } - - /** -- * Return true if the blocks passed is a power related rail. -+ * This function is no longer called by Minecraft - */ -+ @Deprecated - static boolean isPoweredBlockRail(BlockRail par0BlockRail) - { - return par0BlockRail.isPowered; - } -+ -+ /** -+ * Return true if the rail can make corners. -+ * Used by placement logic. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the rail can make corners. -+ */ -+ public boolean isFlexibleRail(World world, int y, int x, int z) -+ { -+ return !isPowered; -+ } -+ -+ /** -+ * Returns true if the rail can make up and down slopes. -+ * Used by placement logic. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the rail can make slopes. -+ */ -+ public boolean canMakeSlopes(World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ /** -+ * Return the rails metadata (without the power bit if the rail uses one). -+ * Can be used to make the cart think the rail something other than it is, -+ * for example when making diamond junctions or switches. -+ * The cart parameter will often be null unless it it called from EntityMinecart. -+ * -+ * Valid rail metadata is defined as follows: -+ * 0x0: flat track going North-South -+ * 0x1: flat track going West-East -+ * 0x2: track ascending to the East -+ * 0x3: track ascending to the West -+ * 0x4: track ascending to the North -+ * 0x5: track ascending to the South -+ * 0x6: WestNorth corner (connecting East and South) -+ * 0x7: EastNorth corner (connecting West and South) -+ * 0x8: EastSouth corner (connecting West and North) -+ * 0x9: WestSouth corner (connecting East and North) -+ * -+ * All directions are Notch defined. -+ * In MC Beta 1.8.3 the Sun rises in the North. -+ * In MC 1.0.0 the Sun rises in the East. -+ * -+ * @param world The world. -+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. -+ * @param y The rail X coordinate. -+ * @param x The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return The metadata. -+ */ -+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) -+ { -+ int meta = world.getBlockMetadata(x, y, z); -+ if(isPowered) -+ { -+ meta = meta & 7; -+ } -+ return meta; -+ } -+ -+ /** -+ * Returns the max speed of the rail at the specified position. -+ * @param world The world. -+ * @param cart The cart on the rail, may be null. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return The max speed of the current rail. -+ */ -+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) -+ { -+ return 0.4f; -+ } -+ -+ /** -+ * This function is called by any minecart that passes over this rail. -+ * It is called once per update tick that the minecart is on the rail. -+ * @param world The world. -+ * @param cart The cart on the rail. -+ * @param y The rail X coordinate. -+ * @param x The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ */ -+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z) -+ { -+ } -+ -+ /** -+ * Return true if this rail uses the 4th bit as a power bit. -+ * Avoid using this function when getBasicRailMetadata() can be used instead. -+ * The only reason to use this function is if you wish to change the rails metadata. -+ * @param world The world. -+ * @param x The rail X coordinate. -+ * @param y The rail Y coordinate. -+ * @param z The rail Z coordinate. -+ * @return True if the 4th bit is a power bit. -+ */ -+ public boolean hasPowerBit(World world, int x, int y, int z) -+ { -+ return isPowered; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch b/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch deleted file mode 100644 index 2d0ba3885e..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -@@ -33,7 +33,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); -+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); - } - - /** -@@ -41,7 +41,7 @@ - */ - public boolean canBlockStay(World par1World, int par2, int par3, int par4) - { -- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canBlockStay(par1World, par2, par3, par4); -+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canBlockStay(par1World, par2, par3, par4); - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch b/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch deleted file mode 100644 index 0aa260d759..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,6 +5,8 @@ - import java.util.Random; - import java.util.Set; - -+import net.minecraft.src.forge.IConnectRedstone; -+ - public class BlockRedstoneWire extends Block - { - /** -@@ -67,7 +69,7 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; -+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; - } - - /** -@@ -502,6 +504,10 @@ - } - else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID) - { -+ if (Block.blocksList[var5] instanceof IConnectRedstone) -+ { -+ return ((IConnectRedstone)Block.blocksList[var5]).canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4); -+ } - return Block.blocksList[var5].canProvidePower() && par4 != -1; - } - else diff --git a/patches/minecraft_server/net/minecraft/src/BlockSnow.java.patch b/patches/minecraft_server/net/minecraft/src/BlockSnow.java.patch deleted file mode 100644 index c5c7b77342..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockSnow.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -54,7 +54,8 @@ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { - int var5 = par1World.getBlockId(par2, par3 - 1, par4); -- return var5 != 0 && (var5 == Block.leaves.blockID || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; -+ Block block = Block.blocksList[var5]; -+ return var5 != 0 && ((block != null && block.isLeaves(par1World, par2, par3 - 1, par4)) || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; - } - - /** -@@ -73,7 +74,6 @@ - { - if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) - { -- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlockWithNotify(par2, par3, par4, 0); - return false; - } -@@ -89,15 +89,7 @@ - */ - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) - { -- int var7 = Item.snowball.shiftedIndex; -- float var8 = 0.7F; -- double var9 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- double var11 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- double var13 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D; -- EntityItem var15 = new EntityItem(par1World, (double)par3 + var9, (double)par4 + var11, (double)par5 + var13, new ItemStack(var7, 1, 0)); -- var15.delayBeforeCanPickup = 10; -- par1World.spawnEntityInWorld(var15); -- par1World.setBlockWithNotify(par3, par4, par5, 0); -+ dropBlockAsItem(par1World, par3, par4, par5, par6, 0); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - } - -@@ -114,7 +106,7 @@ - */ - public int quantityDropped(Random par1Random) - { -- return 0; -+ return 1; - } - - /** -@@ -124,7 +116,6 @@ - { - if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) - { -- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlockWithNotify(par2, par3, par4, 0); - } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch b/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch deleted file mode 100644 index 94d465881b..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,12 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockTallGrass extends BlockFlower -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockTallGrass extends BlockFlower implements IShearable - { - protected BlockTallGrass(int par1, int par2) - { -@@ -24,7 +28,7 @@ - */ - public int idDropped(int par1, Random par2Random, int par3) - { -- return par2Random.nextInt(8) == 0 ? Item.seeds.shiftedIndex : -1; -+ return -1; - } - - /** -@@ -41,14 +45,37 @@ - */ - 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.shiftedIndex) -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ } -+ -+ @Override -+ public ArrayList getBlockDropped(World world, int x, int y, int z, int meta, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ if (world.rand.nextInt(8) != 0) - { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); -+ return ret; - } -- else -+ -+ ItemStack item = ForgeHooks.getGrassSeed(world); -+ if (item != null) - { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ ret.add(item); - } -+ return ret; -+ } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); -+ return ret; - } - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch b/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch deleted file mode 100644 index 09f673edf3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -@@ -49,7 +49,7 @@ - */ - private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) - { -- if (par1World.isBlockNormalCubeDefault(par2, par3, par4, true)) -+ if (par1World.isBlockSolidOnSide(par2, par3, par4, 1)) - { - return true; - } -@@ -83,7 +83,11 @@ - */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - { -- return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)))); -+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) || -+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) || -+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) || -+ this.canPlaceTorchOn(par1World, par2, par3 - 1, par4); - } - - /** -@@ -99,22 +103,22 @@ - var6 = 5; - } - -- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) -+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - var6 = 4; - } - -- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) -+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - var6 = 3; - } - -- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) -+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - var6 = 2; - } - -- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) -+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - var6 = 1; - } -@@ -140,19 +144,19 @@ - */ - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { -- if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) -+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 1); - } -- else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) -+ else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); - } -- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) -+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); - } -- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) -+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); - } -@@ -175,22 +179,22 @@ - int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; - -- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1) -+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2) -+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3) - { - var7 = true; - } - -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4) -+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4) - { - var7 = true; - } diff --git a/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch b/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch deleted file mode 100644 index 0e45693844..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,9 @@ - - public class BlockTrapDoor extends Block - { -+ /** Set this to allow trapdoors to remain free-floating */ -+ public static boolean disableValidation = false; -+ - protected BlockTrapDoor(int par1, Material par2Material) - { - super(par1, par2Material); -@@ -174,7 +177,7 @@ - --var7; - } - -- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8))) -+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, (var6 & 3) + 2))) - { - par1World.setBlockWithNotify(par2, par3, par4, 0); - this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -@@ -235,6 +238,11 @@ - */ - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) - { -+ if (disableValidation) -+ { -+ return true; -+ } -+ - if (par5 == 0) - { - return false; -@@ -265,7 +273,7 @@ - --par2; - } - -- return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)); -+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)) || par1World.isBlockSolidOnSide(par2, par3, par4, par5); - } - } - -@@ -280,6 +288,10 @@ - */ - private static boolean isValidSupportBlock(int par0) - { -+ if (disableValidation) -+ { -+ return true; -+ } - if (par0 <= 0) - { - return false; diff --git a/patches/minecraft_server/net/minecraft/src/BlockVine.java.patch b/patches/minecraft_server/net/minecraft/src/BlockVine.java.patch deleted file mode 100644 index e12d0d5c20..0000000000 --- a/patches/minecraft_server/net/minecraft/src/BlockVine.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class BlockVine extends Block -+import net.minecraft.src.forge.IShearable; -+ -+public class BlockVine extends Block implements IShearable - { - public BlockVine(int par1) - { -@@ -402,14 +405,26 @@ - */ - 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.shiftedIndex) -- { -- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0)); -- } -- else -- { -- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -- } -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) -+ { -+ return true; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, 0)); -+ return ret; -+ } -+ -+ @Override -+ public boolean isLadder(World world, int x, int y, int z) -+ { -+ return true; - } - } diff --git a/patches/minecraft_server/net/minecraft/src/Chunk.java.patch b/patches/minecraft_server/net/minecraft/src/Chunk.java.patch deleted file mode 100644 index 95722581e9..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Chunk.java.patch +++ /dev/null @@ -1,321 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 -@@ -8,6 +8,8 @@ - import java.util.Map; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class Chunk - { - /** -@@ -120,7 +122,9 @@ - { - for (int var8 = 0; var8 < var5; ++var8) - { -- byte var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8]; -+ /* FORGE: The following change, a cast from unsigned byte to int, -+ * fixes a vanilla bug when generating new chunks that contain a block ID > 127 */ -+ int var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8] & 0xFF; - - if (var9 != 0) - { -@@ -139,6 +143,48 @@ - } - - /** -+ * Metadata sensitive Chunk constructor for use in new ChunkProviders that -+ * use metadata sensitive blocks during generation. -+ * -+ * @param world The world this chunk belongs to -+ * @param ids A ByteArray containing all the BlockID's to set this chunk to -+ * @param metadata A ByteArray containing all the metadata to set this chunk to -+ * @param chunkX The chunk's X position -+ * @param chunkZ The Chunk's Z position -+ */ -+ public Chunk(World world, byte[] ids, byte[] metadata, int chunkX, int chunkZ) -+ { -+ this(world, chunkX, chunkZ); -+ int height = ids.length / 256; -+ -+ for (int x = 0; x < 16; ++x) -+ { -+ for (int z = 0; z < 16; ++z) -+ { -+ for (int y = 0; y < height; ++y) -+ { -+ int index = x << 11 | z << 7 | y; -+ int id = ids[index] & 0xFF; -+ int meta = metadata[index] & 0x0F; -+ -+ if (id != 0) -+ { -+ int chunkY = y >> 4; -+ -+ if (storageArrays[chunkY] == null) -+ { -+ storageArrays[chunkY] = new ExtendedBlockStorage(chunkY << 4); -+ } -+ -+ storageArrays[chunkY].setExtBlockID(x, y & 15, z, id); -+ storageArrays[chunkY].setExtBlockMetadata(x, y & 15, z, meta); -+ } -+ } -+ } -+ } -+ } -+ -+ /** - * Checks whether the chunk is at the X/Z location specified - */ - public boolean isAtLocation(int par1, int par2) -@@ -465,7 +511,7 @@ - */ - public int getBlockID(int par1, int par2, int par3) - { -- if (par2 >> 4 >= this.storageArrays.length) -+ if (par2 >> 4 >= this.storageArrays.length || par2 >> 4 < 0) - { - return 0; - } -@@ -481,7 +527,7 @@ - */ - public int getBlockMetadata(int par1, int par2, int par3) - { -- if (par2 >> 4 >= this.storageArrays.length) -+ if (par2 >> 4 >= this.storageArrays.length || par2 >> 4 < 0) - { - return 0; - } -@@ -521,6 +567,11 @@ - } - else - { -+ if (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0) -+ { -+ return false; -+ } -+ - ExtendedBlockStorage var9 = this.storageArrays[par2 >> 4]; - boolean var10 = false; - -@@ -545,7 +596,7 @@ - { - Block.blocksList[var8].onBlockRemoval(this.worldObj, var11, par2, var12); - } -- else if (Block.blocksList[var8] instanceof BlockContainer && var8 != par4) -+ if (Block.blocksList[var8] != null && Block.blocksList[var8].hasTileEntity(getBlockMetadata(par1, par2, par3))) - { - this.worldObj.removeBlockTileEntity(var11, par2, var12); - } -@@ -589,32 +640,23 @@ - Block.blocksList[par4].onBlockAdded(this.worldObj, var11, par2, var12); - } - -- if (Block.blocksList[par4] instanceof BlockContainer) -+ if (Block.blocksList[par4] != null && Block.blocksList[par4].hasTileEntity(par5)) - { - var13 = this.getChunkBlockTileEntity(par1, par2, par3); - - if (var13 == null) - { -- var13 = ((BlockContainer)Block.blocksList[par4]).getBlockEntity(); -+ var13 = Block.blocksList[par4].getTileEntity(par5); - this.worldObj.setBlockTileEntity(var11, par2, var12, var13); - } - - if (var13 != null) - { - var13.updateContainingBlockInfo(); -+ var13.blockMetadata = par5; - } - } - } -- else if (var8 > 0 && Block.blocksList[var8] instanceof BlockContainer) -- { -- var13 = this.getChunkBlockTileEntity(par1, par2, par3); -- -- if (var13 != null) -- { -- var13.updateContainingBlockInfo(); -- } -- } -- - this.isModified = true; - return true; - } -@@ -626,7 +668,7 @@ - */ - public boolean setBlockMetadata(int par1, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ ExtendedBlockStorage var5 = (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0 ? null : storageArrays[par2 >> 4]); - - if (var5 == null) - { -@@ -646,7 +688,7 @@ - var5.setExtBlockMetadata(par1, par2 & 15, par3, par4); - int var7 = var5.getExtBlockID(par1, par2 & 15, par3); - -- if (var7 > 0 && Block.blocksList[var7] instanceof BlockContainer) -+ if (var7 > 0 && Block.blocksList[var7] != null && Block.blocksList[var7].hasTileEntity(var5.getExtBlockMetadata(par1, par2 & 15, par3))) - { - TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3); - -@@ -667,7 +709,7 @@ - */ - public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par3 >> 4]; -+ ExtendedBlockStorage var5 = (par3 >> 4 >= storageArrays.length || par3 >> 4 < 0 ? null : storageArrays[par3 >> 4]); - return var5 == null ? par1EnumSkyBlock.defaultLightValue : (par1EnumSkyBlock == EnumSkyBlock.Sky ? var5.getExtSkylightValue(par2, par3 & 15, par4) : (par1EnumSkyBlock == EnumSkyBlock.Block ? var5.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue)); - } - -@@ -677,6 +719,11 @@ - */ - public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) - { -+ if (par3 >> 4 >= storageArrays.length || par3 >> 4 < 0) -+ { -+ return; -+ } -+ - ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4]; - - if (var6 == null) -@@ -710,7 +757,7 @@ - */ - public int getBlockLightValue(int par1, int par2, int par3, int par4) - { -- ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ ExtendedBlockStorage var5 = (par2 >> 4 >= storageArrays.length || par2 >> 4 < 0 ? null : storageArrays[par2 >> 4]); - - if (var5 == null) - { -@@ -812,34 +859,31 @@ - { - ChunkPosition var4 = new ChunkPosition(par1, par2, par3); - TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4); -+ -+ if (var5 != null && var5.isInvalid()) -+ { -+ chunkTileEntityMap.remove(var4); -+ var5 = null; -+ } - - if (var5 == null) - { - int var6 = this.getBlockID(par1, par2, par3); -- -- if (var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) -+ int meta = getBlockMetadata(par1, par2, par3); -+ if (var6 <= 0 || Block.blocksList[var6] == null || !Block.blocksList[var6].hasTileEntity(meta)) - { - return null; - } - - if (var5 == null) - { -- var5 = ((BlockContainer)Block.blocksList[var6]).getBlockEntity(); -+ var5 = Block.blocksList[var6].getTileEntity(meta); - this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, var5); - } - - var5 = (TileEntity)this.chunkTileEntityMap.get(var4); - } -- -- if (var5 != null && var5.isInvalid()) -- { -- this.chunkTileEntityMap.remove(var4); -- return null; -- } -- else -- { -- return var5; -- } -+ return var5; - } - - /** -@@ -854,7 +898,7 @@ - - if (this.isChunkLoaded) - { -- this.worldObj.loadedTileEntityList.add(par1TileEntity); -+ this.worldObj.addTileEntity(par1TileEntity); - } - } - -@@ -869,8 +913,14 @@ - par4TileEntity.yCoord = par2; - par4TileEntity.zCoord = this.zPosition * 16 + par3; - -- if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof BlockContainer) -+ int id = getBlockID(par1, par2, par3); -+ if (id > 0 && Block.blocksList[id] != null && Block.blocksList[id].hasTileEntity(getBlockMetadata(par1, par2, par3))) - { -+ TileEntity old = (TileEntity)chunkTileEntityMap.get(var5); -+ if (old != null) -+ { -+ old.invalidate(); -+ } - par4TileEntity.validate(); - this.chunkTileEntityMap.put(var5, par4TileEntity); - } -@@ -906,6 +956,7 @@ - { - this.worldObj.addLoadedEntities(this.entityLists[var1]); - } -+ ForgeHooks.onChunkLoad(worldObj, this); - } - - /** -@@ -926,6 +977,7 @@ - { - this.worldObj.unloadEntities(this.entityLists[var3]); - } -+ ForgeHooks.onChunkUnload(worldObj, this); - } - - /** -@@ -942,8 +994,8 @@ - */ - public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List) - { -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - - if (var4 < 0) - { -@@ -990,8 +1042,8 @@ - */ - public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List) - { -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - - if (var4 < 0) - { -@@ -1290,4 +1342,18 @@ - } - } - } -+ -+ /** FORGE: Used to remove only invalid TileEntities */ -+ public void cleanChunkBlockTileEntity(int x, int y, int z) -+ { -+ ChunkPosition position = new ChunkPosition(x, y, z); -+ if (isChunkLoaded) -+ { -+ TileEntity entity = (TileEntity)chunkTileEntityMap.get(position); -+ if (entity != null && entity.isInvalid()) -+ { -+ chunkTileEntityMap.remove(position); -+ } -+ } -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/ChunkProvider.java.patch b/patches/minecraft_server/net/minecraft/src/ChunkProvider.java.patch deleted file mode 100644 index 543c6527b4..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ChunkProvider.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ChunkProvider.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ChunkProvider.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - import java.util.List; - import java.util.Set; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ChunkProvider implements IChunkProvider - { - /** A set of dropped chunks. Currently not used in single player. */ -@@ -51,6 +53,11 @@ - */ - public void dropChunk(int par1, int par2) - { -+ if(!ForgeHooks.canUnloadChunk(worldObj.getChunkFromChunkCoords(par1, par2))) -+ { -+ return; -+ } -+ - ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); - int var4 = par1 * 16 + 8 - var3.posX; - int var5 = par2 * 16 + 8 - var3.posZ; diff --git a/patches/minecraft_server/net/minecraft/src/ChunkProviderServer.java.patch b/patches/minecraft_server/net/minecraft/src/ChunkProviderServer.java.patch deleted file mode 100644 index 957b67cf72..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ChunkProviderServer.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ChunkProviderServer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ChunkProviderServer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -9,6 +9,8 @@ - - import cpw.mods.fml.server.FMLServerHandler; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ChunkProviderServer implements IChunkProvider - { - private Set droppedChunksSet = new HashSet(); -@@ -51,6 +53,11 @@ - - public void dropChunk(int par1, int par2) - { -+ if(!ForgeHooks.canUnloadChunk(world.getChunkFromChunkCoords(par1, par2))) -+ { -+ return; -+ } -+ - if (this.world.worldProvider.canRespawnHere()) - { - ChunkCoordinates var3 = this.world.getSpawnPoint(); diff --git a/patches/minecraft_server/net/minecraft/src/ConsoleCommandHandler.java.patch b/patches/minecraft_server/net/minecraft/src/ConsoleCommandHandler.java.patch deleted file mode 100644 index 323e3d7f96..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ConsoleCommandHandler.java.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ConsoleCommandHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ConsoleCommandHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - - import cpw.mods.fml.server.FMLServerHandler; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.DimensionManager; -+import net.minecraft.src.forge.ForgeHooks; - - public class ConsoleCommandHandler - { -@@ -57,9 +59,9 @@ - var8.savePlayerStates(); - } - -- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9) -+ for (World world : DimensionManager.getWorlds()) - { -- var10 = this.minecraftServer.worldMngr[var9]; -+ var10 = (WorldServer)world; - boolean var11 = var10.levelSaving; - var10.levelSaving = false; - var10.saveWorld(true, (IProgressUpdate)null); -@@ -72,20 +74,18 @@ - { - this.sendNoticeToOps(var7, "Disabling level saving.."); - -- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9) -+ for (World world : DimensionManager.getWorlds()) - { -- var10 = this.minecraftServer.worldMngr[var9]; -- var10.levelSaving = true; -+ ((WorldServer)world).levelSaving = true; - } - } - else if (var4.equalsIgnoreCase("save-on")) - { - this.sendNoticeToOps(var7, "Enabling level saving.."); - -- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9) -+ for (World world : DimensionManager.getWorlds()) - { -- var10 = this.minecraftServer.worldMngr[var9]; -- var10.levelSaving = false; -+ ((WorldServer)world).levelSaving = false; - } - } - else if (var4.equalsIgnoreCase("op")) -@@ -332,20 +332,18 @@ - - if ("add".equalsIgnoreCase(var19)) - { -- for (var21 = 0; var21 < this.minecraftServer.worldMngr.length; ++var21) -+ for (World world : DimensionManager.getWorlds()) - { -- var24 = this.minecraftServer.worldMngr[var21]; -- var24.advanceTime(var24.getWorldTime() + (long)var23); -+ world.advanceTime(world.getWorldTime() + (long)var23); - } - - this.sendNoticeToOps(var7, "Added " + var23 + " to time"); - } - else if ("set".equalsIgnoreCase(var19)) - { -- for (var21 = 0; var21 < this.minecraftServer.worldMngr.length; ++var21) -+ for (World world : DimensionManager.getWorlds()) - { -- var24 = this.minecraftServer.worldMngr[var21]; -- var24.advanceTime((long)var23); -+ world.advanceTime((long)var23); - } - - this.sendNoticeToOps(var7, "Set time to " + var23); -@@ -362,8 +360,12 @@ - } - else if (var4.equalsIgnoreCase("say") && var5.length() > 0) - { -- minecraftLogger.info("[" + var7 + "] " + var5); -- var8.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var5)); -+ var5 = ForgeHooks.onServerCommandSay(var6, var6.getUsername(), var5); -+ if (var5 != null) -+ { -+ minecraftLogger.info("[" + var7 + "] " + var5); -+ var8.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var5)); -+ } - } - else if (var4.equalsIgnoreCase("tell")) - { -@@ -387,7 +389,7 @@ - } - else if (var4.equalsIgnoreCase("toggledownfall")) - { -- this.minecraftServer.worldMngr[0].commandToggleDownfall(); -+ ((WorldServer)DimensionManager.getWorld(0)).commandToggleDownfall(); - var6.log("Toggling rain and snow, hold on..."); - } - else if (var4.equalsIgnoreCase("banlist")) -@@ -408,6 +410,10 @@ - { - - } -+ else if (ForgeHooks.onServerCommand(var6, var6.getUsername(), var2)) -+ { -+ //Nom Nom Nom, Do we need to log anything, Let the command handle it themselves. -+ } - else - { - minecraftLogger.info("Unknown console command. Type \"help\" for help."); diff --git a/patches/minecraft_server/net/minecraft/src/ContainerFurnace.java.patch b/patches/minecraft_server/net/minecraft/src/ContainerFurnace.java.patch deleted file mode 100644 index cf5c14f6bb..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ContainerFurnace.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ContainerFurnace.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ContainerFurnace.java 0000-00-00 00:00:00.000000000 -0000 -@@ -98,7 +98,7 @@ - } - else if (par1 != 1 && par1 != 0) - { -- if (FurnaceRecipes.smelting().getSmeltingResult(var4.getItem().shiftedIndex) != null) -+ if (FurnaceRecipes.smelting().getSmeltingResult(var4) != null) - { - if (!this.mergeItemStack(var4, 0, 1, false)) - { diff --git a/patches/minecraft_server/net/minecraft/src/CraftingManager.java.patch b/patches/minecraft_server/net/minecraft/src/CraftingManager.java.patch deleted file mode 100644 index 5edfef84a3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/CraftingManager.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -242,7 +242,7 @@ - } - } - -- if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isDamageable()) -+ if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isRepairable()) - { - Item var11 = Item.itemsList[var3.itemID]; - int var10 = var11.getMaxDamage() - var3.getItemDamageForDisplay(); diff --git a/patches/minecraft_server/net/minecraft/src/Enchantment.java.patch b/patches/minecraft_server/net/minecraft/src/Enchantment.java.patch deleted file mode 100644 index bcd0656e6e..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Enchantment.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000 -@@ -174,4 +174,14 @@ - this.name = par1Str; - return this; - } -+ -+ /** -+ * Called to determine if this enchantment can be applied to a ItemStack -+ * @param item The ItemStack that the enchantment might be put on -+ * @return True if the item is valid, false otherwise -+ */ -+ public boolean canEnchantItem(ItemStack item) -+ { -+ return type.canEnchantItem(item.getItem()); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EnchantmentHelper.java.patch b/patches/minecraft_server/net/minecraft/src/EnchantmentHelper.java.patch deleted file mode 100644 index 221b46ba9f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EnchantmentHelper.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000 -@@ -357,7 +357,7 @@ - { - Enchantment var7 = var4[var6]; - -- if (var7 != null && var7.type.canEnchantItem(var2)) -+ if (var7 != null && var7.canEnchantItem(par1ItemStack)) - { - for (int var8 = var7.getMinLevel(); var8 <= var7.getMaxLevel(); ++var8) - { diff --git a/patches/minecraft_server/net/minecraft/src/Entity.java.patch b/patches/minecraft_server/net/minecraft/src/Entity.java.patch deleted file mode 100644 index 4a42c6d525..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Entity.java.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.List; - import java.util.Random; - -@@ -165,6 +166,11 @@ - public boolean ignoreFrustumCheck; - public boolean isAirBorne; - -+ /** Forge: Used to store custom data for each entity. */ -+ private NBTTagCompound customEntityData; -+ protected boolean captureDrops = false; -+ protected ArrayList capturedDrops = new ArrayList(); -+ - public Entity(World par1World) - { - this.entityId = nextEntityID++; -@@ -206,6 +212,29 @@ - - protected abstract void entityInit(); - -+ /** -+ * Returns a NBTTagCompound that can be used to store custom data for this entity. -+ * It will be written, and read from disc, so it persists over world saves. -+ * @return A NBTTagCompound -+ */ -+ public NBTTagCompound getEntityData() -+ { -+ if (customEntityData == null) -+ { -+ customEntityData = new NBTTagCompound(); -+ } -+ return customEntityData; -+ } -+ -+ /** -+ * Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position. -+ * @return false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation. -+ */ -+ public boolean shouldRiderSit() -+ { -+ return true; -+ } -+ - public DataWatcher getDataWatcher() - { - return this.dataWatcher; -@@ -1215,6 +1244,10 @@ - par1NBTTagCompound.setShort("Fire", (short)this.fire); - par1NBTTagCompound.setShort("Air", (short)this.getAir()); - par1NBTTagCompound.setBoolean("OnGround", this.onGround); -+ if (customEntityData != null) -+ { -+ par1NBTTagCompound.setCompoundTag("ForgeData", customEntityData); -+ } - this.writeEntityToNBT(par1NBTTagCompound); - } - -@@ -1256,6 +1289,10 @@ - this.onGround = par1NBTTagCompound.getBoolean("OnGround"); - this.setPosition(this.posX, this.posY, this.posZ); - this.setRotation(this.rotationYaw, this.rotationPitch); -+ if (par1NBTTagCompound.hasKey("ForgeData")) -+ { -+ customEntityData = par1NBTTagCompound.getCompoundTag("ForgeData"); -+ } - this.readEntityFromNBT(par1NBTTagCompound); - } - -@@ -1336,7 +1373,14 @@ - { - EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); - var3.delayBeforeCanPickup = 10; -- this.worldObj.spawnEntityInWorld(var3); -+ if (captureDrops) -+ { -+ capturedDrops.add(var3); -+ } -+ else -+ { -+ this.worldObj.spawnEntityInWorld(var3); -+ } - return var3; - } - diff --git a/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch b/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch deleted file mode 100644 index 3643cf33df..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,7 +2,7 @@ - - public class EntityEnderman extends EntityMob - { -- private static boolean[] canCarryBlocks = new boolean[256]; -+ private static boolean[] canCarryBlocks = new boolean[Block.blocksList.length]; - - /** Is the enderman attacking another entity? */ - public boolean isAttacking = false; diff --git a/patches/minecraft_server/net/minecraft/src/EntityItem.java.patch b/patches/minecraft_server/net/minecraft/src/EntityItem.java.patch deleted file mode 100644 index a47e1317e6..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityItem.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,8 @@ - - import cpw.mods.fml.server.FMLServerHandler; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class EntityItem extends Entity - { - /** The item stack of this EntityItem. */ -@@ -177,6 +179,20 @@ - if (!this.worldObj.isRemote) - { - int var2 = this.item.stackSize; -+ -+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(par1EntityPlayer, this)) -+ { -+ FMLServerHandler.instance().notifyItemPickup(this,par1EntityPlayer); -+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ par1EntityPlayer.onItemPickup(this, var2); -+ if (item.stackSize <= 0) -+ { -+ setDead(); -+ } -+ return; -+ } -+ -+ var2 = item.stackSize; - - if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(this.item)) - { diff --git a/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch b/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch deleted file mode 100644 index 5019ccc89c..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch +++ /dev/null @@ -1,148 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - import java.util.List; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public abstract class EntityLiving extends Entity - { - public int heartsHalvesLife = 20; -@@ -59,7 +61,7 @@ - * in each step in the damage calculations, this is set to the 'carryover' that would result if someone was damaged - * .25 hearts (for example), and added to the damage in the next step - */ -- protected int carryoverDamage; -+ public int carryoverDamage; - - /** Number of ticks since this EntityLiving last produced its sound */ - private int livingSoundTime; -@@ -300,6 +302,7 @@ - public void setAttackTarget(EntityLiving par1EntityLiving) - { - this.attackTarget = par1EntityLiving; -+ ForgeHooks.onEntityLivingSetAttackTarget(this, par1EntityLiving); - } - - public boolean func_48336_a(Class par1Class) -@@ -356,6 +359,7 @@ - { - this.entityLivingToAttack = par1EntityLiving; - this.revengeTimer = this.entityLivingToAttack != null ? 60 : 0; -+ ForgeHooks.onEntityLivingSetAttackTarget(this, par1EntityLiving); - } - - protected void entityInit() -@@ -616,6 +620,11 @@ - */ - public void onUpdate() - { -+ if (ForgeHooks.onEntityLivingUpdate(this)) -+ { -+ return; -+ } -+ - super.onUpdate(); - - if (this.arrowHitTempCounter > 0) -@@ -808,6 +817,11 @@ - */ - public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) - { -+ if (ForgeHooks.onEntityLivingAttacked(this, par1DamageSource, par2)) -+ { -+ return false; -+ } -+ - if (this.worldObj.isRemote) - { - return false; -@@ -977,6 +991,12 @@ - */ - protected void damageEntity(DamageSource par1DamageSource, int par2) - { -+ par2 = ForgeHooks.onEntityLivingHurt(this, par1DamageSource, par2); -+ if (par2 == 0) -+ { -+ return; -+ } -+ - par2 = this.applyArmorCalculations(par1DamageSource, par2); - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - this.health -= par2; -@@ -1040,6 +1060,11 @@ - */ - public void onDeath(DamageSource par1DamageSource) - { -+ if (ForgeHooks.onEntityLivingDeath(this, par1DamageSource)) -+ { -+ return; -+ } -+ - Entity var2 = par1DamageSource.getEntity(); - - if (this.scoreValue >= 0 && var2 != null) -@@ -1063,13 +1088,17 @@ - var3 = EnchantmentHelper.getLootingModifier(((EntityPlayer)var2).inventory); - } - -+ captureDrops = true; -+ capturedDrops.clear(); -+ int var4 = 0; -+ - if (!this.isChild()) - { - this.dropFewItems(this.recentlyHit > 0, var3); - - if (this.recentlyHit > 0) - { -- int var4 = this.rand.nextInt(200) - var3; -+ var4 = this.rand.nextInt(200) - var3; - - if (var4 < 5) - { -@@ -1077,6 +1106,13 @@ - } - } - } -+ -+ captureDrops = false; -+ ForgeHooks.onEntityLivingDrops(this, par1DamageSource, capturedDrops, var3, recentlyHit > 0, var4); -+ for (EntityItem item : capturedDrops) -+ { -+ worldObj.spawnEntityInWorld(item); -+ } - } - - this.worldObj.setEntityState(this, (byte)3); -@@ -1120,6 +1156,11 @@ - */ - protected void fall(float par1) - { -+ if (ForgeHooks.onEntityLivingFall(this, par1)) -+ { -+ return; -+ } -+ - super.fall(par1); - int var2 = (int)Math.ceil((double)(par1 - 3.0F)); - -@@ -1307,7 +1348,7 @@ - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - int var4 = this.worldObj.getBlockId(var1, var2, var3); -- return var4 == Block.ladder.blockID || var4 == Block.vine.blockID; -+ return (Block.blocksList[var4] != null && Block.blocksList[var4].isLadder(worldObj, var1, var2, var3)); - } - - /** -@@ -1578,6 +1619,8 @@ - } - - this.isAirBorne = true; -+ -+ ForgeHooks.onEntityLivingJump(this); - } - - /** diff --git a/patches/minecraft_server/net/minecraft/src/EntityMinecart.java.patch b/patches/minecraft_server/net/minecraft/src/EntityMinecart.java.patch deleted file mode 100644 index c841a3a760..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityMinecart.java.patch +++ /dev/null @@ -1,957 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,27 +1,52 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.List; - -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.IMinecartCollisionHandler; -+import net.minecraft.src.forge.MinecraftForge; -+ - public class EntityMinecart extends Entity implements IInventory - { - /** Array of item stacks stored in minecart (for storage minecarts). */ -- private ItemStack[] cargoItems; -- private int fuel; -- private boolean field_469_aj; -+ protected ItemStack[] cargoItems; -+ protected int fuel; -+ protected boolean field_469_aj; - - /** The type of minecart, 2 for powered, 1 for storage. */ - public int minecartType; - public double pushX; - public double pushZ; -- private static final int[][][] field_468_ak = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; -+ protected static final int[][][] field_468_ak = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; - - /** appears to be the progress of the turn */ -- private int turnProgress; -- private double minecartX; -- private double minecartY; -- private double minecartZ; -- private double minecartYaw; -- private double minecartPitch; -+ protected int turnProgress; -+ protected double minecartX; -+ protected double minecartY; -+ protected double minecartZ; -+ protected double minecartYaw; -+ protected double minecartPitch; -+ protected double velocityX; -+ protected double velocityY; -+ protected double velocityZ; -+ -+ /* Forge: Minecart Compatibility Layer Integration. */ -+ public static float defaultMaxSpeedRail = 0.4f; -+ public static float defaultMaxSpeedGround = 0.4f; -+ public static float defaultMaxSpeedAirLateral = 0.4f; -+ public static float defaultMaxSpeedAirVertical = -1f; -+ public static double defaultDragAir = 0.94999998807907104D; -+ protected boolean canUseRail = true; -+ protected boolean canBePushed = true; -+ private static IMinecartCollisionHandler collisionHandler = null; -+ -+ /* Instance versions of the above physics properties */ -+ protected float maxSpeedRail; -+ protected float maxSpeedGround; -+ protected float maxSpeedAirLateral; -+ protected float maxSpeedAirVertical; -+ protected double dragAir; - - public EntityMinecart(World par1World) - { -@@ -32,6 +57,18 @@ - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.7F); - this.yOffset = this.height / 2.0F; -+ -+ maxSpeedRail = defaultMaxSpeedRail; -+ maxSpeedGround = defaultMaxSpeedGround; -+ maxSpeedAirLateral = defaultMaxSpeedAirLateral; -+ maxSpeedAirVertical = defaultMaxSpeedAirVertical; -+ dragAir = defaultDragAir; -+ } -+ -+ public EntityMinecart(World world, int type) -+ { -+ this(world); -+ minecartType = type; - } - - /** -@@ -57,6 +94,10 @@ - */ - public AxisAlignedBB getCollisionBox(Entity par1Entity) - { -+ if (getCollisionHandler() != null) -+ { -+ return getCollisionHandler().getCollisionBox(this, par1Entity); -+ } - return par1Entity.boundingBox; - } - -@@ -65,6 +106,10 @@ - */ - public AxisAlignedBB getBoundingBox() - { -+ if (getCollisionHandler() != null) -+ { -+ return getCollisionHandler().getBoundingBox(this); -+ } - return null; - } - -@@ -73,7 +118,7 @@ - */ - public boolean canBePushed() - { -- return true; -+ return canBePushed; - } - - public EntityMinecart(World par1World, double par2, double par4, double par6, int par8) -@@ -117,48 +162,7 @@ - } - - this.setDead(); -- this.dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F); -- -- if (this.minecartType == 1) -- { -- EntityMinecart var3 = this; -- -- for (int var4 = 0; var4 < var3.getSizeInventory(); ++var4) -- { -- ItemStack var5 = var3.getStackInSlot(var4); -- -- if (var5 != null) -- { -- float var6 = this.rand.nextFloat() * 0.8F + 0.1F; -- float var7 = this.rand.nextFloat() * 0.8F + 0.1F; -- float var8 = this.rand.nextFloat() * 0.8F + 0.1F; -- -- while (var5.stackSize > 0) -- { -- int var9 = this.rand.nextInt(21) + 10; -- -- if (var9 > var5.stackSize) -- { -- var9 = var5.stackSize; -- } -- -- var5.stackSize -= var9; -- EntityItem var10 = new EntityItem(this.worldObj, this.posX + (double)var6, this.posY + (double)var7, this.posZ + (double)var8, new ItemStack(var5.itemID, var9, var5.getItemDamage())); -- float var11 = 0.05F; -- var10.motionX = (double)((float)this.rand.nextGaussian() * var11); -- var10.motionY = (double)((float)this.rand.nextGaussian() * var11 + 0.2F); -- var10.motionZ = (double)((float)this.rand.nextGaussian() * var11); -- this.worldObj.spawnEntityInWorld(var10); -- } -- } -- } -- -- this.dropItemWithOffset(Block.chest.blockID, 1, 0.0F); -- } -- else if (this.minecartType == 2) -- { -- this.dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F); -- } -+ dropCartAsItem(); - } - - return true; -@@ -241,7 +245,7 @@ - this.kill(); - } - -- if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) -+ if (this.isMinecartPowered() && this.rand.nextInt(4) == 0 && minecartType == 2 && getClass() == EntityMinecart.class) - { - this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); - } -@@ -296,49 +300,26 @@ - double var6 = 0.0078125D; - int var8 = this.worldObj.getBlockId(var1, var2, var3); - -- if (BlockRail.isRailBlock(var8)) -+ if (canUseRail() && BlockRail.isRailBlock(var8)) - { - Vec3D var9 = this.func_182_g(this.posX, this.posY, this.posZ); -- int var10 = this.worldObj.getBlockMetadata(var1, var2, var3); -+ int var10 = ((BlockRail)Block.blocksList[var8]).getBasicRailMetadata(worldObj, this, var1, var2, var3); - this.posY = (double)var2; - boolean var11 = false; - boolean var12 = false; - - if (var8 == Block.railPowered.blockID) - { -- var11 = (var10 & 8) != 0; -+ var11 = (worldObj.getBlockMetadata(var1, var2, var3) & 8) != 0; - var12 = !var11; - } - -- if (((BlockRail)Block.blocksList[var8]).isPowered()) -- { -- var10 &= 7; -- } -- - if (var10 >= 2 && var10 <= 5) - { - this.posY = (double)(var2 + 1); - } - -- if (var10 == 2) -- { -- this.motionX -= var6; -- } -- -- if (var10 == 3) -- { -- this.motionX += var6; -- } -- -- if (var10 == 4) -- { -- this.motionZ += var6; -- } -- -- if (var10 == 5) -- { -- this.motionZ -= var6; -- } -+ adjustSlopeVelocities(var10); - - int[][] var13 = field_468_ak[var10]; - double var14 = (double)(var13[1][0] - var13[0][0]); -@@ -357,7 +338,7 @@ - this.motionZ = var22 * var16 / var18; - double var24; - -- if (var12) -+ if (var12 && shouldDoRailFunctions()) - { - var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - -@@ -407,36 +388,8 @@ - this.posX = var26 + var14 * var24; - this.posZ = var28 + var16 * var24; - this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); -- var34 = this.motionX; -- var36 = this.motionZ; -- -- if (this.riddenByEntity != null) -- { -- var34 *= 0.75D; -- var36 *= 0.75D; -- } -- -- if (var34 < -var4) -- { -- var34 = -var4; -- } -- -- if (var34 > var4) -- { -- var34 = var4; -- } -- -- if (var36 < -var4) -- { -- var36 = -var4; -- } -- -- if (var36 > var4) -- { -- var36 = var4; -- } -- -- this.moveEntity(var34, 0.0D, var36); -+ -+ moveMinecartOnRail(var1, var2, var3); - - if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[0][0] && MathHelper.floor_double(this.posZ) - var3 == var13[0][2]) - { -@@ -447,41 +400,7 @@ - this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); - } - -- if (this.riddenByEntity != null) -- { -- this.motionX *= 0.996999979019165D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.996999979019165D; -- } -- else -- { -- if (this.minecartType == 2) -- { -- var38 = (double)MathHelper.sqrt_double(this.pushX * this.pushX + this.pushZ * this.pushZ); -- -- if (var38 > 0.01D) -- { -- this.pushX /= var38; -- this.pushZ /= var38; -- double var40 = 0.04D; -- this.motionX *= 0.800000011920929D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.800000011920929D; -- this.motionX += this.pushX * var40; -- this.motionZ += this.pushZ * var40; -- } -- else -- { -- this.motionX *= 0.8999999761581421D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.8999999761581421D; -- } -- } -- -- this.motionX *= 0.9599999785423279D; -- this.motionY *= 0.0D; -- this.motionZ *= 0.9599999785423279D; -- } -+ applyDragAndPushForces(); - - Vec3D var52 = this.func_182_g(this.posX, this.posY, this.posZ); - -@@ -510,30 +429,15 @@ - } - - double var41; -- -- if (this.minecartType == 2) -+ -+ updatePushForces(); -+ -+ if(shouldDoRailFunctions()) - { -- var41 = (double)MathHelper.sqrt_double(this.pushX * this.pushX + this.pushZ * this.pushZ); -- -- if (var41 > 0.01D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) -- { -- this.pushX /= var41; -- this.pushZ /= var41; -- -- if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) -- { -- this.pushX = 0.0D; -- this.pushZ = 0.0D; -- } -- else -- { -- this.pushX = this.motionX; -- this.pushZ = this.motionZ; -- } -- } -+ ((BlockRail)Block.blocksList[var8]).onMinecartPass(worldObj, this, var1, var2, var3); - } - -- if (var11) -+ if (var11 && shouldDoRailFunctions()) - { - var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - -@@ -569,41 +473,7 @@ - } - else - { -- if (this.motionX < -var4) -- { -- this.motionX = -var4; -- } -- -- if (this.motionX > var4) -- { -- this.motionX = var4; -- } -- -- if (this.motionZ < -var4) -- { -- this.motionZ = -var4; -- } -- -- if (this.motionZ > var4) -- { -- this.motionZ = var4; -- } -- -- if (this.onGround) -- { -- this.motionX *= 0.5D; -- this.motionY *= 0.5D; -- this.motionZ *= 0.5D; -- } -- -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -- -- if (!this.onGround) -- { -- this.motionX *= 0.949999988079071D; -- this.motionY *= 0.949999988079071D; -- this.motionZ *= 0.949999988079071D; -- } -+ moveMinecartOffRail(var1, var2, var3); - } - - this.rotationPitch = 0.0F; -@@ -639,7 +509,18 @@ - } - - this.setRotation(this.rotationYaw, this.rotationPitch); -- List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); -+ -+ AxisAlignedBB box = null; -+ if (getCollisionHandler() != null) -+ { -+ box = getCollisionHandler().getMinecartCollisionBox(this); -+ } -+ else -+ { -+ box = boundingBox.expand(0.2D, 0.0D, 0.2D); -+ } -+ -+ List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); - - if (var15 != null && var15.size() > 0) - { -@@ -664,17 +545,8 @@ - this.riddenByEntity = null; - } - -- if (this.fuel > 0) -- { -- --this.fuel; -- } -- -- if (this.fuel <= 0) -- { -- this.pushX = this.pushZ = 0.0D; -- } -- -- this.setMinecartPowered(this.fuel > 0); -+ updateFuel(); -+ ForgeHooks.onMinecartUpdate(this, var1, var2, var3); - } - } - -@@ -693,14 +565,9 @@ - - if (BlockRail.isRailBlock(var10)) - { -- int var11 = this.worldObj.getBlockMetadata(var7, var8, var9); -+ int var11 = ((BlockRail)Block.blocksList[var10]).getBasicRailMetadata(worldObj, this, var7, var8, var9); - par3 = (double)var8; - -- if (((BlockRail)Block.blocksList[var10]).isPowered()) -- { -- var11 &= 7; -- } -- - if (var11 >= 2 && var11 <= 5) - { - par3 = (double)(var8 + 1); -@@ -765,13 +632,13 @@ - { - par1NBTTagCompound.setInteger("Type", this.minecartType); - -- if (this.minecartType == 2) -+ if (isPoweredCart()) - { - par1NBTTagCompound.setDouble("PushX", this.pushX); - par1NBTTagCompound.setDouble("PushZ", this.pushZ); -- par1NBTTagCompound.setShort("Fuel", (short)this.fuel); -+ par1NBTTagCompound.setInteger("Fuel", this.fuel); - } -- else if (this.minecartType == 1) -+ if (getSizeInventory() > 0) - { - NBTTagList var2 = new NBTTagList(); - -@@ -797,13 +664,20 @@ - { - this.minecartType = par1NBTTagCompound.getInteger("Type"); - -- if (this.minecartType == 2) -+ if (isPoweredCart()) - { - this.pushX = par1NBTTagCompound.getDouble("PushX"); - this.pushZ = par1NBTTagCompound.getDouble("PushZ"); -- this.fuel = par1NBTTagCompound.getShort("Fuel"); -+ try -+ { -+ this.fuel = par1NBTTagCompound.getInteger("Fuel"); -+ } -+ catch (ClassCastException e) -+ { -+ this.fuel = par1NBTTagCompound.getShort("Fuel"); -+ } - } -- else if (this.minecartType == 1) -+ if (getSizeInventory() > 0) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.cargoItems = new ItemStack[this.getSizeInventory()]; -@@ -826,11 +700,18 @@ - */ - public void applyEntityCollision(Entity par1Entity) - { -+ ForgeHooks.onMinecartEntityCollision(this, par1Entity); -+ if (getCollisionHandler() != null) -+ { -+ getCollisionHandler().onEntityCollision(this, par1Entity); -+ return; -+ } -+ - if (!this.worldObj.isRemote) - { - if (par1Entity != this.riddenByEntity) - { -- if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.minecartType == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) -+ if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) - { - par1Entity.mountEntity(this); - } -@@ -876,7 +757,7 @@ - double var18 = par1Entity.motionX + this.motionX; - double var20 = par1Entity.motionZ + this.motionZ; - -- if (((EntityMinecart)par1Entity).minecartType == 2 && this.minecartType != 2) -+ if (((EntityMinecart)par1Entity).isPoweredCart() && !isPoweredCart()) - { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; -@@ -884,7 +765,7 @@ - par1Entity.motionX *= 0.949999988079071D; - par1Entity.motionZ *= 0.949999988079071D; - } -- else if (((EntityMinecart)par1Entity).minecartType != 2 && this.minecartType == 2) -+ else if (!((EntityMinecart)par1Entity).isPoweredCart() && isPoweredCart()) - { - par1Entity.motionX *= 0.20000000298023224D; - par1Entity.motionZ *= 0.20000000298023224D; -@@ -919,7 +800,7 @@ - */ - public int getSizeInventory() - { -- return 27; -+ return (minecartType == 1 && getClass() == EntityMinecart.class ? 27 : 0); - } - - /** -@@ -1022,7 +903,12 @@ - */ - public boolean interact(EntityPlayer par1EntityPlayer) - { -- if (this.minecartType == 0) -+ if (!ForgeHooks.onMinecartInteract(this, par1EntityPlayer)) -+ { -+ return true; -+ } -+ -+ if (canBeRidden()) - { - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) - { -@@ -1034,14 +920,14 @@ - par1EntityPlayer.mountEntity(this); - } - } -- else if (this.minecartType == 1) -+ else if (getSizeInventory() > 0) - { - if (!this.worldObj.isRemote) - { - par1EntityPlayer.displayGUIChest(this); - } - } -- else if (this.minecartType == 2) -+ else if (this.minecartType == 2 && getClass() == EntityMinecart.class) - { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - -@@ -1073,7 +959,7 @@ - /** - * Is this minecart powered (Fuel > 0) - */ -- protected boolean isMinecartPowered() -+ public boolean isMinecartPowered() - { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } -@@ -1126,4 +1012,373 @@ - { - return this.dataWatcher.getWatchableObjectInt(18); - } -+ -+ /** -+ * Drops the cart as a item. The exact item dropped is defined by getItemDropped(). -+ */ -+ public void dropCartAsItem() -+ { -+ for(ItemStack item : getItemsDropped()) -+ { -+ entityDropItem(item, 0); -+ } -+ } -+ -+ /** -+ * Override this to define which items your cart drops when broken. -+ * This does not include items contained in the inventory, -+ * that is handled elsewhere. -+ * @return A list of items dropped. -+ */ -+ public List getItemsDropped() -+ { -+ List items = new ArrayList(); -+ items.add(new ItemStack(Item.minecartEmpty)); -+ -+ switch(minecartType) -+ { -+ case 1: -+ items.add(new ItemStack(Block.chest)); -+ break; -+ case 2: -+ items.add(new ItemStack(Block.stoneOvenIdle)); -+ break; -+ } -+ return items; -+ } -+ -+ /** -+ * This function returns an ItemStack that represents this cart. -+ * This should be an ItemStack that can be used by the player to place the cart. -+ * This is the item that was registered with the cart via the registerMinecart function, -+ * but is not necessary the item the cart drops when destroyed. -+ * @return An ItemStack that can be used to place the cart. -+ */ -+ public ItemStack getCartItem() -+ { -+ return MinecraftForge.getItemForCart(this); -+ } -+ -+ /** -+ * Returns true if this cart is self propelled. -+ * @return True if powered. -+ */ -+ public boolean isPoweredCart() -+ { -+ return minecartType == 2 && getClass() == EntityMinecart.class; -+ } -+ -+ /** -+ * Returns true if this cart is a storage cart -+ * Some carts may have inventories but not be storage carts -+ * and some carts without inventories may be storage carts. -+ * @return True if this cart should be classified as a storage cart. -+ */ -+ public boolean isStorageCart() -+ { -+ return minecartType == 1 && getClass() == EntityMinecart.class; -+ } -+ -+ /** -+ * Returns true if this cart can be ridden by an Entity. -+ * @return True if this cart can be ridden. -+ */ -+ public boolean canBeRidden() -+ { -+ if(minecartType == 0 && getClass() == EntityMinecart.class) -+ { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Returns true if this cart can currently use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @return True if the minecart can use rails. -+ */ -+ public boolean canUseRail() -+ { -+ return canUseRail; -+ } -+ -+ /** -+ * Set whether the minecart can use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @param use Whether the minecart can currently use rails. -+ */ -+ public void setCanUseRail(boolean use) -+ { -+ canUseRail = use; -+ } -+ -+ /** -+ * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails. -+ * @return True if this cart should call IRail.onMinecartPass(). -+ */ -+ public boolean shouldDoRailFunctions() -+ { -+ return true; -+ } -+ -+ /** -+ * Simply returns the minecartType variable. -+ * @return minecartType -+ */ -+ public int getMinecartType() -+ { -+ return minecartType; -+ } -+ -+ /** -+ * Gets the current global Minecart Collision handler if none -+ * is registered, returns null -+ * @return The collision handler or null -+ */ -+ public static IMinecartCollisionHandler getCollisionHandler() -+ { -+ return collisionHandler; -+ } -+ -+ /** -+ * Sets the global Minecart Collision handler, overwrites any -+ * that is currently set. -+ * @param handler The new handler -+ */ -+ public static void setCollisionHandler(IMinecartCollisionHandler handler) -+ { -+ collisionHandler = handler; -+ } -+ -+ /** -+ * Carts should return their drag factor here -+ * @return The drag rate. -+ */ -+ protected double getDrag() -+ { -+ return riddenByEntity != null ? 0.99D : 0.96D; -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code applies drag and updates push forces. -+ */ -+ protected void applyDragAndPushForces() -+ { -+ if(isPoweredCart()) -+ { -+ double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); -+ if(d27 > 0.01D) -+ { -+ pushX /= d27; -+ pushZ /= d27; -+ double d29 = 0.04; -+ motionX *= 0.8D; -+ motionY *= 0.0D; -+ motionZ *= 0.8D; -+ motionX += pushX * d29; -+ motionZ += pushZ * d29; -+ } else -+ { -+ motionX *= 0.9D; -+ motionY *= 0.0D; -+ motionZ *= 0.9D; -+ } -+ } -+ motionX *= getDrag(); -+ motionY *= 0.0D; -+ motionZ *= getDrag(); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code updates push forces. -+ */ -+ protected void updatePushForces() -+ { -+ if(isPoweredCart()) -+ { -+ double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); -+ if(push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) -+ { -+ pushX /= push; -+ pushZ /= push; -+ if(pushX * motionX + pushZ * motionZ < 0.0D) -+ { -+ pushX = 0.0D; -+ pushZ = 0.0D; -+ } else -+ { -+ pushX = motionX; -+ pushZ = motionZ; -+ } -+ } -+ } -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when on a rail. -+ */ -+ protected void moveMinecartOnRail(int i, int j, int k) -+ { -+ int id = worldObj.getBlockId(i, j, k); -+ if (!BlockRail.isRailBlock(id)) -+ { -+ return; -+ } -+ float railMaxSpeed = ((BlockRail)Block.blocksList[id]).getRailMaxSpeed(worldObj, this, i, j, k); -+ -+ double maxSpeed = Math.min(railMaxSpeed, getMaxSpeedRail()); -+ double mX = motionX; -+ double mZ = motionZ; -+ if(riddenByEntity != null) -+ { -+ mX *= 0.75D; -+ mZ *= 0.75D; -+ } -+ if(mX < -maxSpeed) mX = -maxSpeed; -+ if(mX > maxSpeed) mX = maxSpeed; -+ if(mZ < -maxSpeed) mZ = -maxSpeed; -+ if(mZ > maxSpeed) mZ = maxSpeed; -+ moveEntity(mX, 0.0D, mZ); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when not on a rail. -+ */ -+ protected void moveMinecartOffRail(int i, int j, int k) -+ { -+ double d2 = getMaxSpeedGround(); -+ if(!onGround) -+ { -+ d2 = getMaxSpeedAirLateral(); -+ } -+ if(motionX < -d2) motionX = -d2; -+ if(motionX > d2) motionX = d2; -+ if(motionZ < -d2) motionZ = -d2; -+ if(motionZ > d2) motionZ = d2; -+ double moveY = motionY; -+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) -+ { -+ moveY = getMaxSpeedAirVertical(); -+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) -+ { -+ moveY = 0.15f; -+ motionY = moveY; -+ } -+ } -+ if(onGround) -+ { -+ motionX *= 0.5D; -+ motionY *= 0.5D; -+ motionZ *= 0.5D; -+ } -+ moveEntity(motionX, moveY, motionZ); -+ if(!onGround) -+ { -+ motionX *= getDragAir(); -+ motionY *= getDragAir(); -+ motionZ *= getDragAir(); -+ } -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code applies fuel consumption. -+ */ -+ protected void updateFuel() -+ { -+ if (fuel > 0) fuel--; -+ if (fuel <= 0) pushX = pushZ = 0.0D; -+ setMinecartPowered(fuel > 0); -+ } -+ -+ /** -+ * Moved to allow overrides, This code handle slopes affecting velocity. -+ * @param metadata The blocks position metadata -+ */ -+ protected void adjustSlopeVelocities(int metadata) -+ { -+ double acceleration = 0.0078125D; -+ if (metadata == 2) -+ { -+ motionX -= acceleration; -+ } -+ else if (metadata == 3) -+ { -+ motionX += acceleration; -+ } -+ else if (metadata == 4) -+ { -+ motionZ += acceleration; -+ } -+ else if (metadata == 5) -+ { -+ motionZ -= acceleration; -+ } -+ } -+ -+ /** -+ * Getters/setters for physics variables -+ */ -+ -+ /** -+ * Returns the carts max speed. -+ * Carts going faster than 1.1 cause issues with chunk loading. -+ * Carts cant traverse slopes or corners at greater than 0.5 - 0.6. -+ * This value is compared with the rails max speed to determine -+ * the carts current max speed. A normal rails max speed is 0.4. -+ * @return Carts max speed. -+ */ -+ public float getMaxSpeedRail() -+ { -+ return maxSpeedRail; -+ } -+ -+ public void setMaxSpeedRail(float value) -+ { -+ maxSpeedRail = value; -+ } -+ -+ public float getMaxSpeedGround() -+ { -+ return maxSpeedGround; -+ } -+ -+ public void setMaxSpeedGround(float value) -+ { -+ maxSpeedGround = value; -+ } -+ -+ public float getMaxSpeedAirLateral() -+ { -+ return maxSpeedAirLateral; -+ } -+ -+ public void setMaxSpeedAirLateral(float value) -+ { -+ maxSpeedAirLateral = value; -+ } -+ -+ public float getMaxSpeedAirVertical() -+ { -+ return maxSpeedAirVertical; -+ } -+ -+ public void setMaxSpeedAirVertical(float value) -+ { -+ maxSpeedAirVertical = value; -+ } -+ -+ public double getDragAir() -+ { -+ return dragAir; -+ } -+ -+ public void setDragAir(double value) -+ { -+ dragAir = value; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EntityMooshroom.java.patch b/patches/minecraft_server/net/minecraft/src/EntityMooshroom.java.patch deleted file mode 100644 index 62461055eb..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityMooshroom.java.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityMooshroom.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,6 +1,10 @@ - package net.minecraft.src; - --public class EntityMooshroom extends EntityCow -+import java.util.ArrayList; -+ -+import net.minecraft.src.forge.IShearable; -+ -+public class EntityMooshroom extends EntityCow implements IShearable - { - public EntityMooshroom(World par1World) - { -@@ -30,32 +34,7 @@ - return true; - } - } -- -- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0) -- { -- this.setDead(); -- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); -- -- if (!this.worldObj.isRemote) -- { -- EntityCow var3 = new EntityCow(this.worldObj); -- var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); -- var3.setEntityHealth(this.getHealth()); -- var3.renderYawOffset = this.renderYawOffset; -- this.worldObj.spawnEntityInWorld(var3); -- -- for (int var4 = 0; var4 < 5; ++var4) -- { -- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed))); -- } -- } -- -- return true; -- } -- else -- { -- return super.interact(par1EntityPlayer); -- } -+ return super.interact(par1EntityPlayer); - } - - /** -@@ -65,4 +44,29 @@ - { - return new EntityMooshroom(this.worldObj); - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) -+ { -+ return getGrowingAge() >= 0; -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) -+ { -+ setDead(); -+ EntityCow entitycow = new EntityCow(worldObj); -+ entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); -+ entitycow.setEntityHealth(getHealth()); -+ entitycow.renderYawOffset = renderYawOffset; -+ worldObj.spawnEntityInWorld(entitycow); -+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); -+ -+ ArrayList ret = new ArrayList(); -+ for (int x = 0; x < 5; x++) -+ { -+ ret.add(new ItemStack(Block.mushroomRed)); -+ } -+ return ret; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EntityOcelot.java.patch b/patches/minecraft_server/net/minecraft/src/EntityOcelot.java.patch deleted file mode 100644 index 3e8517af15..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityOcelot.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityOcelot.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityOcelot.java 0000-00-00 00:00:00.000000000 -0000 -@@ -301,7 +301,8 @@ - - int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3); - -- if (var4 == Block.grass.blockID || var4 == Block.leaves.blockID) -+ Block block = Block.blocksList[var4]; -+ if (var4 == Block.grass.blockID || (block != null && block.isLeaves(worldObj, var1, var2 - 1, var3))) - { - return true; - } diff --git a/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch b/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch deleted file mode 100644 index bb076c3404..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch +++ /dev/null @@ -1,252 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -7,6 +7,14 @@ - import cpw.mods.fml.common.FMLCommonHandler; - import cpw.mods.fml.common.TickType; - -+import net.minecraft.src.forge.ArmorProperties; -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.IGuiHandler; -+import net.minecraft.src.forge.ISpecialArmor; -+import net.minecraft.src.forge.MinecraftForge; -+import net.minecraft.src.forge.NetworkMod; -+import net.minecraft.src.forge.packets.PacketOpenGUI; -+ - public abstract class EntityPlayer extends EntityLiving - { - /** Inventory of the player */ -@@ -182,6 +190,7 @@ - } - else - { -+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount); - if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) - { - this.updateItemUse(var1, 5); -@@ -372,6 +381,10 @@ - */ - protected void closeScreen() - { -+ if (craftingInventory != null) //TODO: This is a bugfix for chests staying open in SMP -+ { -+ craftingInventory.onCraftGuiClosed(this); -+ } - this.craftingInventory = this.inventorySlots; - } - -@@ -555,7 +568,16 @@ - */ - public EntityItem dropOneItem() - { -- return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, 1), false); -+ ItemStack stack = inventory.getCurrentItem(); -+ if (stack == null) -+ { -+ return null; -+ } -+ if (stack.getItem().onDroppedByPlayer(stack, this)) -+ { -+ return dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false); -+ } -+ return null; - } - - /** -@@ -621,10 +643,18 @@ - - /** - * Returns how strong the player is against the specified block at this moment -+ * Deprecated in favor of the metadata-sensitive version - */ -+ @Deprecated - public float getCurrentPlayerStrVsBlock(Block par1Block) - { -- float var2 = this.inventory.getStrVsBlock(par1Block); -+ return getCurrentPlayerStrVsBlock(par1Block, 0); -+ } -+ -+ public float getCurrentPlayerStrVsBlock(Block par1Block, int meta) -+ { -+ ItemStack stack = inventory.getCurrentItem(); -+ float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta)); - float var3 = var2; - int var4 = EnchantmentHelper.getEfficiencyModifier(this.inventory); - -@@ -915,12 +945,22 @@ - */ - protected void damageEntity(DamageSource par1DamageSource, int par2) - { -+ par2 = ForgeHooks.onEntityLivingHurt(this, par1DamageSource, par2); -+ if (par2 == 0) -+ { -+ return; -+ } -+ - if (!par1DamageSource.isUnblockable() && this.isBlocking()) - { - par2 = 1 + par2 >> 1; - } - -- par2 = this.applyArmorCalculations(par1DamageSource, par2); -+ par2 = ArmorProperties.ApplyArmor(this, inventory.armorInventory, par1DamageSource, par2); -+ if (par2 <= 0) -+ { -+ return; -+ } - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - this.addExhaustion(par1DamageSource.getHungerDamage()); - this.health -= par2; -@@ -951,6 +991,10 @@ - */ - public void useCurrentItemOnEntity(Entity par1Entity) - { -+ if (!ForgeHooks.onEntityInteract(this, par1Entity, false)) -+ { -+ return; -+ } - if (!par1Entity.interact(this)) - { - ItemStack var2 = this.getCurrentEquippedItem(); -@@ -981,7 +1025,9 @@ - */ - public void destroyCurrentEquippedItem() - { -+ ItemStack orig = inventory.getCurrentItem(); - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); -+ ForgeHooks.onDestroyCurrentItem(this, orig); - } - - /** -@@ -1010,6 +1056,16 @@ - */ - public void attackTargetEntityWithCurrentItem(Entity par1Entity) - { -+ if (!ForgeHooks.onEntityInteract(this, par1Entity, true)) -+ { -+ return; -+ } -+ ItemStack stack = getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onLeftClickEntity(stack, this, par1Entity)) -+ { -+ return; -+ } -+ - if (par1Entity.canAttackWithItem()) - { - int var2 = this.inventory.getDamageVsEntity(par1Entity); -@@ -1148,6 +1204,12 @@ - */ - public EnumStatus sleepInBedAt(int par1, int par2, int par3) - { -+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, par1, par2, par3); -+ if (customSleep != null) -+ { -+ return customSleep; -+ } -+ - if (!this.worldObj.isRemote) - { - if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1187,6 +1249,11 @@ - { - int var9 = this.worldObj.getBlockMetadata(par1, par2, par3); - int var5 = BlockBed.getDirection(var9); -+ Block block = Block.blocksList[worldObj.getBlockId(par1, par2, par3)]; -+ if (block != null) -+ { -+ var5 = block.getBedDirection(worldObj, par1, par2, par3); -+ } - float var10 = 0.5F; - float var7 = 0.5F; - -@@ -1256,11 +1323,12 @@ - this.resetHeight(); - ChunkCoordinates var4 = this.playerLocation; - ChunkCoordinates var5 = this.playerLocation; -+ Block block = (var4 == null ? null : Block.blocksList[worldObj.getBlockId(var4.posX, var4.posY, var4.posZ)]); - -- if (var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) -+ if (var4 != null && block != null && block.isBed(worldObj, var4.posX, var4.posY, var4.posZ, this)) - { -- BlockBed.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, false); -- var5 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, var4.posX, var4.posY, var4.posZ, 0); -+ block.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, this, false); -+ var5 = block.getBedSpawnPosition(worldObj, var4.posX, var4.posY, var4.posZ, this); - - if (var5 == null) - { -@@ -1297,7 +1365,9 @@ - */ - private boolean isInBed() - { -- return this.worldObj.getBlockId(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Block.bed.blockID; -+ ChunkCoordinates c = playerLocation; -+ int blockID = worldObj.getBlockId(c.posX, c.posY, c.posZ); -+ return Block.blocksList[blockID] != null && Block.blocksList[blockID].isBed(worldObj, c.posX, c.posY, c.posZ, this); - } - - /** -@@ -1312,13 +1382,15 @@ - var2.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - var2.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - -- if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) != Block.bed.blockID) -+ ChunkCoordinates c = par1ChunkCoordinates; -+ Block block = Block.blocksList[par0World.getBlockId(c.posX, c.posY, c.posZ)]; -+ if (block == null || !block.isBed(par0World, c.posX, c.posY, c.posZ, null)) - { - return null; - } - else - { -- ChunkCoordinates var3 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); -+ ChunkCoordinates var3 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null); - return var3; - } - } -@@ -1725,4 +1797,45 @@ - } - - public void func_50022_L() {} -+ -+ /** -+ * Opens a Gui for the player. -+ * -+ * @param mod The mod associated with the gui -+ * @param ID The ID number for the Gui -+ * @param world The World -+ * @param X X Position -+ * @param Y Y Position -+ * @param Z Z Position -+ */ -+ public void openGui(BaseMod mod, int ID, World world, int x, int y, int z) -+ { -+ if (!(this instanceof EntityPlayerMP)) -+ { -+ return; -+ } -+ -+ EntityPlayerMP player = (EntityPlayerMP)this; -+ -+ if (!(mod instanceof NetworkMod)) -+ { -+ return; -+ } -+ -+ IGuiHandler handler = MinecraftForge.getGuiHandler(mod); -+ if (handler != null) -+ { -+ Container container = (Container)handler.getGuiElement(ID, player, world, x, y, z); -+ if (container != null) -+ { -+ player.realGetNextWidowId(); -+ player.closeCraftingGui(); -+ PacketOpenGUI pkt = new PacketOpenGUI(player.getCurrentWindowIdField(), MinecraftForge.getModID((NetworkMod)mod), ID, x, y, z); -+ player.playerNetServerHandler.sendPacket(pkt.getPacket()); -+ craftingInventory = container; -+ craftingInventory.windowId = player.getCurrentWindowIdField(); -+ craftingInventory.onCraftGuiOpened(player); -+ } -+ } -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch b/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch deleted file mode 100644 index 3ee8bc54fd..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000 -@@ -551,6 +551,7 @@ - public void displayWorkbenchGUI(int par1, int par2, int par3) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9)); - this.craftingInventory = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3); - this.craftingInventory.windowId = this.currentWindowId; -@@ -560,6 +561,7 @@ - public void displayGUIEnchantment(int par1, int par2, int par3) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 4, "Enchanting", 9)); - this.craftingInventory = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3); - this.craftingInventory.windowId = this.currentWindowId; -@@ -572,6 +574,7 @@ - public void displayGUIChest(IInventory par1IInventory) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory())); - this.craftingInventory = new ContainerChest(this.inventory, par1IInventory); - this.craftingInventory.windowId = this.currentWindowId; -@@ -584,6 +587,7 @@ - public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory())); - this.craftingInventory = new ContainerFurnace(this.inventory, par1TileEntityFurnace); - this.craftingInventory.windowId = this.currentWindowId; -@@ -596,6 +600,7 @@ - public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory())); - this.craftingInventory = new ContainerDispenser(this.inventory, par1TileEntityDispenser); - this.craftingInventory.windowId = this.currentWindowId; -@@ -608,6 +613,7 @@ - public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) - { - this.getNextWindowId(); -+ closeCraftingGui(); //NOTE: This is a bug fix for chests staying open in SMP - this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory())); - this.craftingInventory = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand); - this.craftingInventory.windowId = this.currentWindowId; -@@ -805,4 +811,18 @@ - this.playerNetServerHandler.sendPacket(new Packet202PlayerAbilities(this.capabilities)); - } - } -+ -+ /* These functions are added to have compatibility with PlayerAPI. -+ * If Divisor does not implement these functions, it is his fault, -+ * these are specifically the functions he told me to use and would be guaranteed to be in PAPI. -+ */ -+ public final void realGetNextWidowId() -+ { -+ getNextWindowId(); -+ } -+ -+ public final int getCurrentWindowIdField() -+ { -+ return currentWindowId; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EntitySheep.java.patch b/patches/minecraft_server/net/minecraft/src/EntitySheep.java.patch deleted file mode 100644 index 9ebe44a8dc..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntitySheep.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntitySheep.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntitySheep.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class EntitySheep extends EntityAnimal -+import net.minecraft.src.forge.IShearable; -+ -+public class EntitySheep extends EntityAnimal implements IShearable - { - /** - * Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. -@@ -99,27 +102,6 @@ - */ - public boolean interact(EntityPlayer par1EntityPlayer) - { -- ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -- -- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && !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); -- } -- - return super.interact(par1EntityPlayer); - } - -@@ -252,4 +234,23 @@ - this.setGrowingAge(var1); - } - } -+ -+ @Override -+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) -+ { -+ return !getSheared() && !isChild(); -+ } -+ -+ @Override -+ public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) -+ { -+ ArrayList ret = new ArrayList(); -+ setSheared(true); -+ int i = 1 + rand.nextInt(3); -+ for (int j = 0; j < i; j++) -+ { -+ ret.add(new ItemStack(Block.cloth.blockID, 1, getFleeceColor())); -+ } -+ return ret; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/EntityTracker.java.patch b/patches/minecraft_server/net/minecraft/src/EntityTracker.java.patch deleted file mode 100644 index 021b43b150..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityTracker.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityTracker.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityTracker.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,6 +5,7 @@ - import java.util.Iterator; - import java.util.Set; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.ForgeHooksServer; - - public class EntityTracker - { -@@ -30,6 +31,10 @@ - - public void trackEntity(Entity par1Entity) - { -+ if (ForgeHooksServer.OnTrackEntity(this, par1Entity)) -+ { -+ return; -+ } - if (par1Entity instanceof EntityPlayerMP) - { - this.trackEntity(par1Entity, 512, 2); diff --git a/patches/minecraft_server/net/minecraft/src/EntityTrackerEntry.java.patch b/patches/minecraft_server/net/minecraft/src/EntityTrackerEntry.java.patch deleted file mode 100644 index 73e95709a2..0000000000 --- a/patches/minecraft_server/net/minecraft/src/EntityTrackerEntry.java.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/EntityTrackerEntry.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/EntityTrackerEntry.java 0000-00-00 00:00:00.000000000 -0000 -@@ -5,6 +5,9 @@ - import java.util.List; - import java.util.Set; - -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.packets.PacketEntityTrack; -+ - public class EntityTrackerEntry - { - /** The entity that this EntityTrackerEntry tracks. */ -@@ -226,6 +229,15 @@ - this.trackedPlayers.add(par1EntityPlayerMP); - par1EntityPlayerMP.playerNetServerHandler.sendPacket(this.getSpawnPacket()); - -+ int posX = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); -+ int posY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); -+ int posZ = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); -+ if (posX != this.encodedPosX || posY != this.encodedPosY || posZ != this.encodedPosZ) -+ { -+ PacketEntityTrack pkt = new PacketEntityTrack(this.trackedEntity.entityId, this.encodedPosX, this.encodedPosY, this.encodedPosZ); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacket(pkt.getPacket()); -+ } -+ - if (this.shouldSendMotionUpdates) - { - par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet28EntityVelocity(this.trackedEntity.entityId, this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); -@@ -286,6 +298,11 @@ - { - System.out.println("Fetching addPacket for removed entity"); - } -+ Packet pkt = ForgeHooks.getEntitySpawnPacket(trackedEntity); -+ if (pkt != null) -+ { -+ return pkt; -+ } - - if (this.trackedEntity instanceof EntityItem) - { diff --git a/patches/minecraft_server/net/minecraft/src/Explosion.java.patch b/patches/minecraft_server/net/minecraft/src/Explosion.java.patch deleted file mode 100644 index a0b7b8ceb3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Explosion.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,8 @@ - import java.util.Random; - import java.util.Set; - -+import net.minecraft.src.forge.ISpecialResistance; -+ - public class Explosion - { - /** whether or not the explosion sets fire to blocks around it */ -@@ -72,7 +74,15 @@ - - if (var25 > 0) - { -- var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21; -+ if (Block.blocksList[var25] instanceof ISpecialResistance) -+ { -+ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[var25]; -+ var14 -= (isr.getSpecialExplosionResistance(worldObj, var22, var23, var24, explosionX, explosionY, explosionZ, exploder) + 0.3F) * var21; -+ } -+ else -+ { -+ var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21; -+ } - } - - if (var14 > 0.0F) diff --git a/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch b/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch deleted file mode 100644 index cef8bf01f3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.util.Arrays; - import java.util.HashMap; - import java.util.Map; - -@@ -9,6 +10,7 @@ - - /** The list of smelting results. */ - private Map smeltingList = new HashMap(); -+ private Map metaSmeltingList = new HashMap(); - - /** - * Used to call methods addSmelting and getSmeltingResult. -@@ -47,7 +49,9 @@ - - /** - * Returns the smelting result of an item. -+ * Deprecated in favor of a metadata sensitive version - */ -+ @Deprecated - public ItemStack getSmeltingResult(int par1) - { - return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); -@@ -57,4 +61,34 @@ - { - return this.smeltingList; - } -+ -+ /** -+ * Add a metadata-sensitive furnace recipe -+ * @param itemID The Item ID -+ * @param metadata The Item Metadata -+ * @param itemstack The ItemStack for the result -+ */ -+ public void addSmelting(int itemID, int metadata, ItemStack itemstack) -+ { -+ metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); -+ } -+ -+ /** -+ * Used to get the resulting ItemStack form a source ItemStack -+ * @param item The Source ItemStack -+ * @return The result ItemStack -+ */ -+ public ItemStack getSmeltingResult(ItemStack item) -+ { -+ if (item == null) -+ { -+ return null; -+ } -+ ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); -+ if (ret != null) -+ { -+ return ret; -+ } -+ return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/GuiStatsComponent.java.patch b/patches/minecraft_server/net/minecraft/src/GuiStatsComponent.java.patch deleted file mode 100644 index 5ccd99f11a..0000000000 --- a/patches/minecraft_server/net/minecraft/src/GuiStatsComponent.java.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/GuiStatsComponent.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/GuiStatsComponent.java 0000-00-00 00:00:00.000000000 -0000 -@@ -7,6 +7,7 @@ - import javax.swing.JComponent; - import javax.swing.Timer; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.DimensionManager; - - public class GuiStatsComponent extends JComponent - { -@@ -41,22 +42,30 @@ - { - long var1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); - System.gc(); -+ -+ if (displayStrings.length < DimensionManager.getIDs().length + 3) -+ { -+ displayStrings = new String[DimensionManager.getIDs().length + 3]; -+ } -+ for(int x = 0; x < displayStrings.length; x++) -+ { -+ displayStrings[x] = ""; -+ } -+ - this.displayStrings[0] = "Memory use: " + var1 / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)"; - this.displayStrings[1] = "Threads: " + NetworkManager.numReadThreads + " + " + NetworkManager.numWriteThreads; - this.displayStrings[2] = "Avg tick: " + field_40573_a.format(this.func_48551_a(this.field_40572_e.field_40027_f) * 1.0E-6D) + " ms"; - this.displayStrings[3] = "Avg sent: " + (int)this.func_48551_a(this.field_40572_e.field_48080_u) + ", Avg size: " + (int)this.func_48551_a(this.field_40572_e.field_48079_v); - this.displayStrings[4] = "Avg rec: " + (int)this.func_48551_a(this.field_40572_e.field_48078_w) + ", Avg size: " + (int)this.func_48551_a(this.field_40572_e.field_48082_x); - -- if (this.field_40572_e.worldMngr != null) -+ int x = 0; -+ for (Integer id : DimensionManager.getIDs()) - { -- for (int var3 = 0; var3 < this.field_40572_e.worldMngr.length; ++var3) -+ displayStrings[2 + ++x] = "Lvl " + id + " tick: " + field_40573_a.format(func_48551_a(field_40572_e.worldTickTimes.get(id)) * 10E-6D) + " ms"; -+ WorldServer world = (WorldServer)DimensionManager.getWorld(id); -+ if (world != null && world.chunkProviderServer != null) - { -- this.displayStrings[5 + var3] = "Lvl " + var3 + " tick: " + field_40573_a.format(this.func_48551_a(this.field_40572_e.field_40028_g[var3]) * 1.0E-6D) + " ms"; -- -- if (this.field_40572_e.worldMngr[var3] != null && this.field_40572_e.worldMngr[var3].chunkProviderServer != null) -- { -- this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", " + this.field_40572_e.worldMngr[var3].chunkProviderServer.func_46040_d(); -- } -+ displayStrings[2 + x] += ", " + world.chunkProviderServer.func_46040_d(); - } - } - -@@ -67,7 +76,7 @@ - private double func_48551_a(long[] par1ArrayOfLong) - { - long var2 = 0L; -- -+ if (par1ArrayOfLong == null) return 0; - for (int var4 = 0; var4 < par1ArrayOfLong.length; ++var4) - { - var2 += par1ArrayOfLong[var4]; diff --git a/patches/minecraft_server/net/minecraft/src/Item.java.patch b/patches/minecraft_server/net/minecraft/src/Item.java.patch deleted file mode 100644 index 3fe585ce5f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Item.java.patch +++ /dev/null @@ -1,236 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,8 +1,11 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Random; - --public class Item -+import net.minecraft.src.forge.ITextureProvider; -+ -+public class Item implements ITextureProvider - { - /** The RNG used by the Item subclasses. */ - protected static Random itemRand = new Random(); -@@ -191,6 +194,9 @@ - - /** full name of item from language file */ - private String itemName; -+ -+ /** FORGE: To disable repair recipes. */ -+ protected boolean canRepair = true; - - protected Item(int par1) - { -@@ -198,7 +204,7 @@ - - if (itemsList[256 + par1] != null) - { -- System.out.println("CONFLICT @ " + par1); -+ System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this); - } - - itemsList[256 + par1] = this; -@@ -492,6 +498,10 @@ - float var18 = var15 * var16; - float var20 = var14 * var16; - double var21 = 5.0D; -+ if (par2EntityPlayer instanceof EntityPlayerMP) -+ { -+ var21 = ((EntityPlayerMP)par2EntityPlayer).itemInWorldManager.getBlockReachDistance(); -+ } - Vec3D var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); - MovingObjectPosition var24 = par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); - return var24; -@@ -509,4 +519,190 @@ - { - StatList.initStats(); - } -+ -+ /* =========================================================== FORGE START ===============================================================*/ -+ public boolean isDefaultTexture = true; -+ private String currentTexture = "/gui/items.png"; -+ /** -+ * Called when a new CreativeContainer is opened, populate the list -+ * with all of the items for this item you want a player in creative mode -+ * to have access to. -+ * -+ * @param itemList The list of items currently in the creative inventory -+ */ -+ public void addCreativeItems(ArrayList itemList) -+ { -+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex) -+ { -+ itemList.add(new ItemStack(this, 1)); -+ } -+ } -+ -+ /** -+ * Called when a player drops the item into the world, -+ * returning false from this will prevent the item from -+ * being removed from the players inventory and spawning -+ * in the world -+ * -+ * @param player The player that dropped the item -+ * @param item The item stack, before the item is removed. -+ */ -+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) -+ { -+ return true; -+ } -+ -+ /** -+ * This is called when the item is used, before the block is activated. -+ * @param stack The Item Stack -+ * @param player The Player that used the item -+ * @param world The Current World -+ * @param X Target X Position -+ * @param Y Target Y Position -+ * @param Z Target Z Position -+ * @param side The side of the target hit -+ * @return Return true to prevent any further processing. -+ */ -+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side) -+ { -+ return false; -+ } -+ -+ /** -+ * Metadata-sensitive version of getStrVsBlock -+ * @param itemstack The Item Stack -+ * @param block The block the item is trying to break -+ * @param metadata The items current metadata -+ * @return The damage strength -+ */ -+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata) -+ { -+ return getStrVsBlock(itemstack, block); -+ } -+ -+ /** -+ * Called by CraftingManager to determine if an item is reparable. -+ * @return True if reparable -+ */ -+ public boolean isRepairable() -+ { -+ return canRepair && isDamageable(); -+ } -+ -+ /** -+ * Call to disable repair recipes. -+ * @return The current Item instance -+ */ -+ public Item setNoRepair() -+ { -+ canRepair = false; -+ return this; -+ } -+ -+ /** -+ * Called before a block is broken. Return true to prevent default block harvesting. -+ * -+ * Note: In SMP, this is called on both client and server sides! -+ * -+ * @param itemstack The current ItemStack -+ * @param X The X Position -+ * @param Y The X Position -+ * @param Z The X Position -+ * @param player The Player that is wielding the item -+ * @return True to prevent harvesting, false to continue as normal -+ */ -+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) -+ { -+ return false; -+ } -+ -+ /** -+ * Called each tick while using an item. -+ * @param stack The Item being used -+ * @param player The Player using the item -+ * @param count The amount of time in tick the item has been used for continuously -+ */ -+ public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count) -+ { -+ } -+ -+ /** -+ * Called when the player Left Clicks (attacks) an entity. -+ * Processed before damage is done, if return value is true further processing is canceled -+ * and the entity is not attacked. -+ * -+ * @param stack The Item being used -+ * @param player The player that is attacking -+ * @param entity The entity being attacked -+ * @return True to cancel the rest of the interaction. -+ */ -+ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) -+ { -+ return false; -+ } -+ -+ /** -+ * Player, Render pass, and item usage sensitive version of getIconIndex. -+ * -+ * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null) -+ * @param renderPass The pass to get the icon for, 0 is default. -+ * @param player The player holding the item -+ * @param usingItem The item the player is actively using. Can be null if not using anything. -+ * @param useRemaining The ticks remaining for the active item. -+ * @return The icon index -+ */ -+ public int getIconIndex(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) -+ { -+ /* -+ * Here is an example usage for Vanilla bows. -+ if (usingItem != null && usingItem.getItem().shiftedIndex == Item.bow.shiftedIndex) -+ { -+ int k = usingItem.getMaxItemUseDuration() - useRemaining; -+ if (k >= 18) return 133; -+ if (k > 13) return 117; -+ if (k > 0) return 101; -+ } -+ */ -+ return 0; -+ } -+ -+ /** -+ * Returns the number of render passes/layers this item has. -+ * Usually equates to ItemRenderer.renderItem being called for this many passes. -+ * Does not get called unless func_46058_c() is true; -+ * -+ * Not called on the server -+ * -+ * @param metadata The item's metadata -+ * @return The number of passes to run. -+ */ -+ public int getRenderPasses(int metadata) -+ { -+ return 1; //return func_46058_c() ? 2 : 1; -+ } -+ -+ /** -+ * Grabs the current texture file used for this block -+ */ -+ @Override -+ public String getTextureFile() -+ { -+ if (this instanceof ItemBlock) -+ { -+ return Block.blocksList[((ItemBlock)this).getBlockID()].getTextureFile(); -+ } -+ return currentTexture; -+ } -+ -+ /** -+ * Sets the current texture file for this item, used when rendering. -+ * Default is "/gui/items.png" -+ * -+ * @param texture The texture file -+ */ -+ public void setTextureFile(String texture) -+ { -+ currentTexture = texture; -+ isDefaultTexture = false; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/ItemBlock.java.patch b/patches/minecraft_server/net/minecraft/src/ItemBlock.java.patch deleted file mode 100644 index 0f89de5a64..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemBlock.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemBlock.java 0000-00-00 00:00:00.000000000 -0000 -@@ -32,7 +32,8 @@ - { - par7 = 1; - } -- else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) -+ else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID -+ && (Block.blocksList[var8] != null && !Block.blocksList[var8].isBlockReplaceable(par3World, par4, par5, par6))) - { - if (par7 == 0) - { diff --git a/patches/minecraft_server/net/minecraft/src/ItemBow.java.patch b/patches/minecraft_server/net/minecraft/src/ItemBow.java.patch deleted file mode 100644 index 5b4b4b5110..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemBow.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemBow extends Item - { - public ItemBow(int par1) -@@ -14,6 +16,11 @@ - */ - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) - { -+ if (ForgeHooks.onArrowLoose(par1ItemStack, par2World, par3EntityPlayer, getMaxItemUseDuration(par1ItemStack) - par4)) -+ { -+ return; -+ } -+ - boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; - - if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) -@@ -103,6 +110,12 @@ - */ - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { -+ ItemStack stack = ForgeHooks.onArrowNock(par1ItemStack, par2World, par3EntityPlayer); -+ if (stack != null) -+ { -+ return stack; -+ } -+ - if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) - { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); diff --git a/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch b/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch deleted file mode 100644 index d36a94503a..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.MinecraftForge; -+ - public class ItemBucket extends Item - { - /** field for checking if the bucket has been filled. */ -@@ -43,10 +45,16 @@ - - if (this.isFull == 0) - { -- if (!par3EntityPlayer.canPlayerEdit(var13, var14, var15)) -+ if (par3EntityPlayer != null && !par3EntityPlayer.canPlayerEdit(var13, var14, var15)) - { - return par1ItemStack; - } -+ -+ ItemStack stack = MinecraftForge.fillCustomBucket(par2World, var13, var14, var15); -+ if (stack != null) -+ { -+ return stack; -+ } - - if (par2World.getBlockMaterial(var13, var14, var15) == Material.water && par2World.getBlockMetadata(var13, var14, var15) == 0) - { diff --git a/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch b/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch deleted file mode 100644 index 93969d7364..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemDye extends Item - { - /** List of dye color names */ -@@ -25,7 +27,7 @@ - */ - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) - { -- if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6)) -+ if (par2EntityPlayer != null && !par2EntityPlayer.canPlayerEdit(par4, par5, par6)) - { - return false; - } -@@ -34,7 +36,14 @@ - if (par1ItemStack.getItemDamage() == 15) - { - int var8 = par3World.getBlockId(par4, par5, par6); -- -+ if (ForgeHooks.onUseBonemeal(par3World, var8, par4, par5, par6)) -+ { -+ if (!par3World.isRemote) -+ { -+ par1ItemStack.stackSize--; -+ } -+ return true; -+ } - if (var8 == Block.sapling.blockID) - { - if (!par3World.isRemote) -@@ -107,15 +116,15 @@ - { - if (itemRand.nextInt(10) != 0) - { -+ if (mod_MinecraftForge.DISABLE_DARK_ROOMS && !Block.tallGrass.canBlockStay(par3World, var10, var11, var12)) -+ { -+ continue; -+ } - par3World.setBlockAndMetadataWithNotify(var10, var11, var12, Block.tallGrass.blockID, 1); - } -- else if (itemRand.nextInt(3) != 0) -- { -- par3World.setBlockWithNotify(var10, var11, var12, Block.plantYellow.blockID); -- } - else - { -- par3World.setBlockWithNotify(var10, var11, var12, Block.plantRed.blockID); -+ ForgeHooks.plantGrassPlant(par3World, var10, var11, var12); - } - } - } diff --git a/patches/minecraft_server/net/minecraft/src/ItemHoe.java.patch b/patches/minecraft_server/net/minecraft/src/ItemHoe.java.patch deleted file mode 100644 index 880d0ad41b..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemHoe.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemHoe.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemHoe.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemHoe extends Item - { - public ItemHoe(int par1, EnumToolMaterial par2EnumToolMaterial) -@@ -21,6 +23,11 @@ - } - else - { -+ if(ForgeHooks.onUseHoe(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6)) -+ { -+ par1ItemStack.damageItem(1, par2EntityPlayer); -+ return true; -+ } - int var8 = par3World.getBlockId(par4, par5, par6); - int var9 = par3World.getBlockId(par4, par5 + 1, par6); - diff --git a/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch b/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch deleted file mode 100644 index 11e535ed43..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch +++ /dev/null @@ -1,122 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,7 +1,11 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemInWorldManager - { -+ /** Forge reach distance hook */ -+ private double blockReachDistance = 5.0d; - /** The world object that this object is connected to. */ - public World thisWorld; - -@@ -83,7 +87,7 @@ - if (var2 != 0) - { - Block var3 = Block.blocksList[var2]; -- float var4 = var3.blockStrength(this.thisPlayer) * (float)(var1 + 1); -+ float var4 = var3.blockStrength(thisWorld, this.thisPlayer, field_22049_l, field_22048_m, field_22047_n) * (float)(var1 + 1); - - if (var4 >= 1.0F) - { -@@ -118,7 +122,7 @@ - Block.blocksList[var5].onBlockClicked(this.thisWorld, par1, par2, par3, this.thisPlayer); - } - -- if (var5 > 0 && Block.blocksList[var5].blockStrength(this.thisPlayer) >= 1.0F) -+ if (var5 > 0 && Block.blocksList[var5].blockStrength(thisWorld, this.thisPlayer, par1, par2, par3) >= 1.0F) - { - this.blockHarvessted(par1, par2, par3); - } -@@ -141,7 +145,7 @@ - if (var5 != 0) - { - Block var6 = Block.blocksList[var5]; -- float var7 = var6.blockStrength(this.thisPlayer) * (float)(var4 + 1); -+ float var7 = var6.blockStrength(thisWorld, this.thisPlayer, par1, par2, par3) * (float)(var4 + 1); - - if (var7 >= 0.7F) - { -@@ -168,7 +172,7 @@ - { - Block var4 = Block.blocksList[this.thisWorld.getBlockId(par1, par2, par3)]; - int var5 = this.thisWorld.getBlockMetadata(par1, par2, par3); -- boolean var6 = this.thisWorld.setBlockWithNotify(par1, par2, par3, 0); -+ boolean var6 = (var4 != null && var4.removeBlockByPlayer(thisWorld, thisPlayer, par1, par2, par3)); - - if (var4 != null && var6) - { -@@ -180,6 +184,11 @@ - - public boolean blockHarvessted(int par1, int par2, int par3) - { -+ ItemStack stack = thisPlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, thisPlayer)) -+ { -+ return false; -+ } - int var4 = this.thisWorld.getBlockId(par1, par2, par3); - int var5 = this.thisWorld.getBlockMetadata(par1, par2, par3); - this.thisWorld.playAuxSFXAtEntity(this.thisPlayer, 2001, par1, par2, par3, var4 + (this.thisWorld.getBlockMetadata(par1, par2, par3) << 12)); -@@ -192,7 +201,7 @@ - else - { - ItemStack var7 = this.thisPlayer.getCurrentEquippedItem(); -- boolean var8 = this.thisPlayer.canHarvestBlock(Block.blocksList[var4]); -+ boolean var8 = Block.blocksList[var4].canHarvestBlock(thisPlayer, var5); - - if (var7 != null) - { -@@ -202,6 +211,7 @@ - { - var7.onItemDestroyedByUse(this.thisPlayer); - this.thisPlayer.destroyCurrentEquippedItem(); -+ ForgeHooks.onDestroyCurrentItem(thisPlayer, var7); - } - } - -@@ -248,6 +258,11 @@ - */ - public boolean activeBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7) - { -+ if (par3ItemStack != null && par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return true; -+ } -+ - int var8 = par2World.getBlockId(par4, par5, par6); - - if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer)) -@@ -269,7 +284,15 @@ - } - else - { -- return par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7); -+ if (!par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7)) -+ { -+ return false; -+ } -+ if (par3ItemStack.stackSize == 0) -+ { -+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, par3ItemStack); -+ } -+ return true; - } - } - -@@ -280,4 +303,13 @@ - { - this.thisWorld = par1WorldServer; - } -+ -+ public double getBlockReachDistance() -+ { -+ return blockReachDistance; -+ } -+ public void setBlockReachDistance(double distance) -+ { -+ blockReachDistance = distance; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch b/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch deleted file mode 100644 index cbed0c91c6..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 -@@ -68,7 +68,7 @@ - byte var23 = 0; - byte var24 = 0; - byte var25 = 0; -- int[] var26 = new int[256]; -+ int[] var26 = new int[Block.blocksList.length]; - Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22); - int var28 = var21 & 15; - int var29 = var22 & 15; -@@ -158,7 +158,7 @@ - var33 = 0; - var34 = 0; - -- for (var35 = 0; var35 < 256; ++var35) -+ for (var35 = 0; var35 < Block.blocksList.length; ++var35) - { - if (var26[var35] > var33) - { diff --git a/patches/minecraft_server/net/minecraft/src/ItemShears.java.patch b/patches/minecraft_server/net/minecraft/src/ItemShears.java.patch deleted file mode 100644 index a7bf11a1cd..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemShears.java.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,9 @@ - package net.minecraft.src; - -+import java.util.ArrayList; -+ -+import net.minecraft.src.forge.IShearable; -+ - public class ItemShears extends Item - { - public ItemShears(int par1) -@@ -11,13 +15,12 @@ - - public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) - { -- if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID) -+ if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID && !(Block.blocksList[par2] instanceof IShearable)) - { - return super.onBlockDestroyed(par1ItemStack, par2, par3, par4, par5, par6EntityLiving); - } - else - { -- par1ItemStack.damageItem(1, par6EntityLiving); - return true; - } - } -@@ -38,4 +41,62 @@ - { - return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F; - } -+ -+ @Override -+ public void useItemOnEntity(ItemStack itemstack, EntityLiving entity) -+ { -+ if (entity.worldObj.isRemote) -+ { -+ return; -+ } -+ if (entity instanceof IShearable) -+ { -+ IShearable target = (IShearable)entity; -+ if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) -+ { -+ ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); -+ for(ItemStack stack : drops) -+ { -+ EntityItem ent = entity.entityDropItem(stack, 1.0F); -+ ent.motionY += entity.rand.nextFloat() * 0.05F; -+ ent.motionX += (entity.rand.nextFloat() - entity.rand.nextFloat()) * 0.1F; -+ ent.motionZ += (entity.rand.nextFloat() - entity.rand.nextFloat()) * 0.1F; -+ } -+ itemstack.damageItem(1, entity); -+ } -+ } -+ } -+ -+ @Override -+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) -+ { -+ if (player.worldObj.isRemote) -+ { -+ return false; -+ } -+ int id = player.worldObj.getBlockId(X, Y, Z); -+ if (Block.blocksList[id] != null && Block.blocksList[id] instanceof IShearable) -+ { -+ IShearable target = (IShearable)Block.blocksList[id]; -+ if (target.isShearable(itemstack, player.worldObj, X, Y, Z)) -+ { -+ ArrayList drops = target.onSheared(itemstack, player.worldObj, X, Y, Z, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); -+ for(ItemStack stack : drops) -+ { -+ float f = 0.7F; -+ double d = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ double d1 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ double d2 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ EntityItem entityitem = new EntityItem(player.worldObj, (double)X + d, (double)Y + d1, (double)Z + d2, stack); -+ entityitem.delayBeforeCanPickup = 10; -+ player.worldObj.spawnEntityInWorld(entityitem); -+ } -+ itemstack.damageItem(1, player); -+ player.addStat(StatList.mineBlockStatArray[id], 1); -+ } -+ } -+ return false; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch b/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch deleted file mode 100644 index 407c602eeb..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,13 +1,15 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class ItemTool extends Item - { - /** Array of blocks the tool has extra effect against. */ - private Block[] blocksEffectiveAgainst; -- protected float efficiencyOnProperMaterial = 4.0F; -+ public float efficiencyOnProperMaterial = 4.0F; - - /** Damage versus entities. */ -- private int damageVsEntity; -+ public int damageVsEntity; - - /** The material this tool is made from. */ - protected EnumToolMaterial toolMaterial; -@@ -71,4 +73,15 @@ - { - return this.toolMaterial.getEnchantability(); - } -+ -+ /** FORGE: Overridden to allow custom tool effectiveness */ -+ @Override -+ public float getStrVsBlock(ItemStack stack, Block block, int meta) -+ { -+ if (ForgeHooks.isToolEffective(stack, block, meta)) -+ { -+ return efficiencyOnProperMaterial; -+ } -+ return getStrVsBlock(stack, block); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch b/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch deleted file mode 100644 index 28d55df65d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -@@ -26,6 +26,9 @@ - /** The hit entity */ - public Entity entityHit; - -+ /** Used to determine what sub-segment is hit */ -+ public int subHit = -1; -+ - public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3D par5Vec3D) - { - this.typeOfHit = EnumMovingObjectType.TILE; diff --git a/patches/minecraft_server/net/minecraft/src/NetLoginHandler.java.patch b/patches/minecraft_server/net/minecraft/src/NetLoginHandler.java.patch deleted file mode 100644 index e3db064657..0000000000 --- a/patches/minecraft_server/net/minecraft/src/NetLoginHandler.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/NetLoginHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/NetLoginHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -8,6 +8,9 @@ - - import cpw.mods.fml.server.FMLServerHandler; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.*; -+import net.minecraft.src.forge.packets.*; -+import java.io.UnsupportedEncodingException; - - public class NetLoginHandler extends NetHandler - { -@@ -48,6 +51,7 @@ - this.mcServer = par1MinecraftServer; - this.netManager = new NetworkManager(par2Socket, par3Str, this); - this.netManager.chunkDataSendCounter = 0; -+ ForgeHooks.onConnect(netManager); - } - - /** -@@ -148,6 +152,7 @@ - ChunkCoordinates var4 = var3.getSpawnPoint(); - var2.itemInWorldManager.func_35695_b(var3.getWorldInfo().getGameType()); - NetServerHandler var5 = new NetServerHandler(this.mcServer, this.netManager, var2); -+ /* - var5.sendPacket(new Packet1Login("", var2.entityId, var3.getWorldInfo().getTerrainType(), var2.itemInWorldManager.getGameType(), var3.worldProvider.worldType, (byte)var3.difficultySetting, (byte)var3.getHeight(), (byte)this.mcServer.configManager.getMaxPlayers())); - var5.sendPacket(new Packet6SpawnPosition(var4.posX, var4.posY, var4.posZ)); - var5.sendPacket(new Packet202PlayerAbilities(var2.capabilities)); -@@ -155,7 +160,9 @@ - this.mcServer.configManager.sendPacketToAllPlayers(new Packet3Chat("\u00a7e" + var2.username + " joined the game.")); - this.mcServer.configManager.playerLoggedIn(var2); - var5.teleportTo(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch); -+ */ - this.mcServer.networkServer.addPlayer(var5); -+ /* - var5.sendPacket(new Packet4UpdateTime(var3.getWorldTime())); - Iterator var6 = var2.getActivePotionEffects().iterator(); - -@@ -166,9 +173,10 @@ - } - - var2.func_20057_k(); -+ */ -+ ForgeHooksServer.handleLoginPacket(par1Packet1Login, var5, netManager); - - FMLServerHandler.instance().handleLogin(par1Packet1Login, netManager); -- FMLServerHandler.instance().announceLogin(var2); - } - - this.finishedProcessing = true; diff --git a/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch b/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch deleted file mode 100644 index 5f36a19efd..0000000000 --- a/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch +++ /dev/null @@ -1,190 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,10 +2,14 @@ - - import java.util.ArrayList; - import java.util.Random; -+import java.util.logging.Level; - import java.util.logging.Logger; - - import cpw.mods.fml.server.FMLServerHandler; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.MessageManager; -+import java.io.UnsupportedEncodingException; - - public class NetServerHandler extends NetHandler implements ICommandListener - { -@@ -19,7 +23,7 @@ - public boolean connectionClosed = false; - - /** Reference to the MinecraftServer object. */ -- private MinecraftServer mcServer; -+ public MinecraftServer mcServer; - - /** Reference to the EntityPlayerMP object. */ - private EntityPlayerMP playerEntity; -@@ -374,8 +378,11 @@ - double var10 = this.playerEntity.posY - ((double)var6 + 0.5D) + 1.5D; - double var12 = this.playerEntity.posZ - ((double)var7 + 0.5D); - double var14 = var8 * var8 + var10 * var10 + var12 * var12; -+ -+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 1; -+ dist *= dist; - -- if (var14 > 36.0D) -+ if (var14 > dist) - { - return; - } -@@ -397,7 +404,7 @@ - - if (par1Packet14BlockDig.status == 0) - { -- if (var20 <= 16 && !var3) -+ if (var20 <= mcServer.spawnProtectionSize && !var3) - { - this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); - } -@@ -467,8 +474,9 @@ - { - var12 = var11; - } -- -- if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && (var12 > 16 || var9)) -+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 1; -+ dist *= dist; -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < dist && (var12 > mcServer.spawnProtectionSize || var9)) - { - this.playerEntity.itemInWorldManager.activeBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8); - } -@@ -602,9 +610,13 @@ - } - else - { -- var2 = "<" + this.playerEntity.username + "> " + var2; -- logger.info(var2); -- this.mcServer.configManager.sendPacketToAllPlayers(new Packet3Chat(var2)); -+ var2 = ForgeHooks.onServerChat(playerEntity, var2); -+ if (var2 != null) -+ { -+ var2 = "<" + this.playerEntity.username + "> " + var2; -+ logger.info(var2); -+ this.mcServer.configManager.sendPacketToAllPlayers(new Packet3Chat(var2)); -+ } - } - - this.field_45001_m += 20; -@@ -648,6 +660,10 @@ - } - } - } -+ else if (ForgeHooks.onChatCommand(this.playerEntity, this.mcServer.configManager.isOp(playerEntity.username), par1Str.substring(1))) -+ { -+ logger.info("Forge: " + playerEntity.username + " issues command: " + par1Str.substring(1)); -+ } - else - { - String var3; -@@ -765,9 +781,10 @@ - */ - public void handleRespawn(Packet9Respawn par1Packet9Respawn) - { -+ int dim = (this.mcServer.getWorldManager(this.playerEntity.dimension).worldProvider.canRespawnHere() ? this.playerEntity.dimension : 0); - if (this.playerEntity.gameOver) - { -- this.playerEntity = this.mcServer.configManager.recreatePlayerEntity(this.playerEntity, 0, true); -+ this.playerEntity = this.mcServer.configManager.recreatePlayerEntity(this.playerEntity, dim, true); - } - else - { -@@ -776,7 +793,7 @@ - return; - } - -- this.playerEntity = this.mcServer.configManager.recreatePlayerEntity(this.playerEntity, 0, false); -+ this.playerEntity = this.mcServer.configManager.recreatePlayerEntity(this.playerEntity, dim, false); - } - } - -@@ -969,9 +986,78 @@ - { - this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.isFlying && this.playerEntity.capabilities.allowFlying; - } -+ -+ public EntityPlayerMP getPlayerEntity() -+ { -+ return playerEntity; -+ } -+ -+ @Override -+ public void handleCustomPayload(Packet250CustomPayload pkt) -+ { -+ FMLServerHandler.instance().handlePacket250(pkt, playerEntity); -+ MessageManager inst = MessageManager.getInstance(); -+ if (pkt.channel.equals("REGISTER")) -+ { -+ try -+ { -+ String channels = new String(pkt.data, "UTF8"); -+ for (String channel : channels.split("\0")) -+ { -+ inst.addActiveChannel(netManager, channel); -+ } -+ } -+ catch (UnsupportedEncodingException ex) -+ { -+ ModLoader.throwException("NetServerHandler.handleCustomPayload", ex); -+ } -+ } -+ else if (pkt.channel.equals("UNREGISTER")) -+ { -+ try -+ { -+ String channels = new String(pkt.data, "UTF8"); -+ for (String channel : channels.split("\0")) -+ { -+ inst.removeActiveChannel(netManager, channel); -+ } -+ } -+ catch (UnsupportedEncodingException ex) -+ { -+ ModLoader.throwException("NetServerHandler.handleCustomPayload", ex); -+ } -+ } -+ else -+ { -+ inst.dispatchIncomingMessage(netManager, pkt.channel, pkt.data); -+ } -+ } -+ -+ @Override -+ public void handleMapData(Packet131MapData par1Packet131MapData) -+ { -+ ForgeHooks.onItemDataPacket(netManager, par1Packet131MapData); -+ } - - @Override -- public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) { -- FMLServerHandler.instance().handlePacket250(par1Packet250CustomPayload, playerEntity); -+ public void handleTileEntityData(Packet132TileEntityData pkt) -+ { -+ World world = this.getPlayerEntity().worldObj; -+ if (world.blockExists(pkt.xPosition, pkt.yPosition, pkt.zPosition)) -+ { -+ TileEntity te = world.getBlockTileEntity(pkt.xPosition, pkt.yPosition, pkt.zPosition); -+ if (te != null) -+ { -+ te.onDataPacket(netManager, pkt); -+ } -+ else -+ { -+ ModLoader.getLogger().log(Level.WARNING, String.format( -+ "Received a TileEntityData packet for a location that did not have a TileEntity: (%d, %d, %d) %d: %d, %d, %d", -+ pkt.xPosition, pkt.yPosition, pkt.zPosition, -+ pkt.actionType, -+ pkt.customParam1, pkt.customParam2, pkt.customParam3)); -+ } -+ } - } - } diff --git a/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch b/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch deleted file mode 100644 index aee13ade21..0000000000 --- a/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -11,6 +11,9 @@ - import java.util.Collections; - import java.util.List; - -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.MessageManager; -+ - public class NetworkManager - { - /** Synchronization object used for read and write threads. */ -@@ -315,6 +318,8 @@ - { - ; - } -+ ForgeHooks.onDisconnect(this, par1Str, par2ArrayOfObj); -+ MessageManager.getInstance().removeConnection(this); - } - } - -@@ -462,4 +467,14 @@ - { - return par0NetworkManager.writeThread; - } -+ -+ /** -+ * Retrieves the current associated network handler. -+ * Added so modders don't have to use reflection. -+ * @return The current registered Network Handler -+ */ -+ public NetHandler getNetHandler() -+ { -+ return netHandler; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch b/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch deleted file mode 100644 index 7c4b785445..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 -@@ -44,7 +44,7 @@ - this.xPosition = par1DataInputStream.readInt(); - this.yPosition = par1DataInputStream.read(); - this.zPosition = par1DataInputStream.readInt(); -- this.type = par1DataInputStream.read(); -+ this.type = par1DataInputStream.readInt(); //4096 - this.metadata = par1DataInputStream.read(); - } - -@@ -56,7 +56,7 @@ - par1DataOutputStream.writeInt(this.xPosition); - par1DataOutputStream.write(this.yPosition); - par1DataOutputStream.writeInt(this.zPosition); -- par1DataOutputStream.write(this.type); -+ par1DataOutputStream.writeInt(this.type); //4096 - par1DataOutputStream.write(this.metadata); - } - -@@ -73,6 +73,6 @@ - */ - public int getPacketSize() - { -- return 11; -+ return 14; - } - } diff --git a/patches/minecraft_server/net/minecraft/src/RailLogic.java.patch b/patches/minecraft_server/net/minecraft/src/RailLogic.java.patch deleted file mode 100644 index 2281108007..0000000000 --- a/patches/minecraft_server/net/minecraft/src/RailLogic.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,7 +3,7 @@ - import java.util.ArrayList; - import java.util.List; - --class RailLogic -+public class RailLogic - { - /** Reference to the World object. */ - private World worldObj; -@@ -18,6 +18,7 @@ - private List connectedTracks; - - final BlockRail rail; -+ private final boolean canMakeSlopes; - - public RailLogic(BlockRail par1BlockRail, World par2World, int par3, int par4, int par5) - { -@@ -28,17 +29,11 @@ - this.trackY = par4; - this.trackZ = par5; - int var6 = par2World.getBlockId(par3, par4, par5); -- int var7 = par2World.getBlockMetadata(par3, par4, par5); - -- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[var6])) -- { -- this.isPoweredRail = true; -- var7 &= -9; -- } -- else -- { -- this.isPoweredRail = false; -- } -+ BlockRail target = (BlockRail)Block.blocksList[var6]; -+ int var7 = target.getBasicRailMetadata(par2World, null, par3, par4, par5); -+ isPoweredRail = !target.isFlexibleRail(par2World, par3, par4, par5); -+ canMakeSlopes = target.canMakeSlopes(par2World, par3, par4, par5); - - this.setConnections(var7); - } -@@ -258,7 +253,7 @@ - } - } - -- if (var6 == 0) -+ if (var6 == 0 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1)) - { -@@ -271,7 +266,7 @@ - } - } - -- if (var6 == 1) -+ if (var6 == 1 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ)) - { -@@ -422,7 +417,7 @@ - } - } - -- if (var7 == 0) -+ if (var7 == 0 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1)) - { -@@ -435,7 +430,7 @@ - } - } - -- if (var7 == 1) -+ if (var7 == 1 && canMakeSlopes) - { - if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ)) - { -@@ -485,7 +480,7 @@ - /** - * get number of adjacent tracks - */ -- static int getNAdjacentTracks(RailLogic par0RailLogic) -+ public static int getNAdjacentTracks(RailLogic par0RailLogic) - { - return par0RailLogic.getAdjacentTracks(); - } diff --git a/patches/minecraft_server/net/minecraft/src/ServerConfigurationManager.java.patch b/patches/minecraft_server/net/minecraft/src/ServerConfigurationManager.java.patch deleted file mode 100644 index 20dd44dde1..0000000000 --- a/patches/minecraft_server/net/minecraft/src/ServerConfigurationManager.java.patch +++ /dev/null @@ -1,153 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/ServerConfigurationManager.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/ServerConfigurationManager.java 0000-00-00 00:00:00.000000000 -0000 -@@ -14,6 +14,7 @@ - - import cpw.mods.fml.server.FMLServerHandler; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.DimensionManager; - - public class ServerConfigurationManager - { -@@ -27,7 +28,7 @@ - private MinecraftServer mcServer; - - /** Reference to the PlayerManager object. */ -- private PlayerManager[] playerManagerObj = new PlayerManager[3]; -+ //private PlayerManager[] playerManagerObj = new PlayerManager[3]; - - /** the maximum amount of players that can be connected */ - private int maxPlayers; -@@ -73,9 +74,11 @@ - this.opFile = par1MinecraftServer.getFile("ops.txt"); - this.whitelistPlayersFile = par1MinecraftServer.getFile("white-list.txt"); - int var2 = par1MinecraftServer.propertyManagerObj.getIntProperty("view-distance", 10); -+ /* - this.playerManagerObj[0] = new PlayerManager(par1MinecraftServer, 0, var2); - this.playerManagerObj[1] = new PlayerManager(par1MinecraftServer, -1, var2); - this.playerManagerObj[2] = new PlayerManager(par1MinecraftServer, 1, var2); -+ */ - this.maxPlayers = par1MinecraftServer.propertyManagerObj.getIntProperty("max-players", 20); - this.whiteListEnforced = par1MinecraftServer.propertyManagerObj.getBooleanProperty("white-list", false); - this.readBannedPlayers(); -@@ -102,9 +105,10 @@ - */ - public void joinNewPlayerManager(EntityPlayerMP par1EntityPlayerMP) - { -- this.playerManagerObj[0].removePlayer(par1EntityPlayerMP); -- this.playerManagerObj[1].removePlayer(par1EntityPlayerMP); -- this.playerManagerObj[2].removePlayer(par1EntityPlayerMP); -+ for (World world : DimensionManager.getWorlds()) -+ { -+ ((WorldServer)world).playerManager.removePlayer(par1EntityPlayerMP); -+ } - this.getPlayerManager(par1EntityPlayerMP.dimension).addPlayer(par1EntityPlayerMP); - WorldServer var2 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension); - var2.chunkProviderServer.loadChunk((int)par1EntityPlayerMP.posX >> 4, (int)par1EntityPlayerMP.posZ >> 4); -@@ -112,7 +116,7 @@ - - public int getMaxTrackingDistance() - { -- return this.playerManagerObj[0].getMaxTrackingDistance(); -+ return getPlayerManager(0).getMaxTrackingDistance(); - } - - /** -@@ -120,7 +124,8 @@ - */ - private PlayerManager getPlayerManager(int par1) - { -- return par1 == -1 ? this.playerManagerObj[1] : (par1 == 0 ? this.playerManagerObj[0] : (par1 == 1 ? this.playerManagerObj[2] : null)); -+ WorldServer world = (WorldServer)DimensionManager.getWorld(par1); -+ return (world == null ? null : world.playerManager); - } - - /** -@@ -245,6 +250,7 @@ - var5.copyPlayer(par1EntityPlayerMP); - } - -+ var5.dimension = par2; - var5.entityId = par1EntityPlayerMP.entityId; - var5.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; - WorldServer var6 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension); -@@ -289,6 +295,10 @@ - */ - public void sendPlayerToOtherDimension(EntityPlayerMP par1EntityPlayerMP, int par2) - { -+ sendPlayerToOtherDimension(par1EntityPlayerMP, par2, new Teleporter()); -+ } -+ public void sendPlayerToOtherDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter) -+ { - int var3 = par1EntityPlayerMP.dimension; - WorldServer var4 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension); - par1EntityPlayerMP.dimension = par2; -@@ -296,33 +306,14 @@ - par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.itemInWorldManager.getGameType())); - var4.removePlayer(par1EntityPlayerMP); - par1EntityPlayerMP.isDead = false; -- double var6 = par1EntityPlayerMP.posX; -- double var8 = par1EntityPlayerMP.posZ; -- double var10 = 8.0D; -- -- if (par1EntityPlayerMP.dimension == -1) -- { -- var6 /= var10; -- var8 /= var10; -- par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); - -- if (par1EntityPlayerMP.isEntityAlive()) -- { -- var4.updateEntityWithOptionalForce(par1EntityPlayerMP, false); -- } -- } -- else if (par1EntityPlayerMP.dimension == 0) -- { -- var6 *= var10; -- var8 *= var10; -- par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); -+ WorldProvider pOld = DimensionManager.getProvider(var3); -+ WorldProvider pNew = DimensionManager.getProvider(par2); -+ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); -+ double var6 = par1EntityPlayerMP.posX * moveFactor; -+ double var8 = par1EntityPlayerMP.posZ * moveFactor; - -- if (par1EntityPlayerMP.isEntityAlive()) -- { -- var4.updateEntityWithOptionalForce(par1EntityPlayerMP, false); -- } -- } -- else -+ if (par1EntityPlayerMP.dimension == 1) - { - ChunkCoordinates var12 = var5.getEntrancePortalLocation(); - var6 = (double)var12.posX; -@@ -342,7 +333,7 @@ - par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); - var5.updateEntityWithOptionalForce(par1EntityPlayerMP, false); - var5.chunkProviderServer.chunkLoadOverride = true; -- (new Teleporter()).placeInPortal(var5, par1EntityPlayerMP); -+ teleporter.placeInPortal(var5, par1EntityPlayerMP); - var5.chunkProviderServer.chunkLoadOverride = false; - } - -@@ -372,9 +363,9 @@ - this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.username, true, var1.ping)); - } - -- for (int var2 = 0; var2 < this.playerManagerObj.length; ++var2) -+ for (World world : DimensionManager.getWorlds()) - { -- this.playerManagerObj[var2].updatePlayerInstances(); -+ ((WorldServer)world).playerManager.updatePlayerInstances(); - } - } - -@@ -907,7 +898,7 @@ - - public String[] func_52019_t() - { -- return this.mcServer.worldMngr[0].getSaveHandler().getPlayerNBTManager().func_52007_g(); -+ return DimensionManager.getWorld(0).getSaveHandler().getPlayerNBTManager().func_52007_g(); - } - - private void func_52018_u() diff --git a/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch b/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch deleted file mode 100644 index 898ee7ab3f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,8 @@ - - import cpw.mods.fml.server.FMLServerHandler; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class SlotCrafting extends Slot - { - /** The craft matrix inventory linked to this result slot. */ -@@ -99,6 +101,7 @@ - public void onPickupFromSlot(ItemStack par1ItemStack) - { - FMLServerHandler.instance().onItemCrafted(thePlayer, par1ItemStack, craftMatrix); -+ ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix); - this.func_48416_b(par1ItemStack); - - for (int var2 = 0; var2 < this.craftMatrix.getSizeInventory(); ++var2) diff --git a/patches/minecraft_server/net/minecraft/src/SpawnerAnimals.java.patch b/patches/minecraft_server/net/minecraft/src/SpawnerAnimals.java.patch deleted file mode 100644 index c6371528b5..0000000000 --- a/patches/minecraft_server/net/minecraft/src/SpawnerAnimals.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,10 +1,14 @@ - package net.minecraft.src; - -+import java.util.ArrayList; -+import java.util.Collections; - import java.util.HashMap; - import java.util.Iterator; - import java.util.List; - import java.util.Random; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public final class SpawnerAnimals - { - /** The 17x17 area around the player where mobs can spawn */ -@@ -20,7 +24,7 @@ - { - Chunk var3 = par0World.getChunkFromChunkCoords(par1, par2); - int var4 = par1 * 16 + par0World.rand.nextInt(16); -- int var5 = par0World.rand.nextInt(var3 == null ? 128 : Math.max(128, var3.getTopFilledSegment())); -+ int var5 = par0World.rand.nextInt(var3 == null ? 128 : Math.max(128, var3.getTopFilledSegment() + 15)); //Vanilla Bug that causes mobs to not spawn on the topmost chunk with blocks. - int var6 = par2 * 16 + par0World.rand.nextInt(16); - return new ChunkPosition(var4, var5, var6); - } -@@ -78,6 +82,13 @@ - if ((!var34.getPeacefulCreature() || par2) && (var34.getPeacefulCreature() || par1) && par0World.countEntities(var34.getCreatureClass()) <= var34.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256) - { - Iterator var35 = eligibleChunksForSpawning.keySet().iterator(); -+ if (mod_MinecraftForge.SPAWNER_MAKE_MORE_RANDOM) -+ { -+ ArrayList tmp = new ArrayList(eligibleChunksForSpawning.keySet()); -+ Collections.shuffle(tmp); -+ var35 = tmp.iterator(); -+ //Note for cpw: this can be done by Collections.shuffle(b) -+ } - label108: - - while (var35.hasNext()) -@@ -202,7 +213,8 @@ - else - { - int var5 = par1World.getBlockId(par2, par3 - 1, par4); -- return Block.isNormalCube(var5) && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); -+ boolean spawnBlock = (Block.blocksList[var5] != null && Block.blocksList[var5].canCreatureSpawn(par0EnumCreatureType, par1World, par2, par3 - 1, par4)); -+ return spawnBlock && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); - } - } - -@@ -211,6 +223,16 @@ - */ - private static void creatureSpecificInit(EntityLiving par0EntityLiving, World par1World, float par2, float par3, float par4) - { -+ if (ForgeHooks.onEntitySpawnSpecial(par0EntityLiving, par1World, par2, par3, par4)) //Deprecated in 1.2.5, remove in 1.3 -+ { -+ return; -+ } -+ -+ if (ForgeHooks.onEntityLivingSpawn(par0EntityLiving, par1World, par2, par3, par4)) -+ { -+ return; -+ } -+ - if (par0EntityLiving instanceof EntitySpider && par1World.rand.nextInt(100) == 0) - { - EntitySkeleton var7 = new EntitySkeleton(par1World); diff --git a/patches/minecraft_server/net/minecraft/src/StatList.java.patch b/patches/minecraft_server/net/minecraft/src/StatList.java.patch deleted file mode 100644 index 6713f755d7..0000000000 --- a/patches/minecraft_server/net/minecraft/src/StatList.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 -@@ -166,9 +166,9 @@ - */ - private static StatBase[] initMinableStats(String par0Str, int par1) - { -- StatBase[] var2 = new StatBase[256]; -+ StatBase[] var2 = new StatBase[Block.blocksList.length]; - -- for (int var3 = 0; var3 < 256; ++var3) -+ for (int var3 = 0; var3 < Block.blocksList.length; ++var3) - { - if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) - { diff --git a/patches/minecraft_server/net/minecraft/src/Teleporter.java.patch b/patches/minecraft_server/net/minecraft/src/Teleporter.java.patch deleted file mode 100644 index 9d417f8751..0000000000 --- a/patches/minecraft_server/net/minecraft/src/Teleporter.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/Teleporter.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/Teleporter.java 0000-00-00 00:00:00.000000000 -0000 -@@ -70,7 +70,7 @@ - { - double var15 = (double)var14 + 0.5D - par2Entity.posZ; - -- for (int var17 = 127; var17 >= 0; --var17) -+ for (int var17 = par1World.getHeight() - 1; var17 >= 0; --var17) //BugFix - { - if (par1World.getBlockId(var11, var17, var14) == Block.portal.blockID) - { -@@ -170,7 +170,7 @@ - var18 = (double)var17 + 0.5D - par2Entity.posZ; - label274: - -- for (var20 = 127; var20 >= 0; --var20) -+ for (var20 = par1World.getHeight() - 1; var20 >= 0; --var20) //BugFix - { - if (par1World.isAirBlock(var14, var20, var17)) - { -@@ -236,7 +236,7 @@ - var18 = (double)var17 + 0.5D - par2Entity.posZ; - label222: - -- for (var20 = 127; var20 >= 0; --var20) -+ for (var20 = par1World.getHeight() - 1; var20 >= 0; --var20) //BugFix - { - if (par1World.isAirBlock(var14, var20, var17)) - { -@@ -304,9 +304,9 @@ - var10 = 70; - } - -- if (var10 > 118) -+ if (var10 > par1World.getHeight() - 10) //BugFix - { -- var10 = 118; -+ var10 = par1World.getHeight() - 10; //BugFix - } - - var16 = var10; diff --git a/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch b/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch deleted file mode 100644 index ea26b9c53f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -207,4 +207,29 @@ - public static void addNewTileEntityMapping(Class tileEntityClass, String id) { - addMapping(tileEntityClass, id); - } -+ -+ /** -+ * Determines if this TileEntity requires update calls. -+ * @return True if you want updateEntity() to be called, false if not -+ */ -+ public boolean canUpdate() -+ { -+ return true; -+ } -+ -+ /** -+ * Called when you receive a TileEntityData packet for the location this -+ * TileEntity is currently in. On the client, the NetworkManager will always -+ * be the remote server. On the server, it will be whomever is responsible for -+ * sending the packet. -+ * -+ * @param net The NetworkManager the packet originated from -+ * @param pkt The data packet -+ */ -+ public void onDataPacket(NetworkManager net, Packet132TileEntityData pkt){} -+ -+ /** -+ * Called when the chunk this TileEntity is on is Unloaded. -+ */ -+ public void onChunkUnload(){} - } diff --git a/patches/minecraft_server/net/minecraft/src/TileEntityBrewingStand.java.patch b/patches/minecraft_server/net/minecraft/src/TileEntityBrewingStand.java.patch deleted file mode 100644 index 60a68514cf..0000000000 --- a/patches/minecraft_server/net/minecraft/src/TileEntityBrewingStand.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,7 +2,9 @@ - - import java.util.List; - --public class TileEntityBrewingStand extends TileEntity implements IInventory -+import net.minecraft.src.forge.ISidedInventory; -+ -+public class TileEntityBrewingStand extends TileEntity implements IInventory, ISidedInventory - { - /** The itemstacks currently placed in the slots of the brewing stand */ - private ItemStack[] brewingItemStacks = new ItemStack[4]; -@@ -317,4 +319,16 @@ - - return var1; - } -+ -+ @Override -+ public int getStartInventorySide(int side) -+ { -+ return (side == 1 ? 3 : 0); -+ } -+ -+ @Override -+ public int getSizeInventorySide(int side) -+ { -+ return (side == 1 ? 1 : 3); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch b/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch deleted file mode 100644 index 6c17198b8d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,7 +2,10 @@ - - import cpw.mods.fml.common.FMLCommonHandler; - --public class TileEntityFurnace extends TileEntity implements IInventory -+import net.minecraft.src.forge.ForgeHooks; -+import net.minecraft.src.forge.ISidedInventory; -+ -+public class TileEntityFurnace extends TileEntity implements IInventory, ISidedInventory - { - /** - * The ItemStacks that hold the items currently being used in the furnace -@@ -251,8 +254,12 @@ - } - else - { -- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); -- return var1 == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(var1) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < var1.getMaxStackSize()))); -+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); -+ if (var1 == null) return false; -+ if (this.furnaceItemStacks[2] == null) return true; -+ if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false; -+ int result = furnaceItemStacks[2].stackSize + var1.stackSize; -+ return (result <= this.getInventoryStackLimit() && result <= this.furnaceItemStacks[2].getMaxStackSize()); - } - } - -@@ -263,15 +270,25 @@ - { - if (this.canSmelt()) - { -- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); -+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); - - if (this.furnaceItemStacks[2] == null) - { - this.furnaceItemStacks[2] = var1.copy(); - } -- else if (this.furnaceItemStacks[2].itemID == var1.itemID) -+ else if (this.furnaceItemStacks[2].isItemEqual(var1)) - { -- ++this.furnaceItemStacks[2].stackSize; -+ //========================================================== -+ //Adding extra importance here, so this really small bug -+ //fix stops slipping through the cracks. -+ // -+ //Makes it so that items that result in multiple items are -+ //smelted correctly each time. -+ // -+ // -+ // -+ this.furnaceItemStacks[2].stackSize += var1.stackSize; -+ //========================================================== - } - - --this.furnaceItemStacks[0].stackSize; -@@ -296,12 +313,17 @@ - else - { - int var1 = par1ItemStack.getItem().shiftedIndex; -- if (var1 < 256 && Block.blocksList[var1].blockMaterial == Material.wood) return 300; -+ if (par1ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1].blockMaterial == Material.wood) return 300; - if (var1 == Item.stick.shiftedIndex) return 100; - if (var1 == Item.coal.shiftedIndex) return 1600; - if (var1 == Item.bucketLava.shiftedIndex) return 20000; - if (var1 == Block.sapling.blockID) return 100; - if (var1 == Item.blazeRod.shiftedIndex) return 2400; -+ int ret = ForgeHooks.getItemBurnTime(par1ItemStack); -+ if (ret > 0) -+ { -+ return ret; -+ } - return FMLCommonHandler.instance().fuelLookup(var1, par1ItemStack.getItemDamage()); - } - } -@@ -325,4 +347,18 @@ - public void openChest() {} - - public void closeChest() {} -+ -+ @Override -+ public int getStartInventorySide(int side) -+ { -+ if (side == 0) return 1; -+ if (side == 1) return 0; -+ return 2; -+ } -+ -+ @Override -+ public int getSizeInventorySide(int side) -+ { -+ return 1; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/World.java.patch b/patches/minecraft_server/net/minecraft/src/World.java.patch deleted file mode 100644 index 266391f668..0000000000 --- a/patches/minecraft_server/net/minecraft/src/World.java.patch +++ /dev/null @@ -1,354 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -@@ -9,8 +9,17 @@ - import java.util.Set; - import java.util.TreeSet; - -+import net.minecraft.src.forge.ForgeHooks; -+ - public class World implements IBlockAccess - { -+ /** -+ * Used in the getEntitiesWithinAABB functions to expand the search area for entities. -+ * Modders should change this variable to a higher value if it is less then the radius -+ * of one of there entities. -+ */ -+ public static double MAX_ENTITY_RADIUS = 2.0D; -+ - /** - * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately - */ -@@ -79,7 +88,7 @@ - * Contains a timestamp from when the World object was created. Is used in the session.lock file - */ - private long lockTimestamp = System.currentTimeMillis(); -- protected int autosavePeriod = 40; -+ public int autosavePeriod = 40; - - /** Whether monsters are enabled or not. (1 = on, 0 = off) */ - public int difficultySetting; -@@ -219,6 +228,7 @@ - - this.calculateInitialSkylight(); - this.calculateInitialWeather(); -+ ForgeHooks.onWorldLoad(this); - } - - /** -@@ -323,6 +333,7 @@ - } - - this.chunkProvider.saveChunks(par1, par2IProgressUpdate); -+ ForgeHooks.onWorldSave(this); - } - } - -@@ -354,7 +365,8 @@ - */ - public boolean isAirBlock(int par1, int par2, int par3) - { -- return this.getBlockId(par1, par2, par3) == 0; -+ int id = getBlockId(par1, par2, par3); -+ return (id == 0 || Block.blocksList[id] == null || Block.blocksList[id].isAirBlock(this, par1, par2, par3)); - } - - /** -@@ -363,7 +375,8 @@ - public boolean blockHasTileEntity(int par1, int par2, int par3) - { - int var4 = this.getBlockId(par1, par2, par3); -- return Block.blocksList[var4] != null && Block.blocksList[var4].hasTileEntity(); -+ int md = this.getBlockMetadata(par1, par2, par3); -+ return Block.blocksList[var4] != null && Block.blocksList[var4].hasTileEntity(md); - } - - /** -@@ -956,7 +969,9 @@ - int var12 = this.getBlockMetadata(var8, var9, var10); - Block var13 = Block.blocksList[var11]; - -- if ((!par4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var11 > 0 && var13.canCollideCheck(var12, par3)) -+ if (var13 != null && //BugFix NPE on missconfigured block ids. -+ (!par4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && -+ var11 > 0 && var13.canCollideCheck(var12, par3)) - { - MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3D, par2Vec3D); - -@@ -1604,7 +1619,7 @@ - - if (var7 != null) - { -- var7.removeChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15); -+ var7.cleanChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15); - } - } - } -@@ -1614,6 +1629,10 @@ - - if (!this.entityRemoval.isEmpty()) - { -+ for (Object tile : entityRemoval) -+ { -+ ((TileEntity)tile).onChunkUnload(); -+ } - this.loadedTileEntityList.removeAll(this.entityRemoval); - this.entityRemoval.clear(); - } -@@ -1634,14 +1653,16 @@ - { - this.loadedTileEntityList.add(var8); - } -- -+ } -+ else -+ { - if (this.chunkExists(var8.xCoord >> 4, var8.zCoord >> 4)) - { - Chunk var9 = this.getChunkFromChunkCoords(var8.xCoord >> 4, var8.zCoord >> 4); - - if (var9 != null) - { -- var9.setChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15, var8); -+ var9.cleanChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15); - } - } - -@@ -1658,13 +1679,13 @@ - - public void addTileEntity(Collection par1Collection) - { -- if (this.scanningTileEntities) -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ for(Object entity : par1Collection) - { -- this.addedTileEntityList.addAll(par1Collection); -- } -- else -- { -- this.loadedTileEntityList.addAll(par1Collection); -+ if(((TileEntity)entity).canUpdate()) -+ { -+ dest.add(entity); -+ } - } - } - -@@ -1686,7 +1707,7 @@ - int var4 = MathHelper.floor_double(par1Entity.posZ); - byte var5 = 32; - -- if (!par2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5)) -+ if (!par2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5) || ForgeHooks.canUpdateEntity(par1Entity)) - { - par1Entity.lastTickPosX = par1Entity.posX; - par1Entity.lastTickPosY = par1Entity.posY; -@@ -1910,6 +1931,13 @@ - { - return true; - } -+ else -+ { -+ if (var11 > 0 && Block.blocksList[var11] != null && Block.blocksList[var11].isBlockBurning(this, var8, var9, var10)) -+ { -+ return true; -+ } -+ } - } - } - } -@@ -2192,25 +2220,21 @@ - */ - public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) - { -- if (par4TileEntity != null && !par4TileEntity.isInvalid()) -+ if (par4TileEntity == null || par4TileEntity.isInvalid()) - { -- if (this.scanningTileEntities) -- { -- par4TileEntity.xCoord = par1; -- par4TileEntity.yCoord = par2; -- par4TileEntity.zCoord = par3; -- this.addedTileEntityList.add(par4TileEntity); -- } -- else -- { -- this.loadedTileEntityList.add(par4TileEntity); -- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ return; -+ } -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ if (par4TileEntity.canUpdate()) -+ { -+ dest.add(par4TileEntity); -+ } - -- if (var5 != null) -- { -- var5.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); -- } -- } -+ Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ -+ if (var5 != null) -+ { -+ var5.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); - } - } - -@@ -2219,27 +2243,10 @@ - */ - public void removeBlockTileEntity(int par1, int par2, int par3) - { -- TileEntity var4 = this.getBlockTileEntity(par1, par2, par3); -- -- if (var4 != null && this.scanningTileEntities) -- { -- var4.invalidate(); -- this.addedTileEntityList.remove(var4); -- } -- else -+ Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ if (var5 != null) - { -- if (var4 != null) -- { -- this.addedTileEntityList.remove(var4); -- this.loadedTileEntityList.remove(var4); -- } -- -- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -- -- if (var5 != null) -- { -- var5.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); -- } -+ var5.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - } - -@@ -2265,7 +2272,8 @@ - */ - public boolean isBlockNormalCube(int par1, int par2, int par3) - { -- return Block.isNormalCube(this.getBlockId(par1, par2, par3)); -+ Block block = Block.blocksList[getBlockId(par1, par2, par3)]; -+ return block != null && block.isBlockNormalCube(this, par1, par2, par3); - } - - /** -@@ -2281,7 +2289,7 @@ - if (var5 != null && !var5.isEmpty()) - { - Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)]; -- return var6 == null ? false : var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock(); -+ return var6 == null ? false : isBlockNormalCube(par1, par2, par3); - } - else - { -@@ -2540,6 +2548,7 @@ - } - } - } -+ ForgeHooks.addActiveChunks(this, activeChunkSet); - - Profiler.endSection(); - -@@ -2863,7 +2872,7 @@ - - private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6) - { -- int var7 = Block.lightValue[par5]; -+ int var7 = (par5 == 0 || Block.blocksList[par5] == null ? 0 : Block.blocksList[par5].getLightValue(this, par2, par3, par4)); - int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6; - int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6; - int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6; -@@ -3196,10 +3205,10 @@ - public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) - { - this.entitiesWithinAABBExcludingEntity.clear(); -- int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); - - for (int var7 = var3; var7 <= var4; ++var7) - { -@@ -3220,10 +3229,10 @@ - */ - public List getEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB) - { -- int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int var3 = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); - ArrayList var7 = new ArrayList(); - - for (int var8 = var3; var8 <= var4; ++var8) -@@ -3350,6 +3359,11 @@ - var8 = null; - } - -+ if (var8 != null && var8.isBlockReplaceable(this, par2, par3, par4)) -+ { -+ var8 = null; -+ } -+ - return par1 > 0 && var8 == null && var9.canPlaceBlockOnSide(this, par2, par3, par4, par6); - } - } -@@ -3827,7 +3841,7 @@ - */ - public int getHeight() - { -- return 256; -+ return worldProvider.hasNoSky ? 128 : 256; //Nether is 128, overworld is 256, Bugfix related to Portal generation - } - - /** -@@ -3864,4 +3878,38 @@ - { - return this.getChunkProvider().findClosestStructure(this, par1Str, par2, par3, par4); - } -+ -+ /** -+ * Adds a single TileEntity to the world. -+ * TODO: Eloraam fully describe the bug this fixes. -+ * @param entity The TileEntity to be added. -+ */ -+ public void addTileEntity(TileEntity entity) -+ { -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ if(entity.canUpdate()) -+ { -+ dest.add(entity); -+ } -+ } -+ -+ /** -+ * Determine if the given block is considered solid on the -+ * specified side. Used by placement logic. -+ * -+ * @param x Block X Position -+ * @param y Block Y Position -+ * @param z Block Z Position -+ * @param side The Side in question -+ * @return True if the side is solid -+ */ -+ public boolean isBlockSolidOnSide(int x, int y, int z, int side) -+ { -+ Block block = Block.blocksList[getBlockId(x, y, z)]; -+ if(block == null) -+ { -+ return false; -+ } -+ return block.isBlockSolidOnSide(this, x, y, z, side); -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenBigMushroom.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenBigMushroom.java.patch deleted file mode 100644 index a288eed406..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenBigMushroom.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenBigMushroom.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenBigMushroom.java 0000-00-00 00:00:00.000000000 -0000 -@@ -54,7 +54,9 @@ - { - var13 = par1World.getBlockId(var11, var9, var12); - -- if (var13 != 0 && var13 != Block.leaves.blockID) -+ Block block = Block.blocksList[var13]; -+ -+ if (var13 != 0 && block != null && !block.isLeaves(par1World, var11, var9, var12)) - { - var8 = false; - } -@@ -186,7 +188,9 @@ - var15 = 0; - } - -- if ((var15 != 0 || par4 >= par4 + var7 - 1) && !Block.opaqueCubeLookup[par1World.getBlockId(var13, var11, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var13, var11, var14)]; -+ -+ if ((var15 != 0 || par4 >= par4 + var7 - 1) && (block == null || block.canBeReplacedByLeaves(par1World, var13, var11, var14))) - { - this.setBlockAndMetadata(par1World, var13, var11, var14, Block.mushroomCapBrown.blockID + var6, var15); - } -@@ -198,7 +202,9 @@ - { - var12 = par1World.getBlockId(par3, par4 + var11, par5); - -- if (!Block.opaqueCubeLookup[var12]) -+ Block block = Block.blocksList[var12]; -+ -+ if (block == null || block.canBeReplacedByLeaves(par1World, par3, par4 + var11, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.mushroomCapBrown.blockID + var6, 10); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenDeadBush.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenDeadBush.java.patch deleted file mode 100644 index b8d798be5e..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenDeadBush.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenDeadBush.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenDeadBush.java 0000-00-00 00:00:00.000000000 -0000 -@@ -16,10 +16,16 @@ - { - int var11; - -- for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - for (int var7 = 0; var7 < 4; ++var7) - { diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenDungeons.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenDungeons.java.patch deleted file mode 100644 index 28aac01d98..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenDungeons.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,6 +2,8 @@ - - import java.util.Random; - -+import net.minecraft.src.forge.MinecraftForge; -+ - public class WorldGenDungeons extends WorldGenerator - { - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) -@@ -117,9 +119,9 @@ - - if (var16 != null) - { -- for (int var17 = 0; var17 < 8; ++var17) -+ for (int var17 = 0; var17 < MinecraftForge.getDungeonLootTries(); ++var17) - { -- ItemStack var18 = this.pickCheckLootItem(par2Random); -+ ItemStack var18 = MinecraftForge.getRandomDungeonLoot(par2Random); - - if (var18 != null) - { -@@ -147,7 +149,7 @@ - - if (var19 != null) - { -- var19.setMobID(this.pickMobSpawner(par2Random)); -+ var19.setMobID(MinecraftForge.getRandomDungeonMob(par2Random)); - } - else - { diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenForest.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenForest.java.patch deleted file mode 100644 index 6524cac514..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenForest.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenForest.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenForest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -43,7 +43,9 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 != 0 && (block != null && !block.isLeaves(par1World, var10, var8, var11))) - { - var7 = false; - } -@@ -82,7 +84,10 @@ - { - int var15 = var14 - par5; - -- if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var14)]; -+ -+ if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var12, var16, var14))) - { - this.setBlockAndMetadata(par1World, var12, var16, var14, Block.leaves.blockID, 2); - } -@@ -94,7 +99,9 @@ - { - var10 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var10 == 0 || var10 == Block.leaves.blockID) -+ Block block = Block.blocksList[var10]; -+ -+ if (var10 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var16, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 2); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenHugeTrees.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenHugeTrees.java.patch deleted file mode 100644 index 26db3a98a8..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenHugeTrees.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenHugeTrees.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenHugeTrees.java 0000-00-00 00:00:00.000000000 -0000 -@@ -55,7 +55,12 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) -+ if (var12 != 0 && -+ (Block.blocksList[var12] != null && !Block.blocksList[var12].isLeaves(par1World, var10, var8, var11)) && -+ var12 != Block.grass.blockID && -+ var12 != Block.dirt.blockID && -+ (Block.blocksList[var12] != null && !Block.blocksList[var12].isWood(par1World, var10, var8, var11)) && -+ var12 != Block.sapling.blockID) - { - var7 = false; - } -@@ -103,7 +108,7 @@ - { - var11 = par1World.getBlockId(par3, par4 + var10, par5); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3, par4 + var10, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); - -@@ -125,7 +130,7 @@ - { - var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3 + 1, par4 + var10, par5)) - { - this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); - -@@ -145,7 +150,7 @@ - - var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5 + 1); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null && Block.blocksList[var11].isLeaves(par1World, par3 + 1, par4 + var10, par5 + 1)) - { - this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); - -@@ -165,7 +170,7 @@ - - var11 = par1World.getBlockId(par3, par4 + var10, par5 + 1); - -- if (var11 == 0 || var11 == Block.leaves.blockID) -+ if (var11 == 0 || Block.blocksList[var11] == null || Block.blocksList[var11].isLeaves(par1World, par3, par4 + var10, par5 + 1)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); - -@@ -216,7 +221,12 @@ - { - int var14 = var13 - par3; - -- if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1)) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) -+ Block block = Block.blocksList[par1World.getBlockId(var11, var8, var13)]; -+ -+ if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && -+ (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && -+ (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1)) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var11, var8, var13))) - { - this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenMinable.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenMinable.java.patch deleted file mode 100644 index 99795c27db..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenMinable.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenMinable.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenMinable.java 0000-00-00 00:00:00.000000000 -0000 -@@ -6,6 +6,7 @@ - { - /** The block ID of the ore to be placed using this generator. */ - private int minableBlockId; -+ private int minableBlockMeta = 0; - - /** The number of blocks to generate. */ - private int numberOfBlocks; -@@ -15,6 +16,12 @@ - this.minableBlockId = par1; - this.numberOfBlocks = par2; - } -+ -+ public WorldGenMinable(int id, int meta, int number) -+ { -+ this(id, number); -+ minableBlockMeta = meta; -+ } - - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) - { -@@ -57,9 +64,10 @@ - { - double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D); - -- if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.getBlockId(var38, var41, var44) == Block.stone.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var38, var41, var44)]; -+ if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, var38, var41, var44))) - { -- par1World.setBlock(var38, var41, var44, this.minableBlockId); -+ par1World.setBlockAndMetadata(var38, var41, var44, this.minableBlockId, minableBlockMeta); - } - } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenShrub.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenShrub.java.patch deleted file mode 100644 index 9509a7ae46..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenShrub.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenShrub.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenShrub.java 0000-00-00 00:00:00.000000000 -0000 -@@ -17,10 +17,16 @@ - { - int var15; - -- for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - int var7 = par1World.getBlockId(par3, par4, par5); - -@@ -42,7 +48,9 @@ - { - int var14 = var13 - par5; - -- if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) -+ block = Block.blocksList[par1World.getBlockId(var11, var8, var13)]; -+ -+ if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && (block == null || block.canBeReplacedByLeaves(par1World, var11, var8, var13))) - { - this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.field_48408_a); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenSwamp.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenSwamp.java.patch deleted file mode 100644 index 433de5bfb6..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenSwamp.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenSwamp.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenSwamp.java 0000-00-00 00:00:00.000000000 -0000 -@@ -44,7 +44,7 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID) -+ if (var12 != 0 && (Block.blocksList[var12] != null && !Block.blocksList[var12].isLeaves(par1World, var10, var8, var11))) - { - if (var12 != Block.waterStill.blockID && var12 != Block.waterMoving.blockID) - { -@@ -91,7 +91,10 @@ - { - int var15 = var14 - par5; - -- if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var14)]; -+ -+ if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var12, var16, var14))) - { - this.setBlock(par1World, var12, var16, var14, Block.leaves.blockID); - } -@@ -103,7 +106,9 @@ - { - var10 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) -+ Block block = Block.blocksList[var10]; -+ -+ if (var10 == 0 || (block != null && block.isLeaves(par1World, par3, par4 + var16, par5)) || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) - { - this.setBlock(par1World, par3, par4 + var16, par5, Block.wood.blockID); - } -@@ -118,7 +123,8 @@ - { - for (var13 = par5 - var11; var13 <= par5 + var11; ++var13) - { -- if (par1World.getBlockId(var12, var16, var13) == Block.leaves.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var12, var16, var13)]; -+ if (block != null && block.isLeaves(par1World, var12, var16, var13)) - { - if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0) - { diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenTaiga1.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenTaiga1.java.patch deleted file mode 100644 index 26a521840f..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenTaiga1.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenTaiga1.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenTaiga1.java 0000-00-00 00:00:00.000000000 -0000 -@@ -41,7 +41,9 @@ - { - var15 = par1World.getBlockId(var13, var11, var14); - -- if (var15 != 0 && var15 != Block.leaves.blockID) -+ Block block = Block.blocksList[var15]; -+ -+ if (var15 != 0 && (block == null || !block.isLeaves(par1World, var13, var11, var14))) - { - var10 = false; - } -@@ -77,7 +79,10 @@ - { - int var17 = var16 - par5; - -- if ((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var13, var16)]) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var13, var16)]; -+ -+ if ((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var14, var13, var16))) - { - this.setBlockAndMetadata(par1World, var14, var13, var16, Block.leaves.blockID, 1); - } -@@ -98,7 +103,9 @@ - { - var14 = par1World.getBlockId(par3, par4 + var13, par5); - -- if (var14 == 0 || var14 == Block.leaves.blockID) -+ Block block = Block.blocksList[var14]; -+ -+ if (var14 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var13, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var13, par5, Block.wood.blockID, 1); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenTaiga2.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenTaiga2.java.patch deleted file mode 100644 index 9f8cadbcd4..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenTaiga2.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenTaiga2.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenTaiga2.java 0000-00-00 00:00:00.000000000 -0000 -@@ -45,7 +45,9 @@ - { - var15 = par1World.getBlockId(var13, var11, var14); - -- if (var15 != 0 && var15 != Block.leaves.blockID) -+ Block block = Block.blocksList[var15]; -+ -+ if (var15 != 0 && block != null && !block.isLeaves(par1World, var13, var11, var14)) - { - var10 = false; - } -@@ -87,7 +89,9 @@ - { - int var20 = var19 - par5; - -- if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var17, var16, var19)]) -+ Block block = Block.blocksList[par1World.getBlockId(var17, var16, var19)]; -+ -+ if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && (block == null || block.canBeReplacedByLeaves(par1World, var17, var16, var19))) - { - this.setBlockAndMetadata(par1World, var17, var16, var19, Block.leaves.blockID, 1); - } -@@ -117,7 +121,9 @@ - { - var17 = par1World.getBlockId(par3, par4 + var16, par5); - -- if (var17 == 0 || var17 == Block.leaves.blockID) -+ Block block = Block.blocksList[var17]; -+ -+ if (var17 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var16, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 1); - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenTallGrass.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenTallGrass.java.patch deleted file mode 100644 index 5819588d7c..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenTallGrass.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenTallGrass.java 0000-00-00 00:00:00.000000000 -0000 -@@ -18,10 +18,16 @@ - { - int var11; - -- for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) -+ Block block = null; -+ do - { -- ; -- } -+ block = Block.blocksList[par1World.getBlockId(par3, par4, par5)]; -+ if (block != null && !block.isLeaves(par1World, par3, par4, par5)) -+ { -+ break; -+ } -+ par4--; -+ } while (par4 > 0); - - for (int var7 = 0; var7 < 128; ++var7) - { diff --git a/patches/minecraft_server/net/minecraft/src/WorldGenTrees.java.patch b/patches/minecraft_server/net/minecraft/src/WorldGenTrees.java.patch deleted file mode 100644 index c56173db36..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldGenTrees.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldGenTrees.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldGenTrees.java 0000-00-00 00:00:00.000000000 -0000 -@@ -64,7 +64,13 @@ - { - var12 = par1World.getBlockId(var10, var8, var11); - -- if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 != 0 && -+ !block.isLeaves(par1World, var10, var8, var11) && -+ var12 != Block.grass.blockID && -+ var12 != Block.dirt.blockID && -+ !block.isWood(par1World, var10, var8, var11)) - { - var7 = false; - } -@@ -107,7 +113,10 @@ - { - int var17 = var16 - par5; - -- if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var11, var16)]) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var11, var16)]; -+ -+ if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) && -+ (block == null || block.canBeReplacedByLeaves(par1World, var14, var11, var16))) - { - this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves); - } -@@ -119,7 +128,9 @@ - { - var12 = par1World.getBlockId(par3, par4 + var11, par5); - -- if (var12 == 0 || var12 == Block.leaves.blockID) -+ Block block = Block.blocksList[var12]; -+ -+ if (var12 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var11, par5)) - { - this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.wood.blockID, this.metaWood); - -@@ -159,7 +170,8 @@ - { - for (var15 = par5 - var13; var15 <= par5 + var13; ++var15) - { -- if (par1World.getBlockId(var14, var11, var15) == Block.leaves.blockID) -+ Block block = Block.blocksList[par1World.getBlockId(var14, var11, var15)]; -+ if (block != null && block.isLeaves(par1World, var14, var11, var15)) - { - if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0) - { diff --git a/patches/minecraft_server/net/minecraft/src/WorldProvider.java.patch b/patches/minecraft_server/net/minecraft/src/WorldProvider.java.patch deleted file mode 100644 index d8c6dce440..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldProvider.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldProvider.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1,5 +1,7 @@ - package net.minecraft.src; - -+import net.minecraft.src.forge.DimensionManager; -+ - public abstract class WorldProvider - { - /** world object being used */ -@@ -117,7 +119,7 @@ - - public static WorldProvider getProviderForDimension(int par0) - { -- return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null))); -+ return DimensionManager.createProviderFor(par0); - } - - /** -@@ -132,4 +134,36 @@ - { - return this.terrainType.getMinimumSpawnHeight(worldObj); - } -+ -+ /** -+ * Returns the sub-folder of the world folder that this WorldProvider saves to. -+ * EXA: DIM1, DIM-1 -+ * @return The sub-folder name to save this world's chunks to. -+ */ -+ public abstract String getSaveFolder(); -+ -+ /** -+ * A message to display to the user when they transfer to this dimension. -+ * -+ * @return The message to be displayed -+ */ -+ public abstract String getWelcomeMessage(); -+ -+ /** -+ * A Message to display to the user when they transfer out of this dismension. -+ * -+ * @return The message to be displayed -+ */ -+ public abstract String getDepartMessage(); -+ -+ /** -+ * The dimensions movement factor. Relative to normal overworld. -+ * It is applied to the players position when they transfer dimensions. -+ * Exa: Nether movement is 8.0 -+ * @return The movement factor -+ */ -+ public double getMovementFactor() -+ { -+ return 1.0; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldProviderEnd.java.patch b/patches/minecraft_server/net/minecraft/src/WorldProviderEnd.java.patch deleted file mode 100644 index b52789dd65..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldProviderEnd.java.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000 -@@ -62,4 +62,22 @@ - { - return 50; - } -+ -+ @Override -+ public String getSaveFolder() -+ { -+ return "DIM1"; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return "Entering the End"; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return "Leaving the End"; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldProviderHell.java.patch b/patches/minecraft_server/net/minecraft/src/WorldProviderHell.java.patch deleted file mode 100644 index c0acea1d8b..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldProviderHell.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000 -@@ -63,4 +63,28 @@ - { - return false; - } -+ -+ @Override -+ public String getSaveFolder() -+ { -+ return "DIM-1"; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return "Entering the Nether"; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return "Leaving the Nether"; -+ } -+ -+ @Override -+ public double getMovementFactor() -+ { -+ return 8.0; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldProviderSurface.java.patch b/patches/minecraft_server/net/minecraft/src/WorldProviderSurface.java.patch deleted file mode 100644 index 4e895ed0c3..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldProviderSurface.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2,4 +2,21 @@ - - public class WorldProviderSurface extends WorldProvider - { -+ @Override -+ public String getSaveFolder() -+ { -+ return null; -+ } -+ -+ @Override -+ public String getWelcomeMessage() -+ { -+ return null; -+ } -+ -+ @Override -+ public String getDepartMessage() -+ { -+ return null; -+ } - } diff --git a/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch b/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch deleted file mode 100644 index 475612ef3d..0000000000 --- a/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- ../src_base/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000 -+++ ../src_work/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,6 +3,7 @@ - import java.util.ArrayList; - import java.util.List; - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.forge.DimensionManager; - - public class WorldServer extends World - { -@@ -17,6 +18,8 @@ - - /** Maps ids to entity instances */ - private IntHashMap entityInstanceIdMap; -+ public EntityTracker entityTracker; -+ public PlayerManager playerManager; - - public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings) - { -@@ -27,6 +30,9 @@ - { - this.entityInstanceIdMap = new IntHashMap(); - } -+ DimensionManager.setWorld(par4, this); -+ playerManager = new PlayerManager(mcServer, par4, mcServer.propertyManagerObj.getIntProperty("view-distance", 10)); -+ entityTracker = new EntityTracker(mcServer, par4); - } - - /** -@@ -72,14 +78,26 @@ - public List getTileEntityList(int par1, int par2, int par3, int par4, int par5, int par6) - { - ArrayList var7 = new ArrayList(); -- -- for (int var8 = 0; var8 < this.loadedTileEntityList.size(); ++var8) -+ for(int x = (par1 >> 4); x <= (par4 >> 4); x++) - { -- TileEntity var9 = (TileEntity)this.loadedTileEntityList.get(var8); -- -- if (var9.xCoord >= par1 && var9.yCoord >= par2 && var9.zCoord >= par3 && var9.xCoord < par4 && var9.yCoord < par5 && var9.zCoord < par6) -+ for(int z = (par3 >> 4); z <= (par6 >> 4); z++) - { -- var7.add(var9); -+ Chunk chunk = getChunkFromChunkCoords(x, z); -+ if (chunk != null) -+ { -+ for(Object obj : chunk.chunkTileEntityMap.values()) -+ { -+ TileEntity entity = (TileEntity)obj; -+ if (!entity.isInvalid()) -+ { -+ if (entity.xCoord >= par1 && entity.yCoord >= par2 && entity.zCoord >= par3 && -+ entity.xCoord <= par4 && entity.yCoord <= par5 && entity.zCoord <= par6) -+ { -+ var7.add(entity); -+ } -+ } -+ } -+ } - } - } - -@@ -99,7 +117,7 @@ - var6 = var5; - } - -- return var6 > 16 || this.mcServer.configManager.isOp(par1EntityPlayer.username); -+ return var6 > mcServer.spawnProtectionSize || this.mcServer.configManager.isOp(par1EntityPlayer.username); - } - - /**