diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 4a691a02e..cf7783440 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/Block.java -+++ ../src_work/minecraft/net/minecraft/block/Block.java +--- ../src-base/minecraft/net/minecraft/block/Block.java ++++ ../src-work/minecraft/net/minecraft/block/Block.java @@ -1,15 +1,22 @@ package net.minecraft.block; @@ -158,9 +158,8 @@ par2EntityPlayer.addExhaustion(0.025F); - if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) -- { + if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) -+ { + { + ArrayList items = new ArrayList(); ItemStack itemstack = this.createStackedBlock(par6); @@ -180,13 +179,10 @@ + harvesters.set(par2EntityPlayer); int i1 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); this.dropBlockAsItem(par1World, par3, par4, par5, par6, i1); -- } -- } -- + harvesters.set(null); -+ } -+ } -+ + } + } + + private int silk_check_meta = -1; //Dirty hack to stop us from needing to special case the silk check hook. /** * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. diff --git a/patches/minecraft/net/minecraft/block/BlockBaseRailLogic.java.patch b/patches/minecraft/net/minecraft/block/BlockBaseRailLogic.java.patch index 47b610cc1..a91ce10cf 100644 --- a/patches/minecraft/net/minecraft/block/BlockBaseRailLogic.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBaseRailLogic.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockBaseRailLogic.java -+++ ../src_work/minecraft/net/minecraft/block/BlockBaseRailLogic.java +--- ../src-base/minecraft/net/minecraft/block/BlockBaseRailLogic.java ++++ ../src-work/minecraft/net/minecraft/block/BlockBaseRailLogic.java @@ -16,6 +16,8 @@ /** The chunk position the rail is at. */ private List railChunkPosition; @@ -14,7 +14,7 @@ this.railZ = par5; int l = par2World.getBlockId(par3, par4, par5); - int i1 = par2World.getBlockMetadata(par3, par4, par5); -- + - if (((BlockRailBase)Block.blocksList[l]).isPowered) - { - this.isStraightRail = true; @@ -24,7 +24,6 @@ - { - this.isStraightRail = false; - } -+ + BlockRailBase target = (BlockRailBase)Block.blocksList[l]; + int i1 = target.getBasicRailMetadata(par2World, null, par3, par4, par5); + isStraightRail = !target.isFlexibleRail(par2World, par3, par4, par5); diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch index f5ca96a7f..6ddf25f9b 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockButton.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockButton.java -+++ ../src_work/minecraft/net/minecraft/block/BlockButton.java +--- ../src-base/minecraft/net/minecraft/block/BlockButton.java ++++ ../src-work/minecraft/net/minecraft/block/BlockButton.java @@ -14,6 +14,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index d9a8af5db..12800190c 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockCactus.java -+++ ../src_work/minecraft/net/minecraft/block/BlockCactus.java +--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java @@ -12,7 +12,11 @@ import net.minecraft.util.Icon; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch index d7f040fb6..f0b35a447 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockChest.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockChest.java -+++ ../src_work/minecraft/net/minecraft/block/BlockChest.java +--- ../src-base/minecraft/net/minecraft/block/BlockChest.java ++++ ../src-work/minecraft/net/minecraft/block/BlockChest.java @@ -23,6 +23,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -23,30 +23,21 @@ return null; } - else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) -- { -- return null; -- } -- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) -- { -- return null; -- } -- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) -- { -- return null; -- } -- 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 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) -+ { -+ return null; -+ } + { + return null; + } +- 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, DOWN) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) -+ { -+ return null; -+ } + { + return null; + } +- 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, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) -+ { -+ return null; -+ } + { + return null; + } +- 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, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) { return null; diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index 5fd3e3401..72f73f8a2 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockCocoa.java -+++ ../src_work/minecraft/net/minecraft/block/BlockCocoa.java +--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; @@ -30,9 +30,8 @@ for (int k1 = 0; k1 < b0; ++k1) { - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3)); -- } + dropped.add(new ItemStack(Item.dyePowder, 1, 3)); -+ } + } + return dropped; } diff --git a/patches/minecraft/net/minecraft/block/BlockComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockComparator.java.patch index 4a094ef48..2ef2cfe25 100644 --- a/patches/minecraft/net/minecraft/block/BlockComparator.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockComparator.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockComparator.java -+++ ../src_work/minecraft/net/minecraft/block/BlockComparator.java +--- ../src-base/minecraft/net/minecraft/block/BlockComparator.java ++++ ../src-work/minecraft/net/minecraft/block/BlockComparator.java @@ -268,4 +268,17 @@ { return new TileEntityComparator(); diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index 66a57d160..7c1b02adf 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockCrops.java -+++ ../src_work/minecraft/net/minecraft/block/BlockCrops.java +--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java @@ -2,6 +2,7 @@ import cpw.mods.fml.relauncher.Side; @@ -34,31 +34,28 @@ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); -- -- if (!par1World.isRemote) -- { -- if (par5 >= 7) + } -+ + +- if (!par1World.isRemote) + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = super.getBlockDropped(world, x, y, z, metadata, fortune); + + if (metadata >= 7) -+ { + { +- if (par5 >= 7) + for (int n = 0; n < 3 + fortune; n++) { - int j1 = 3 + par7; - - for (int k1 = 0; k1 < j1; ++k1) -- { ++ if (world.rand.nextInt(15) <= metadata) + { - if (par1World.rand.nextInt(15) <= par5) - { - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0)); - } -+ if (world.rand.nextInt(15) <= metadata) -+ { + ret.add(new ItemStack(this.getSeedItem(), 1, 0)); } } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index 8c2b8006e..ce2adce93 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockDoor.java -+++ ../src_work/minecraft/net/minecraft/block/BlockDoor.java +--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java @@ -290,7 +290,7 @@ { if (this.blockMaterial == Material.iron) diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch index 55a9cb1cb..90859cbee 100644 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockFarmland.java -+++ ../src_work/minecraft/net/minecraft/block/BlockFarmland.java -@@ -10,6 +10,9 @@ - import net.minecraft.util.AxisAlignedBB; +--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java +@@ -11,6 +11,9 @@ import net.minecraft.util.Icon; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.IPlantable; - ++ public class BlockFarmland extends Block { + @SideOnly(Side.CLIENT) @@ -115,7 +118,8 @@ { int j1 = par1World.getBlockId(l, par3 + 1, i1); diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index dceb641c7..54dc6e33a 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockFire.java -+++ ../src_work/minecraft/net/minecraft/block/BlockFire.java +--- ../src-base/minecraft/net/minecraft/block/BlockFire.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFire.java @@ -11,6 +11,9 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProviderEnd; @@ -29,21 +29,22 @@ } /** -@@ -123,12 +127,8 @@ +@@ -123,13 +127,9 @@ { if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - boolean flag = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; -- ++ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; ++ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP)); + - if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) - { - flag = true; - } -+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; -+ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP)); - +- if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { + par1World.setBlockToAir(par2, par3, par4); @@ -157,7 +157,7 @@ par1World.setBlockToAir(par2, par3, par4); } @@ -72,7 +73,7 @@ for (int i1 = par2 - 1; i1 <= par2 + 1; ++i1) { -@@ -230,9 +230,20 @@ +@@ -230,10 +230,21 @@ return false; } @@ -82,7 +83,7 @@ - int j1 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; + tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP); + } -+ + + private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face) + { + int j1 = 0; @@ -91,9 +92,10 @@ + { + j1 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face); + } - ++ if (par6Random.nextInt(par5) < j1) { + boolean flag = par1World.getBlockId(par2, par3, par4) == Block.tnt.blockID; @@ -266,7 +277,12 @@ */ private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) @@ -131,9 +133,8 @@ /** * 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) { @@ -145,9 +146,8 @@ * 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) { @@ -162,10 +162,9 @@ float f2; - if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) -- { -- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) + if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP)) -+ { + { +- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) + if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, EAST)) { for (l = 0; l < 2; ++l) diff --git a/patches/minecraft/net/minecraft/block/BlockFlower.java.patch b/patches/minecraft/net/minecraft/block/BlockFlower.java.patch index f8d50aa08..25ccf6831 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlower.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFlower.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockFlower.java -+++ ../src_work/minecraft/net/minecraft/block/BlockFlower.java +--- ../src-base/minecraft/net/minecraft/block/BlockFlower.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFlower.java @@ -6,7 +6,12 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockFlowing.java.patch b/patches/minecraft/net/minecraft/block/BlockFlowing.java.patch index a5d7403a9..e4bd1e372 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlowing.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFlowing.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockFlowing.java -+++ ../src_work/minecraft/net/minecraft/block/BlockFlowing.java +--- ../src-base/minecraft/net/minecraft/block/BlockFlowing.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFlowing.java @@ -206,7 +206,7 @@ { this.triggerLavaMixEffects(par1World, par2, par3, par4); diff --git a/patches/minecraft/net/minecraft/block/BlockFluid.java.patch b/patches/minecraft/net/minecraft/block/BlockFluid.java.patch index 5aa1d6cdd..67010a533 100644 --- a/patches/minecraft/net/minecraft/block/BlockFluid.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFluid.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockFluid.java -+++ ../src_work/minecraft/net/minecraft/block/BlockFluid.java +--- ../src-base/minecraft/net/minecraft/block/BlockFluid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFluid.java @@ -59,7 +59,7 @@ { for (int l1 = -1; l1 <= 1; ++l1) @@ -9,17 +9,17 @@ l += (i2 & 16711680) >> 16; i1 += (i2 & 65280) >> 8; j1 += i2 & 255; -@@ -81,6 +81,13 @@ - } - +@@ -83,6 +83,13 @@ return (float)(par0 + 1) / 9.0F; -+ } -+ + } + + + @Deprecated //Implemented here for compatibility, need to change this when we make vanilla fluids use our fluid methods. + public float getFilledPercentage(IBlockAccess world, int x, int y, int z) + { + return 1 - BlockFluid.getFluidHeightPercent(world.getBlockMetadata(x, y, z)); - } - ++ } ++ @SideOnly(Side.CLIENT) + + /** diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch index a4333889a..4ce69db5b 100644 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockGrass.java -+++ ../src_work/minecraft/net/minecraft/block/BlockGrass.java +--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java ++++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java @@ -44,7 +44,7 @@ { if (!par1World.isRemote) diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index e5ee3915c..374ea1450 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -1,6 +1,6 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockLadder.java -+++ ../src_work/minecraft/net/minecraft/block/BlockLadder.java -@@ -5,9 +5,13 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java +@@ -5,10 +5,14 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -8,12 +8,13 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ForgeDirection; +import static net.minecraftforge.common.ForgeDirection.*; - ++ public class BlockLadder extends Block { + protected BlockLadder(int par1) @@ -104,7 +108,10 @@ */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index c8743d88e..ee66cbc55 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockLeaves.java -+++ ../src_work/minecraft/net/minecraft/block/BlockLeaves.java +--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; diff --git a/patches/minecraft/net/minecraft/block/BlockLever.java.patch b/patches/minecraft/net/minecraft/block/BlockLever.java.patch index b3678dd23..bb54ee524 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLever.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockLever.java -+++ ../src_work/minecraft/net/minecraft/block/BlockLever.java +--- ../src-base/minecraft/net/minecraft/block/BlockLever.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLever.java @@ -10,6 +10,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -83,76 +83,48 @@ boolean flag = false; - if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4) -- { -- flag = true; -- } -- -- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5) -- { -- flag = true; -- } -- -- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7) + if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2) + if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5) + if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6) + if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0) + if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7) + if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch index b597fc76a..c42f76120 100644 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLog.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockLog.java -+++ ../src_work/minecraft/net/minecraft/block/BlockLog.java +--- ../src-base/minecraft/net/minecraft/block/BlockLog.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLog.java @@ -62,14 +62,9 @@ { int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2); diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index 605fe5464..284ad7b45 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -1,17 +1,18 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockMobSpawner.java -+++ ../src_work/minecraft/net/minecraft/block/BlockMobSpawner.java -@@ -45,8 +45,12 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java +@@ -45,9 +45,13 @@ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); -+ } + } + + @Override + public int getExpDrop(World world, int data, int enchantmentLevel) + { + return 15 + world.rand.nextInt(15) + world.rand.nextInt(15); - } ++ } /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch index a47d2ff80..00928c9b5 100644 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch @@ -1,14 +1,14 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockMushroom.java -+++ ../src_work/minecraft/net/minecraft/block/BlockMushroom.java -@@ -3,6 +3,8 @@ - import java.util.Random; +--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java +@@ -4,6 +4,8 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenBigMushroom; -+ -+import net.minecraftforge.common.ForgeDirection; ++import net.minecraftforge.common.ForgeDirection; ++ public class BlockMushroom extends BlockFlower { + protected BlockMushroom(int par1) @@ -96,7 +98,9 @@ if (par3 >= 0 && par3 < 256) { diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch index 97068f89c..253912a33 100644 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockMycelium.java -+++ ../src_work/minecraft/net/minecraft/block/BlockMycelium.java +--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java @@ -41,7 +41,7 @@ { if (!par1World.isRemote) diff --git a/patches/minecraft/net/minecraft/block/BlockNetherStalk.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherStalk.java.patch index a8d9e1043..c5cf5a164 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherStalk.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherStalk.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockNetherStalk.java -+++ ../src_work/minecraft/net/minecraft/block/BlockNetherStalk.java +--- ../src-base/minecraft/net/minecraft/block/BlockNetherStalk.java ++++ ../src-work/minecraft/net/minecraft/block/BlockNetherStalk.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch index ad83441b3..88432eeb7 100644 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOre.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockOre.java -+++ ../src_work/minecraft/net/minecraft/block/BlockOre.java +--- ../src-base/minecraft/net/minecraft/block/BlockOre.java ++++ ../src-work/minecraft/net/minecraft/block/BlockOre.java @@ -60,6 +60,11 @@ { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); @@ -16,11 +16,11 @@ { j1 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); } -+ return j1; -+ } - +- - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); -- } ++ return j1; + } ++ + return 0; } diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch index 5753ac2be..4018305a9 100644 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockPane.java -+++ ../src_work/minecraft/net/minecraft/block/BlockPane.java +--- ../src-base/minecraft/net/minecraft/block/BlockPane.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPane.java @@ -13,6 +13,7 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index 03c3ebcf3..42f0bb457 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java -+++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java +--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java @@ -439,7 +439,7 @@ return false; } diff --git a/patches/minecraft/net/minecraft/block/BlockPortal.java.patch b/patches/minecraft/net/minecraft/block/BlockPortal.java.patch index 94bd8008c..810e69653 100644 --- a/patches/minecraft/net/minecraft/block/BlockPortal.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPortal.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockPortal.java -+++ ../src_work/minecraft/net/minecraft/block/BlockPortal.java +--- ../src-base/minecraft/net/minecraft/block/BlockPortal.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPortal.java @@ -118,7 +118,7 @@ } else diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch index 1bdfc4f82..d45d46b90 100644 --- a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockPumpkin.java -+++ ../src_work/minecraft/net/minecraft/block/BlockPumpkin.java +--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java @@ -123,7 +123,8 @@ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 9042db6fa..0be618f58 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockRailBase.java -+++ ../src_work/minecraft/net/minecraft/block/BlockRailBase.java +--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java @@ -3,6 +3,7 @@ import java.util.Random; import net.minecraft.block.material.Material; diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index 5fac601b4..cc76bd5fe 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockRedstoneOre.java -+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneOre.java +--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java @@ -116,11 +116,17 @@ { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); @@ -13,9 +13,8 @@ { int j1 = 1 + par1World.rand.nextInt(5); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); -- } + return j1; -+ } + } + return 0; } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index 63039d8b5..2b66e7721 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java -+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java +--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java @@ -475,7 +475,7 @@ } else if (!Block.redstoneRepeaterIdle.func_94487_f(i1)) diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index 908cab4cd..ca73e896d 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockReed.java -+++ ../src_work/minecraft/net/minecraft/block/BlockReed.java +--- ../src-base/minecraft/net/minecraft/block/BlockReed.java ++++ ../src-work/minecraft/net/minecraft/block/BlockReed.java @@ -8,7 +8,11 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockSand.java.patch b/patches/minecraft/net/minecraft/block/BlockSand.java.patch index 381cc4e61..dd3b3749d 100644 --- a/patches/minecraft/net/minecraft/block/BlockSand.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSand.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockSand.java -+++ ../src_work/minecraft/net/minecraft/block/BlockSand.java +--- ../src-base/minecraft/net/minecraft/block/BlockSand.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSand.java @@ -105,7 +105,7 @@ { int l = par0World.getBlockId(par1, par2, par3); diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index c0b596496..4997497db 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockSapling.java -+++ ../src_work/minecraft/net/minecraft/block/BlockSapling.java +--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java @@ -16,6 +16,8 @@ import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index effb9ea80..f50966366 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockSkull.java -+++ ../src_work/minecraft/net/minecraft/block/BlockSkull.java +--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; @@ -21,22 +21,20 @@ * Called when the block is attempted to be harvested */ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) -@@ -149,6 +146,8 @@ - par5 |= 8; +@@ -150,6 +147,8 @@ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); } -+ -+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0); ++ dropBlockAsItem(par1World, par2, par3, par4, par5, 0); ++ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); } + @@ -160,24 +159,30 @@ */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { - if (!par1World.isRemote) -- { -- if ((par6 & 8) == 0) + super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + @@ -45,15 +43,14 @@ + { + ArrayList drops = new ArrayList(); + if ((metadata & 8) == 0) -+ { -+ ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z)); -+ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z); -+ -+ if (tileentityskull == null) - { + { +- if ((par6 & 8) == 0) +- { - ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4)); - TileEntitySkull tileentityskull = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4); -- ++ ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z)); ++ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z); + - if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) - { - itemstack.setTagCompound(new NBTTagCompound()); @@ -61,18 +58,19 @@ - } - - this.dropBlockAsItem_do(par1World, par2, par3, par4, itemstack); ++ if (tileentityskull == null) ++ { + return drops; } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); -- } + if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) + { + itemstack.setTagCompound(new NBTTagCompound()); + itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType()); + } + drops.add(itemstack); -+ } + } + return drops; } diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index c44d79bc4..25c8dc508 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockSnow.java -+++ ../src_work/minecraft/net/minecraft/block/BlockSnow.java +--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java @@ -96,8 +96,12 @@ */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 2cf1257dc..90c93767c 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockStem.java -+++ ../src_work/minecraft/net/minecraft/block/BlockStem.java +--- ../src-base/minecraft/net/minecraft/block/BlockStem.java ++++ ../src-work/minecraft/net/minecraft/block/BlockStem.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; @@ -46,19 +46,17 @@ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -- ++ } + - if (!par1World.isRemote) - { - Item item = null; -- -- if (this.fruitType == Block.pumpkin) -+ } -+ + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); -+ + +- if (this.fruitType == Block.pumpkin) + for (int i = 0; i < 3; i++) + { + if (world.rand.nextInt(15) <= metadata) @@ -79,8 +77,7 @@ - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item)); - } - } -- } -+ } + } + + return ret; } diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index 344908516..2f91f9511 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockTallGrass.java -+++ ../src_work/minecraft/net/minecraft/block/BlockTallGrass.java +--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch index 4e058172e..a674a9aaa 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockTorch.java -+++ ../src_work/minecraft/net/minecraft/block/BlockTorch.java +--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java @@ -10,6 +10,9 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -88,36 +88,24 @@ boolean flag = false; - if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && i1 == 1) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3) -- { -- flag = true; -- } -- -- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4) + if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2) + if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3) -+ { -+ flag = true; -+ } -+ + { + flag = true; + } + +- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch index 56f164468..481eb4014 100644 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockTrapDoor.java -+++ ../src_work/minecraft/net/minecraft/block/BlockTrapDoor.java +--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java @@ -11,8 +11,13 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockTripWireSource.java.patch b/patches/minecraft/net/minecraft/block/BlockTripWireSource.java.patch index 86e1f866b..e758d60fe 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireSource.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTripWireSource.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockTripWireSource.java -+++ ../src_work/minecraft/net/minecraft/block/BlockTripWireSource.java +--- ../src-base/minecraft/net/minecraft/block/BlockTripWireSource.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTripWireSource.java @@ -8,6 +8,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index 1042d045c..937df2a55 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockVine.java -+++ ../src_work/minecraft/net/minecraft/block/BlockVine.java +--- ../src-base/minecraft/net/minecraft/block/BlockVine.java ++++ ../src-work/minecraft/net/minecraft/block/BlockVine.java @@ -2,9 +2,12 @@ import cpw.mods.fml.relauncher.Side; @@ -38,7 +38,7 @@ - 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) @@ -58,5 +58,5 @@ + public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity) + { + return true; - } ++ } } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index d642b0249..36a0f4001 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/Minecraft.java -+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java +--- ../src-base/minecraft/net/minecraft/client/Minecraft.java ++++ ../src-work/minecraft/net/minecraft/client/Minecraft.java @@ -137,6 +137,16 @@ import com.google.common.collect.MapDifference; @@ -56,12 +56,10 @@ this.statFileWriter.syncStats(); if (par1GuiScreen == null && this.theWorld == null) -@@ -694,6 +699,20 @@ - else if (par1GuiScreen == null && this.thePlayer.getHealth() <= 0.0F) - { +@@ -696,6 +701,20 @@ par1GuiScreen = new GuiGameOver(); -+ } -+ + } + + GuiScreen old = this.currentScreen; + GuiOpenEvent event = new GuiOpenEvent(par1GuiScreen); + @@ -74,9 +72,11 @@ + if (old != null && par1GuiScreen != old) + { + old.onGuiClosed(); - } - ++ } ++ if (par1GuiScreen instanceof GuiMainMenu) + { + this.gameSettings.showDebugInfo = false; @@ -1301,7 +1320,7 @@ if (this.thePlayer.isCurrentToolAdventureModeExempt(j, k, l)) @@ -155,7 +155,7 @@ } /** -@@ -2237,107 +2277,12 @@ +@@ -2237,108 +2277,13 @@ if (this.objectMouseOver != null) { boolean flag = this.thePlayer.capabilities.isCreativeMode; @@ -165,7 +165,8 @@ int k; - if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) -- { ++ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) + { - k = this.objectMouseOver.blockX; - int l = this.objectMouseOver.blockY; - int i1 = this.objectMouseOver.blockZ; @@ -186,14 +187,15 @@ - flag1 = Item.itemsList[j].getHasSubtypes(); - int j1 = j < 256 && !Block.blocksList[block.blockID].isFlowerPot() ? j : block.blockID; - i = Block.blocksList[j1].getDamageValue(this.theWorld, k, l, i1); -- } ++ return; + } - else - { - if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) - { - return; - } -- + - if (this.objectMouseOver.entityHit instanceof EntityPainting) - { - j = Item.painting.itemID; @@ -260,13 +262,10 @@ - } - - this.thePlayer.inventory.setCurrentItem(j, i, flag1, flag); -+ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) -+ { -+ return; -+ } - +- if (flag) { + k = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; @@ -2420,11 +2365,18 @@ par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index b9b624184..34e7355a3 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/audio/SoundManager.java -+++ ../src_work/minecraft/net/minecraft/client/audio/SoundManager.java +--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java ++++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java @@ -1,5 +1,9 @@ package net.minecraft.client.audio; diff --git a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch index 4563e5cc2..ca165dc7a 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java -+++ ../src_work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java +--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java ++++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java @@ -170,7 +170,8 @@ } } diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index 95daa4aaf..09410ab15 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java -+++ ../src_work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java ++++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java @@ -49,6 +49,9 @@ import net.minecraft.util.MovementInput; import net.minecraft.util.Session; @@ -34,17 +34,16 @@ double d4 = par5 - (double)k; - if (this.isBlockTranslucent(i, j, k) || this.isBlockTranslucent(i, j + 1, k)) -- { -- boolean flag = !this.isBlockTranslucent(i - 1, j, k) && !this.isBlockTranslucent(i - 1, j + 1, k); -- boolean flag1 = !this.isBlockTranslucent(i + 1, j, k) && !this.isBlockTranslucent(i + 1, j + 1, k); -- boolean flag2 = !this.isBlockTranslucent(i, j, k - 1) && !this.isBlockTranslucent(i, j + 1, k - 1); -- boolean flag3 = !this.isBlockTranslucent(i, j, k + 1) && !this.isBlockTranslucent(i, j + 1, k + 1); + int entHeight = Math.max(Math.round(this.height), 1); + + boolean inTranslucentBlock = true; + + for (int i1 = 0; i1 < entHeight; i1++) -+ { + { +- boolean flag = !this.isBlockTranslucent(i - 1, j, k) && !this.isBlockTranslucent(i - 1, j + 1, k); +- boolean flag1 = !this.isBlockTranslucent(i + 1, j, k) && !this.isBlockTranslucent(i + 1, j + 1, k); +- boolean flag2 = !this.isBlockTranslucent(i, j, k - 1) && !this.isBlockTranslucent(i, j + 1, k - 1); +- boolean flag3 = !this.isBlockTranslucent(i, j, k + 1) && !this.isBlockTranslucent(i, j + 1, k + 1); + if (!this.isBlockTranslucent(i, j + i1, k)) + { + inTranslucentBlock = false; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch index 755d5e311..cb3b93c56 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/GuiChat.java -+++ ../src_work/minecraft/net/minecraft/client/gui/GuiChat.java +--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java @@ -7,8 +7,11 @@ import java.util.Iterator; import java.util.List; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch index 9a9d412bc..0eeaca8d5 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch @@ -1,23 +1,23 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/GuiControls.java -+++ ../src_work/minecraft/net/minecraft/client/gui/GuiControls.java -@@ -6,6 +6,8 @@ - import net.minecraft.client.settings.GameSettings; +--- ../src-base/minecraft/net/minecraft/client/gui/GuiControls.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiControls.java +@@ -7,6 +7,8 @@ import net.minecraft.client.settings.KeyBinding; import net.minecraft.util.EnumChatFormatting; -+ -+import net.minecraftforge.client.GuiControlsScrollPanel; ++import net.minecraftforge.client.GuiControlsScrollPanel; ++ @SideOnly(Side.CLIENT) public class GuiControls extends GuiScreen -@@ -23,6 +25,8 @@ - + { +@@ -24,6 +26,8 @@ /** The ID of the button that has been pressed. */ private int buttonId = -1; -+ -+ private GuiControlsScrollPanel scrollPane; ++ private GuiControlsScrollPanel scrollPane; ++ public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { + this.parentScreen = par1GuiScreen; @@ -43,14 +47,9 @@ */ public void initGui() @@ -36,7 +36,7 @@ this.screenTitle = I18n.getString("controls.title"); } -@@ -59,19 +58,9 @@ +@@ -59,20 +58,10 @@ */ protected void actionPerformed(GuiButton par1GuiButton) { @@ -48,14 +48,15 @@ if (par1GuiButton.id == 200) { this.mc.displayGuiScreen(this.parentScreen); -- } + } - else - { - this.buttonId = par1GuiButton.id; - par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; - } +- } } + /** @@ -80,17 +69,7 @@ */ protected void mouseClicked(int par1, int par2, int par3) @@ -75,22 +76,23 @@ } /** -@@ -98,14 +77,7 @@ +@@ -98,15 +77,8 @@ */ protected void keyTyped(char par1, int par2) { - if (this.buttonId >= 0) -- { ++ if (scrollPane.keyTyped(par1, par2)) + { - this.options.setKeyBinding(this.buttonId, par2); - ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); - this.buttonId = -1; - KeyBinding.resetKeyBindingArrayAndHash(); - } - else -+ if (scrollPane.keyTyped(par1, par2)) - { +- { super.keyTyped(par1, par2); } + } @@ -117,6 +89,7 @@ public void drawScreen(int par1, int par2, float par3) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index 26f56825c..83b51860e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -+++ ../src_work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java @@ -376,7 +376,7 @@ } else if (par1GuiButton.id == 8) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch index 37ed0182c..3e8f7609f 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/GuiIngame.java -+++ ../src_work/minecraft/net/minecraft/client/gui/GuiIngame.java +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java @@ -40,6 +40,8 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @@ -14,10 +14,9 @@ ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); - if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.itemID == Block.pumpkin.blockID) -- { -- this.renderPumpkinBlur(k, l); + if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null) -+ { + { +- this.renderPumpkinBlur(k, l); + if (itemstack.itemID == Block.pumpkin.blockID) + { + this.renderPumpkinBlur(k, l); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index f8b6dfb54..e7b2ad3d5 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/GuiSlot.java -+++ ../src_work/minecraft/net/minecraft/client/gui/GuiSlot.java +--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java @@ -331,16 +331,7 @@ GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch index 8c36054ee..711d721bb 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java -+++ ../src_work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java +--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java ++++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -2,6 +2,9 @@ import cpw.mods.fml.relauncher.Side; @@ -53,12 +53,10 @@ } /** -@@ -87,6 +105,16 @@ - { - this.mc.displayGuiScreen((GuiScreen)null); +@@ -89,6 +107,16 @@ this.mc.setIngameFocus(); -+ } -+ + } + + if (par1GuiButton.id == 2) + { + currentPage++; @@ -67,23 +65,23 @@ + currentPage = -1; + } + button.displayString = AchievementPage.getTitle(currentPage); - } - ++ } ++ super.actionPerformed(par1GuiButton); + } + @@ -314,11 +342,12 @@ int i4; int j4; - for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3) -- { -- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3); -- -- if (achievement.parentAchievement != null) + List achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (i3 = 0; i3 < achievementList.size(); ++i3) -+ { + { +- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3); + Achievement achievement = achievementList.get(i3); -+ + +- if (achievement.parentAchievement != null) + if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement)) { k3 = achievement.displayColumn * 24 - k + 11 + k1; @@ -93,10 +91,9 @@ int i5; - for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3) -- { -- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3); + for (k3 = 0; k3 < achievementList.size(); ++k3) -+ { + { +- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3); + Achievement achievement2 = (Achievement)achievementList.get(k3); j4 = achievement2.displayColumn * 24 - k; l3 = achievement2.displayRow * 24 - l; diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch index 7c9c01a74..8b05df6e1 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java -+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Set; @@ -44,18 +44,18 @@ } /** -@@ -242,6 +251,11 @@ - } +@@ -243,6 +252,11 @@ protected void func_102021_a(List par1List, int par2, int par3) -+ { + { + drawHoveringText(par1List, par2, par3, fontRenderer); + } + + protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) - { ++ { if (!par1List.isEmpty()) { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); @@ -255,7 +269,7 @@ while (iterator.hasNext()) { diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index ff621b4fc..7f0043457 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java ++++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -61,6 +61,8 @@ private Slot field_74235_v; private boolean field_74234_w; @@ -61,10 +61,9 @@ Item.enchantedBook.func_92113_a(enchantment, containercreative.itemList); } } -- + updateFilteredItems(containercreative); + } -+ + + //split from above for custom search tabs + private void updateFilteredItems(ContainerCreative containercreative) + { @@ -116,26 +115,24 @@ { this.searchField.setVisible(true); this.searchField.setCanLoseFocus(false); -@@ -653,21 +682,42 @@ +@@ -653,23 +682,44 @@ super.drawScreen(par1, par2, par3); CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; - int i2 = acreativetabs.length; -- -- for (int j2 = 0; j2 < i2; ++j2) + int start = tabPage * 10; + int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2); + if (tabPage != 0) start += 2; + boolean rendered = false; -+ + +- for (int j2 = 0; j2 < i2; ++j2) + for (int j2 = start; j2 < i2; ++j2) { CreativeTabs creativetabs = acreativetabs[j2]; - if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) -- { + if (creativetabs != null && this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) -+ { + { + rendered = true; break; } @@ -149,8 +146,8 @@ if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) { this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2); -+ } -+ + } + + if (maxPages != 0) + { + String page = String.format("%d / %d", tabPage + 1, maxPages + 1); @@ -161,10 +158,12 @@ + fontRenderer.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); + this.zLevel = 0.0F; + itemRenderer.zLevel = 0.0F; - } - ++ } ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -741,14 +791,32 @@ + GL11.glDisable(GL11.GL_LIGHTING); + } +@@ -741,17 +791,35 @@ int k = acreativetabs.length; int l; @@ -182,9 +181,9 @@ + if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex) { this.renderCreativeTab(creativetabs1); -+ } -+ } -+ + } + } + + if (tabPage != 0) + { + if (creativetabs != CreativeTabs.tabAllSearch) @@ -196,9 +195,12 @@ + { + this.mc.getTextureManager().bindTexture(field_110424_t); + renderCreativeTab(CreativeTabs.tabInventory); - } - } - ++ } ++ } ++ + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); + this.searchField.drawTextBox(); @@ -766,6 +834,14 @@ this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); } diff --git a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch index d8c9903b7..0215b27c9 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/model/ModelBase.java -+++ ../src_work/minecraft/net/minecraft/client/model/ModelBase.java +--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java @@ -10,7 +10,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch index a6a05697e..d55462a0d 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/model/ModelBox.java -+++ ../src_work/minecraft/net/minecraft/client/model/ModelBox.java +--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java @@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.Tessellator; diff --git a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch index 85723365d..90fa5af76 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/model/ModelRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/model/ModelRenderer.java +--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java @@ -8,7 +8,6 @@ import net.minecraft.client.renderer.Tessellator; import org.lwjgl.opengl.GL11; diff --git a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch index 31bdc80a8..415aa3c13 100644 --- a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/model/PositionTextureVertex.java -+++ ../src_work/minecraft/net/minecraft/client/model/PositionTextureVertex.java +--- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java ++++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java @@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.util.Vec3; diff --git a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch index 5b698e854..f1d328bf4 100644 --- a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/model/TexturedQuad.java -+++ ../src_work/minecraft/net/minecraft/client/model/TexturedQuad.java +--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java ++++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java @@ -5,7 +5,6 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.Vec3; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index 64bbb6bcd..07ade0b89 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java -+++ ../src_work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -13,6 +13,8 @@ import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.EmptyChunk; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch index 63a962248..06bf44fdf 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java -+++ ../src_work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java +--- ../src-base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java @@ -191,6 +191,11 @@ import net.minecraft.world.storage.MapStorage; import org.lwjgl.input.Keyboard; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 18f79e8d5..04799859f 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java -+++ ../src_work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -22,6 +22,10 @@ import net.minecraft.world.EnumGameType; import net.minecraft.world.World; @@ -37,15 +37,14 @@ float f2 = (float)par8Vec3.zCoord - (float)par6; boolean flag = false; int i1; -- -- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) + if (par3ItemStack != null && + par3ItemStack.getItem() != null && + par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2)) + { + return true; + } -+ + +- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) + if (!par1EntityPlayer.isSneaking() || (par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6))) { i1 = par2World.getBlockId(par4, par5, par6); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index e9f19b6c1..9eb922568 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/multiplayer/WorldClient.java -+++ ../src_work/minecraft/net/minecraft/client/multiplayer/WorldClient.java +--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java @@ -29,6 +29,9 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.storage.SaveHandlerMP; @@ -14,11 +14,11 @@ super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler, par6ILogAgent); this.sendQueue = par1NetClientHandler; this.difficultySetting = par4; -+ this.mapStorage = par1NetClientHandler.mapStorage; +- this.setSpawnLocation(8, 64, 8); + this.mapStorage = par1NetClientHandler.mapStorage; + this.isRemote = true; + finishSetup(); - this.setSpawnLocation(8, 64, 8); -- this.mapStorage = par1NetClientHandler.mapStorage; ++ this.setSpawnLocation(8, 64, 8); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this)); } diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index face476c9..79e5e732b 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/particle/EffectRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/particle/EffectRenderer.java +--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java @@ -12,6 +12,7 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; @@ -8,23 +8,23 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -@@ -63,9 +64,13 @@ +@@ -63,10 +64,14 @@ for (int j = 0; j < this.fxLayers[i].size(); ++j) { EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j); - entityfx.onUpdate(); -- + - if (entityfx.isDead) -+ + if (entityfx != null) -+ { + { + entityfx.onUpdate(); + } + + if (entityfx == null || entityfx.isDead) - { ++ { this.fxLayers[i].remove(j--); } + } @@ -115,6 +120,7 @@ for (int j = 0; j < this.fxLayers[i].size(); ++j) { @@ -46,11 +46,10 @@ public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) { - if (par4 != 0) -- { -- Block block = Block.blocksList[par4]; + Block block = Block.blocksList[par4]; + if (block != null && !block.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this)) -+ { + { +- Block block = Block.blocksList[par4]; byte b0 = 4; for (int j1 = 0; j1 < b0; ++j1) diff --git a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch index fe344139e..796ab3069 100644 --- a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java -+++ ../src_work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java +--- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java ++++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java @@ -10,15 +10,22 @@ public class EntityDiggingFX extends EntityFX { diff --git a/patches/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java.patch b/patches/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java.patch index 74db91f85..05433d175 100644 --- a/patches/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java -+++ ../src_work/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java +--- ../src-base/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java ++++ ../src-work/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java @@ -30,11 +30,11 @@ { this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions"); diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index df979bdbd..abd997054 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/EntityRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/EntityRenderer.java +--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java @@ -40,6 +40,11 @@ import org.lwjgl.opengl.GLContext; import org.lwjgl.util.glu.Project; @@ -133,11 +133,10 @@ GL11.glDisable(GL11.GL_BLEND); this.mc.mcProfiler.endStartSection("weather"); this.renderRainSnow(par1); -@@ -1248,6 +1273,20 @@ - { +@@ -1249,6 +1274,20 @@ this.renderCloudsCheck(renderglobal, par1); } -+ + + //Forge: Moved section from above, now particles are the last thing to render. + this.enableLightmap((double)par1); + this.mc.mcProfiler.endStartSection("litParticles"); @@ -151,6 +150,7 @@ + + this.mc.mcProfiler.endStartSection("FRenderLast"); + ForgeHooksClient.dispatchRenderLast(renderglobal, par1); - ++ this.mc.mcProfiler.endStartSection("hand"); + if (this.cameraZoom == 1.0D) diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 5553fdde3..3218d6eac 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/ItemRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/ItemRenderer.java +--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java @@ -16,6 +16,8 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.EnumAction; @@ -23,7 +23,7 @@ @SideOnly(Side.CLIENT) public class ItemRenderer { -@@ -54,15 +63,32 @@ +@@ -54,16 +63,33 @@ this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager()); } @@ -44,7 +44,7 @@ - if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) + Block block = null; + if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length) -+ { + { + block = Block.blocksList[par2ItemStack.itemID]; + } + @@ -55,9 +55,10 @@ + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksInstance, par1EntityLivingBase, par2ItemStack); + } + else if (block != null && par2ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) - { ++ { texturemanager.bindTexture(texturemanager.getResourceLocation(0)); this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); + } @@ -94,7 +120,7 @@ GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F); @@ -76,32 +77,31 @@ { GL11.glPushMatrix(); f12 = 0.8F; -@@ -333,11 +359,20 @@ +@@ -333,12 +359,21 @@ tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); tessellator.draw(); - MapData mapdata = Item.map.getMapData(itemstack, this.mc.theWorld); -- + - if (mapdata != null) -- { -- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata); -+ + IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); + MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld); + + if (custom == null) -+ { + { +- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata); + if (mapdata != null) + { + this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata); + } -+ } + } + else + { + custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata); - } ++ } GL11.glPopMatrix(); + } @@ -439,17 +474,20 @@ if (itemstack.getItem().requiresMultipleRenderPasses()) diff --git a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index f2af3b8a8..4fcd49a74 100644 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,16 +1,16 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java -@@ -25,6 +25,10 @@ - * True if the renderer supports multitextures and the OpenGL version != 1.3 +--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +@@ -26,6 +26,10 @@ */ private static boolean useMultitextureARB; -+ + + /* Stores the last values sent into setLightmapTextureCoords */ + public static float lastBrightnessX = 0.0f; + public static float lastBrightnessY = 0.0f; - ++ /** * Initializes the texture constants to be used when rendering lightmap values + */ @@ -88,5 +92,11 @@ { GL13.glMultiTexCoord2f(par0, par1, par2); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch index 460445999..824986e4c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/RenderBlocks.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderBlocks.java +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java @@ -45,6 +45,8 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 6e7d87f96..8de1168c9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java @@ -68,6 +68,9 @@ import org.lwjgl.opengl.ARBOcclusionQuery; import org.lwjgl.opengl.GL11; @@ -103,15 +103,15 @@ if (this.mc.theWorld.provider.isSurfaceWorld()) { if (this.mc.gameSettings.fancyGraphics) -@@ -1595,6 +1628,11 @@ - } +@@ -1596,6 +1629,11 @@ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) -+ { + { + drawBlockDamageTexture(par1Tessellator, (EntityLivingBase)par2EntityPlayer, par3); + } + + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) - { ++ { double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; + double d2 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3; diff --git a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch index 82dbc93aa..1c2b1deec 100644 --- a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/Tessellator.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/Tessellator.java +--- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java @@ -7,6 +7,8 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; @@ -75,11 +75,6 @@ - this.shortBuffer = this.byteBuffer.asShortBuffer(); - this.rawBuffer = new int[par1]; - this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -- -- if (this.useVBO) -- { -- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount); -- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers); + } + + public Tessellator() @@ -90,9 +85,12 @@ + { + instance.defaultTexture = true; + useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -+ + +- if (this.useVBO) + if (useVBO) -+ { + { +- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount); +- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers); + vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); + ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); } @@ -103,10 +101,9 @@ this.isDrawing = false; - if (this.vertexCount > 0) -- { + int offs = 0; + while (offs < vertexCount) -+ { + { + int vtc = 0; + if (drawMode == 7 && convertQuadsToTriangles) + { @@ -140,19 +137,19 @@ } GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); -@@ -278,6 +300,12 @@ - { - GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); +@@ -280,6 +302,12 @@ } -+ } -+ + } + + if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) + { + rawBufferSize = 0; + rawBuffer = null; - } - ++ } ++ int i = this.rawBufferIndex * 4; + this.reset(); + return i; @@ -442,6 +470,19 @@ */ public void addVertex(double par1, double par3, double par5) diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index 49e9cd3ea..52b23684b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/WorldRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/WorldRenderer.java +--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java @@ -23,7 +23,7 @@ /** Reference to the World object. */ public World worldObj; diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch index 5880e6540..f3be8c979 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java @@ -14,9 +14,15 @@ import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.Item; @@ -85,12 +85,11 @@ float f1 = 1.0F; - if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH) -- { -- int j = itemarmor.getColor(itemstack); + //Move out of if to allow for more then just CLOTH to have color + int j = itemarmor.getColor(itemstack); + if (j != -1) -+ { + { +- int j = itemarmor.getColor(itemstack); float f2 = (float)(j >> 16 & 255) / 255.0F; float f3 = (float)(j >> 8 & 255) / 255.0F; float f4 = (float)(j & 255) / 255.0F; @@ -108,13 +107,12 @@ this.modelBipedMain.bipedHead.postRender(0.0625F); - if (itemstack1.getItem().itemID < 256) -- { -- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); + + if (itemstack1.getItem() instanceof ItemBlock) -+ { + { +- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) + if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) { f2 = 0.625F; diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch index 5de5df58c..f41993529 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java @@ -21,6 +21,8 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @@ -9,7 +9,7 @@ @SideOnly(Side.CLIENT) public class RenderItem extends Render { -@@ -53,29 +55,9 @@ +@@ -53,30 +55,10 @@ if (itemstack.getItem() != null) { GL11.glPushMatrix(); @@ -17,7 +17,8 @@ + float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI); - byte b0 = 1; -- ++ byte b0 = getMiniBlockCount(itemstack); + - if (par1EntityItem.getEntityItem().stackSize > 1) - { - b0 = 2; @@ -37,20 +38,19 @@ - { - b0 = 5; - } -+ byte b0 = getMiniBlockCount(itemstack); - +- GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f4; @@ -84,9 +66,18 @@ float f6; int i; - if (itemstack.getItemSpriteNumber() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) -- { -- Block block = Block.blocksList[itemstack.itemID]; + Block block = null; + if (itemstack.itemID < Block.blocksList.length) -+ { + { +- Block block = Block.blocksList[itemstack.itemID]; + block = Block.blocksList[itemstack.itemID]; + } + @@ -99,23 +99,24 @@ } } } -@@ -204,6 +195,10 @@ - * Renders a dropped item +@@ -205,6 +196,10 @@ */ private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) -+ { + { + renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); + } + private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) - { ++ { Tessellator tessellator = Tessellator.instance; + if (par2Icon == null) @@ -240,32 +235,26 @@ f11 = 0.021875F; ItemStack itemstack = par1EntityItem.getEntityItem(); int j = itemstack.stackSize; - byte b0; -- ++ byte b0 = getMiniItemCount(itemstack); + - if (j < 2) - { - b0 = 1; @@ -132,15 +133,12 @@ - { - b0 = 4; - } -+ byte b0 = getMiniItemCount(itemstack); - +- GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F)); for (int k = 0; k < b0; ++k) { - GL11.glTranslatef(0.0F, 0.0F, f12 + f11); -- -- if (itemstack.getItemSpriteNumber() == 0 && Block.blocksList[itemstack.itemID] != null) + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + if (k > 0 && shouldSpreadItems()) + { @@ -153,7 +151,8 @@ + { + GL11.glTranslatef(0f, 0f, f12 + f11); + } -+ + +- if (itemstack.getItemSpriteNumber() == 0 && Block.blocksList[itemstack.itemID] != null) + if (itemstack.getItemSpriteNumber() == 0) { this.bindTexture(TextureMap.locationBlocksTexture); @@ -196,13 +195,11 @@ { GL11.glDisable(GL11.GL_LIGHTING); - par2TextureManager.bindTexture(TextureMap.locationItemsTexture); -- + - for (int j1 = 0; j1 <= 1; ++j1) -- { -- Icon icon = Item.itemsList[k].getIconFromDamageForRenderPass(l, j1); -+ + for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) -+ { + { +- Icon icon = Item.itemsList[k].getIconFromDamageForRenderPass(l, j1); + par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); @@ -260,12 +257,11 @@ if (par3ItemStack != null) { - this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); -- + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float)par4, (float)par5)) + { + this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); + } -+ + + /* Modders must handle this themselves if they use custom renderers! if (par3ItemStack.hasEffect()) { diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index d24e1117b..06ec9da9d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,17 +1,16 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java @@ -223,12 +223,14 @@ if (par4EntityLivingBase.isPlayerSleeping()) { - int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); -- -- if (i == Block.bed.blockID) + int x = MathHelper.floor_double(par4EntityLivingBase.posX); + int y = MathHelper.floor_double(par4EntityLivingBase.posY); + int z = MathHelper.floor_double(par4EntityLivingBase.posZ); + Block block = Block.blocksList[par1World.getBlockId(x, y, z)]; -+ + +- if (i == Block.bed.blockID) + if (block != null && block.isBed(par1World, x, y, z, par4EntityLivingBase)) { - int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 1c52bf670..65c769b1d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java @@ -15,13 +15,22 @@ import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.Item; @@ -58,12 +58,11 @@ float f1 = 1.0F; - if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH) -- { -- int j = itemarmor.getColor(itemstack); + //Move outside if to allow for more then just CLOTH + int j = itemarmor.getColor(itemstack); + if (j != -1) -+ { + { +- int j = itemarmor.getColor(itemstack); float f2 = (float)(j >> 16 & 255) / 255.0F; float f3 = (float)(j >> 8 & 255) / 255.0F; float f4 = (float)(j & 255) / 255.0F; @@ -116,10 +115,9 @@ float f2; - if (itemstack.getItem().itemID < 256) -- { -- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) + if (itemstack != null && itemstack.getItem() instanceof ItemBlock) -+ { + { +- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch index 7b8e50683..dce268645 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java @@ -8,9 +8,14 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch index e336a3838..0dc6fd224 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java @@ -18,6 +18,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch index 8eae647b0..42a2d0444 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java @@ -187,7 +187,7 @@ if (flag4 ^ flag5) diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch index d12ee3c7f..8f4c9bd6f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java @@ -11,9 +11,11 @@ import java.util.List; import javax.imageio.ImageIO; diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch index 21a3376b5..ba3336d40 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java @@ -21,6 +21,7 @@ import net.minecraft.util.Icon; import net.minecraft.util.ReportedException; diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch index 62171239b..375062ad5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java -+++ ../src_work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java @@ -1,5 +1,6 @@ package net.minecraft.client.renderer.tileentity; diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index 8529ac966..882b4851c 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/command/CommandHandler.java -+++ ../src_work/minecraft/net/minecraft/command/CommandHandler.java +--- ../src-base/minecraft/net/minecraft/command/CommandHandler.java ++++ ../src-work/minecraft/net/minecraft/command/CommandHandler.java @@ -12,6 +12,9 @@ import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.EnumChatFormatting; diff --git a/patches/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java.patch b/patches/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java.patch index 44ee2ec9d..db365e231 100644 --- a/patches/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java.patch +++ b/patches/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java -+++ ../src_work/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java +--- ../src-base/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java ++++ ../src-work/minecraft/net/minecraft/crash/CallableSuspiciousClasses.java @@ -130,6 +130,6 @@ public Object call() diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch index 78fd5a696..c6ccc419b 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/crash/CrashReport.java -+++ ../src_work/minecraft/net/minecraft/crash/CrashReport.java +--- ../src-base/minecraft/net/minecraft/crash/CrashReport.java ++++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java @@ -245,7 +245,8 @@ StackTraceElement stacktraceelement = null; StackTraceElement stacktraceelement1 = null; diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index e877e5230..7799d347b 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/crash/CrashReportCategory.java -+++ ../src_work/minecraft/net/minecraft/crash/CrashReportCategory.java +--- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java ++++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java @@ -130,8 +130,11 @@ public int func_85073_a(int par1) { diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch index 5b1f85db5..694be619f 100644 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch +++ b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/creativetab/CreativeTabs.java -+++ ../src_work/minecraft/net/minecraft/creativetab/CreativeTabs.java +--- ../src-base/minecraft/net/minecraft/creativetab/CreativeTabs.java ++++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java @@ -7,6 +7,7 @@ import net.minecraft.enchantment.EnchantmentData; import net.minecraft.enchantment.EnumEnchantmentType; @@ -53,17 +53,16 @@ return this.tabIndex < 6; } -@@ -187,9 +210,17 @@ +@@ -187,10 +210,18 @@ { Item item = aitem[j]; - if (item != null && item.getCreativeTab() == this) -- { -- item.getSubItems(item.itemID, this, par1List); + if (item == null) -+ { + { +- item.getSubItems(item.itemID, this, par1List); + continue; -+ } + } + + for (CreativeTabs tab : item.getCreativeTabs()) + { @@ -71,9 +70,10 @@ + { + item.getSubItems(item.itemID, this, par1List); + } - } ++ } } + if (this.func_111225_m() != null) @@ -232,4 +263,36 @@ } } diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index 9a531e19a..03d457717 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/enchantment/Enchantment.java -+++ ../src_work/minecraft/net/minecraft/enchantment/Enchantment.java +--- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java ++++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java @@ -1,6 +1,9 @@ package net.minecraft.enchantment; diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 8fe6cc8cf..1f5fff16e 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java -+++ ../src_work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java @@ -463,7 +463,10 @@ { Enchantment enchantment = aenchantment[k]; diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index e5a282d75..43a6e6e9d 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/Entity.java -+++ ../src_work/minecraft/net/minecraft/entity/Entity.java +--- ../src-base/minecraft/net/minecraft/entity/Entity.java ++++ ../src-work/minecraft/net/minecraft/entity/Entity.java @@ -1,10 +1,15 @@ package net.minecraft.entity; @@ -49,7 +49,7 @@ public abstract class Entity { -@@ -218,6 +234,13 @@ +@@ -218,7 +234,14 @@ private boolean invulnerable; private UUID entityUniqueID; public EnumEntitySize myEntitySize; @@ -58,11 +58,12 @@ + public boolean captureDrops = false; + public ArrayList capturedDrops = new ArrayList(); + private UUID persistentID; -+ -+ private HashMap extendedProperties; ++ private HashMap extendedProperties; ++ public Entity(World par1World) { + this.entityId = nextEntityID++; @@ -245,6 +268,15 @@ this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); this.dataWatcher.addObject(1, Short.valueOf((short)300)); @@ -84,13 +85,12 @@ int l = this.worldObj.getBlockId(i, j, k); - if (l != 0 && Block.blocksList[l].blockMaterial == par1Material) -- { ++ Block block = Block.blocksList[l]; ++ if (block != null && block.blockMaterial == par1Material) + { - float f = BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(i, j, k)) - 0.11111111F; - float f1 = (float)(j + 1) - f; - return d0 < (double)f1; -+ Block block = Block.blocksList[l]; -+ if (block != null && block.blockMaterial == par1Material) -+ { + double filled = block.getFilledPercentage(worldObj, i, j, k); + if (filled < 0) + { diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 2127d37b7..69b1a087b 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/EntityLiving.java -+++ ../src_work/minecraft/net/minecraft/entity/EntityLiving.java +--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java @@ -31,6 +31,11 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -20,7 +20,7 @@ } /** -@@ -547,9 +553,21 @@ +@@ -547,10 +553,22 @@ */ protected void despawnEntity() { @@ -28,7 +28,7 @@ if (this.persistenceRequired) { this.entityAge = 0; -+ } + } + else if ((this.entityAge & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT) + { + if (result == Result.DENY) @@ -39,9 +39,10 @@ + { + this.setDead(); + } - } ++ } else { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, -1.0D); @@ -726,8 +744,6 @@ return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); } diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 04896364f..b4c5accdc 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/EntityLivingBase.java -+++ ../src_work/minecraft/net/minecraft/entity/EntityLivingBase.java +--- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java @@ -20,9 +20,11 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; @@ -73,7 +73,7 @@ if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { this.dropFewItems(this.recentlyHit > 0, i); -@@ -1013,12 +1021,22 @@ +@@ -1013,7 +1021,7 @@ if (this.recentlyHit > 0) { @@ -82,10 +82,10 @@ if (j < 5) { - this.dropRareDrop(j <= 0 ? 1 : 0); +@@ -1021,6 +1029,16 @@ } -+ } -+ } + } + } + + captureDrops = false; + @@ -94,9 +94,11 @@ + for (EntityItem item : capturedDrops) + { + worldObj.spawnEntityInWorld(item); - } - } ++ } ++ } } + + this.worldObj.setEntityState(this, (byte)3); @@ -1088,7 +1106,7 @@ int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch index 634136b7f..f1337800f 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java -+++ ../src_work/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -3,6 +3,7 @@ import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; @@ -8,15 +8,15 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; -@@ -28,6 +29,8 @@ - PathEntity entityPathEntity; +@@ -29,6 +30,8 @@ Class classTarget; private int field_75445_i; -+ -+ private int failedPathFindingPenalty; ++ private int failedPathFindingPenalty; ++ public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, Class par2Class, double par3, boolean par5) { + this(par1EntityCreature, par3, par5); @@ -65,8 +68,16 @@ } else diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index 1adbe8327..b8484ab2d 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -1,13 +1,12 @@ ---- ../src_base/minecraft/net/minecraft/entity/boss/EntityDragon.java -+++ ../src_work/minecraft/net/minecraft/entity/boss/EntityDragon.java +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java @@ -527,10 +527,11 @@ for (int i2 = k; i2 <= j1; ++i2) { int j2 = this.worldObj.getBlockId(k1, l1, i2); -- -- if (j2 != 0) + Block block = Block.blocksList[j2]; -+ + +- if (j2 != 0) + if (block != null) { - if (j2 != Block.obsidian.blockID && j2 != Block.whiteStone.blockID && j2 != Block.bedrock.blockID && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch index 1808b3220..88f0f4620 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/boss/EntityWither.java -+++ ../src_work/minecraft/net/minecraft/entity/boss/EntityWither.java +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java @@ -355,7 +355,8 @@ int l2 = j1 + l1; int i3 = this.worldObj.getBlockId(j2, k2, l2); diff --git a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch index a0843132e..033e61042 100644 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java -+++ ../src_work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +--- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java ++++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java @@ -10,6 +10,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index 5695a078f..5dc75e9f0 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java @@ -9,6 +9,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index eedc3671c..82c46068d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -1,17 +1,17 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityItem.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityItem.java -@@ -1,6 +1,11 @@ - package net.minecraft.entity.item; +--- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java +@@ -2,6 +2,11 @@ import java.util.Iterator; -+ + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.Event.Result; +import net.minecraftforge.event.entity.item.ItemExpireEvent; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; - ++ import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; + import net.minecraft.block.material.Material; @@ -30,6 +35,11 @@ /** The EntityItem's random initial float height. */ public float hoverStart; @@ -48,7 +48,7 @@ super.onUpdate(); if (this.delayBeforeCanPickup > 0) -@@ -133,7 +153,29 @@ +@@ -133,8 +153,30 @@ ++this.age; @@ -56,7 +56,7 @@ + ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); + + if (!this.worldObj.isRemote && this.age >= lifespan) -+ { + { + if (item != null) + { + ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj))); @@ -76,9 +76,10 @@ + } + + if (item != null && item.stackSize <= 0) - { ++ { this.setDead(); } + } @@ -268,6 +310,7 @@ { par1NBTTagCompound.setShort("Health", (short)((byte)this.health)); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index c1d216a14..65c46345f 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecart.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecart.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java @@ -21,6 +21,10 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -68,12 +68,11 @@ int l = this.worldObj.getBlockId(j, i, k); - if (BlockRailBase.isRailBlock(l)) -- { ++ if (canUseRail() && BlockRailBase.isRailBlock(l)) + { - int i1 = this.worldObj.getBlockMetadata(j, i, k); - this.updateOnTrack(j, i, k, d4, d5, l, i1); - -+ if (canUseRail() && BlockRailBase.isRailBlock(l)) -+ { + BlockRailBase rail = (BlockRailBase)Block.blocksList[l]; + float railMaxSpeed = rail.getRailMaxSpeed(worldObj, this, j, i, k); + double maxSpeed = Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); @@ -92,12 +91,12 @@ } this.doBlockCollisions(); -@@ -391,7 +419,18 @@ +@@ -391,8 +419,19 @@ } this.setRotation(this.rotationYaw, this.rotationPitch); - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); -+ + + AxisAlignedBB box; + if (getCollisionHandler() != null) + { @@ -109,9 +108,10 @@ + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); - ++ if (list != null && !list.isEmpty()) { + for (int j1 = 0; j1 < list.size(); ++j1) @@ -415,6 +454,8 @@ this.riddenByEntity = null; @@ -121,12 +121,10 @@ } } -@@ -443,6 +484,17 @@ - if (this.motionZ > par1) - { +@@ -445,6 +486,17 @@ this.motionZ = par1; -+ } -+ + } + + double moveY = motionY; + if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) + { @@ -136,9 +134,11 @@ + moveY = 0.15f; + motionY = moveY; + } - } - ++ } ++ if (this.onGround) + { + this.motionX *= 0.5D; @@ -452,13 +504,13 @@ this.motionZ *= 0.5D; } @@ -175,19 +175,20 @@ { d7 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -@@ -599,36 +651,8 @@ +@@ -599,37 +651,9 @@ this.posX = d8 + d2 * d7; this.posZ = d9 + d3 * d7; this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); - d12 = this.motionX; - d13 = this.motionZ; -- + - if (this.riddenByEntity != null) - { - d12 *= 0.75D; - d13 *= 0.75D; - } -- ++ moveMinecartOnRail(par1, par2, par3, par4); + - if (d12 < -par4) - { - d12 = -par4; @@ -209,54 +210,56 @@ - } - - this.moveEntity(d12, 0.0D, d13); -+ -+ moveMinecartOnRail(par1, par2, par3, par4); - +- if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - par1 == aint[0][0] && MathHelper.floor_double(this.posZ) - par3 == aint[0][2]) { -@@ -666,7 +690,12 @@ + this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); +@@ -666,8 +690,13 @@ this.motionZ = d6 * (double)(k1 - par3); } - if (flag) + if(shouldDoRailFunctions()) -+ { + { + ((BlockRailBase)Block.blocksList[par8]).onMinecartPass(worldObj, this, par1, par2, par3); + } + + if (flag && shouldDoRailFunctions()) - { ++ { double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -@@ -737,12 +766,7 @@ + if (d15 > 0.01D) +@@ -737,13 +766,8 @@ } else { - int i1 = this.worldObj.getBlockMetadata(i, j, k); -- ++ int i1 = ((BlockRailBase)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k); + - if (((BlockRailBase)Block.blocksList[l]).isPowered()) - { - i1 &= 7; - } -+ int i1 = ((BlockRailBase)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k); - +- par3 = (double)j; -@@ -788,13 +812,8 @@ + if (i1 >= 2 && i1 <= 5) +@@ -788,14 +812,9 @@ if (BlockRailBase.isRailBlock(l)) { - int i1 = this.worldObj.getBlockMetadata(i, j, k); + int i1 = ((BlockRailBase)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k); par3 = (double)j; -- + - if (((BlockRailBase)Block.blocksList[l]).isPowered()) - { - i1 &= 7; - } - +- if (i1 >= 2 && i1 <= 5) { + par3 = (double)(j + 1); @@ -900,11 +919,17 @@ */ public void applyEntityCollision(Entity par1Entity) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index b7e320772..1e8e2fdb5 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java @@ -8,6 +8,8 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.DamageSource; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch index 4da3529d0..fad2ad765 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -2,6 +2,8 @@ import net.minecraft.entity.player.EntityPlayer; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch index 3e17e342a..68fb0c9a0 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -8,6 +8,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch index 0ca5ac4bb..6910037ba 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java -+++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java @@ -9,6 +9,8 @@ import net.minecraft.tileentity.TileEntityHopper; import net.minecraft.util.DamageSource; diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch index e68dd7a3d..0c5985167 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/monster/EntityEnderman.java -+++ ../src_work/minecraft/net/minecraft/entity/monster/EntityEnderman.java +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEnderman.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java @@ -16,6 +16,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 4c6237f2c..722281d52 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/monster/EntityZombie.java -+++ ../src_work/minecraft/net/minecraft/entity/monster/EntityZombie.java +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java @@ -34,6 +34,10 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; @@ -30,11 +30,10 @@ - int j = MathHelper.floor_double(this.posY); - int k = MathHelper.floor_double(this.posZ); - EntityZombie entityzombie = new EntityZombie(this.worldObj); -- + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); -+ + + SummonAidEvent summonAid = ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(field_110186_bp).getAttributeValue()); + + if (summonAid.getResult() == Result.DENY) diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index aa7a381a7..927de6add 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java -+++ ../src_work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java @@ -8,7 +8,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -13,12 +13,12 @@ { public EntityMooshroom(World par1World) { -@@ -38,28 +42,6 @@ +@@ -38,29 +42,7 @@ } } - if (itemstack != null && itemstack.itemID == Item.shears.itemID && 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); - @@ -39,9 +39,10 @@ - return true; - } - else - { +- { return super.interact(par1EntityPlayer); } + } @@ -82,4 +64,29 @@ { return this.func_94900_c(par1EntityAgeable); diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch index 2237df0f6..eb6a832b9 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -1,13 +1,12 @@ ---- ../src_base/minecraft/net/minecraft/entity/passive/EntityOcelot.java -+++ ../src_work/minecraft/net/minecraft/entity/passive/EntityOcelot.java +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java @@ -334,8 +334,9 @@ } int l = this.worldObj.getBlockId(i, j - 1, k); -- -- if (l == Block.grass.blockID || l == Block.leaves.blockID) + Block block = Block.blocksList[l]; -+ + +- if (l == Block.grass.blockID || l == Block.leaves.blockID) + if (l == Block.grass.blockID || (block != null && block.isLeaves(worldObj, i, j - 1, k))) { return true; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index 980d333b0..9c5cf3768 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/passive/EntitySheep.java -+++ ../src_work/minecraft/net/minecraft/entity/passive/EntitySheep.java +--- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java @@ -2,6 +2,8 @@ import cpw.mods.fml.relauncher.Side; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch index ab69a14ae..f796c92b0 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/passive/EntityVillager.java -+++ ../src_work/minecraft/net/minecraft/entity/passive/EntityVillager.java +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java @@ -205,7 +205,7 @@ ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); boolean flag = itemstack != null && itemstack.itemID == Item.monsterPlacer.itemID; diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index f1b2fccd4..b46869007 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayer.java -+++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayer.java +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java @@ -5,8 +5,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -112,12 +112,10 @@ if (this.username.equals("Notch")) { this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true); -@@ -697,6 +721,20 @@ - if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) - { +@@ -699,6 +723,20 @@ this.inventory.dropAllItems(); -+ } -+ + } + + captureDrops = false; + + if (!worldObj.isRemote) @@ -130,9 +128,11 @@ + joinEntityItemWithWorld(item); + } + } - } - ++ } ++ if (par1DamageSource != null) + { + this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); @@ -747,7 +785,20 @@ */ public EntityItem dropOneItem(boolean par1) @@ -164,7 +164,7 @@ } /** -@@ -812,15 +863,28 @@ +@@ -812,16 +863,29 @@ */ public void joinEntityItemWithWorld(EntityItem par1EntityItem) { @@ -178,23 +178,23 @@ /** * Returns how strong the player is against the specified block at this moment -- */ + * Deprecated in favor of the more sensitive version -+ */ + */ + @Deprecated public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2) { - float f = this.inventory.getStrVsBlock(par1Block); + return getCurrentPlayerStrVsBlock(par1Block, par2, 0); + } -+ + + public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2, int meta) + { + ItemStack stack = inventory.getCurrentItem(); + float f = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta)); - ++ if (f > 1.0F) { + int i = EnchantmentHelper.getEfficiencyModifier(this); @@ -831,7 +895,9 @@ { float f1 = (float)(i * i + 1); @@ -360,13 +360,12 @@ ChunkCoordinates chunkcoordinates1 = this.playerLocation; - if (chunkcoordinates != null && this.worldObj.getBlockId(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ) == Block.bed.blockID) -- { -- BlockBed.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, false); -- chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, 0); + Block block = (chunkcoordinates == null ? null : Block.blocksList[worldObj.getBlockId(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)]); + + if (chunkcoordinates != null && block != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this)) -+ { + { +- BlockBed.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, false); +- chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, 0); + block.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this, false); + chunkcoordinates1 = block.getBedSpawnPosition(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this); @@ -388,13 +387,12 @@ ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Block.bed.blockID) -- { -- ChunkCoordinates chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); + 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)) -+ { + { +- ChunkCoordinates chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); + ChunkCoordinates chunkcoordinates1 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null); return chunkcoordinates1; } @@ -405,19 +403,18 @@ { - int i = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); - int j = BlockBed.getDirection(i); -- -- switch (j) + int x = playerLocation.posX; + int y = playerLocation.posY; + int z = playerLocation.posZ; + Block block = Block.blocksList[worldObj.getBlockId(x, y, z)]; + int i = (block == null ? 0 : block.getBedDirection(worldObj, x, y, z)); -+ + +- switch (j) + switch (i) { case 0: return 90.0F; -@@ -1635,14 +1762,40 @@ +@@ -1635,21 +1762,52 @@ /** * Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. */ @@ -425,19 +422,17 @@ public ChunkCoordinates getBedLocation() { - return this.spawnChunk; -- } -- + return getBedLocation(this.dimension); -+ } -+ + } + + @Deprecated public boolean isSpawnForced() { - return this.spawnForced; + return isSpawnForced(this.dimension); -+ } -+ -+ /** + } + + /** + * A dimension aware version of getBedLocation. + * @param dimension The dimension to get the bed spawn for + * @return The player specific spawn location for the dimension. May be null. @@ -459,10 +454,10 @@ + Boolean forced = this.spawnForcedMap.get(dimension); + if (forced == null) return false; + return forced; - } - - /** -@@ -1650,6 +1803,11 @@ ++ } ++ ++ /** + * Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. */ public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2) { @@ -474,12 +469,12 @@ if (par1ChunkCoordinates != null) { this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates); -@@ -1661,7 +1819,39 @@ +@@ -1661,8 +1819,40 @@ this.spawnForced = false; } } - -+ /** + /** + * A dimension aware version of setSpawnChunk. + * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension. + * @param chunkCoordinates The spawn point to set as the player-specific spawn point for the dimension @@ -512,9 +507,10 @@ + this.spawnForcedMap.remove(dimension); + } + } - /** ++ /** * Will trigger the specified trigger. */ + public void triggerAchievement(StatBase par1StatBase) @@ -1843,6 +2033,10 @@ super.fall(par1); diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index a186e0fbd..e0a5845eb 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java -+++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java @@ -92,6 +92,12 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.chunk.Chunk; @@ -13,7 +13,7 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { private String translator = "en_US"; -@@ -164,19 +170,14 @@ +@@ -164,20 +170,15 @@ super(par2World, par3Str); par4ItemInWorldManager.thisPlayerMP = this; this.theItemInWorldManager = par4ItemInWorldManager; @@ -27,7 +27,7 @@ int i = chunkcoordinates.posX; int j = chunkcoordinates.posZ; int k = chunkcoordinates.posY; -- + - if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) - { - int l = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6); @@ -35,9 +35,10 @@ - j += this.rand.nextInt(l * 2) - l; - k = par2World.getTopSolidOrLiquidBlock(i, j); - } - +- this.mcServer = par1MinecraftServer; this.stepHeight = 0.0F; + this.yOffset = 0.0F; @@ -240,11 +241,6 @@ this.yOffset = 0.0F; } diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 0c5cc440b..f5976d07c 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,17 +1,17 @@ ---- ../src_base/minecraft/net/minecraft/entity/player/InventoryPlayer.java -+++ ../src_work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -357,6 +357,14 @@ - if (this.mainInventory[i] != null) - { +--- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java +@@ -359,6 +359,14 @@ this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); -+ } -+ } + } + } + + for (int i = 0; i < this.armorInventory.length; i++) + { + if (this.armorInventory[i] != null) + { + this.armorInventory[i].getItem().onArmorTickUpdate(this.player.worldObj, this.player, this.armorInventory[i]); - } - } ++ } ++ } } + + /** diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index d216107ce..1ffa06a95 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/ContainerEnchantment.java -+++ ../src_work/minecraft/net/minecraft/inventory/ContainerEnchantment.java +--- ../src-base/minecraft/net/minecraft/inventory/ContainerEnchantment.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java @@ -12,6 +12,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -24,14 +24,14 @@ - { - ++i; - } -- ++ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j * 2); ++ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j * 2); + - if (this.worldPointer.getBlockId(this.posX + k * 2, this.posY + 1, this.posZ + j * 2) == Block.bookShelf.blockID) - { - ++i; - } -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j * 2); -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j * 2); - +- if (k != 0 && j != 0) { - if (this.worldPointer.getBlockId(this.posX + k * 2, this.posY, this.posZ + j) == Block.bookShelf.blockID) diff --git a/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch index ea525208f..5a130d68b 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/ContainerFurnace.java -+++ ../src_work/minecraft/net/minecraft/inventory/ContainerFurnace.java +--- ../src-base/minecraft/net/minecraft/inventory/ContainerFurnace.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerFurnace.java @@ -125,7 +125,7 @@ } else if (par2 != 1 && par2 != 0) diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 0006d1437..e6a3d5411 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/ContainerRepair.java -+++ ../src_work/minecraft/net/minecraft/inventory/ContainerRepair.java +--- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java @@ -315,6 +315,11 @@ k = Math.max(1, k / 2); } @@ -12,11 +12,11 @@ this.maximumCost = k + i; if (i <= 0) -@@ -331,6 +336,7 @@ - { +@@ -332,6 +337,7 @@ itemstack1 = null; } -+ ++ if (itemstack1 != null) { + i1 = itemstack1.getRepairCost(); diff --git a/patches/minecraft/net/minecraft/inventory/Slot.java.patch b/patches/minecraft/net/minecraft/inventory/Slot.java.patch index 01087b84c..2b621b672 100644 --- a/patches/minecraft/net/minecraft/inventory/Slot.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Slot.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/Slot.java -+++ ../src_work/minecraft/net/minecraft/inventory/Slot.java +--- ../src-base/minecraft/net/minecraft/inventory/Slot.java ++++ ../src-work/minecraft/net/minecraft/inventory/Slot.java @@ -2,9 +2,11 @@ import cpw.mods.fml.relauncher.Side; @@ -12,20 +12,20 @@ public class Slot { -@@ -22,6 +24,13 @@ - +@@ -23,6 +25,13 @@ /** display position of the inventory slot on the screen y axis */ public int yDisplayPosition; -+ + + /** Position within background texture file, normally -1 which causes no background to be drawn. */ + protected Icon backgroundIcon = null; + + /** Background texture file assigned to this slot, if any. Vanilla "/gui/items.png" is used if this is null. */ + @SideOnly(Side.CLIENT) + protected ResourceLocation texture; - ++ public Slot(IInventory par1IInventory, int par2, int par3, int par4) { + this.inventory = par1IInventory; @@ -148,7 +157,7 @@ */ public Icon getBackgroundIconIndex() diff --git a/patches/minecraft/net/minecraft/inventory/SlotArmor.java.patch b/patches/minecraft/net/minecraft/inventory/SlotArmor.java.patch index ce7951b75..05bf3b8da 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotArmor.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotArmor.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/SlotArmor.java -+++ ../src_work/minecraft/net/minecraft/inventory/SlotArmor.java +--- ../src-base/minecraft/net/minecraft/inventory/SlotArmor.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotArmor.java @@ -41,7 +41,8 @@ */ public boolean isItemValid(ItemStack par1ItemStack) diff --git a/patches/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java.patch b/patches/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java.patch index 83a474dd9..a96cb9f41 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java -+++ ../src_work/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java +--- ../src-base/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotBrewingStandIngredient.java @@ -19,7 +19,7 @@ */ public boolean isItemValid(ItemStack par1ItemStack) diff --git a/patches/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java.patch b/patches/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java.patch index 369d9ffe8..2c609514c 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java -+++ ../src_work/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java +--- ../src-base/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotBrewingStandPotion.java @@ -2,6 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index 188b5cb07..a84ac065c 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -1,17 +1,17 @@ ---- ../src_base/minecraft/net/minecraft/inventory/SlotCrafting.java -+++ ../src_work/minecraft/net/minecraft/inventory/SlotCrafting.java -@@ -6,6 +6,10 @@ - import net.minecraft.item.Item; +--- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java +@@ -7,6 +7,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; -+ + +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; - ++ public class SlotCrafting extends Slot { -@@ -124,9 +128,15 @@ + /** The craft matrix inventory linked to this result slot. */ +@@ -124,10 +128,16 @@ if (itemstack1.getItem().hasContainerItem()) { @@ -20,12 +20,13 @@ - if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) + if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) -+ { + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); + itemstack2 = null; + } + + if (itemstack2 != null && (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2))) - { ++ { if (this.craftMatrix.getStackInSlot(i) == null) { + this.craftMatrix.setInventorySlotContents(i, itemstack2); diff --git a/patches/minecraft/net/minecraft/inventory/SlotFurnace.java.patch b/patches/minecraft/net/minecraft/inventory/SlotFurnace.java.patch index a6d52e28f..f40ad988c 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotFurnace.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotFurnace.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/inventory/SlotFurnace.java -+++ ../src_work/minecraft/net/minecraft/inventory/SlotFurnace.java +--- ../src-base/minecraft/net/minecraft/inventory/SlotFurnace.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotFurnace.java @@ -69,7 +69,7 @@ if (!this.thePlayer.worldObj.isRemote) { diff --git a/patches/minecraft/net/minecraft/item/BehaviorDispenseArmor.java.patch b/patches/minecraft/net/minecraft/item/BehaviorDispenseArmor.java.patch index 26d558f06..b503af410 100644 --- a/patches/minecraft/net/minecraft/item/BehaviorDispenseArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/BehaviorDispenseArmor.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/BehaviorDispenseArmor.java -+++ ../src_work/minecraft/net/minecraft/item/BehaviorDispenseArmor.java +--- ../src-base/minecraft/net/minecraft/item/BehaviorDispenseArmor.java ++++ ../src-work/minecraft/net/minecraft/item/BehaviorDispenseArmor.java @@ -32,7 +32,7 @@ int i1 = EntityLiving.getArmorPosition(par2ItemStack); ItemStack itemstack1 = par2ItemStack.copy(); diff --git a/patches/minecraft/net/minecraft/item/EnumArmorMaterial.java.patch b/patches/minecraft/net/minecraft/item/EnumArmorMaterial.java.patch index 2e4ba0048..fe1a4c27e 100644 --- a/patches/minecraft/net/minecraft/item/EnumArmorMaterial.java.patch +++ b/patches/minecraft/net/minecraft/item/EnumArmorMaterial.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/item/EnumArmorMaterial.java -+++ ../src_work/minecraft/net/minecraft/item/EnumArmorMaterial.java -@@ -22,6 +22,9 @@ - +--- ../src-base/minecraft/net/minecraft/item/EnumArmorMaterial.java ++++ ../src-work/minecraft/net/minecraft/item/EnumArmorMaterial.java +@@ -23,6 +23,9 @@ /** Return the enchantability factor of the material */ private int enchantability; -+ + + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; - ++ private EnumArmorMaterial(int par3, int[] par4ArrayOfInteger, int par5) { + this.maxDamageFactor = par3; @@ -61,6 +64,14 @@ */ public int getArmorCraftingMaterial() diff --git a/patches/minecraft/net/minecraft/item/EnumRarity.java.patch b/patches/minecraft/net/minecraft/item/EnumRarity.java.patch index d154ce11c..e02018873 100644 --- a/patches/minecraft/net/minecraft/item/EnumRarity.java.patch +++ b/patches/minecraft/net/minecraft/item/EnumRarity.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/EnumRarity.java -+++ ../src_work/minecraft/net/minecraft/item/EnumRarity.java +--- ../src-base/minecraft/net/minecraft/item/EnumRarity.java ++++ ../src-work/minecraft/net/minecraft/item/EnumRarity.java @@ -1,9 +1,5 @@ package net.minecraft.item; diff --git a/patches/minecraft/net/minecraft/item/EnumToolMaterial.java.patch b/patches/minecraft/net/minecraft/item/EnumToolMaterial.java.patch index 4fe0bbb27..8ccd20a4c 100644 --- a/patches/minecraft/net/minecraft/item/EnumToolMaterial.java.patch +++ b/patches/minecraft/net/minecraft/item/EnumToolMaterial.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/item/EnumToolMaterial.java -+++ ../src_work/minecraft/net/minecraft/item/EnumToolMaterial.java -@@ -30,6 +30,9 @@ - +--- ../src-base/minecraft/net/minecraft/item/EnumToolMaterial.java ++++ ../src-work/minecraft/net/minecraft/item/EnumToolMaterial.java +@@ -31,6 +31,9 @@ /** Defines the natural enchantability factor of the material. */ private final int enchantability; -+ + + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; - ++ private EnumToolMaterial(int par3, int par4, float par5, float par6, int par7) { + this.harvestLevel = par3; @@ -86,6 +89,14 @@ */ public int getToolCraftingMaterial() diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 57afb05ec..556dc57dc 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/Item.java -+++ ../src_work/minecraft/net/minecraft/item/Item.java +--- ../src-base/minecraft/net/minecraft/item/Item.java ++++ ../src-work/minecraft/net/minecraft/item/Item.java @@ -11,13 +11,18 @@ import java.util.UUID; import net.minecraft.block.Block; diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index 928624e62..9430c052a 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemArmor.java -+++ ../src_work/minecraft/net/minecraft/item/ItemArmor.java +--- ../src-base/minecraft/net/minecraft/item/ItemArmor.java ++++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java @@ -218,7 +218,7 @@ if (itemstack1 == null) diff --git a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch index 1dabef838..ea8e6458d 100644 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemBlock.java -+++ ../src_work/minecraft/net/minecraft/item/ItemBlock.java +--- ../src-base/minecraft/net/minecraft/item/ItemBlock.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java @@ -64,7 +64,8 @@ { par7 = 1; @@ -15,15 +15,14 @@ int k1 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, j1); - if (par3World.setBlock(par4, par5, par6, this.blockID, k1, 3)) -- { ++ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, k1)) + { - if (par3World.getBlockId(par4, par5, par6) == this.blockID) - { - Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); - Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, k1); - } - -+ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, k1)) -+ { par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); --par1ItemStack.stackSize; } diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index ebf7d5bcd..83aeafb8c 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -1,16 +1,16 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemBow.java -+++ ../src_work/minecraft/net/minecraft/item/ItemBow.java -@@ -10,6 +10,10 @@ - import net.minecraft.entity.projectile.EntityArrow; +--- ../src-base/minecraft/net/minecraft/item/ItemBow.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBow.java +@@ -11,6 +11,10 @@ import net.minecraft.util.Icon; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; +import net.minecraftforge.event.entity.player.ArrowNockEvent; - ++ public class ItemBow extends Item { + public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; @@ -30,11 +34,20 @@ */ public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) diff --git a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch index c266b01f9..97226f108 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemBucket.java -+++ ../src_work/minecraft/net/minecraft/item/ItemBucket.java +--- ../src-base/minecraft/net/minecraft/item/ItemBucket.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucket.java @@ -8,6 +8,10 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index a03156a47..a15935d93 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemBucketMilk.java -+++ ../src_work/minecraft/net/minecraft/item/ItemBucketMilk.java +--- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java @@ -22,7 +22,7 @@ if (!par2World.isRemote) diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index ba4fec69d..c6d7a0b35 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemDye.java -+++ ../src_work/minecraft/net/minecraft/item/ItemDye.java +--- ../src-base/minecraft/net/minecraft/item/ItemDye.java ++++ ../src-work/minecraft/net/minecraft/item/ItemDye.java @@ -21,6 +21,12 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -22,7 +22,7 @@ { if (!par3World.isRemote) { -@@ -141,7 +147,27 @@ +@@ -141,8 +147,28 @@ public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4) { @@ -32,7 +32,7 @@ + public static boolean applyBonemeal(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) + { int l = par1World.getBlockId(par2, par3, par4); -+ + + BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4); + if (MinecraftForge.EVENT_BUS.post(event)) + { @@ -47,10 +47,11 @@ + } + return true; + } - ++ if (l == Block.sapling.blockID) { -@@ -244,16 +270,9 @@ + if (!par1World.isRemote) +@@ -244,17 +270,10 @@ par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3); } } @@ -61,14 +62,15 @@ - { - par1World.setBlock(j1, k1, l1, Block.plantYellow.blockID); - } -- } ++ ForgeHooks.plantGrass(par1World, j1, k1, l1); + } - else if (Block.plantRed.canBlockStay(par1World, j1, k1, l1)) - { - par1World.setBlock(j1, k1, l1, Block.plantRed.blockID); -+ ForgeHooks.plantGrass(par1World, j1, k1, l1); - } +- } } } + } @@ -318,6 +337,16 @@ par0World.spawnParticle("happyVillager", (double)((float)par1 + itemRand.nextFloat()), (double)par2 + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)par3 + itemRand.nextFloat()), d0, d1, d2); } diff --git a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch index 39a372d29..c8ac11d4a 100644 --- a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemFlintAndSteel.java -+++ ../src_work/minecraft/net/minecraft/item/ItemFlintAndSteel.java +--- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java ++++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java @@ -57,9 +57,7 @@ } else diff --git a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch index b837ae6d7..b2cbb6961 100644 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemHoe.java -+++ ../src_work/minecraft/net/minecraft/item/ItemHoe.java +--- ../src-base/minecraft/net/minecraft/item/ItemHoe.java ++++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java @@ -6,6 +6,9 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; diff --git a/patches/minecraft/net/minecraft/item/ItemInWorldManager.java.patch b/patches/minecraft/net/minecraft/item/ItemInWorldManager.java.patch index 37bb8c940..3c1b9b61e 100644 --- a/patches/minecraft/net/minecraft/item/ItemInWorldManager.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemInWorldManager.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemInWorldManager.java -+++ ../src_work/minecraft/net/minecraft/item/ItemInWorldManager.java +--- ../src-base/minecraft/net/minecraft/item/ItemInWorldManager.java ++++ ../src-work/minecraft/net/minecraft/item/ItemInWorldManager.java @@ -4,12 +4,25 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -40,7 +40,7 @@ if (this.isCreative()) { if (!this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4)) -@@ -154,15 +174,33 @@ +@@ -154,17 +174,35 @@ } else { @@ -50,13 +50,12 @@ int i1 = this.theWorld.getBlockId(par1, par2, par3); - if (i1 > 0) -- { -- Block.blocksList[i1].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); -- f = Block.blocksList[i1].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3); + Block block = Block.blocksList[i1]; + + if (block != null) -+ { + { +- Block.blocksList[i1].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); +- f = Block.blocksList[i1].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3); + if (event.useBlock != Event.Result.DENY) + { + block.onBlockClicked(theWorld, par1, par2, par3, thisPlayerMP); @@ -67,8 +66,8 @@ + thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, theWorld)); + } + f = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3); -+ } -+ + } + + if (event.useItem == Event.Result.DENY) + { + if (f >= 1.0f) @@ -76,9 +75,11 @@ + thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, theWorld)); + } + return; - } - ++ } ++ if (i1 > 0 && f >= 1.0F) + { + this.tryHarvestBlock(par1, par2, par3); @@ -236,7 +274,7 @@ block.onBlockHarvested(this.theWorld, par1, par2, par3, l, this.thisPlayerMP); } @@ -133,7 +134,7 @@ if (itemstack != null) { -@@ -285,11 +331,18 @@ +@@ -285,12 +331,19 @@ } } @@ -143,15 +144,16 @@ Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1); } } -+ + + // Drop experience + if (!this.isCreative() && flag && event != null) + { + Block.blocksList[l].dropXpOnBlockBreak(this.theWorld, par1, par2, par3, event.getExpToDrop()); + } - ++ return flag; } + } @@ -325,6 +378,7 @@ if (itemstack1.stackSize == 0) { @@ -165,27 +167,60 @@ public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - int i1; -- -- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) -- { -- i1 = par2World.getBlockId(par4, par5, par6); -- -- if (i1 > 0 && Block.blocksList[i1].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) -- { -- return true; -- } -- } -- -- if (par3ItemStack == null) -- { + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(par1EntityPlayer, Action.RIGHT_CLICK_BLOCK, par4, par5, par6, par7); + if (event.isCanceled()) + { + thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par4, par5, par6, theWorld)); - return false; ++ return false; ++ } + +- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) ++ Item item = (par3ItemStack != null ? par3ItemStack.getItem() : null); ++ if (item != null && item.onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10)) + { +- i1 = par2World.getBlockId(par4, par5, par6); ++ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); ++ return true; ++ } + +- if (i1 > 0 && Block.blocksList[i1].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) ++ int i1 = par2World.getBlockId(par4, par5, par6); ++ Block block = Block.blocksList[i1]; ++ boolean result = false; ++ ++ if (block != null && (!par1EntityPlayer.isSneaking() || ( par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6)))) ++ { ++ if (event.useBlock != Event.Result.DENY) + { +- return true; ++ result = block.onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10); + } ++ else ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par4, par5, par6, theWorld)); ++ result = event.useItem != Event.Result.ALLOW; ++ } + } + +- if (par3ItemStack == null) ++ if (par3ItemStack != null && !result && event.useItem != Event.Result.DENY) + { +- return false; ++ int meta = par3ItemStack.getItemDamage(); ++ int size = par3ItemStack.stackSize; ++ result = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); ++ if (isCreative()) ++ { ++ par3ItemStack.setItemDamage(meta); ++ par3ItemStack.stackSize = size; ++ } ++ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); } - else if (this.isCreative()) -- { ++ ++ /* Re-enable if this causes bukkit incompatibility, or re-write client side to only send a single packet per right click. ++ if (par3ItemStack != null && ((!result && event.useItem != Event.Result.DENY) || event.useItem == Event.Result.ALLOW)) + { - i1 = par3ItemStack.getItemDamage(); - int j1 = par3ItemStack.stackSize; - boolean flag = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); @@ -197,47 +232,6 @@ - { - return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); - } -+ -+ Item item = (par3ItemStack != null ? par3ItemStack.getItem() : null); -+ if (item != null && item.onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10)) -+ { -+ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); -+ return true; -+ } -+ -+ int i1 = par2World.getBlockId(par4, par5, par6); -+ Block block = Block.blocksList[i1]; -+ boolean result = false; -+ -+ if (block != null && (!par1EntityPlayer.isSneaking() || ( par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6)))) -+ { -+ if (event.useBlock != Event.Result.DENY) -+ { -+ result = block.onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10); -+ } -+ else -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par4, par5, par6, theWorld)); -+ result = event.useItem != Event.Result.ALLOW; -+ } -+ } -+ -+ if (par3ItemStack != null && !result && event.useItem != Event.Result.DENY) -+ { -+ int meta = par3ItemStack.getItemDamage(); -+ int size = par3ItemStack.stackSize; -+ result = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); -+ if (isCreative()) -+ { -+ par3ItemStack.setItemDamage(meta); -+ par3ItemStack.stackSize = size; -+ } -+ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); -+ } -+ -+ /* Re-enable if this causes bukkit incompatibility, or re-write client side to only send a single packet per right click. -+ if (par3ItemStack != null && ((!result && event.useItem != Event.Result.DENY) || event.useItem == Event.Result.ALLOW)) -+ { + this.tryUseItem(thisPlayerMP, par2World, par3ItemStack); + }*/ + return result; diff --git a/patches/minecraft/net/minecraft/item/ItemMap.java.patch b/patches/minecraft/net/minecraft/item/ItemMap.java.patch index 340992551..9e0093a31 100644 --- a/patches/minecraft/net/minecraft/item/ItemMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMap.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemMap.java -+++ ../src_work/minecraft/net/minecraft/item/ItemMap.java +--- ../src-base/minecraft/net/minecraft/item/ItemMap.java ++++ ../src-work/minecraft/net/minecraft/item/ItemMap.java @@ -98,7 +98,7 @@ boolean flag = k2 * k2 + l2 * l2 > (j1 - 2) * (j1 - 2); int i3 = (j / i + k1 - short1 / 2) * i; diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 3674ecad5..ee004b998 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemSeedFood.java -+++ ../src_work/minecraft/net/minecraft/item/ItemSeedFood.java +--- ../src-base/minecraft/net/minecraft/item/ItemSeedFood.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeedFood.java @@ -1,9 +1,13 @@ package net.minecraft.item; diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index 45f86820a..785de820a 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemSeeds.java -+++ ../src_work/minecraft/net/minecraft/item/ItemSeeds.java +--- ../src-base/minecraft/net/minecraft/item/ItemSeeds.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeeds.java @@ -1,10 +1,15 @@ package net.minecraft.item; diff --git a/patches/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch index 9fa69529d..e34f35745 100644 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemShears.java.patch @@ -1,11 +1,11 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemShears.java -+++ ../src_work/minecraft/net/minecraft/item/ItemShears.java +--- ../src-base/minecraft/net/minecraft/item/ItemShears.java ++++ ../src-work/minecraft/net/minecraft/item/ItemShears.java @@ -1,9 +1,19 @@ package net.minecraft.item; -+ + +import java.util.ArrayList; +import java.util.Random; - ++ import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 7ccbc4139..c44d2392a 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemStack.java -+++ ../src_work/minecraft/net/minecraft/item/ItemStack.java +--- ../src-base/minecraft/net/minecraft/item/ItemStack.java ++++ ../src-work/minecraft/net/minecraft/item/ItemStack.java @@ -29,6 +29,7 @@ import net.minecraft.util.Icon; import net.minecraft.util.StatCollector; @@ -101,7 +101,7 @@ } public boolean func_111282_a(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) -@@ -733,14 +750,21 @@ +@@ -733,15 +750,22 @@ { arraylist.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); } @@ -116,11 +116,12 @@ { - return this.getItem().hasEffect(this); + return hasEffect(0); -+ } + } + @SideOnly(Side.CLIENT) + public boolean hasEffect(int pass) + { + return this.getItem().hasEffect(this, pass); - } ++ } @SideOnly(Side.CLIENT) + public EnumRarity getRarity() diff --git a/patches/minecraft/net/minecraft/item/ItemTool.java.patch b/patches/minecraft/net/minecraft/item/ItemTool.java.patch index 304d514ac..7b273ad04 100644 --- a/patches/minecraft/net/minecraft/item/ItemTool.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemTool.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/ItemTool.java -+++ ../src_work/minecraft/net/minecraft/item/ItemTool.java +--- ../src-base/minecraft/net/minecraft/item/ItemTool.java ++++ ../src-work/minecraft/net/minecraft/item/ItemTool.java @@ -9,6 +9,7 @@ import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; diff --git a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch index 14d3f9784..6ebe38e3f 100644 --- a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/crafting/CraftingManager.java -+++ ../src_work/minecraft/net/minecraft/item/crafting/CraftingManager.java +--- ../src-base/minecraft/net/minecraft/item/crafting/CraftingManager.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/CraftingManager.java @@ -283,7 +283,7 @@ } } diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index fd593450e..507d7cab0 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -+++ ../src_work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +--- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java @@ -1,6 +1,8 @@ package net.minecraft.item.crafting; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch index 488cc8fa3..809096b6b 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java -+++ ../src_work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java +--- ../src-base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java @@ -91,9 +91,9 @@ { this.field_92102_a = new ItemStack(Item.firework); @@ -16,10 +16,8 @@ nbttagcompound1.setByte("Flight", (byte)j); nbttagcompound.setTag("Fireworks", nbttagcompound1); - this.field_92102_a.setTagCompound(nbttagcompound); -- } -- -+ } -+ + } + + this.field_92102_a.setTagCompound(nbttagcompound); return true; } diff --git a/patches/minecraft/net/minecraft/logging/LogAgent.java.patch b/patches/minecraft/net/minecraft/logging/LogAgent.java.patch index 1623d5b7b..5e61ecbd2 100644 --- a/patches/minecraft/net/minecraft/logging/LogAgent.java.patch +++ b/patches/minecraft/net/minecraft/logging/LogAgent.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/logging/LogAgent.java -+++ ../src_work/minecraft/net/minecraft/logging/LogAgent.java +--- ../src-base/minecraft/net/minecraft/logging/LogAgent.java ++++ ../src-work/minecraft/net/minecraft/logging/LogAgent.java @@ -72,7 +72,7 @@ public void logWarningFormatted(String par1Str, Object ... par2ArrayOfObj) diff --git a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch index e8c364ea5..e8bd316d1 100644 --- a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/nbt/CompressedStreamTools.java -+++ ../src_work/minecraft/net/minecraft/nbt/CompressedStreamTools.java +--- ../src-base/minecraft/net/minecraft/nbt/CompressedStreamTools.java ++++ ../src-work/minecraft/net/minecraft/nbt/CompressedStreamTools.java @@ -140,7 +140,6 @@ NBTBase.writeNamedTag(par0NBTTagCompound, par1DataOutput); } diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch index 298a132db..f81f690e5 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/nbt/NBTTagList.java -+++ ../src_work/minecraft/net/minecraft/nbt/NBTTagList.java +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagList.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagList.java @@ -1,7 +1,5 @@ package net.minecraft.nbt; diff --git a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch index 7e6a1554f..bb8a86e57 100644 --- a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/network/NetServerHandler.java -+++ ../src_work/minecraft/net/minecraft/network/NetServerHandler.java +--- ../src-base/minecraft/net/minecraft/network/NetServerHandler.java ++++ ../src-work/minecraft/net/minecraft/network/NetServerHandler.java @@ -71,6 +71,14 @@ import net.minecraft.world.WorldServer; import org.apache.commons.lang3.StringUtils; @@ -15,18 +15,18 @@ public class NetServerHandler extends NetHandler { /** The underlying network manager for this server handler. */ -@@ -221,6 +229,11 @@ - if (this.playerEntity.ridingEntity != null) - { +@@ -223,6 +231,11 @@ this.playerEntity.ridingEntity.updateRiderPosition(); -+ } -+ + } + + if (!this.hasMoved) //Fixes teleportation kick while riding entities + { + return; - } - ++ } ++ this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + + if (this.hasMoved) @@ -300,9 +313,10 @@ d4 = d1 - this.playerEntity.posX; double d5 = d2 - this.playerEntity.posY; @@ -41,18 +41,18 @@ double d10 = d7 * d7 + d8 * d8 + d9 * d9; if (d10 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) -@@ -318,6 +332,11 @@ - if (this.playerEntity.onGround && !par1Packet10Flying.onGround && d5 > 0.0D) - { +@@ -320,6 +334,11 @@ this.playerEntity.addExhaustion(0.2F); -+ } -+ + } + + if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; - } - ++ } ++ this.playerEntity.moveEntity(d4, d5, d6); + this.playerEntity.onGround = par1Packet10Flying.onGround; + this.playerEntity.addMovementStat(d4, d5, d6); @@ -342,10 +361,15 @@ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved wrongly!"); } diff --git a/patches/minecraft/net/minecraft/network/packet/Packet51MapChunk.java.patch b/patches/minecraft/net/minecraft/network/packet/Packet51MapChunk.java.patch index 3c6c38fb5..a293891ee 100644 --- a/patches/minecraft/net/minecraft/network/packet/Packet51MapChunk.java.patch +++ b/patches/minecraft/net/minecraft/network/packet/Packet51MapChunk.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/network/packet/Packet51MapChunk.java -+++ ../src_work/minecraft/net/minecraft/network/packet/Packet51MapChunk.java +--- ../src-base/minecraft/net/minecraft/network/packet/Packet51MapChunk.java ++++ ../src-work/minecraft/net/minecraft/network/packet/Packet51MapChunk.java @@ -5,6 +5,7 @@ import java.io.DataInput; import java.io.DataOutput; @@ -24,11 +24,10 @@ - Deflater deflater = new Deflater(-1); this.yChMax = packet51mapchunkdata.chunkHasAddSectionFlag; this.yChMin = packet51mapchunkdata.chunkExistFlag; -- + this.compressedChunkData = packet51mapchunkdata.compressedData; + this.deflateGate = new Semaphore(1); + } -+ + + private void deflate() + { + Deflater deflater = new Deflater(-1); diff --git a/patches/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java.patch b/patches/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java.patch index 12dca7774..87003341e 100644 --- a/patches/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java.patch +++ b/patches/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java -+++ ../src_work/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java +--- ../src-base/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java ++++ ../src-work/minecraft/net/minecraft/network/packet/Packet52MultiBlockChange.java @@ -7,6 +7,8 @@ import java.io.IOException; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/network/packet/Packet56MapChunks.java.patch b/patches/minecraft/net/minecraft/network/packet/Packet56MapChunks.java.patch index 1ef0a9d8b..b0ab38ea2 100644 --- a/patches/minecraft/net/minecraft/network/packet/Packet56MapChunks.java.patch +++ b/patches/minecraft/net/minecraft/network/packet/Packet56MapChunks.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/network/packet/Packet56MapChunks.java -+++ ../src_work/minecraft/net/minecraft/network/packet/Packet56MapChunks.java +--- ../src-base/minecraft/net/minecraft/network/packet/Packet56MapChunks.java ++++ ../src-work/minecraft/net/minecraft/network/packet/Packet56MapChunks.java @@ -6,6 +6,7 @@ import java.io.DataOutput; import java.io.IOException; @@ -8,16 +8,17 @@ import java.util.zip.DataFormatException; import java.util.zip.Deflater; import java.util.zip.Inflater; -@@ -31,6 +32,9 @@ +@@ -31,7 +32,10 @@ */ private boolean skyLightSent; private static byte[] chunkDataNotCompressed = new byte[0]; + private int maxLen = 0; -+ -+ private Semaphore deflateGate; ++ private Semaphore deflateGate; ++ public Packet56MapChunks() {} + public Packet56MapChunks(List par1List) @@ -49,15 +53,6 @@ { Chunk chunk = (Chunk)par1List.get(k); @@ -41,7 +42,7 @@ + deflateGate = new Semaphore(1); + maxLen = j; + } -+ + + private void deflate() + { + byte[] data = new byte[maxLen]; @@ -51,7 +52,7 @@ + System.arraycopy(field_73584_f[x], 0, data, offset, field_73584_f[x].length); + offset += field_73584_f[x].length; + } - ++ Deflater deflater = new Deflater(-1); try diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch index 0a52e4c3f..bcebb171f 100644 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -1,11 +1,11 @@ ---- ../src_base/minecraft/net/minecraft/potion/PotionEffect.java -+++ ../src_work/minecraft/net/minecraft/potion/PotionEffect.java +--- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java ++++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java @@ -1,8 +1,13 @@ package net.minecraft.potion; -+ + +import java.util.ArrayList; +import java.util.List; - ++ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLivingBase; @@ -41,12 +41,10 @@ } /** -@@ -93,6 +104,63 @@ - public int getAmplifier() - { +@@ -95,6 +106,63 @@ return this.amplifier; -+ } -+ + } + + /*** + * Returns a list of curative items for the potion effect + * @return The list (ItemStack) of curative items for the potion effect @@ -102,6 +100,8 @@ + { + this.curativeItems.add(stack); + } - } - ++ } ++ /** + * Set whether this potion is a splash potion. + */ diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 9dfab6b89..9927bae56 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/server/MinecraftServer.java -+++ ../src_work/minecraft/net/minecraft/server/MinecraftServer.java +--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java ++++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java @@ -11,6 +11,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -52,9 +52,13 @@ } - for (int j = 0; j < this.worldServers.length; ++j) -- { ++ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler, getLogAgent())); ++ for (int dim : DimensionManager.getStaticDimensionIDs()) + { - byte b0 = 0; -- ++ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler, getLogAgent())); ++ world.addWorldAccess(new WorldManager(this, world)); + - if (j == 1) - { - b0 = -1; @@ -82,12 +86,7 @@ - } - - this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j])); -+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler, getLogAgent())); -+ for (int dim : DimensionManager.getStaticDimensionIDs()) -+ { -+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler, getLogAgent())); -+ world.addWorldAccess(new WorldManager(this, world)); - +- if (!this.isSinglePlayer()) { - this.worldServers[j].getWorldInfo().setGameType(this.getGameType()); @@ -95,12 +94,10 @@ } this.serverConfigManager.setPlayerManager(this.worldServers); -- } -- + + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); -+ } -+ + } + + this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld }); this.setDifficultyForAllWorlds(this.getDifficulty()); this.initialWorldChunkLoad(); @@ -113,38 +110,38 @@ int i = aworldserver.length; for (int j = 0; j < i; ++j) -@@ -413,7 +395,14 @@ +@@ -413,9 +395,16 @@ for (int i = 0; i < this.worldServers.length; ++i) { WorldServer worldserver = this.worldServers[i]; + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); worldserver.flush(); -+ } -+ + } + + WorldServer[] tmp = worldServers; + for (WorldServer world : tmp) + { + DimensionManager.setWorld(world.provider.dimensionId, null); - } - ++ } ++ if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) + { + this.usageSnooper.stopSnooper(); @@ -638,13 +627,15 @@ this.theProfiler.startSection("levels"); int i; - for (i = 0; i < this.worldServers.length; ++i) -- { + Integer[] ids = DimensionManager.getIDs(this.tickCounter % 200 == 0); + for (int x = 0; x < ids.length; x++) -+ { + { + int id = ids[x]; long j = System.nanoTime(); - if (i == 0 || this.getAllowNether()) -- { -- WorldServer worldserver = this.worldServers[i]; + if (id == 0 || this.getAllowNether()) -+ { + { +- WorldServer worldserver = this.worldServers[i]; + WorldServer worldserver = DimensionManager.getWorld(id); this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); this.theProfiler.startSection("pools"); @@ -154,11 +151,9 @@ } - this.timeOfLastDimensionTick[i][this.tickCounter % 100] = System.nanoTime() - j; -- } -- + worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - j; -+ } -+ + } + + this.theProfiler.endStartSection("dim_unloading"); + DimensionManager.unloadWorlds(worldTickTimes); this.theProfiler.endStartSection("connection"); diff --git a/patches/minecraft/net/minecraft/server/gui/StatsComponent.java.patch b/patches/minecraft/net/minecraft/server/gui/StatsComponent.java.patch index 05baecfa2..1e56f7bf4 100644 --- a/patches/minecraft/net/minecraft/server/gui/StatsComponent.java.patch +++ b/patches/minecraft/net/minecraft/server/gui/StatsComponent.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/server/gui/StatsComponent.java -+++ ../src_work/minecraft/net/minecraft/server/gui/StatsComponent.java +--- ../src-base/minecraft/net/minecraft/server/gui/StatsComponent.java ++++ ../src-work/minecraft/net/minecraft/server/gui/StatsComponent.java @@ -10,6 +10,8 @@ import javax.swing.Timer; import net.minecraft.network.TcpConnection; diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index db0fe6d6c..4bf1d8cd7 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/server/integrated/IntegratedServer.java -+++ ../src_work/minecraft/net/minecraft/server/integrated/IntegratedServer.java +--- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java ++++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java @@ -23,6 +23,10 @@ import net.minecraft.world.demo.DemoWorldServer; import net.minecraft.world.storage.ISaveHandler; @@ -20,16 +20,14 @@ ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); - for (int j = 0; j < this.worldServers.length; ++j) -- { -- byte b0 = 0; -- -- if (j == 1) + WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler, getLogAgent())); + for (int dim : DimensionManager.getStaticDimensionIDs()) -+ { + { +- byte b0 = 0; + WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler, getLogAgent())); + world.addWorldAccess(new WorldManager(this, world)); -+ + +- if (j == 1) + if (!this.isSinglePlayer()) { - b0 = -1; @@ -59,11 +57,9 @@ - - this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j])); - this.getConfigurationManager().setPlayerManager(this.worldServers); -- } -- + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); -+ } -+ + } + + this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld }); this.setDifficultyForAllWorlds(this.getDifficulty()); this.initialWorldChunkLoad(); diff --git a/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch index 9f378ae5c..59bf8105d 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/server/management/PlayerInstance.java -+++ ../src_work/minecraft/net/minecraft/server/management/PlayerInstance.java +--- ../src-base/minecraft/net/minecraft/server/management/PlayerInstance.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerInstance.java @@ -1,6 +1,7 @@ package net.minecraft.server.management; @@ -71,9 +71,8 @@ else { this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); -- + } -+ + + { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small for (i = 0; i < this.numberOfTilesToUpdate; ++i) { diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch index 337f3c861..c5c4042ee 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -1,6 +1,6 @@ ---- ../src_base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -+++ ../src_work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -@@ -52,10 +52,14 @@ +--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java +@@ -52,11 +52,15 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.EnumGameType; @@ -10,11 +10,12 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.demo.DemoWorldManager; import net.minecraft.world.storage.IPlayerFileData; -+ -+import net.minecraftforge.common.DimensionManager; ++import net.minecraftforge.common.DimensionManager; ++ public abstract class ServerConfigurationManager { + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); @@ -392,13 +396,23 @@ */ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) @@ -70,7 +71,7 @@ this.func_72375_a(par1EntityPlayerMP, worldserver); par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1); -@@ -487,38 +507,23 @@ +@@ -487,39 +507,24 @@ */ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) { @@ -94,7 +95,8 @@ par3WorldServer.theProfiler.startSection("moving"); - if (par1Entity.dimension == -1) -- { ++ if (par1Entity.dimension == 1) + { - d0 /= d2; - d1 /= d2; - par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); @@ -116,10 +118,10 @@ - } - } - else -+ if (par1Entity.dimension == 1) - { +- { ChunkCoordinates chunkcoordinates; + if (par2 == 1) @@ -555,7 +560,7 @@ par4WorldServer.spawnEntityInWorld(par1Entity); par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); diff --git a/patches/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch index 6c2eb1e61..1e155a9cf 100644 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatList.java.patch @@ -1,14 +1,13 @@ ---- ../src_base/minecraft/net/minecraft/stats/StatList.java -+++ ../src_work/minecraft/net/minecraft/stats/StatList.java +--- ../src-base/minecraft/net/minecraft/stats/StatList.java ++++ ../src-work/minecraft/net/minecraft/stats/StatList.java @@ -182,9 +182,9 @@ */ private static StatBase[] initMinableStats(String par0Str, int par1) { - StatBase[] astatbase = new StatBase[256]; -- -- for (int j = 0; j < 256; ++j) + StatBase[] astatbase = new StatBase[Block.blocksList.length]; -+ + +- for (int j = 0; j < 256; ++j) + for (int j = 0; j < Block.blocksList.length; ++j) { if (Block.blocksList[j] != null && Block.blocksList[j].getEnableStats()) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 0d0680d8e..dfb93eb6e 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/tileentity/TileEntity.java -+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntity.java +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java @@ -10,8 +10,11 @@ import net.minecraft.block.Block; import net.minecraft.crash.CrashReportCategory; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index 772b4845d..eb458c8cb 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java -+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java @@ -121,7 +121,9 @@ { int i1 = this.worldObj.getBlockId(k, j, l); diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index 1ad51bf08..3bf5c46fb 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java -+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -11,6 +11,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 4487d07f9..20e6d6618 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -54,10 +54,9 @@ this.furnaceItemStacks[2] = itemstack.copy(); } - else if (this.furnaceItemStacks[2].itemID == itemstack.itemID) -- { -- ++this.furnaceItemStacks[2].stackSize; + else if (this.furnaceItemStacks[2].isItemEqual(itemstack)) -+ { + { +- ++this.furnaceItemStacks[2].stackSize; + furnaceItemStacks[2].stackSize += itemstack.stackSize; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index ef86ad058..d03f52c7b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/tileentity/TileEntityHopper.java -+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityHopper.java +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java @@ -453,17 +453,28 @@ if (itemstack1 == null) diff --git a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch index 194af9719..45e18118a 100644 --- a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch +++ b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/util/MovingObjectPosition.java -+++ ../src_work/minecraft/net/minecraft/util/MovingObjectPosition.java +--- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java ++++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java @@ -27,7 +27,13 @@ /** The hit entity */ diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch index 05cd8c0ef..0945bcc01 100644 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/util/Session.java -+++ ../src_work/minecraft/net/minecraft/util/Session.java +--- ../src-base/minecraft/net/minecraft/util/Session.java ++++ ../src-work/minecraft/net/minecraft/util/Session.java @@ -11,6 +11,19 @@ public Session(String par1Str, String par2Str) diff --git a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch index a05146aa8..23ec43a9d 100644 --- a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch +++ b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/util/WeightedRandomChestContent.java -+++ ../src_work/minecraft/net/minecraft/util/WeightedRandomChestContent.java +--- ../src-base/minecraft/net/minecraft/util/WeightedRandomChestContent.java ++++ ../src-work/minecraft/net/minecraft/util/WeightedRandomChestContent.java @@ -4,6 +4,9 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,7 +10,7 @@ public class WeightedRandomChestContent extends WeightedRandomItem { -@@ -40,22 +43,11 @@ +@@ -40,23 +43,12 @@ for (int j = 0; j < par3; ++j) { WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent); @@ -23,7 +23,8 @@ - ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); - itemstack.stackSize = k; - par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), itemstack); -- } ++ par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), item); + } - else - { - for (int l = 0; l < k; ++l) @@ -32,11 +33,11 @@ - itemstack1.stackSize = 1; - par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), itemstack1); - } -+ par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), item); - } +- } } } -@@ -68,22 +60,11 @@ + +@@ -68,23 +60,12 @@ for (int j = 0; j < par3; ++j) { WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent); @@ -49,7 +50,8 @@ - ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); - itemstack.stackSize = k; - par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), itemstack); -- } ++ par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), item); + } - else - { - for (int l = 0; l < k; ++l) @@ -58,10 +60,10 @@ - itemstack1.stackSize = 1; - par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), itemstack1); - } -+ par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), item); - } +- } } } + @@ -109,4 +90,18 @@ return aweightedrandomchestcontent1; diff --git a/patches/minecraft/net/minecraft/village/VillageCollection.java.patch b/patches/minecraft/net/minecraft/village/VillageCollection.java.patch index f4811e403..0ddb52f6a 100644 --- a/patches/minecraft/net/minecraft/village/VillageCollection.java.patch +++ b/patches/minecraft/net/minecraft/village/VillageCollection.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/village/VillageCollection.java -+++ ../src_work/minecraft/net/minecraft/village/VillageCollection.java +--- ../src-base/minecraft/net/minecraft/village/VillageCollection.java ++++ ../src-work/minecraft/net/minecraft/village/VillageCollection.java @@ -165,7 +165,7 @@ { Village village = (Village)iterator.next(); diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch index e088306c9..64894396e 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/ChunkCache.java -+++ ../src_work/minecraft/net/minecraft/world/ChunkCache.java +--- ../src-base/minecraft/net/minecraft/world/ChunkCache.java ++++ ../src-work/minecraft/net/minecraft/world/ChunkCache.java @@ -8,6 +8,7 @@ import net.minecraft.util.Vec3Pool; import net.minecraft.world.biome.BiomeGenBase; diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index d79fa15ec..6f71cfff0 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/Explosion.java -+++ ../src_work/minecraft/net/minecraft/world/Explosion.java +--- ../src-base/minecraft/net/minecraft/world/Explosion.java ++++ ../src-work/minecraft/net/minecraft/world/Explosion.java @@ -92,7 +92,7 @@ if (k1 > 0) { diff --git a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch index a38857bb6..36274d664 100644 --- a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch +++ b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/IBlockAccess.java -+++ ../src_work/minecraft/net/minecraft/world/IBlockAccess.java +--- ../src-base/minecraft/net/minecraft/world/IBlockAccess.java ++++ ../src-work/minecraft/net/minecraft/world/IBlockAccess.java @@ -6,6 +6,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3Pool; diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch index c87464019..2b328f2d9 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/SpawnerAnimals.java -+++ ../src_work/minecraft/net/minecraft/world/SpawnerAnimals.java +--- ../src-base/minecraft/net/minecraft/world/SpawnerAnimals.java ++++ ../src-work/minecraft/net/minecraft/world/SpawnerAnimals.java @@ -1,5 +1,7 @@ package net.minecraft.world; @@ -44,13 +44,12 @@ ++j2; par1WorldServer.spawnEntityInWorld(entityliving); - entitylivingdata = entityliving.onSpawnWithEgg(entitylivingdata); -- -- if (j2 >= entityliving.getMaxSpawnedInChunk()) + if (!ForgeEventFactory.doSpecialSpawn(entityliving, par1WorldServer, f, f1, f2)) + { + entitylivingdata = entityliving.onSpawnWithEgg(entitylivingdata); + } -+ + +- if (j2 >= entityliving.getMaxSpawnedInChunk()) + if (j2 >= ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { continue label110; diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 33ed9901f..dfa11c165 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/World.java -+++ ../src_work/minecraft/net/minecraft/world/World.java +--- ../src-base/minecraft/net/minecraft/world/World.java ++++ ../src-work/minecraft/net/minecraft/world/World.java @@ -1,5 +1,6 @@ package net.minecraft.world; @@ -7,7 +7,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; -@@ -53,8 +54,33 @@ +@@ -53,9 +54,34 @@ import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.WorldInfo; @@ -29,7 +29,7 @@ + public abstract 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. @@ -38,9 +38,10 @@ + + public final MapStorage perWorldStorage; + - /** ++ /** * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately */ + public boolean scheduledUpdatesAreImmediate; @@ -167,6 +193,11 @@ */ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) @@ -122,12 +123,10 @@ } else { -@@ -290,6 +338,20 @@ - - this.calculateInitialSkylight(); +@@ -292,6 +340,20 @@ this.calculateInitialWeather(); -+ } -+ + } + + private static MapStorage s_mapStorage; + private static ISaveHandler s_savehandler; + //Provides a solution for different worlds getting different copies of the same data, potentially rewriting the data or causing race conditions/stale data @@ -140,9 +139,11 @@ + s_savehandler = savehandler; + } + return s_mapStorage; - } - ++ } ++ /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ @@ -373,7 +435,8 @@ */ public boolean isAirBlock(int par1, int par2, int par3) @@ -207,18 +208,18 @@ if (par1EntityPlayer != null && par2Str != null) { for (int i = 0; i < this.worldAccesses.size(); ++i) -@@ -1492,6 +1568,11 @@ - EntityPlayer entityplayer = (EntityPlayer)par1Entity; - this.playerEntities.add(entityplayer); +@@ -1494,6 +1570,11 @@ this.updateAllPlayersSleepingFlag(); -+ } -+ + } + + if (MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(par1Entity, this)) && !flag) + { + return false; - } - ++ } ++ this.getChunkFromChunkCoords(i, j).addEntity(par1Entity); + this.loadedEntityList.add(par1Entity); + this.onEntityAdded(par1Entity); @@ -1733,6 +1814,12 @@ */ public Vec3 getSkyColor(Entity par1Entity, float par2) @@ -286,19 +287,19 @@ { return k + 1; } -@@ -1926,6 +2021,12 @@ - * How bright are stars in the sky +@@ -1927,6 +2022,12 @@ */ public float getStarBrightness(float par1) -+ { + { + return provider.getStarBrightness(par1); + } + + @SideOnly(Side.CLIENT) + public float getStarBrightnessBody(float par1) - { ++ { float f1 = this.getCelestialAngle(par1); float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + @@ -1990,7 +2091,15 @@ entity.addEntityCrashInfo(crashreportcategory); } @@ -395,48 +396,48 @@ } } -@@ -2162,13 +2293,13 @@ +@@ -2162,14 +2293,14 @@ public void addTileEntity(Collection par1Collection) { - if (this.scanningTileEntities) -- { -- this.addedTileEntityList.addAll(par1Collection); -- } -- else -- { -- this.loadedTileEntityList.addAll(par1Collection); + List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; + for(Object entity : par1Collection) -+ { + { +- this.addedTileEntityList.addAll(par1Collection); + if(((TileEntity)entity).canUpdate()) + { + dest.add(entity); + } } +- else +- { +- this.loadedTileEntityList.addAll(par1Collection); +- } } -@@ -2188,9 +2319,17 @@ + /** +@@ -2188,10 +2319,18 @@ { int i = MathHelper.floor_double(par1Entity.posX); int j = MathHelper.floor_double(par1Entity.posZ); - byte b0 = 32; -- + - if (!par2 || this.checkChunksExist(i - b0, 0, j - b0, i + b0, 0, j + b0)) -+ + boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(i >> 4, j >> 4)); + byte b0 = isForced ? (byte)0 : 32; + boolean canUpdate = !par2 || this.checkChunksExist(i - b0, 0, j - b0, i + b0, 0, j + b0); + if (!canUpdate) -+ { + { + EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(par1Entity); + MinecraftForge.EVENT_BUS.post(event); + canUpdate = event.canUpdate; + } + if (canUpdate) - { ++ { par1Entity.lastTickPosX = par1Entity.posX; par1Entity.lastTickPosY = par1Entity.posY; + par1Entity.lastTickPosZ = par1Entity.posZ; @@ -2424,6 +2563,14 @@ { return true; @@ -457,19 +458,17 @@ 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; - Iterator iterator = this.addedTileEntityList.iterator(); -- -+ if (par4TileEntity == null || par4TileEntity.isInvalid()) -+ { + return; + } -+ + + if (par4TileEntity.canUpdate()) + { + if (scanningTileEntities) @@ -495,11 +494,9 @@ - { - chunk.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); - } -- } -- } + loadedTileEntityList.add(par4TileEntity); -+ } -+ } + } + } + + Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); + if (chunk != null) @@ -518,10 +515,13 @@ - TileEntity tileentity = this.getBlockTileEntity(par1, par2, par3); - - if (tileentity != null && this.scanningTileEntities) -- { ++ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4); ++ if (chunk != null) + { - tileentity.invalidate(); - this.addedTileEntityList.remove(tileentity); -- } ++ chunk.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); + } - else - { - if (tileentity != null) @@ -537,11 +537,6 @@ - chunk.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - } -+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ if (chunk != null) -+ { -+ chunk.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); -+ } + //notify tile changes + func_96440_m(par1, par2, par3, 0); } @@ -608,18 +603,18 @@ if (this.worldInfo.isRaining()) { this.rainingStrength = 1.0F; -@@ -2944,6 +3084,11 @@ - * Updates all weather states. +@@ -2945,6 +3085,11 @@ */ protected void updateWeather() -+ { + { + provider.updateWeather(); + } + + public void updateWeatherBody() - { ++ { if (!this.provider.hasNoSky) { + int i = this.worldInfo.getThunderTime(); @@ -3041,12 +3186,14 @@ public void toggleRain() @@ -666,13 +661,12 @@ int l = this.getBlockId(par1, par2, par3); - int i1 = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : Block.lightValue[l]; - int j1 = Block.lightOpacity[l]; -- -- if (j1 >= 15 && Block.lightValue[l] > 0) + Block block = Block.blocksList[l]; + int blockLight = (block == null ? 0 : block.getLightValue(this, par1, par2, par3)); + int i1 = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : blockLight; + int j1 = (block == null ? 0 : block.getLightOpacity(this, par1, par2, par3)); -+ + +- if (j1 >= 15 && Block.lightValue[l] > 0) + if (j1 >= 15 && blockLight > 0) { j1 = 1; @@ -736,18 +730,18 @@ } } -@@ -3620,6 +3784,11 @@ - else - { - if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable())) +@@ -3624,6 +3788,11 @@ + block = null; + } + ++ if (block != null && block.isBlockReplaceable(this, par2, par3, par4)) + { + block = null; + } + -+ if (block != null && block.isBlockReplaceable(this, par2, par3, par4)) - { - block = null; - } + return block != null && block.blockMaterial == Material.circuits && block1 == Block.anvil ? true : par1 > 0 && block == null && block1.canPlaceBlockOnSide(this, par2, par3, par4, par6, par8ItemStack); + } + } @@ -3744,14 +3913,20 @@ */ public int getIndirectPowerLevelTo(int par1, int par2, int par3, int par4) @@ -756,12 +750,12 @@ + Block block = Block.blocksList[this.getBlockId(par1, par2, par3)]; + + if (block == null) -+ { + { + return 0; + } + + if (!block.shouldCheckWeakPower(this, par1, par2, par3, par4)) - { ++ { return this.getBlockPowerInput(par1, par2, par3); } else @@ -827,18 +821,18 @@ } } -@@ -3978,6 +4156,11 @@ - * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. +@@ -3979,6 +4157,11 @@ */ public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) -+ { + { + return provider.canMineBlock(par1EntityPlayer, par2, par3, par4); + } + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) - { ++ { return true; } + @@ -4098,8 +4281,7 @@ */ public boolean isBlockHighHumidity(int par1, int par2, int par3) @@ -881,17 +875,26 @@ public void func_96440_m(int par1, int par2, int par3, int par4) { - for (int i1 = 0; i1 < 4; ++i1) -- { ++ for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { - int j1 = par1 + Direction.offsetX[i1]; - int k1 = par3 + Direction.offsetZ[i1]; - int l1 = this.getBlockId(j1, par2, k1); -- ++ int j1 = par1 + dir.offsetX; ++ int y = par2 + dir.offsetY; ++ int k1 = par3 + dir.offsetZ; ++ int l1 = getBlockId(j1, y, k1); ++ Block block = Block.blocksList[l1]; + - if (l1 != 0) -- { ++ if(block != null) + { - Block block = Block.blocksList[l1]; -- ++ block.onNeighborTileChange(this, j1, y, k1, par1, par2, par3); + - if (Block.redstoneComparatorIdle.func_94487_f(l1)) -- { ++ if(Block.isNormalCube(l1)) + { - block.onNeighborBlockChange(this, j1, par2, k1, par4); - } - else if (Block.isNormalCube(l1)) @@ -899,20 +902,6 @@ - j1 += Direction.offsetX[i1]; - k1 += Direction.offsetZ[i1]; - l1 = this.getBlockId(j1, par2, k1); -+ for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) -+ { -+ int j1 = par1 + dir.offsetX; -+ int y = par2 + dir.offsetY; -+ int k1 = par3 + dir.offsetZ; -+ int l1 = getBlockId(j1, y, k1); -+ Block block = Block.blocksList[l1]; -+ -+ if(block != null) -+ { -+ block.onNeighborTileChange(this, j1, y, k1, par1, par2, par3); -+ -+ if(Block.isNormalCube(l1)) -+ { + j1 += dir.offsetX; + y += dir.offsetY; + k1 += dir.offsetZ; @@ -920,10 +909,9 @@ block = Block.blocksList[l1]; - - if (Block.redstoneComparatorIdle.func_94487_f(l1)) -- { -- block.onNeighborBlockChange(this, j1, par2, k1, par4); + if(block != null && block.weakTileChanges()) -+ { + { +- block.onNeighborBlockChange(this, j1, par2, k1, par4); + block.onNeighborTileChange(this, j1, y, k1, par1, par2, par3); } } diff --git a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch index d9035628e..9790d31f7 100644 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/WorldProvider.java -+++ ../src_work/minecraft/net/minecraft/world/WorldProvider.java +--- ../src-base/minecraft/net/minecraft/world/WorldProvider.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java @@ -3,16 +3,23 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index 6f33e5962..6cd8bd29a 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/WorldServer.java -+++ ../src_work/minecraft/net/minecraft/world/WorldServer.java +--- ../src-base/minecraft/net/minecraft/world/WorldServer.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServer.java @@ -2,6 +2,7 @@ import cpw.mods.fml.relauncher.Side; @@ -83,11 +83,10 @@ } public boolean areAllPlayersAsleep() -@@ -315,6 +333,14 @@ - int i = 0; +@@ -316,6 +334,14 @@ int j = 0; Iterator iterator = this.activeChunkSet.iterator(); -+ + + doneChunks.retainAll(activeChunkSet); + if (doneChunks.size() == activeChunkSet.size()) + { @@ -95,9 +94,10 @@ + } + + final long startTime = System.nanoTime(); - ++ while (iterator.hasNext()) { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator.next(); @@ -325,14 +351,18 @@ Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); this.moodSoundAndLightCheck(k, l, chunk); @@ -162,19 +162,14 @@ ArrayList arraylist = new ArrayList(); - for (int k1 = 0; k1 < this.loadedTileEntityList.size(); ++k1) -- { ++ for(int x = (par1 >> 4); x <= (par4 >> 4); x++) + { - TileEntity tileentity = (TileEntity)this.loadedTileEntityList.get(k1); - - if (tileentity.xCoord >= par1 && tileentity.yCoord >= par2 && tileentity.zCoord >= par3 && tileentity.xCoord < par4 && tileentity.yCoord < par5 && tileentity.zCoord < par6) -- { -- arraylist.add(tileentity); -- } -- } -- -+ for(int x = (par1 >> 4); x <= (par4 >> 4); x++) -+ { + for(int z = (par3 >> 4); z <= (par6 >> 4); z++) -+ { + { +- arraylist.add(tileentity); + Chunk chunk = getChunkFromChunkCoords(x, z); + if (chunk != null) + { @@ -191,23 +186,24 @@ + } + } + } -+ } -+ } + } + } +- return arraylist; } -@@ -717,6 +765,11 @@ - * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. +@@ -718,6 +766,11 @@ */ public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) -+ { + { + return super.canMineBlock(par1EntityPlayer, par2, par3, par4); + } + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) - { ++ { return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer); } + @@ -801,7 +854,7 @@ */ protected void createBonusChest() diff --git a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch index f127cbe07..155084e24 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/WorldServerMulti.java -+++ ../src_work/minecraft/net/minecraft/world/WorldServerMulti.java +--- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServerMulti.java @@ -19,5 +19,8 @@ /** * Saves the chunks to disk. diff --git a/patches/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch index e9be8615f..6843ddac6 100644 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldType.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/WorldType.java -+++ ../src_work/minecraft/net/minecraft/world/WorldType.java +--- ../src-base/minecraft/net/minecraft/world/WorldType.java ++++ ../src-work/minecraft/net/minecraft/world/WorldType.java @@ -10,6 +10,9 @@ import com.google.common.collect.ObjectArrays; import com.google.common.collect.Sets; diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index f7e827ab3..5036b6605 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -1,17 +1,17 @@ ---- ../src_base/minecraft/net/minecraft/world/biome/BiomeDecorator.java -+++ ../src_work/minecraft/net/minecraft/world/biome/BiomeDecorator.java -@@ -15,6 +15,11 @@ - import net.minecraft.world.gen.feature.WorldGenSand; +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeDecorator.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java +@@ -16,6 +16,11 @@ import net.minecraft.world.gen.feature.WorldGenWaterlily; import net.minecraft.world.gen.feature.WorldGenerator; -+ + +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; - ++ public class BiomeDecorator { + /** The world the BiomeDecorator is currently decorating */ @@ -199,26 +204,31 @@ */ protected void decorate() diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 7c7b2ae97..bb146c8b3 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -1,26 +1,26 @@ ---- ../src_base/minecraft/net/minecraft/world/biome/BiomeGenBase.java -+++ ../src_work/minecraft/net/minecraft/world/biome/BiomeGenBase.java -@@ -30,6 +30,9 @@ - import net.minecraft.world.gen.feature.WorldGenTallGrass; +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenBase.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenBase.java +@@ -31,6 +31,9 @@ import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; -+ + +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; - ++ public abstract class BiomeGenBase { -@@ -140,6 +143,10 @@ - protected WorldGenSwamp worldGeneratorSwamp; + /** An array of all the biomes, indexed by biome id. */ +@@ -141,6 +144,10 @@ public BiomeGenBase(int par1) -+ { + { + this(par1, true); + } + public BiomeGenBase(int par1, boolean register) - { ++ { this.topBlock = (byte)Block.grass.blockID; this.fillerBlock = (byte)Block.dirt.blockID; + this.field_76754_C = 5169201; @@ -159,6 +166,7 @@ this.worldGeneratorForest = new WorldGenForest(false); this.worldGeneratorSwamp = new WorldGenSwamp(); @@ -55,7 +55,7 @@ double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); - return ColorizerFoliage.getFoliageColor(d0, d1); + return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1)); -+ } + } + + public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) + { @@ -81,5 +81,5 @@ + BiomeEvent.GetFoliageColor event = new BiomeEvent.GetFoliageColor(this, original); + MinecraftForge.EVENT_BUS.post(event); + return event.newColor; - } ++ } } diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch index e3662ca5a..c79c96a2d 100644 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/biome/WorldChunkManager.java -+++ ../src_work/minecraft/net/minecraft/world/biome/WorldChunkManager.java +--- ../src-base/minecraft/net/minecraft/world/biome/WorldChunkManager.java ++++ ../src-work/minecraft/net/minecraft/world/biome/WorldChunkManager.java @@ -3,6 +3,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 89f4e50a8..1e34021a0 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/chunk/Chunk.java -+++ ../src_work/minecraft/net/minecraft/world/chunk/Chunk.java +--- ../src-base/minecraft/net/minecraft/world/chunk/Chunk.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java @@ -25,6 +25,10 @@ import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.storage.ExtendedBlockStorage; @@ -141,10 +141,9 @@ Block.blocksList[l1].breakBlock(this.worldObj, j2, par2, k2, l1, i2); } - else if (Block.blocksList[l1] instanceof ITileEntityProvider && l1 != par4) -- { -- this.worldObj.removeBlockTileEntity(j2, par2, k2); + else if (Block.blocksList[l1] != null && Block.blocksList[l1].hasTileEntity(i2)) -+ { + { +- this.worldObj.removeBlockTileEntity(j2, par2, k2); + TileEntity te = worldObj.getBlockTileEntity(j2, par2, k2); + if (te != null && te.shouldRefresh(l1, par4, i2, par5, worldObj, j2, par2, k2)) + { @@ -162,7 +161,7 @@ { if (par2 >= k1) { -@@ -659,29 +758,21 @@ +@@ -659,32 +758,24 @@ Block.blocksList[par4].onBlockAdded(this.worldObj, j2, par2, k2); } @@ -183,18 +182,21 @@ tileentity.updateContainingBlockInfo(); + tileentity.blockMetadata = par5; } -- } -- } + } + } - else if (l1 > 0 && Block.blocksList[l1] instanceof ITileEntityProvider) - { - tileentity = this.getChunkBlockTileEntity(par1, par2, par3); -- + - if (tileentity != null) - { - tileentity.updateContainingBlockInfo(); - } - } - +- } +- } +- + this.isModified = true; + return true; + } @@ -716,7 +807,7 @@ extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4); int j1 = extendedblockstorage.getExtBlockID(par1, par2 & 15, par3); @@ -225,10 +227,9 @@ if (tileentity == null) { int l = this.getBlockID(par1, par2, par3); -- -- if (l <= 0 || !Block.blocksList[l].hasTileEntity()) + int meta = this.getBlockMetadata(par1, par2, par3); -+ + +- if (l <= 0 || !Block.blocksList[l].hasTileEntity()) + if (l <= 0 || !Block.blocksList[l].hasTileEntity(meta)) { return null; @@ -330,13 +331,12 @@ int k = 0; boolean flag1 = !this.worldObj.provider.hasNoSky; int l; -@@ -1354,12 +1457,26 @@ +@@ -1354,13 +1457,27 @@ } this.generateHeightMap(); - Iterator iterator = this.chunkTileEntityMap.values().iterator(); -- -+ + + List invalidList = new ArrayList(); + iterator = chunkTileEntityMap.values().iterator(); while (iterator.hasNext()) @@ -353,14 +353,15 @@ + invalidList.add(tileEntity); + } + tileEntity.updateContainingBlockInfo(); -+ } + } + + for (TileEntity tileEntity : invalidList) + { + tileEntity.invalidate(); - } ++ } } + /** @@ -1468,4 +1585,18 @@ } } diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch index 0c8e3f71b..d0de2f74c 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java -+++ ../src_work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -27,6 +27,8 @@ import net.minecraft.world.chunk.NibbleArray; import net.minecraft.world.storage.IThreadedFileIO; diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch index ee653cbad..35b12c60e 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -1,6 +1,6 @@ ---- ../src_base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -+++ ../src_work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -24,15 +24,9 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java +@@ -24,18 +24,12 @@ File file1 = this.getWorldDirectory(); File file2; @@ -8,13 +8,16 @@ + if (par1WorldProvider.getSaveFolder() != null) { - file2 = new File(file1, "DIM-1"); -- file2.mkdirs(); -- return new AnvilChunkLoader(file2); -- } -- else if (par1WorldProvider instanceof WorldProviderEnd) -- { -- file2 = new File(file1, "DIM1"); + file2 = new File(file1, par1WorldProvider.getSaveFolder()); file2.mkdirs(); return new AnvilChunkLoader(file2); } +- else if (par1WorldProvider instanceof WorldProviderEnd) +- { +- file2 = new File(file1, "DIM1"); +- file2.mkdirs(); +- return new AnvilChunkLoader(file2); +- } + else + { + return new AnvilChunkLoader(file1); diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index 16ce34c38..0c37a1991 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java -+++ ../src_work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java @@ -13,6 +13,10 @@ import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; @@ -11,12 +11,12 @@ public class ChunkProviderEnd implements IChunkProvider { private Random endRNG; -@@ -42,7 +46,15 @@ +@@ -42,8 +46,16 @@ this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); - } -+ + + NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5}; + noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.endRNG, noiseGens); + this.noiseGen1 = noiseGens[0]; @@ -25,9 +25,10 @@ + this.noiseGen4 = noiseGens[3]; + this.noiseGen5 = noiseGens[4]; + } - ++ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { + byte b0 = 2; @@ -114,6 +126,10 @@ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch index 2d7987bff..90855020d 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java -+++ ../src_work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -20,6 +20,12 @@ import net.minecraft.world.gen.structure.MapGenStronghold; import net.minecraft.world.gen.structure.MapGenVillage; @@ -13,11 +13,10 @@ public class ChunkProviderGenerate implements IChunkProvider { /** RNG. */ -@@ -91,6 +97,15 @@ - */ +@@ -92,6 +98,15 @@ float[] parabolicField; int[][] field_73219_j = new int[32][32]; -+ + + { + caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE); + strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD); @@ -26,9 +25,10 @@ + scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); + ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); + } - ++ public ChunkProviderGenerate(World par1World, long par2, boolean par4) { + this.worldObj = par1World; @@ -104,6 +119,16 @@ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); @@ -117,12 +117,12 @@ { for (l1 = 0; l1 < 16; ++l1) { -@@ -554,6 +593,8 @@ - } +@@ -555,6 +594,8 @@ } } -+ -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); ++ BlockSand.fallInstantly = false; } + diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch index 26d1f0ddf..c446cf0f8 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java -+++ ../src_work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java @@ -19,6 +19,13 @@ import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.structure.MapGenNetherBridge; @@ -14,18 +14,18 @@ public class ChunkProviderHell implements IChunkProvider { private Random hellRNG; -@@ -59,6 +66,11 @@ - double[] noiseData3; +@@ -60,6 +67,11 @@ double[] noiseData4; double[] noiseData5; -+ + + { + genNetherBridge = (MapGenNetherBridge) TerrainGen.getModdedMapGen(genNetherBridge, NETHER_BRIDGE); + netherCaveGenerator = TerrainGen.getModdedMapGen(netherCaveGenerator, NETHER_CAVE); + } - ++ public ChunkProviderHell(World par1World, long par2) { + this.worldObj = par1World; @@ -71,6 +83,16 @@ this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index eade5546c..30a3efa5b 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java -+++ ../src_work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java -@@ -6,6 +6,9 @@ - import java.util.Iterator; +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +@@ -7,6 +7,9 @@ import java.util.List; import java.util.Set; -+ + +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.ForgeChunkManager; - ++ import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.crash.CrashReport; + import net.minecraft.crash.CrashReportCategory; @@ -66,7 +69,7 @@ */ public void unloadChunksIfNotNearSpawn(int par1, int par2) diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch index 9bd334702..29a5439d4 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/MapGenCaves.java -+++ ../src_work/minecraft/net/minecraft/world/gen/MapGenCaves.java +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenCaves.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java @@ -4,6 +4,7 @@ import net.minecraft.block.Block; import net.minecraft.util.MathHelper; diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch index 12155325d..c3e81a499 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/MapGenRavine.java -+++ ../src_work/minecraft/net/minecraft/world/gen/MapGenRavine.java +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java @@ -4,6 +4,7 @@ import net.minecraft.block.Block; import net.minecraft.util.MathHelper; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch index 0422952df..e597e4246 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -56,7 +56,9 @@ { i2 = par1World.getBlockId(k1, j1, l1); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch index f232b5294..ba2fbd878 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -1,9 +1,12 @@ package net.minecraft.world.gen.feature; @@ -17,10 +17,9 @@ { aint1[b2] = aint[b2] + k1; int l1 = this.worldObj.getBlockId(aint1[0], aint1[1], aint1[2]); -- -- if (l1 != 0 && l1 != Block.leaves.blockID) + Block block = Block.blocksList[l1]; -+ + +- if (l1 != 0 && l1 != Block.leaves.blockID) + if (block != null && + !block.isAirBlock(worldObj, aint1[0], aint1[1], aint1[2]) && + !block.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) @@ -31,10 +30,9 @@ aint3[b2] = MathHelper.floor_double((double)par1ArrayOfInteger[b2] + (double)i * d0); aint3[b3] = MathHelper.floor_double((double)par1ArrayOfInteger[b3] + (double)i * d1); int k = this.worldObj.getBlockId(aint3[0], aint3[1], aint3[2]); -- -- if (k != 0 && k != Block.leaves.blockID) + Block block = Block.blocksList[k]; -+ + +- if (k != 0 && k != Block.leaves.blockID) + if (block != null && + !block.isAirBlock(worldObj, aint3[0], aint3[1], aint3[2]) && + !block.isLeaves(worldObj, aint3[0], aint3[1], aint3[2])) diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch index 592f11deb..a810fd978 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -18,10 +18,16 @@ { int l; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch index d9fe44071..c4fb47beb 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -8,6 +8,8 @@ import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.WeightedRandomChestContent; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch index 02fc7ec49..a7f5c365a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java @@ -2,7 +2,9 @@ import java.util.Random; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch index 2353e21eb..5483ad42b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -2,8 +2,10 @@ import java.util.Random; @@ -15,10 +15,9 @@ if (i1 >= 0 && i1 < 256) { l1 = par1World.getBlockId(j1, i1, k1); -- -- if (l1 != 0 && l1 != Block.leaves.blockID && l1 != Block.grass.blockID && l1 != Block.dirt.blockID && l1 != Block.wood.blockID && l1 != Block.sapling.blockID) + Block block = Block.blocksList[l1]; -+ + +- if (l1 != 0 && l1 != Block.leaves.blockID && l1 != Block.grass.blockID && l1 != Block.dirt.blockID && l1 != Block.wood.blockID && l1 != Block.sapling.blockID) + if (block != null && + !block.isAirBlock(par1World, j1, i1, k1) && + !block.isLeaves(par1World, j1, i1, k1) && @@ -34,16 +33,15 @@ i1 = par1World.getBlockId(par3, par4 - 1, par5); - if ((i1 == Block.grass.blockID || i1 == Block.dirt.blockID) && par4 < 256 - l - 1) -- { -- par1World.setBlock(par3, par4 - 1, par5, Block.dirt.blockID, 0, 2); -- par1World.setBlock(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 2); -- par1World.setBlock(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); -- par1World.setBlock(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); + Block soil = Block.blocksList[i1]; + boolean isValidSoil = soil != null && soil.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Block.sapling); + + if (isValidSoil && par4 < 256 - l - 1) -+ { + { +- par1World.setBlock(par3, par4 - 1, par5, Block.dirt.blockID, 0, 2); +- par1World.setBlock(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 2); +- par1World.setBlock(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); +- par1World.setBlock(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); + onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); + onPlantGrow(par1World, par3 + 1, par4 - 1, par5, par3, par4, par5); + onPlantGrow(par1World, par3, par4 - 1, par5 + 1, par3, par4, par5); @@ -91,10 +89,9 @@ if ((i2 >= 0 || k2 >= 0 || i2 * i2 + k2 * k2 <= k1 * k1) && (i2 <= 0 && k2 <= 0 || i2 * i2 + k2 * k2 <= (k1 + 1) * (k1 + 1)) && (par6Random.nextInt(4) != 0 || i2 * i2 + k2 * k2 <= (k1 - 1) * (k1 - 1))) { int l2 = par1World.getBlockId(l1, i1, j2); -- -- if (l2 == 0 || l2 == Block.leaves.blockID) + Block block = Block.blocksList[l2]; -+ + +- if (l2 == 0 || l2 == Block.leaves.blockID) + if (block == null || block.canBeReplacedByLeaves(par1World, l1, i1, j2)) { this.setBlockAndMetadata(par1World, l1, i1, j2, Block.leaves.blockID, this.leavesMetadata); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch index dc5e708ae..12f03e522 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -9,6 +9,7 @@ { /** The block ID of the ore to be placed using this generator. */ @@ -8,19 +8,19 @@ /** The number of blocks to generate. */ private int numberOfBlocks; -@@ -26,6 +27,12 @@ - this.minableBlockId = par1; - this.numberOfBlocks = par2; +@@ -28,6 +29,12 @@ this.blockToReplace = par3; -+ } -+ + } + + public WorldGenMinable(int id, int meta, int number, int target) + { + this(id, number, target); + this.minableBlockMeta = meta; - } - ++ } ++ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + float f = par2Random.nextFloat() * (float)Math.PI; @@ -69,9 +76,10 @@ { double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch index 3b8b23b7e..f17972e00 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -19,10 +19,16 @@ { int l; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch index 584a3fa73..56e839be9 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -47,7 +47,7 @@ { l1 = par1World.getBlockId(j1, i1, k1); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch index bb5ebf71e..f7089260e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -43,7 +43,9 @@ { k2 = par1World.getBlockId(i2, l1, j2); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch index bc5800d54..0f8fd5d63 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -2,7 +2,9 @@ import java.util.Random; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch index 8e4ac0bea..3978eb2b2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -20,10 +20,16 @@ { int l; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch index 29587265b..450fa6163 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java -+++ ../src_work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -2,8 +2,10 @@ import java.util.Random; @@ -30,15 +30,13 @@ else { i1 = par1World.getBlockId(par3, par4 - 1, par5); -- -- if ((i1 == Block.grass.blockID || i1 == Block.dirt.blockID) && par4 < 256 - l - 1) -- { -- this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); + Block soil = Block.blocksList[i1]; + boolean isSoil = (soil != null && soil.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Block.sapling)); -+ + +- if ((i1 == Block.grass.blockID || i1 == Block.dirt.blockID) && par4 < 256 - l - 1) + if (isSoil && par4 < 256 - l - 1) -+ { + { +- this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); + soil.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); b0 = 3; byte b1 = 0; @@ -47,10 +45,9 @@ if (Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0) { int j3 = par1World.getBlockId(j2, j1, l2); -- -- if (j3 == 0 || j3 == Block.leaves.blockID) + Block block = Block.blocksList[j3]; -+ + +- if (j3 == 0 || j3 == Block.leaves.blockID) + if (block == null || block.canBeReplacedByLeaves(par1World, j2, j1, l2)) { this.setBlockAndMetadata(par1World, j2, j1, l2, Block.leaves.blockID, this.metaLeaves); diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch index 24f4db9a9..91477d630 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/layer/GenLayer.java -+++ ../src_work/minecraft/net/minecraft/world/gen/layer/GenLayer.java -@@ -1,6 +1,9 @@ - package net.minecraft.world.gen.layer; +--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayer.java +@@ -2,6 +2,9 @@ import net.minecraft.world.WorldType; -+ + +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; - ++ public abstract class GenLayer { + /** seed from World#getWorldSeed that is used in the LCG prng */ @@ -42,6 +45,7 @@ { b0 = 6; diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java.patch index 2175afdb7..b0573a6a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java -@@ -9,6 +9,9 @@ - import net.minecraft.tileentity.TileEntityMobSpawner; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentMineshaftCorridor.java +@@ -10,6 +10,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentMineshaftCorridor extends StructureComponent { + private boolean hasRails; @@ -283,14 +286,16 @@ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, k - 1, Block.torchWood.blockID, 0); this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, k + 1, Block.torchWood.blockID, 0); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java.patch index ec40f1daa..6f1eeab6c 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java -@@ -7,6 +7,9 @@ - import net.minecraft.util.Direction; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureDesertPyramid.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentScatteredFeatureDesertPyramid extends ComponentScatteredFeature { + private boolean[] field_74940_h = new boolean[4]; @@ -236,13 +239,14 @@ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, -10, 13, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, -11, 13, par3StructureBoundingBox); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java.patch index 079651029..ecd8be1e8 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java -@@ -7,6 +7,9 @@ - import net.minecraft.nbt.NBTTagCompound; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeatureJunglePyramid.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentScatteredFeatureJunglePyramid extends ComponentScatteredFeature { + private boolean field_74947_h; @@ -185,9 +188,12 @@ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 4, -3, 1, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, par3StructureBoundingBox); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java.patch index 8dac29b92..015ec0629 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java -@@ -7,6 +7,9 @@ - import net.minecraft.nbt.NBTTagCompound; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdChestCorridor.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentStrongholdChestCorridor extends ComponentStronghold { + /** List of items that Stronghold chests can contain. */ @@ -86,7 +89,7 @@ if (par3StructureBoundingBox.isVecInside(j, i, k)) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java.patch index 57e2af6cf..221962153 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java.patch @@ -1,24 +1,24 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java -@@ -7,6 +7,9 @@ - import net.minecraft.nbt.NBTTagCompound; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdLibrary.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentStrongholdLibrary extends ComponentStronghold { + /** List of items that Stronghold Library chests can contain. */ @@ -161,12 +164,14 @@ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, b1, 8, b2 + 1, par3StructureBoundingBox); } - this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); + ChestGenHooks info = ChestGenHooks.getInfo(STRONGHOLD_LIBRARY); -+ -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, info.getItems(par2Random), info.getCount(par2Random)); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, info.getItems(par2Random), info.getCount(par2Random)); ++ if (this.isLargeRoom) { this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, 9, 1, par3StructureBoundingBox); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java.patch index 166867978..e39441c85 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java -@@ -7,6 +7,9 @@ - import net.minecraft.nbt.NBTTagCompound; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentStrongholdRoomCrossing.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentStrongholdRoomCrossing extends ComponentStronghold { + /** @@ -158,7 +161,7 @@ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, par3StructureBoundingBox); this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, par3StructureBoundingBox); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java.patch index 2904b509c..1d530b2d5 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentVillage.java @@ -7,6 +7,10 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java.patch index 4f229b421..7e814c8f9 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java.patch @@ -1,15 +1,15 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java -@@ -7,6 +7,9 @@ - import net.minecraft.nbt.NBTTagCompound; +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentVillageHouse2.java +@@ -8,6 +8,9 @@ import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; -+ + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; - ++ public class ComponentVillageHouse2 extends ComponentVillage { + /** List of items that Village's Blacksmith chest can contain. */ @@ -106,7 +109,7 @@ if (par3StructureBoundingBox.isVecInside(j, i, k)) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java.patch index 87e5f8493..24c5e1a0a 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentVillageStartPiece.java @@ -12,6 +12,7 @@ /** Boolean that determines if the village is in a desert or not. */ diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch index 55b156239..f502fd946 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -1,6 +1,7 @@ package net.minecraft.world.gen.structure; diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch index d690244d1..bc1f969ad 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java @@ -234,12 +234,12 @@ { if (this.field_143029_e == null) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch index df5b89c36..81fa95c1b 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java @@ -35,6 +35,11 @@ public NBTTagCompound func_143010_b() diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch index 5a00556cd..2d99017dc 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/gen/structure/StructureStart.java -+++ ../src_work/minecraft/net/minecraft/world/gen/structure/StructureStart.java +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java @@ -68,6 +68,11 @@ public NBTTagCompound func_143021_a(int par1, int par2) diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index 2aa401fdd..9515e29c7 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/world/storage/MapData.java -+++ ../src_work/minecraft/net/minecraft/world/storage/MapData.java +--- ../src-base/minecraft/net/minecraft/world/storage/MapData.java ++++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java @@ -173,7 +173,7 @@ par8 += par8 < 0.0D ? -8.0D : 8.0D; b3 = (byte)((int)(par8 * 16.0D / 360.0D));