diff --git a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java index c014d4c69..617378612 100644 --- a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java +++ b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java @@ -231,7 +231,7 @@ public class ForgeHooks { public static final int majorVersion=1; public static final int minorVersion=1; - public static final int revisionVersion=2; + public static final int revisionVersion=3; static { System.out.printf("MinecraftForge V%d.%d.%d Initialized\n",majorVersion,minorVersion,revisionVersion); } diff --git a/forge/install/install.cmd b/forge/install/install.cmd index b2485d3fd..e40fe371b 100755 --- a/forge/install/install.cmd +++ b/forge/install/install.cmd @@ -11,8 +11,12 @@ cmd /C decompile.bat pushd src >nul ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ../forge/modLoaderMP.patch ../forge/modLoaderMP.patch ..\runtime\bin\applydiff.exe -uf -p2 -i ../forge/modLoaderMP.patch - ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ../forge/mlprop.patch ../forge/mlprop.patch - ..\runtime\bin\applydiff.exe -uf -p1 -i ../forge/mlprop.patch + rem ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ../forge/mlprop.patch ../forge/mlprop.patch + rem ..\runtime\bin\applydiff.exe -uf -p1 -i ../forge/mlprop.patch + del minecraft\net\minecraft\src\MLProp.java + copy ..\forge\MLProp.java minecraft\net\minecraft\src\MLProp.java + del minecraft_server\net\minecraft\src\MLProp.java + copy ..\forge\MLProp.java minecraft_server\net\minecraft\src\MLProp.java for /f "delims=" %%a in ('dir /a -d /b /S ..\forge\patches') do ( pushd "%%a" 2>nul diff --git a/forge/install/install.sh b/forge/install/install.sh index 3851d2059..e51237c09 100644 --- a/forge/install/install.sh +++ b/forge/install/install.sh @@ -11,7 +11,9 @@ pushd .. > /dev/null pushd src > /dev/null find . -name *.java -exec sed -i 's/\r//g' \{\} \; patch -p2 -i ../forge/modLoaderMP.patch - patch -p1 -i ../forge/mlprop.patch + #patch -p1 -i ../forge/mlprop.patch + cp ../forge/MLProp.java minecraft/net/minecraft/src/MLProp.java + cp ../forge/MLProp.java minecraft_server/net/minecraft/src/MLProp.java for i in `find ../forge/patches/ -type f` do patch -p2 -i $i diff --git a/forge/package.sh b/forge/package.sh index 6940afc16..8d337cf53 100755 --- a/forge/package.sh +++ b/forge/package.sh @@ -64,7 +64,7 @@ cp ../lfcr.py . cp ../install/install.cmd . cp ../install/install.sh . cp ../modLoaderMP.patch . -cp ../mlprop.patch . +cp ../MLProp.java . cp ../install/README.txt . cp ../minecraftforge_credits.txt . cp -r ../doc . diff --git a/forge/patches/minecraft/net/minecraft/src/Block.java.patch b/forge/patches/minecraft/net/minecraft/src/Block.java.patch index 4ba1a622d..7e1af3014 100644 --- a/forge/patches/minecraft/net/minecraft/src/Block.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Block.java.patch @@ -8,35 +8,37 @@ import java.util.ArrayList; import java.util.Random; -@@ -151,12 +152,14 @@ +@@ -312,12 +313,14 @@ public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) { - return iblockaccess.getBrightness(i, j, k, lightValue[blockID]); + return iblockaccess.getBrightness(i, j, k, -+ getLightValue(iblockaccess,i,j,k)); ++ getLightValue(iblockaccess,i,j,k)); } public int getMixedBrightnessForBlock(IBlockAccess iblockaccess, int i, int j, int k) { - return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, lightValue[blockID]); + return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, -+ getLightValue(iblockaccess,i,j,k)); ++ getLightValue(iblockaccess,i,j,k)); } public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) -@@ -278,24 +281,40 @@ +@@ -438,25 +441,41 @@ + { return 1; } - +- ++ + /* FORGE: Metadata-sensitive version. + */ + public int quantityDropped(int i, Random random) + { + return quantityDropped(random); + } -+ - public int idDropped(int i, Random random) ++ + public int idDropped(int i, Random random, int j) { return blockID; } @@ -57,51 +59,49 @@ - { - return entityplayer.getCurrentPlayerStrVsBlock(this) / blockHardness / 30F; - } -+ return blockStrength(entityplayer,0); ++ return blockStrength(entityplayer,0); + } + + /* FORGE: This function returns the complete list of drops for a block. + */ + public ArrayList getBlockDropped(World world, -+ int i, int j, int k, int md) { -+ ArrayList tr=new ArrayList(); ++ int i, int j, int k, int md) { ++ ArrayList tr=new ArrayList(); + -+ int q=quantityDropped(md,world.rand); -+ for(int n=0; n0) { -+ tr.add(new ItemStack(id,1,damageDropped(md))); -+ } -+ } -+ return tr; ++ int q=quantityDropped(md,world.rand); ++ for(int n=0; n 0) { ++ tr.add(new ItemStack(id,1,damageDropped(md))); ++ } ++ } ++ return tr; } - public final void dropBlockAsItem(World world, int i, int j, int k, int l) -@@ -309,20 +328,12 @@ + public final void dropBlockAsItem(World world, int i, int j, int k, int l, int i1) +@@ -470,18 +489,13 @@ { return; } -- int i1 = quantityDropped(world.rand); -- for(int j1 = 0; j1 < i1; j1++) +- int j1 = func_40198_a(i1, world.rand); +- for(int k1 = 0; k1 < j1; k1++) - { -+ ArrayList ar=getBlockDropped(world,i,j,k,l); -+ for(ItemStack ist : ar) { ++ ArrayList ar = getBlockDropped(world,i,j,k,l); ++ for (ItemStack ist : ar) { if(world.rand.nextFloat() > f) -- { + { continue; -- } -- int k1 = idDropped(l, world.rand); -- if(k1 > 0) + } +- int l1 = idDropped(l, world.rand, i1); +- if(l1 > 0) - { -- dropBlockAsItem_do(world, i, j, k, new ItemStack(k1, 1, damageDropped(l))); +- dropBlockAsItem_do(world, i, j, k, new ItemStack(l1, 1, damageDropped(l))); - } -+ dropBlockAsItem_do(world, i, j, k, ist); ++ dropBlockAsItem_do(world, i, j, k, ist); } -- - } - protected void dropBlockAsItem_do(World world, int i, int j, int k, ItemStack itemstack) -@@ -618,6 +629,96 @@ + } +@@ -805,6 +819,96 @@ return iblockaccess.isBlockNormalCube(i, j, k) ? 0.2F : 1.0F; } diff --git a/forge/patches/minecraft/net/minecraft/src/BlockChest.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockChest.java.patch index 8c69a81af..bb69b0bc0 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockChest.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockChest.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -423,23 +423,23 @@ +@@ -429,23 +429,23 @@ { return true; } diff --git a/forge/patches/minecraft/net/minecraft/src/BlockCrops.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockCrops.java.patch index 2706d14e6..b1110702c 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockCrops.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockCrops.java.patch @@ -8,18 +8,27 @@ // Referenced classes of package net.minecraft.src: // BlockFlower, Block, World, EntityItem, -@@ -108,27 +109,16 @@ +@@ -108,28 +109,16 @@ return 6; } -- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f) +- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1) - { -- super.dropBlockAsItemWithChance(world, i, j, k, l, f); +- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0); - if(world.multiplayerWorld) - { - return; -- } -- for(int i1 = 0; i1 < 3; i1++) ++ public ArrayList getBlockDropped(World world, ++ int i, int j, int k, int md) { ++ ArrayList tr = new ArrayList(); ++ if (md == 7) tr.add(new ItemStack(Item.wheat)); ++ ++ for(int n = 0; n < 3; n++) { ++ if (world.rand.nextInt(15) <= md) ++ tr.add(new ItemStack(Item.seeds)); + } +- int j1 = 3 + i1; +- for(int k1 = 0; k1 < j1; k1++) - { - if(world.rand.nextInt(15) <= l) - { @@ -33,16 +42,7 @@ - } - } - -+ public ArrayList getBlockDropped(World world, -+ int i, int j, int k, int md) { -+ ArrayList tr=new ArrayList(); -+ if(md==7) tr.add(new ItemStack(Item.wheat)); -+ -+ for(int n=0; n<3; n++) { -+ if(world.rand.nextInt(15) <= md) -+ tr.add(new ItemStack(Item.seeds)); -+ } -+ return tr; ++ return tr; } - public int idDropped(int i, Random random) + public int idDropped(int i, Random random, int j) diff --git a/forge/patches/minecraft/net/minecraft/src/BlockDoor.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockDoor.java.patch index 11a54fb63..25ae0f794 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockDoor.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockDoor.java.patch @@ -18,7 +18,7 @@ { world.setBlockWithNotify(i, j, k, 0); flag = true; -@@ -242,7 +242,7 @@ +@@ -241,7 +241,7 @@ return false; } else { diff --git a/forge/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch index 16abd9ba8..ee190d8bc 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockPressurePlate.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -@@ -46,7 +46,8 @@ +@@ -48,7 +48,8 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -10,7 +10,7 @@ } public void onBlockAdded(World world, int i, int j, int k) -@@ -56,7 +57,8 @@ +@@ -58,7 +59,8 @@ public void onNeighborBlockChange(World world, int i, int j, int k, int l) { boolean flag = false; diff --git a/forge/patches/minecraft/net/minecraft/src/BlockRail.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockRail.java.patch index 2e26b4bb3..bb8acdb06 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockRail.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockRail.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -@@ -16,12 +16,12 @@ +@@ -18,12 +18,12 @@ public static final boolean isRailBlockAt(World world, int i, int j, int k) { int l = world.getBlockId(i, j, k); @@ -15,7 +15,7 @@ } protected BlockRail(int i, int j, boolean flag) -@@ -97,7 +97,7 @@ +@@ -99,7 +99,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -24,7 +24,7 @@ } public void onBlockAdded(World world, int i, int j, int k) -@@ -121,23 +121,23 @@ +@@ -123,23 +123,23 @@ j1 &= 7; } boolean flag = false; diff --git a/forge/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch index 488e9ef02..5325b2bd5 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockRedstoneRepeater.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -@@ -27,7 +27,7 @@ +@@ -35,7 +35,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -9,7 +9,7 @@ { return false; } else -@@ -38,7 +38,7 @@ +@@ -46,7 +46,7 @@ public boolean canBlockStay(World world, int i, int j, int k) { diff --git a/forge/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch index f0c5c3468..b71f3ce05 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockRedstoneWire.java.patch @@ -1,14 +1,15 @@ --- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 -@@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode - - package net.minecraft.src; -+import net.minecraft.src.forge.*; +@@ -6,6 +6,8 @@ import java.util.*; -@@ -53,7 +54,7 @@ ++import net.minecraft.src.forge.*; ++ + // Referenced classes of package net.minecraft.src: + // Block, Material, World, ChunkPosition, + // Item, IBlockAccess, Direction, AxisAlignedBB +@@ -56,7 +58,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -17,14 +18,14 @@ } private void updateAndPropagateCurrentStrength(World world, int i, int j, int k) -@@ -451,6 +452,10 @@ +@@ -454,6 +456,10 @@ { return false; } + if (Block.blocksList[i1] instanceof IConnectRedstone) { -+ IConnectRedstone icr = (IConnectRedstone) Block.blocksList[i1]; -+ return icr.canConnectRedstone(iblockaccess, i, j, k, l); ++ IConnectRedstone icr = (IConnectRedstone)Block.blocksList[i1]; ++ return icr.canConnectRedstone(iblockaccess, i, j, k, l); + } - if(Block.blocksList[i1].canProvidePower()) + if(Block.blocksList[i1].canProvidePower() && l != -1) { return true; diff --git a/forge/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch index d4750f520..4a8a12f6a 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockTallGrass.java.patch @@ -11,9 +11,9 @@ // Referenced classes of package net.minecraft.src: // BlockFlower, ColorizerGrass, ColorizerFoliage, IBlockAccess, -@@ -79,13 +82,17 @@ +@@ -73,13 +76,17 @@ - public int idDropped(int i, Random random) + public int idDropped(int i, Random random, int j) { - if(random.nextInt(8) == 0) - { @@ -35,4 +35,4 @@ + return tr; } - public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) + public int func_40198_a(int i, Random random) diff --git a/forge/patches/minecraft/net/minecraft/src/BlockTorch.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockTorch.java.patch index c3f031031..b481a8bf5 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockTorch.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockTorch.java.patch @@ -1,104 +1,107 @@ --- ../src_base/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -@@ -41,24 +41,24 @@ +@@ -41,7 +41,7 @@ private boolean func_31032_h(World world, int i, int j, int k) { -- return world.isBlockNormalCube(i, j, k) || world.getBlockId(i, j, k) == Block.fence.blockID; -+ return world.isBlockSolidOnSide(i, j, k,1) || world.getBlockId(i, j, k) == Block.fence.blockID; - } +- if(world.func_41082_b(i, j, k, true)) ++ if(world.isBlockSolidOnSide(i, j, k, 1)) + { + return true; + } else +@@ -53,19 +53,19 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { -- if(world.isBlockNormalCube(i - 1, j, k)) +- if(world.func_41082_b(i - 1, j, k, true)) + if(world.isBlockSolidOnSide(i - 1, j, k,5)) { return true; } -- if(world.isBlockNormalCube(i + 1, j, k)) +- if(world.func_41082_b(i + 1, j, k, true)) + if(world.isBlockSolidOnSide(i + 1, j, k,4)) { return true; } -- if(world.isBlockNormalCube(i, j, k - 1)) -+ if(world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(world.func_41082_b(i, j, k - 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k-1,3)) { return true; } -- if(world.isBlockNormalCube(i, j, k + 1)) -+ if(world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(world.func_41082_b(i, j, k + 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k+1,2)) { return true; } -@@ -72,19 +72,19 @@ +@@ -79,19 +79,19 @@ { i1 = 5; } -- if(l == 2 && world.isBlockNormalCube(i, j, k + 1)) -+ if(l == 2 && world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(l == 2 && world.func_41082_b(i, j, k + 1, true)) ++ if(l == 2 && world.isBlockSolidOnSide(i, j, k+1,2)) { i1 = 4; } -- if(l == 3 && world.isBlockNormalCube(i, j, k - 1)) -+ if(l == 3 && world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(l == 3 && world.func_41082_b(i, j, k - 1, true)) ++ if(l == 3 && world.isBlockSolidOnSide(i, j, k-1,3)) { i1 = 3; } -- if(l == 4 && world.isBlockNormalCube(i + 1, j, k)) +- if(l == 4 && world.func_41082_b(i + 1, j, k, true)) + if(l == 4 && world.isBlockSolidOnSide(i + 1, j, k,4)) { i1 = 2; } -- if(l == 5 && world.isBlockNormalCube(i - 1, j, k)) +- if(l == 5 && world.func_41082_b(i - 1, j, k, true)) + if(l == 5 && world.isBlockSolidOnSide(i - 1, j, k,5)) { i1 = 1; } -@@ -102,19 +102,19 @@ +@@ -109,19 +109,19 @@ public void onBlockAdded(World world, int i, int j, int k) { -- if(world.isBlockNormalCube(i - 1, j, k)) +- if(world.func_41082_b(i - 1, j, k, true)) + if(world.isBlockSolidOnSide(i - 1, j, k,5)) { world.setBlockMetadataWithNotify(i, j, k, 1); } else -- if(world.isBlockNormalCube(i + 1, j, k)) +- if(world.func_41082_b(i + 1, j, k, true)) + if(world.isBlockSolidOnSide(i + 1, j, k,4)) { world.setBlockMetadataWithNotify(i, j, k, 2); } else -- if(world.isBlockNormalCube(i, j, k - 1)) -+ if(world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(world.func_41082_b(i, j, k - 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k-1,3)) { world.setBlockMetadataWithNotify(i, j, k, 3); } else -- if(world.isBlockNormalCube(i, j, k + 1)) -+ if(world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(world.func_41082_b(i, j, k + 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k+1,2)) { world.setBlockMetadataWithNotify(i, j, k, 4); } else -@@ -131,19 +131,19 @@ +@@ -138,19 +138,19 @@ { int i1 = world.getBlockMetadata(i, j, k); boolean flag = false; -- if(!world.isBlockNormalCube(i - 1, j, k) && i1 == 1) +- if(!world.func_41082_b(i - 1, j, k, true) && i1 == 1) + if(!world.isBlockSolidOnSide(i - 1, j, k,5) && i1 == 1) { flag = true; } -- if(!world.isBlockNormalCube(i + 1, j, k) && i1 == 2) +- if(!world.func_41082_b(i + 1, j, k, true) && i1 == 2) + if(!world.isBlockSolidOnSide(i + 1, j, k,4) && i1 == 2) { flag = true; } -- if(!world.isBlockNormalCube(i, j, k - 1) && i1 == 3) -+ if(!world.isBlockSolidOnSide(i, j, k - 1,3) && i1 == 3) +- if(!world.func_41082_b(i, j, k - 1, true) && i1 == 3) ++ if(!world.isBlockSolidOnSide(i, j, k-1,3) && i1 == 3) { flag = true; } -- if(!world.isBlockNormalCube(i, j, k + 1) && i1 == 4) -+ if(!world.isBlockSolidOnSide(i, j, k + 1,2) && i1 == 4) +- if(!world.func_41082_b(i, j, k + 1, true) && i1 == 4) ++ if(!world.isBlockSolidOnSide(i, j, k+1,2) && i1 == 4) { flag = true; } diff --git a/forge/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch b/forge/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch index e3106e78e..2ab56b3c6 100644 --- a/forge/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/BlockTrapDoor.java.patch @@ -1,36 +1,51 @@ --- ../src_base/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -147,7 +147,7 @@ +@@ -11,7 +11,10 @@ + + public class BlockTrapDoor extends Block + { +- ++ /* FORGE: Set this to allow trapdoors to remain free-floating ++ */ ++ public static boolean disableValidation=false; ++ + protected BlockTrapDoor(int i, Material material) + { + super(i, material); +@@ -147,7 +150,7 @@ { j1--; } -- if(!world.isBlockNormalCube(j1, j, k1)) -+ if(!disableValidation && !world.isBlockSolidOnSide(j1, j, k1, (i1&3)+2)) +- if(!func_41052_f(world.getBlockId(j1, j, k1))) ++ if(!(func_41052_f(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1&3)+2))) { world.setBlockWithNotify(i, j, k, 0); - dropBlockAsItem(world, i, j, k, i1); -@@ -189,6 +189,7 @@ + dropBlockAsItem(world, i, j, k, i1, 0); +@@ -192,6 +195,7 @@ public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l) { -+ if(disableValidation) return true; ++ if(disableValidation) return true; if(l == 0) { return false; -@@ -213,11 +214,15 @@ +@@ -216,7 +220,7 @@ { i--; } -- return world.isBlockNormalCube(i, j, k); -+ return world.isBlockSolidOnSide(i, j, k, l); +- return func_41052_f(world.getBlockId(i, j, k)); ++ return func_41052_f(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l); } public static boolean isTrapdoorOpen(int i) +@@ -226,6 +230,10 @@ + + private static boolean func_41052_f(int i) { - return (i & 4) != 0; - } -+ -+ /* FORGE: Set this to allow trapdoors to remain free-floating -+ */ -+ public static boolean disableValidation=false; - } ++ if (disableValidation) ++ { ++ return true; ++ } + if(i <= 0) + { + return false; diff --git a/forge/patches/minecraft/net/minecraft/src/Chunk.java.patch b/forge/patches/minecraft/net/minecraft/src/Chunk.java.patch index 048c6b84d..799878f10 100644 --- a/forge/patches/minecraft/net/minecraft/src/Chunk.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Chunk.java.patch @@ -1,151 +1,22 @@ --- ../src_base/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.*; import java.io.PrintStream; import java.util.*; -@@ -26,7 +27,6 @@ - hasEntities = false; - lastSaveTime = 0L; - field_35846_u = false; -- world.getClass(); - entities = new List[128 / 16]; - worldObj = world; - xPosition = i; -@@ -44,11 +44,8 @@ - { - this(world, i, j); - blocks = abyte0; -- world.getClass(); - data = new NibbleArray(abyte0.length, 7); -- world.getClass(); - skylightMap = new NibbleArray(abyte0.length, 7); -- world.getClass(); - blocklightMap = new NibbleArray(abyte0.length, 7); - } - -@@ -68,16 +65,12 @@ - - public void generateHeightMap() - { -- worldObj.getClass(); - int i = 128 - 1; - for(int j = 0; j < 16; j++) - { - for(int k = 0; k < 16; k++) - { -- worldObj.getClass(); - int l = 128 - 1; -- worldObj.getClass(); -- worldObj.getClass(); - for(int i1 = j << 11 | k << 7; l > 0 && Block.lightOpacity[blocks[(i1 + l) - 1] & 0xff] == 0; l--) { } - heightMap[k << 4 | j] = (byte)l; - if(l < i) -@@ -94,16 +87,12 @@ - - public void generateSkylightMap() - { -- worldObj.getClass(); - int i = 128 - 1; - for(int j = 0; j < 16; j++) - { - for(int l = 0; l < 16; l++) - { -- worldObj.getClass(); - int j1 = 128 - 1; -- worldObj.getClass(); -- worldObj.getClass(); - int k1; - for(k1 = j << 11 | l << 7; j1 > 0 && Block.lightOpacity[blocks[(k1 + j1) - 1] & 0xff] == 0; j1--) { } - heightMap[l << 4 | j] = (byte)j1; -@@ -116,7 +105,6 @@ - continue; - } - int l1 = 15; -- worldObj.getClass(); - int i2 = 128 - 1; - do - { -@@ -154,7 +142,6 @@ - - private void func_35839_k() - { -- worldObj.getClass(); - if(worldObj.doChunksNearChunkExist(xPosition * 16 + 8, 128 / 2, zPosition * 16 + 8, 16)) - { - for(int i = 0; i < 16; i++) -@@ -216,7 +203,6 @@ - { - if(l > k) - { -- worldObj.getClass(); - if(worldObj.doChunksNearChunkExist(i, 128 / 2, j, 16)) - { - for(int i1 = k; i1 < l; i1++) -@@ -237,8 +223,6 @@ - { - i1 = j; - } -- worldObj.getClass(); -- worldObj.getClass(); - for(int j1 = i << 11 | k << 7; i1 > 0 && Block.lightOpacity[blocks[(j1 + i1) - 1] & 0xff] == 0; i1--) { } - if(i1 == l) - { -@@ -251,7 +235,6 @@ - lowestBlockHeight = i1; - } else - { -- worldObj.getClass(); - int k1 = 128 - 1; - for(int i2 = 0; i2 < 16; i2++) - { -@@ -320,8 +303,6 @@ - - public int getBlockID(int i, int j, int k) - { -- worldObj.getClass(); -- worldObj.getClass(); - return blocks[i << 11 | k << 7 | j] & 0xff; - } - -@@ -334,8 +315,6 @@ - precipitationHeightMap[j1] = -999; - } - int k1 = heightMap[k << 4 | i] & 0xff; -- worldObj.getClass(); -- worldObj.getClass(); - int l1 = blocks[i << 11 | k << 7 | j] & 0xff; - if(l1 == l && data.getNibble(i, j, k) == i1) - { -@@ -343,12 +322,18 @@ +@@ -348,6 +349,7 @@ } int i2 = xPosition * 16 + i; int j2 = zPosition * 16 + k; -- worldObj.getClass(); -- worldObj.getClass(); -+ -+ if (Block.blocksList[l1] instanceof IOverrideReplace) { -+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[l1]; -+ if (!iovr.canReplaceBlock(worldObj, i2, j, j2, l)) -+ return iovr.getReplacedSuccess(); -+ } -+ - blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); -- if(l1 != 0 && !worldObj.multiplayerWorld) -- { -- Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2); -+ if(l1 != 0) { -+ if(!worldObj.multiplayerWorld) -+ Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2); -+ removeChunkBlockTileEntity(i,j,k); - } - data.setNibble(i, j, k, i1); - if(!worldObj.worldProvider.hasNoSky) -@@ -380,7 +365,7 @@ ++ + blocks[i << worldObj.field_35471_b | k << worldObj.field_35473_a | j] = (byte)(byte0 & 0xff); + if(l1 != 0) + { +@@ -390,7 +392,7 @@ TileEntity tileentity = getChunkBlockTileEntity(i, j, k); if(tileentity == null) { @@ -154,7 +25,7 @@ worldObj.setBlockTileEntity(i, j, k, tileentity); } if(tileentity != null) -@@ -388,14 +373,6 @@ +@@ -398,14 +400,6 @@ tileentity.func_35144_b(); } } @@ -169,40 +40,22 @@ } isModified = true; return true; -@@ -410,8 +387,6 @@ - precipitationHeightMap[i1] = -999; - } - int j1 = heightMap[i1] & 0xff; -- worldObj.getClass(); -- worldObj.getClass(); - int k1 = blocks[i << 11 | k << 7 | j] & 0xff; - if(k1 == l) - { -@@ -419,12 +394,18 @@ +@@ -427,10 +421,13 @@ } int l1 = xPosition * 16 + i; int i2 = zPosition * 16 + k; -- worldObj.getClass(); -- worldObj.getClass(); + -+ if (Block.blocksList[k1] instanceof IOverrideReplace) { -+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[k1]; -+ if (!iovr.canReplaceBlock(worldObj, l1, j, i2, l)) -+ return iovr.getReplacedSuccess(); -+ } -+ - blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); -- if(k1 != 0) -- { + blocks[i << worldObj.field_35471_b | k << worldObj.field_35473_a | j] = (byte)(byte0 & 0xff); + if(k1 != 0) + { - Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); -+ if(k1 != 0) { -+ if(!worldObj.multiplayerWorld) -+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); -+ removeChunkBlockTileEntity(i,j,k); ++ if (!worldObj.multiplayerWorld) ++ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); ++ removeChunkBlockTileEntity(i, j, k); } data.setNibble(i, j, k, 0); if(Block.lightOpacity[byte0 & 0xff] != 0) -@@ -452,7 +433,7 @@ +@@ -458,7 +455,7 @@ TileEntity tileentity = getChunkBlockTileEntity(i, j, k); if(tileentity == null) { @@ -211,7 +64,7 @@ worldObj.setBlockTileEntity(i, j, k, tileentity); } if(tileentity != null) -@@ -460,14 +441,6 @@ +@@ -466,14 +463,6 @@ tileentity.func_35144_b(); } } @@ -226,7 +79,7 @@ } isModified = true; return true; -@@ -594,6 +567,11 @@ +@@ -609,6 +598,11 @@ { ChunkPosition chunkposition = new ChunkPosition(i, j, k); TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition); @@ -238,7 +91,7 @@ if(tileentity == null) { int l = getBlockID(i, j, k); -@@ -603,18 +581,23 @@ +@@ -618,18 +612,23 @@ } if(tileentity == null) { @@ -253,7 +106,7 @@ - chunkTileEntityMap.remove(chunkposition); - return null; - } else -+ return tileentity; ++ return tileentity; + } + + /* FORGE: Used to remove only invalid TileEntities */ @@ -264,12 +117,12 @@ { - return tileentity; + TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition); -+ if(tileentity!=null && tileentity.isInvalid()) -+ chunkTileEntityMap.remove(chunkposition); ++ if(tileentity != null && tileentity.isInvalid()) ++ chunkTileEntityMap.remove(chunkposition); } } -@@ -626,7 +609,7 @@ +@@ -641,7 +640,7 @@ setChunkBlockTileEntity(i, j, k, tileentity); if(isChunkLoaded) { @@ -278,65 +131,32 @@ } } -@@ -643,6 +626,8 @@ +@@ -657,6 +656,8 @@ return; } else { -+ TileEntity old=(TileEntity)chunkTileEntityMap.get(chunkposition); -+ if(old!=null) old.invalidate(); ++ TileEntity old = (TileEntity)chunkTileEntityMap.get(chunkposition); ++ if (old != null) old.invalidate(); tileentity.validate(); chunkTileEntityMap.put(chunkposition, tileentity); return; -@@ -773,12 +758,19 @@ +@@ -810,6 +811,15 @@ public int setChunkData(byte abyte0[], int i, int j, int k, int l, int i1, int j1, int k1) { -+ TileEntity te; -+ Iterator iterator = chunkTileEntityMap.values().iterator(); -+ while(iterator.hasNext()) { -+ te = (TileEntity)iterator.next(); -+ te.func_35144_b(); -+ te.getBlockMetadata(); -+ te.getBlockType(); -+ } -+ ++ TileEntity te; ++ Iterator iterator = chunkTileEntityMap.values().iterator(); ++ while (iterator.hasNext()){ ++ te = (TileEntity)iterator.next(); ++ te.func_35144_b(); ++ te.getBlockMetadata(); ++ te.getBlockType(); ++ } ++ for(int l1 = i; l1 < l; l1++) { for(int l2 = k; l2 < j1; l2++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int l3 = l1 << 11 | l2 << 7 | j; - int l4 = i1 - j; - System.arraycopy(abyte0, k1, blocks, l3, l4); -@@ -792,8 +784,6 @@ - { - for(int i3 = k; i3 < j1; i3++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int i4 = (i2 << 11 | i3 << 7 | j) >> 1; - int i5 = (i1 - j) / 2; - System.arraycopy(abyte0, k1, data.data, i4, i5); -@@ -806,8 +796,6 @@ - { - for(int j3 = k; j3 < j1; j3++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int j4 = (j2 << 11 | j3 << 7 | j) >> 1; - int j5 = (i1 - j) / 2; - System.arraycopy(abyte0, k1, blocklightMap.data, j4, j5); -@@ -820,8 +808,6 @@ - { - for(int k3 = k; k3 < j1; k3++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int k4 = (k2 << 11 | k3 << 7 | j) >> 1; - int k5 = (i1 - j) / 2; - System.arraycopy(abyte0, k1, skylightMap.data, k4, k5); -@@ -830,12 +816,25 @@ +@@ -859,12 +869,25 @@ } @@ -344,34 +164,26 @@ - for(Iterator iterator = chunkTileEntityMap.values().iterator(); iterator.hasNext(); tileentity.func_35144_b()) - { - tileentity = (TileEntity)iterator.next(); -+ List invalidList=new ArrayList(); -+ iterator = chunkTileEntityMap.values().iterator(); ++ List invalidList=new ArrayList(); ++ iterator = chunkTileEntityMap.values().iterator(); + while(iterator.hasNext()) { + te = (TileEntity)iterator.next(); -+ if( (te.xCoord&15)>=i && (te.xCoord&15)<=l && -+ te.yCoord>=j && te.yCoord<=i1 && -+ (te.zCoord&15)>=k && (te.zCoord&15)<=j1) { -+ -+ Block bl=te.getBlockType(); -+ if(bl!=null && bl.blockID== -+ worldObj.getBlockId(te.xCoord,te.yCoord,te.zCoord) && -+ te.getBlockMetadata()==worldObj.getBlockMetadata( -+ te.xCoord,te.yCoord,te.zCoord)) -+ continue; -+ invalidList.add(te); -+ } ++ if ((te.xCoord & 15) >= i && (te.xCoord & 15) <= l && ++ (te.yCoord >= j) && (te.yCoord <= i1) && ++ (te.zCoord & 15) >= k && (te.zCoord & 15) <=j1) { ++ ++ Block bl = te.getBlockType(); ++ if (bl != null && ++ bl.blockID == worldObj.getBlockId(te.xCoord, te.yCoord, te.zCoord) && ++ te.getBlockMetadata() == worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord)) ++ continue; ++ ++ invalidList.add(te); ++ } } - -+ for(TileEntity te2 : invalidList) -+ te2.invalidate(); ++ for(TileEntity te2 : invalidList) ++ te2.invalidate(); return k1; } -@@ -880,7 +879,6 @@ - int l = precipitationHeightMap[k]; - if(l == -999) - { -- worldObj.getClass(); - int i1 = 128 - 1; - for(l = -1; i1 > 0 && l == -1;) - { diff --git a/forge/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch b/forge/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch index c2be5a5e8..725eae27f 100644 --- a/forge/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EffectRenderer.java.patch @@ -8,9 +8,15 @@ +import net.minecraft.src.forge.ITextureProvider; + // Referenced classes of package net.minecraft.src: - // EntityFX, Entity, MathHelper, RenderEngine, - // Tessellator, Block, EntityDiggingFX, World -@@ -16,6 +19,7 @@ + // EntityFX, ActiveRenderInfo, Entity, RenderEngine, + // Tessellator, MathHelper, Block, EntityDiggingFX, +@@ -17,11 +20,13 @@ + + protected World worldObj; + private List fxLayers[]; ++ private List effectList; + private RenderEngine renderer; + private Random rand; public EffectRenderer(World world, RenderEngine renderengine) { @@ -18,7 +24,7 @@ fxLayers = new List[4]; rand = new Random(); if(world != null) -@@ -55,7 +59,18 @@ +@@ -61,7 +66,18 @@ } } @@ -38,7 +44,15 @@ } public void renderParticles(Entity entity, float f) -@@ -101,6 +116,21 @@ +@@ -100,6 +116,7 @@ + for(int k = 0; k < fxLayers[i].size(); k++) + { + EntityFX entityfx = (EntityFX)fxLayers[i].get(k); ++ if (entityfx instanceof EntityDiggingFX) continue; + tessellator.setBrightness(entityfx.getEntityBrightnessForRender(f)); + entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4); + } +@@ -107,6 +124,21 @@ tessellator.draw(); } @@ -60,7 +74,7 @@ } public void func_1187_b(Entity entity, float f) -@@ -132,7 +162,12 @@ +@@ -138,7 +170,12 @@ { fxLayers[i].clear(); } @@ -74,7 +88,7 @@ } public void addBlockDestroyEffects(int i, int j, int k, int l, int i1) -@@ -153,7 +188,12 @@ +@@ -159,7 +196,12 @@ double d1 = (double)j + ((double)l1 + 0.5D) / (double)j1; double d2 = (double)k + ((double)i2 + 0.5D) / (double)j1; int j2 = rand.nextInt(6); @@ -88,53 +102,44 @@ } } -@@ -198,16 +238,48 @@ +@@ -204,11 +246,39 @@ { d = (double)i + block.maxX + (double)f; } - addEffect((new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k))).func_4041_a(i, j, k).multiplyVelocity(0.2F).func_405_d(0.6F)); -+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2, -+ 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k)); -+ dig_effect.func_4041_a(i, j, k); -+ dig_effect.multiplyVelocity(0.2F); -+ dig_effect.func_405_d(0.6F); -+ addDigParticleEffect(dig_effect, block); ++ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k)); ++ dig_effect.func_4041_a(i, j, k); ++ dig_effect.multiplyVelocity(0.4F); ++ dig_effect.func_405_d(0.6F); ++ addDigParticleEffect(dig_effect, block); } public String getStatistics() { return (new StringBuilder()).append("").append(fxLayers[0].size() + fxLayers[1].size() + fxLayers[2].size()).toString(); } -+ ++ + public void addDigParticleEffect(EntityDiggingFX dig_effect, Block block) { -+ boolean added = false; -+ String comp; -+ -+ if (block instanceof ITextureProvider) { -+ comp = ((ITextureProvider) block).getTextureFile(); -+ } else { -+ comp = "/terrain.png"; -+ } -+ for (int x = 0; x < effectList.size(); x++) { -+ BlockTextureParticles entry = (BlockTextureParticles) effectList -+ .get(x); -+ if (entry.texture.equals(comp)) { -+ entry.effects.add(dig_effect); -+ added = true; -+ } -+ } -+ if (!added) { -+ BlockTextureParticles entry = new BlockTextureParticles(); -+ entry.texture = comp; -+ entry.effects.add(dig_effect); -+ effectList.add(entry); -+ } -+ addEffect(dig_effect); -+ } - - protected World worldObj; - private List fxLayers[]; -+ private List effectList; - private RenderEngine renderer; - private Random rand; ++ boolean added = false; ++ String comp = "/terrain.png"; ++ ++ if (block instanceof ITextureProvider) { ++ comp = ((ITextureProvider) block).getTextureFile(); ++ } ++ for (int x = 0; x < effectList.size(); x++) { ++ BlockTextureParticles entry = (BlockTextureParticles) effectList ++ .get(x); ++ if (entry.texture.equals(comp)) { ++ entry.effects.add(dig_effect); ++ added = true; ++ } ++ } ++ if (!added) { ++ BlockTextureParticles entry = new BlockTextureParticles(); ++ entry.texture = comp; ++ entry.effects.add(dig_effect); ++ effectList.add(entry); ++ } ++ addEffect(dig_effect); ++ } } diff --git a/forge/patches/minecraft/net/minecraft/src/EntityLiving.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityLiving.java.patch index 6e09fb385..c452466fb 100644 --- a/forge/patches/minecraft/net/minecraft/src/EntityLiving.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EntityLiving.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -@@ -624,7 +624,9 @@ +@@ -794,7 +794,9 @@ int i = MathHelper.floor_double(posX); int j = MathHelper.floor_double(boundingBox.minY); int k = MathHelper.floor_double(posZ); diff --git a/forge/patches/minecraft/net/minecraft/src/EntityPigZombie.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityPigZombie.java.patch index bc405e9e7..a6c3fc34c 100644 --- a/forge/patches/minecraft/net/minecraft/src/EntityPigZombie.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EntityPigZombie.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000 -@@ -90,7 +90,7 @@ +@@ -94,7 +94,7 @@ return super.attackEntityFrom(damagesource, i); } diff --git a/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch index 69367be2b..9235f34df 100644 --- a/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch @@ -11,7 +11,7 @@ import java.util.*; // Referenced classes of package net.minecraft.src: -@@ -485,6 +489,8 @@ +@@ -548,6 +552,8 @@ worldObj.entityJoinedWorld(entityitem); } @@ -20,8 +20,8 @@ public float getCurrentPlayerStrVsBlock(Block block) { float f = inventory.getStrVsBlock(block); -@@ -507,6 +513,32 @@ - return f; +@@ -576,6 +582,32 @@ + return f1; } + /* FORGE: Extended to allow metadata. @@ -53,7 +53,7 @@ public boolean canHarvestBlock(Block block) { return inventory.canHarvestBlock(block); -@@ -667,6 +699,25 @@ +@@ -774,6 +806,25 @@ protected void damageEntity(DamageSource damagesource, int i) { @@ -79,7 +79,7 @@ if(!damagesource.unblockable() && func_35162_ad()) { i = 1 + i >> 1; -@@ -720,7 +771,9 @@ +@@ -825,7 +876,9 @@ public void destroyCurrentEquippedItem() { @@ -89,7 +89,7 @@ } public double getYOffset() -@@ -815,6 +868,10 @@ +@@ -957,6 +1010,10 @@ public EnumStatus sleepInBedAt(int i, int j, int k) { diff --git a/forge/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch index 852e81407..c72429ad2 100644 --- a/forge/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EntityRenderer.java.patch @@ -8,29 +8,29 @@ import java.awt.image.BufferedImage; import java.nio.FloatBuffer; import java.util.Random; -@@ -803,8 +804,12 @@ - { +@@ -916,8 +917,10 @@ EntityPlayer entityplayer = (EntityPlayer)entityliving; GL11.glDisable(3008 /*GL_ALPHA_TEST*/); -+ if(!ForgeHooksClient.onBlockHighlight(renderglobal,entityplayer, -+ mc.objectMouseOver,0, -+ entityplayer.inventory.getCurrentItem(),f)) { - renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); - renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); -+ } + Profiler.endStartSection("outline"); +- renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); +- renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); ++ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f)) { ++ renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); ++ renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f); ++ } GL11.glEnable(3008 /*GL_ALPHA_TEST*/); } } -@@ -853,8 +858,12 @@ - { +@@ -969,8 +972,10 @@ EntityPlayer entityplayer1 = (EntityPlayer)entityliving; GL11.glDisable(3008 /*GL_ALPHA_TEST*/); -+ if(!ForgeHooksClient.onBlockHighlight(renderglobal,entityplayer1, -+ mc.objectMouseOver,0, -+ entityplayer1.inventory.getCurrentItem(),f)) { - renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); - renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); -+ } + Profiler.endStartSection("outline"); +- renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); +- renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); ++ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f)) { ++ renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); ++ renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f); ++ } GL11.glEnable(3008 /*GL_ALPHA_TEST*/); } - renderRainSnow(f); + Profiler.endStartSection("weather"); diff --git a/forge/patches/minecraft/net/minecraft/src/Explosion.java.patch b/forge/patches/minecraft/net/minecraft/src/Explosion.java.patch index bb54fe948..7c84bd964 100644 --- a/forge/patches/minecraft/net/minecraft/src/Explosion.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Explosion.java.patch @@ -8,22 +8,19 @@ // Referenced classes of package net.minecraft.src: // World, MathHelper, Block, ChunkPosition, -@@ -66,7 +67,17 @@ - int i5 = worldObj.getBlockId(j4, k4, l4); - if(i5 > 0) +@@ -76,7 +77,14 @@ + int k3 = worldObj.getBlockId(l2, i3, j3); + if(k3 > 0) { -- f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; -+ if (Block.blocksList[i5] instanceof ISpecialResistance) { -+ ISpecialResistance isr = (ISpecialResistance) Block.blocksList[i5]; -+ f1 -= (isr.getSpecialExplosionResistance( -+ worldObj, j4, k4, l4, explosionX, -+ explosionY, explosionZ, exploder) + 0.3F) -+ * f2; +- f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2; ++ if (Block.blocksList[k3] instanceof ISpecialResistance){ ++ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[k3]; ++ f1 -= (isr.getSpecialExplosionResistance(worldObj, l2, i3, j3, ++ explosionX, explosionY, explosionZ, exploder) + 0.3F) * f2; + } else { -+ f1 -= (Block.blocksList[i5] -+ .getExplosionResistance(exploder) + 0.3F) -+ * f2; ++ f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2; + } ++ } if(f1 > 0.0F) { diff --git a/forge/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch b/forge/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch index b8a98fc45..fd30ce5e8 100644 --- a/forge/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/FurnaceRecipes.java.patch @@ -8,7 +8,15 @@ // Referenced classes of package net.minecraft.src: // Block, ItemStack, Item -@@ -21,6 +22,7 @@ +@@ -15,6 +16,7 @@ + + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + private Map smeltingList; ++ private Map metaSmeltingList; + + public static final FurnaceRecipes smelting() + { +@@ -24,6 +26,7 @@ private FurnaceRecipes() { smeltingList = new HashMap(); @@ -16,7 +24,7 @@ addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron)); addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold)); addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond)); -@@ -40,11 +42,32 @@ +@@ -46,11 +49,32 @@ smeltingList.put(Integer.valueOf(i), itemstack); } @@ -49,10 +57,3 @@ public Map getSmeltingList() { return smeltingList; -@@ -52,5 +75,6 @@ - - private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); - private Map smeltingList; -+ private Map metaSmeltingList; - - } diff --git a/forge/patches/minecraft/net/minecraft/src/Item.java.patch b/forge/patches/minecraft/net/minecraft/src/Item.java.patch index 664d38244..ce763e57f 100644 --- a/forge/patches/minecraft/net/minecraft/src/Item.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Item.java.patch @@ -1,6 +1,16 @@ --- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -@@ -76,6 +76,13 @@ +@@ -177,6 +177,9 @@ + private String field_39010_c; + private String itemName; + ++ // FORGE: To disable repair recipes. ++ protected boolean canRepair=true; ++ + protected Item(int i) + { + maxStackSize = 64; +@@ -231,6 +234,13 @@ return 1.0F; } @@ -14,3 +24,23 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { return itemstack; +@@ -278,6 +288,19 @@ + return maxDamage > 0 && !hasSubtypes; + } + ++ /* FORGE: Called by CraftingManager to determine if an item is repairable. ++ */ ++ public boolean isRepairable() { ++ return canRepair && isDamageable(); ++ } ++ ++ /* FORGE: Call to disable repair recipes. ++ */ ++ public Item setNoRepair() { ++ canRepair=false; ++ return this; ++ } ++ + public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) + { + return false; diff --git a/forge/patches/minecraft/net/minecraft/src/ItemBucket.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemBucket.java.patch index 251d86ec2..73d2c99a0 100644 --- a/forge/patches/minecraft/net/minecraft/src/ItemBucket.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ItemBucket.java.patch @@ -7,9 +7,9 @@ +import net.minecraft.src.forge.MinecraftForge; + // Referenced classes of package net.minecraft.src: - // Item, EntityPlayer, Vec3D, MathHelper, - // World, MovingObjectPosition, EnumMovingObjectType, Material, -@@ -60,6 +62,11 @@ + // Item, EntityPlayer, MovingObjectPosition, EnumMovingObjectType, + // World, Material, PlayerCapabilities, ItemStack, +@@ -50,6 +52,11 @@ { return itemstack; } diff --git a/forge/patches/minecraft/net/minecraft/src/ItemDye.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemDye.java.patch index 66e7f77ee..d78e4dea6 100644 --- a/forge/patches/minecraft/net/minecraft/src/ItemDye.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ItemDye.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.ForgeHooks; import java.util.Random; -@@ -35,13 +36,18 @@ +@@ -45,13 +46,18 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) { @@ -28,7 +28,7 @@ if(i1 == Block.sapling.blockID) { if(!world.multiplayerWorld) -@@ -108,13 +114,7 @@ +@@ -118,13 +124,7 @@ world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1); continue; } diff --git a/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch index 3bcb926ab..bd6528e6e 100644 --- a/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch @@ -9,10 +9,10 @@ +import net.minecraft.src.forge.MinecraftForgeClient; + import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL13; -@@ -32,18 +36,27 @@ - public void renderItem(EntityLiving entityliving, ItemStack itemstack) + // Referenced classes of package net.minecraft.src: +@@ -40,18 +44,27 @@ + public void renderItem(EntityLiving entityliving, ItemStack itemstack, int i) { GL11.glPushMatrix(); - if(itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) @@ -39,4 +39,4 @@ + ForgeHooksClient.overrideTexture (Item.itemsList[itemstack.itemID]); } Tessellator tessellator = Tessellator.instance; - int i = entityliving.getItemIcon(itemstack); + int j = entityliving.getItemIcon(itemstack, i); diff --git a/forge/patches/minecraft/net/minecraft/src/ItemTool.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemTool.java.patch index ba4765bcb..335ee7537 100644 --- a/forge/patches/minecraft/net/minecraft/src/ItemTool.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ItemTool.java.patch @@ -9,7 +9,18 @@ // Referenced classes of package net.minecraft.src: // Item, EnumToolMaterial, ItemStack, Block, -@@ -37,6 +39,14 @@ +@@ -13,8 +15,8 @@ + { + + private Block blocksEffectiveAgainst[]; +- protected float efficiencyOnProperMaterial; +- private int damageVsEntity; ++ public float efficiencyOnProperMaterial; ++ public int damageVsEntity; + protected EnumToolMaterial toolMaterial; + + protected ItemTool(int i, int j, EnumToolMaterial enumtoolmaterial, Block ablock[]) +@@ -42,6 +44,14 @@ return 1.0F; } @@ -24,13 +35,3 @@ public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { itemstack.damageItem(2, entityliving1); -@@ -60,7 +70,7 @@ - } - - private Block blocksEffectiveAgainst[]; -- private float efficiencyOnProperMaterial; -- private int damageVsEntity; -+ public float efficiencyOnProperMaterial; -+ public int damageVsEntity; - protected EnumToolMaterial toolMaterial; - } diff --git a/forge/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch b/forge/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch index 49a2ac24d..24926d754 100644 --- a/forge/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/MovingObjectPosition.java.patch @@ -1,10 +1,12 @@ --- ../src_base/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -@@ -35,4 +35,7 @@ +@@ -18,6 +18,9 @@ public int sideHit; public Vec3D hitVec; public Entity entityHit; -+ -+ // Added for RedPower subblocks. -+ public int subHit=-1; - } ++ ++ //Added for RedPower subblocks ++ public int subHit = -1; + + public MovingObjectPosition(int i, int j, int k, int l, Vec3D vec3d) + { diff --git a/forge/patches/minecraft/net/minecraft/src/Packet100OpenWindow.java.patch b/forge/patches/minecraft/net/minecraft/src/Packet100OpenWindow.java.patch index fc3f841a2..ca03dd7a4 100644 --- a/forge/patches/minecraft/net/minecraft/src/Packet100OpenWindow.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Packet100OpenWindow.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/Packet100OpenWindow.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Packet100OpenWindow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -25,9 +25,9 @@ +@@ -30,9 +30,9 @@ throws IOException { windowId = datainputstream.readByte(); diff --git a/forge/patches/minecraft/net/minecraft/src/Packet230ModLoader.java.patch b/forge/patches/minecraft/net/minecraft/src/Packet230ModLoader.java.patch index 216de77ab..f9034a6fa 100644 --- a/forge/patches/minecraft/net/minecraft/src/Packet230ModLoader.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Packet230ModLoader.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000 -@@ -68,7 +68,10 @@ +@@ -75,7 +75,10 @@ })); } byte abyte0[] = new byte[k1]; diff --git a/forge/patches/minecraft/net/minecraft/src/Packet24MobSpawn.java.patch b/forge/patches/minecraft/net/minecraft/src/Packet24MobSpawn.java.patch index add364620..4a9e792aa 100644 --- a/forge/patches/minecraft/net/minecraft/src/Packet24MobSpawn.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Packet24MobSpawn.java.patch @@ -1,16 +1,7 @@ --- ../src_base/minecraft/net/minecraft/src/Packet24MobSpawn.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/Packet24MobSpawn.java 0000-00-00 00:00:00.000000000 -0000 -@@ -34,7 +34,7 @@ - throws IOException - { - entityId = datainputstream.readInt(); -- type = datainputstream.readByte(); -+ type = datainputstream.readByte()&0xFF; - xPosition = datainputstream.readInt(); - yPosition = datainputstream.readInt(); - zPosition = datainputstream.readInt(); -@@ -72,7 +72,7 @@ - } +@@ -15,7 +15,7 @@ + { public int entityId; - public byte type; @@ -18,3 +9,12 @@ public int xPosition; public int yPosition; public int zPosition; +@@ -44,7 +44,7 @@ + throws IOException + { + entityId = datainputstream.readInt(); +- type = datainputstream.readByte(); ++ type = datainputstream.readByte() & 0xFF; + xPosition = datainputstream.readInt(); + yPosition = datainputstream.readInt(); + zPosition = datainputstream.readInt(); diff --git a/forge/patches/minecraft/net/minecraft/src/PlayerController.java.patch b/forge/patches/minecraft/net/minecraft/src/PlayerController.java.patch index 508e56f21..2625946f0 100644 --- a/forge/patches/minecraft/net/minecraft/src/PlayerController.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/PlayerController.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft/net/minecraft/src/PlayerController.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.*; import net.minecraft.client.Minecraft; -@@ -36,12 +37,11 @@ +@@ -39,11 +40,10 @@ } world.playAuxSFX(2001, i, j, k, block.blockID + world.getBlockMetadata(i, j, k) * 256); int i1 = world.getBlockMetadata(i, j, k); @@ -17,16 +17,14 @@ - { - block.onBlockDestroyedByPlayer(world, i, j, k, i1); - } -- return flag; + -+ if(block==null) return false; -+ boolean flag = block.removeBlockByPlayer(world,mc.thePlayer,i,j,k); -+ if(flag) block.onBlockDestroyedByPlayer(world, i, j, k, i1); -+ return flag; ++ boolean flag = block.removeBlockByPlayer(world, mc.thePlayer, i, j, k); ++ if(flag) ++ block.onBlockDestroyedByPlayer(world, i, j, k, i1); + return flag; } - public abstract void sendBlockRemoving(int i, int j, int k, int l); -@@ -64,6 +64,7 @@ +@@ -67,6 +67,7 @@ if(itemstack1.stackSize == 0) { entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null; diff --git a/forge/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch b/forge/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch index c78999f82..ed72c6fae 100644 --- a/forge/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/PlayerControllerMP.java.patch @@ -10,7 +10,7 @@ import net.minecraft.client.Minecraft; // Referenced classes of package net.minecraft.src: -@@ -91,7 +94,7 @@ +@@ -103,7 +106,7 @@ { Block.blocksList[i1].onBlockClicked(mc.theWorld, i, j, k, mc.thePlayer); } @@ -19,7 +19,7 @@ { sendBlockRemoved(i, j, k, l); } else -@@ -137,7 +140,7 @@ +@@ -149,7 +152,7 @@ return; } Block block = Block.blocksList[i1]; @@ -28,7 +28,7 @@ if(stepSoundTickCounter % 4F == 0.0F && block != null) { mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F); -@@ -204,6 +207,13 @@ +@@ -216,6 +219,13 @@ { syncCurrentPlayItem(); netClientHandler.addToSendQueue(new Packet15Place(i, j, k, l, entityplayer.inventory.getCurrentItem())); @@ -42,7 +42,7 @@ int i1 = world.getBlockId(i, j, k); if(i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer)) { -@@ -223,7 +233,11 @@ +@@ -235,7 +245,11 @@ return flag; } else { diff --git a/forge/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch b/forge/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch index 2bbbf8121..91ada64c4 100644 --- a/forge/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/PlayerControllerSP.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/src/PlayerControllerSP.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/PlayerControllerSP.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,8 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.IUseItemFirst; @@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft; -@@ -42,7 +44,7 @@ +@@ -50,7 +52,7 @@ int j1 = mc.theWorld.getBlockMetadata(i, j, k); boolean flag = super.sendBlockRemoved(i, j, k, l); ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem(); @@ -18,7 +18,7 @@ if(itemstack != null) { itemstack.onDestroyBlock(i1, i, j, k, mc.thePlayer); -@@ -71,7 +73,7 @@ +@@ -79,7 +81,7 @@ { Block.blocksList[i1].onBlockClicked(mc.theWorld, i, j, k, mc.thePlayer); } @@ -27,7 +27,7 @@ { sendBlockRemoved(i, j, k, l); } -@@ -102,7 +104,7 @@ +@@ -110,7 +112,7 @@ return; } Block block = Block.blocksList[i1]; @@ -36,7 +36,7 @@ if(field_1069_h % 4F == 0.0F && block != null) { mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F); -@@ -165,6 +167,12 @@ +@@ -173,6 +175,12 @@ public boolean sendPlaceBlock(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l) { @@ -49,7 +49,7 @@ int i1 = world.getBlockId(i, j, k); if(i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer)) { -@@ -175,7 +183,11 @@ +@@ -183,7 +191,11 @@ return false; } else { diff --git a/forge/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch index f7f78623c..01495bb6d 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderBlocks.java.patch @@ -1,42 +1,42 @@ --- ../src_base/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000 -@@ -2980,7 +2980,7 @@ +@@ -3301,7 +3301,7 @@ colorBlueTopRight *= f27; - int j2 = block.getBlockTexture(blockAccess, i, j, k, 2); - renderEastFace(block, i, j, k, j2); -- if(cfgGrassFix && j2 == 3 && overrideBlockTexture < 0) -+ if(Tessellator.instance.defaultTexture && cfgGrassFix && j2 == 3 && overrideBlockTexture < 0) - { - colorRedTopLeft *= f; - colorRedBottomLeft *= f; -@@ -3085,7 +3085,7 @@ - colorBlueTopRight *= f28; - int k2 = block.getBlockTexture(blockAccess, i, j, k, 3); - renderWestFace(block, i, j, k, block.getBlockTexture(blockAccess, i, j, k, 3)); + int k2 = block.getBlockTexture(blockAccess, i, j, k, 2); + renderEastFace(block, i, j, k, k2); - if(cfgGrassFix && k2 == 3 && overrideBlockTexture < 0) + if(Tessellator.instance.defaultTexture && cfgGrassFix && k2 == 3 && overrideBlockTexture < 0) { colorRedTopLeft *= f; colorRedBottomLeft *= f; -@@ -3190,7 +3190,7 @@ - colorBlueTopRight *= f29; - int l2 = block.getBlockTexture(blockAccess, i, j, k, 4); - renderNorthFace(block, i, j, k, l2); +@@ -3412,7 +3412,7 @@ + colorBlueTopRight *= f28; + int l2 = block.getBlockTexture(blockAccess, i, j, k, 3); + renderWestFace(block, i, j, k, block.getBlockTexture(blockAccess, i, j, k, 3)); - if(cfgGrassFix && l2 == 3 && overrideBlockTexture < 0) + if(Tessellator.instance.defaultTexture && cfgGrassFix && l2 == 3 && overrideBlockTexture < 0) { colorRedTopLeft *= f; colorRedBottomLeft *= f; -@@ -3295,7 +3295,7 @@ - colorBlueTopRight *= f30; - int i3 = block.getBlockTexture(blockAccess, i, j, k, 5); - renderSouthFace(block, i, j, k, i3); +@@ -3523,7 +3523,7 @@ + colorBlueTopRight *= f29; + int i3 = block.getBlockTexture(blockAccess, i, j, k, 4); + renderNorthFace(block, i, j, k, i3); - if(cfgGrassFix && i3 == 3 && overrideBlockTexture < 0) + if(Tessellator.instance.defaultTexture && cfgGrassFix && i3 == 3 && overrideBlockTexture < 0) { colorRedTopLeft *= f; colorRedBottomLeft *= f; -@@ -3388,7 +3388,7 @@ +@@ -3634,7 +3634,7 @@ + colorBlueTopRight *= f30; + int j3 = block.getBlockTexture(blockAccess, i, j, k, 5); + renderSouthFace(block, i, j, k, j3); +- if(cfgGrassFix && j3 == 3 && overrideBlockTexture < 0) ++ if(Tessellator.instance.defaultTexture && cfgGrassFix && j3 == 3 && overrideBlockTexture < 0) + { + colorRedTopLeft *= f; + colorRedBottomLeft *= f; +@@ -3727,7 +3727,7 @@ tessellator.setColorOpaque_F(f11, f14, f17); int i1 = block.getBlockTexture(blockAccess, i, j, k, 2); renderEastFace(block, i, j, k, i1); @@ -45,7 +45,7 @@ { tessellator.setColorOpaque_F(f11 * f, f14 * f1, f17 * f2); renderEastFace(block, i, j, k, 38); -@@ -3401,7 +3401,7 @@ +@@ -3740,7 +3740,7 @@ tessellator.setColorOpaque_F(f11, f14, f17); int j1 = block.getBlockTexture(blockAccess, i, j, k, 3); renderWestFace(block, i, j, k, j1); @@ -54,7 +54,7 @@ { tessellator.setColorOpaque_F(f11 * f, f14 * f1, f17 * f2); renderWestFace(block, i, j, k, 38); -@@ -3414,7 +3414,7 @@ +@@ -3753,7 +3753,7 @@ tessellator.setColorOpaque_F(f12, f15, f18); int k1 = block.getBlockTexture(blockAccess, i, j, k, 4); renderNorthFace(block, i, j, k, k1); @@ -63,7 +63,7 @@ { tessellator.setColorOpaque_F(f12 * f, f15 * f1, f18 * f2); renderNorthFace(block, i, j, k, 38); -@@ -3427,7 +3427,7 @@ +@@ -3766,7 +3766,7 @@ tessellator.setColorOpaque_F(f12, f15, f18); int l1 = block.getBlockTexture(blockAccess, i, j, k, 5); renderSouthFace(block, i, j, k, l1); diff --git a/forge/patches/minecraft/net/minecraft/src/RenderEngine.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderEngine.java.patch index eb2044e7c..3f43dc663 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderEngine.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderEngine.java.patch @@ -1,16 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000 -@@ -128,6 +128,9 @@ - } - try - { -+ if(Tessellator.renderingWorldRenderer) { -+ System.out.printf("Warning: Texture %s not preloaded, will cause render glitches!\n",s); -+ } - singleIntBuffer.clear(); - GLAllocation.generateTextureNames(singleIntBuffer); - int i = singleIntBuffer.get(0); -@@ -667,7 +670,7 @@ +@@ -39,7 +39,7 @@ private GameSettings options; public boolean clampTexture; public boolean blurTexture; @@ -18,4 +8,14 @@ + public TexturePackList texturePack; private BufferedImage missingTextureImage; - } + public RenderEngine(TexturePackList texturepacklist, GameSettings gamesettings) +@@ -142,6 +142,9 @@ + } + try + { ++ if(Tessellator.renderingWorldRenderer) { ++ System.out.printf("Warning: Texture %s not preloaded, will cause render glitches!\n",s); ++ } + singleIntBuffer.clear(); + GLAllocation.generateTextureNames(singleIntBuffer); + int i = singleIntBuffer.get(0); diff --git a/forge/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch index dfade4d45..8bfcdc2b2 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderGlobal.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000 -@@ -1635,8 +1635,8 @@ - } +@@ -34,8 +34,8 @@ + { public List tileEntities; - private World worldObj; @@ -11,7 +11,7 @@ private List worldRenderersToUpdate; private WorldRenderer sortedWorldRenderers[]; private WorldRenderer worldRenderers[]; -@@ -1644,8 +1644,8 @@ +@@ -43,8 +43,8 @@ private int renderChunksTall; private int renderChunksDeep; private int glRenderListBase; diff --git a/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch index f0d2249f2..cbd909181 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch @@ -11,7 +11,7 @@ import java.util.Random; import org.lwjgl.opengl.GL11; -@@ -47,10 +51,36 @@ +@@ -54,10 +58,36 @@ } GL11.glTranslatef((float)d, (float)d1 + f2, (float)d2); GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); @@ -49,7 +49,7 @@ float f4 = 0.25F; int j = Block.blocksList[itemstack.itemID].getRenderType(); if(j == 1 || j == 19 || j == 12 || j == 2) -@@ -80,9 +110,11 @@ +@@ -108,9 +138,11 @@ if(itemstack.itemID < 256) { loadTexture("/terrain.png"); @@ -59,9 +59,9 @@ loadTexture("/gui/items.png"); + ForgeHooksClient.overrideTexture(Item.itemsList[itemstack.itemID]); } - Tessellator tessellator = Tessellator.instance; - float f5 = (float)((i % 16) * 16 + 0) / 256F; -@@ -129,10 +161,37 @@ + if(field_27004_a) + { +@@ -162,10 +194,37 @@ public void drawItemIntoGui(FontRenderer fontrenderer, RenderEngine renderengine, int i, int j, int k, int l, int i1) { @@ -99,8 +99,8 @@ + ForgeHooksClient.overrideTexture (Block.blocksList[i]); Block block = Block.blocksList[j1]; GL11.glPushMatrix(); - GL11.glTranslatef(l - 2, i1 + 3, -3F); -@@ -161,9 +220,11 @@ + GL11.glTranslatef(l - 2, i1 + 3, -3F + field_40268_b); +@@ -215,9 +274,11 @@ if(i < 256) { renderengine.bindTexture(renderengine.getTexture("/terrain.png")); diff --git a/forge/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch index 50669f71c..d38d3eda7 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderPlayer.java.patch @@ -8,7 +8,7 @@ import net.minecraft.client.Minecraft; import org.lwjgl.opengl.GL11; -@@ -34,7 +35,14 @@ +@@ -41,7 +42,14 @@ if(item instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; diff --git a/forge/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch b/forge/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch index fabc12a24..38f04d361 100644 --- a/forge/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/SlotCrafting.java.patch @@ -1,18 +1,18 @@ --- ../src_base/minecraft/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.ForgeHooks; // Referenced classes of package net.minecraft.src: -@@ -60,6 +61,7 @@ - thePlayer.addStat(AchievementList.buildSword, 1); +@@ -71,6 +72,7 @@ + thePlayer.addStat(AchievementList.bookcase, 1); } ModLoader.TakenFromCrafting(thePlayer, itemstack, craftMatrix); -+ ForgeHooks.onTakenFromCrafting(thePlayer, itemstack, craftMatrix); ++ ForgeHooks.onTakenFromCrafting(thePlayer, itemstack, craftMatrix); for(int i = 0; i < craftMatrix.getSizeInventory(); i++) { ItemStack itemstack1 = craftMatrix.getStackInSlot(i); diff --git a/forge/patches/minecraft/net/minecraft/src/Tessellator.java.patch b/forge/patches/minecraft/net/minecraft/src/Tessellator.java.patch index 6d52526c8..1829b728d 100644 --- a/forge/patches/minecraft/net/minecraft/src/Tessellator.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Tessellator.java.patch @@ -8,9 +8,74 @@ import org.lwjgl.opengl.*; // Referenced classes of package net.minecraft.src: -@@ -13,8 +14,7 @@ +@@ -12,13 +13,9 @@ + public class Tessellator { +- + private static boolean convertQuadsToTriangles = false; + private static boolean tryVBO = false; +- private ByteBuffer byteBuffer; +- private IntBuffer intBuffer; +- private FloatBuffer floatBuffer; +- private ShortBuffer shortBuffer; ++ private static boolean useVBO = false; + private int rawBuffer[]; + private int vertexCount; + private double textureU; +@@ -32,21 +29,47 @@ + private int rawBufferIndex; + private int addedVertices; + private boolean isColorDisabled; +- private int drawMode; +- private double xOffset; +- private double yOffset; +- private double zOffset; ++ public int drawMode; ++ public double xOffset; ++ public double yOffset; ++ public double zOffset; + private int normal; +- public static final Tessellator instance = new Tessellator(0x200000); +- private boolean isDrawing; +- private boolean useVBO; +- private IntBuffer vertexBuffers; ++ public boolean isDrawing; + private int vboIndex; +- private int vboCount; +- private int bufferSize; ++ ++ public static boolean renderingWorldRenderer=false; ++ public boolean defaultTexture=false; ++ private int rawBufferSize; ++ private static int vboCount; ++ private static IntBuffer vertexBuffers; ++ private static int nativeBufferSize; ++ private static int trivertsInBuffer; ++ private static ByteBuffer byteBuffer; ++ private static IntBuffer intBuffer; ++ private static FloatBuffer floatBuffer; ++ private static ShortBuffer shortBuffer; ++ public static Tessellator instance; ++ ++ static { ++ instance=new Tessellator(); ++ instance.defaultTexture=true; ++ ++ nativeBufferSize = 0x200000; ++ trivertsInBuffer = (nativeBufferSize/48)*6; ++ byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); ++ intBuffer = byteBuffer.asIntBuffer(); ++ floatBuffer = byteBuffer.asFloatBuffer(); ++ shortBuffer = byteBuffer.asShortBuffer(); ++ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; ++ vboCount = 10; ++ if(useVBO) ++ { ++ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); ++ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); ++ } ++ } - private Tessellator(int i) - { @@ -18,7 +83,7 @@ vertexCount = 0; hasColor = false; hasTexture = false; -@@ -24,21 +24,10 @@ +@@ -56,21 +79,10 @@ addedVertices = 0; isColorDisabled = false; isDrawing = false; @@ -38,12 +103,12 @@ - ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); - } + -+ rawBuffer=null; -+ rawBufferSize=0; ++ rawBuffer=null; ++ rawBufferSize=0; } - public void draw() -@@ -48,12 +37,20 @@ + public int draw() +@@ -80,12 +92,20 @@ throw new IllegalStateException("Not tesselating!"); } isDrawing = false; @@ -68,7 +133,7 @@ if(useVBO) { vboIndex = (vboIndex + 1) % vboCount; -@@ -121,10 +118,10 @@ +@@ -153,10 +173,10 @@ GL11.glEnableClientState(32884 /*GL_VERTEX_ARRAY_EXT*/); if(drawMode == 7 && convertQuadsToTriangles) { @@ -81,34 +146,34 @@ } GL11.glDisableClientState(32884 /*GL_VERTEX_ARRAY_EXT*/); if(hasTexture) -@@ -146,6 +143,10 @@ +@@ -178,6 +198,10 @@ GL11.glDisableClientState(32885 /*GL_NORMAL_ARRAY_EXT*/); } } -+ if(rawBufferSize>0x20000 && rawBufferIndex<(rawBufferSize<<3)) { -+ rawBufferSize=0; -+ rawBuffer=null; -+ } ++ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize<<3)) { ++ rawBufferSize=0; ++ rawBuffer=null; ++ } + int i = rawBufferIndex * 4; reset(); - } - -@@ -265,6 +266,15 @@ + return i; +@@ -299,6 +323,15 @@ public void addVertex(double d, double d1, double d2) { -+ if(rawBufferIndex >= rawBufferSize-32) { -+ if(rawBufferSize==0) { -+ rawBufferSize=0x10000; -+ rawBuffer=new int[rawBufferSize]; -+ } else { -+ rawBufferSize*=2; -+ rawBuffer=Arrays.copyOf(rawBuffer,rawBufferSize); ++ if (rawBufferIndex >= rawBufferSize-32) { ++ if (rawBufferSize == 0) { ++ rawBufferSize = 0x10000; ++ rawBuffer = new int[rawBufferSize]; ++ } else { ++ rawBufferSize *= 2; ++ rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize); ++ } + } -+ } addedVertices++; if(drawMode == 7 && convertQuadsToTriangles && addedVertices % 4 == 0) { -@@ -314,11 +324,6 @@ +@@ -348,11 +381,6 @@ rawBuffer[rawBufferIndex + 2] = Float.floatToRawIntBits((float)(d2 + zOffset)); rawBufferIndex += 8; vertexCount++; @@ -120,69 +185,3 @@ } public void setColorOpaque_I(int i) -@@ -367,10 +372,7 @@ - - private static boolean convertQuadsToTriangles = false; - private static boolean tryVBO = false; -- private ByteBuffer byteBuffer; -- private IntBuffer intBuffer; -- private FloatBuffer floatBuffer; -- private ShortBuffer shortBuffer; -+ private static boolean useVBO = false; - private int rawBuffer[]; - private int vertexCount; - private double textureU; -@@ -384,17 +386,43 @@ - private int rawBufferIndex; - private int addedVertices; - private boolean isColorDisabled; -- private int drawMode; -- private double xOffset; -- private double yOffset; -- private double zOffset; -+ public int drawMode; -+ public double xOffset; -+ public double yOffset; -+ public double zOffset; - private int normal; -- public static final Tessellator instance = new Tessellator(0x200000); -- private boolean isDrawing; -- private boolean useVBO; -- private IntBuffer vertexBuffers; -+ public boolean isDrawing; - private int vboIndex; -- private int vboCount; -- private int bufferSize; - -+ public static boolean renderingWorldRenderer=false; -+ public boolean defaultTexture=false; -+ private int rawBufferSize; -+ private static int vboCount; -+ private static IntBuffer vertexBuffers; -+ private static int nativeBufferSize; -+ private static int trivertsInBuffer; -+ private static ByteBuffer byteBuffer; -+ private static IntBuffer intBuffer; -+ private static FloatBuffer floatBuffer; -+ private static ShortBuffer shortBuffer; -+ public static Tessellator instance; -+ -+ static { -+ instance=new Tessellator(); -+ instance.defaultTexture=true; -+ -+ nativeBufferSize = 0x200000; -+ trivertsInBuffer = (nativeBufferSize/48)*6; -+ byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); -+ intBuffer = byteBuffer.asIntBuffer(); -+ floatBuffer = byteBuffer.asFloatBuffer(); -+ shortBuffer = byteBuffer.asShortBuffer(); -+ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -+ vboCount = 10; -+ if(useVBO) -+ { -+ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); -+ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); -+ } -+ } - } diff --git a/forge/patches/minecraft/net/minecraft/src/TileEntity.java.patch b/forge/patches/minecraft/net/minecraft/src/TileEntity.java.patch index b63e70a65..36c99dc4f 100644 --- a/forge/patches/minecraft/net/minecraft/src/TileEntity.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/TileEntity.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -61,6 +61,13 @@ +@@ -72,6 +72,13 @@ { } diff --git a/forge/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch b/forge/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch index 89dfe957d..118c84f4e 100644 --- a/forge/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/TileEntityFurnace.java.patch @@ -16,8 +16,8 @@ + implements IInventory, ISidedInventory { - public TileEntityFurnace() -@@ -28,6 +29,16 @@ + private ItemStack furnaceItemStacks[]; +@@ -33,6 +34,16 @@ return furnaceItemStacks.length; } @@ -34,7 +34,7 @@ public ItemStack getStackInSlot(int i) { return furnaceItemStacks[i]; -@@ -196,7 +207,7 @@ +@@ -201,7 +212,7 @@ { return false; } @@ -43,7 +43,7 @@ if(itemstack == null) { return false; -@@ -209,11 +220,9 @@ +@@ -214,11 +225,8 @@ { return false; } @@ -52,13 +52,12 @@ - return true; - } - return furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize(); -+ int st=furnaceItemStacks[2].stackSize+itemstack.stackSize; -+ return (st<=getInventoryStackLimit() && -+ st<=itemstack.getMaxStackSize()); ++ int st = furnaceItemStacks[2].stackSize + itemstack.stackSize; ++ return (st <= getInventoryStackLimit() && st <= itemstack.getMaxStackSize()); } public void smeltItem() -@@ -222,14 +231,14 @@ +@@ -227,14 +235,14 @@ { return; } @@ -72,11 +71,11 @@ + if(furnaceItemStacks[2].isItemEqual(itemstack)) { - furnaceItemStacks[2].stackSize++; -+ furnaceItemStacks[2].stackSize+=itemstack.stackSize; ++ furnaceItemStacks[2].stackSize += itemstack.stackSize; } if(furnaceItemStacks[0].getItem().hasContainerItem()) { -@@ -244,7 +253,7 @@ +@@ -249,7 +257,7 @@ } } diff --git a/forge/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch b/forge/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch index e3f6b6cc9..f6cac73f7 100644 --- a/forge/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/TileEntityRendererPiston.java.patch @@ -8,19 +8,19 @@ import net.minecraft.client.Minecraft; import org.lwjgl.opengl.GL11; -@@ -38,6 +39,7 @@ +@@ -40,6 +41,7 @@ { GL11.glShadeModel(7424 /*GL_FLAT*/); } -+ ForgeHooksClient.beforeBlockRender(block,field_31071_b); ++ ForgeHooksClient.beforeBlockRender(block,field_31071_b); tessellator.startDrawingQuads(); tessellator.setTranslationD(((float)d - (float)tileentitypiston.xCoord) + tileentitypiston.func_31017_b(f), ((float)d1 - (float)tileentitypiston.yCoord) + tileentitypiston.func_31014_c(f), ((float)d2 - (float)tileentitypiston.zCoord) + tileentitypiston.func_31013_d(f)); tessellator.setColorOpaque(1, 1, 1); -@@ -58,6 +60,7 @@ +@@ -60,6 +62,7 @@ } tessellator.setTranslationD(0.0D, 0.0D, 0.0D); tessellator.draw(); -+ ForgeHooksClient.afterBlockRender(block,field_31071_b); ++ ForgeHooksClient.afterBlockRender(block,field_31071_b); RenderHelper.enableStandardItemLighting(); } } diff --git a/forge/patches/minecraft/net/minecraft/src/World.java.patch b/forge/patches/minecraft/net/minecraft/src/World.java.patch index 204a25f5c..a7f04659b 100644 --- a/forge/patches/minecraft/net/minecraft/src/World.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/World.java.patch @@ -1,6 +1,15 @@ --- ../src_base/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -@@ -336,7 +336,10 @@ +@@ -51,7 +51,7 @@ + public int lightningFlash; + public boolean editingBlocks; + private long lockTimestamp; +- protected int autosavePeriod; ++ public int autosavePeriod; + public int difficultySetting; + public Random rand; + public boolean isNewWorld; +@@ -406,7 +406,10 @@ public boolean isAirBlock(int i, int j, int k) { @@ -8,11 +17,11 @@ + int iBlockID = getBlockId( i, j, k ); + if ( iBlockID == 0 ) + return true; -+ return Block.blocksList[iBlockID].isAirBlock(this,i,j,k); ++ return Block.blocksList[iBlockID].isAirBlock(this,i,j,k); } public boolean blockExists(int i, int j, int k) -@@ -1476,7 +1479,7 @@ +@@ -1576,7 +1579,7 @@ Chunk chunk = getChunkFromChunkCoords(tileentity.xCoord >> 4, tileentity.zCoord >> 4); if(chunk != null) { @@ -21,11 +30,11 @@ } } } -@@ -1503,16 +1506,16 @@ +@@ -1604,16 +1607,16 @@ { loadedTileEntityList.add(tileentity1); } -+ } else { ++ } else { if(chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4)) { Chunk chunk1 = getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4); @@ -37,11 +46,11 @@ } - markBlockNeedsUpdate(tileentity1.xCoord, tileentity1.yCoord, tileentity1.zCoord); - } -+ } ++ } } while(true); addedTileEntityList.clear(); } -@@ -1520,13 +1523,19 @@ +@@ -1623,13 +1626,17 @@ public void addTileEntity(Collection collection) { @@ -52,35 +61,33 @@ - { - loadedTileEntityList.addAll(collection); - } -+ List dest=scanningTileEntities ? addedTileEntityList : -+ loadedTileEntityList; -+ for(Object ob : collection) { -+ TileEntity te=(TileEntity)ob; -+ if(te.canUpdate()) dest.add(te); -+ } ++ List dest=scanningTileEntities ? addedTileEntityList : loadedTileEntityList; ++ for(Object ob : collection) { ++ TileEntity te = (TileEntity)ob; ++ if(te.canUpdate()) dest.add(te); ++ } + } + + /* FORGE: Used as a bugfix */ + public void addTileEntity(TileEntity te) { -+ List dest=scanningTileEntities ? addedTileEntityList : -+ loadedTileEntityList; -+ if(te.canUpdate()) dest.add(te); ++ List dest=scanningTileEntities ? addedTileEntityList : loadedTileEntityList; ++ if(te.canUpdate()) dest.add(te); } public void updateEntity(Entity entity) -@@ -1684,7 +1693,10 @@ +@@ -1789,7 +1796,10 @@ if(j2 == Block.fire.blockID || j2 == Block.lavaMoving.blockID || j2 == Block.lavaStill.blockID) { return true; - } + } else { -+ if(j2>0 && Block.blocksList[j2].isBlockBurning(this,k1,l1,i2)) -+ return true; -+ } ++ if(j2>0 && Block.blocksList[j2].isBlockBurning(this,k1,l1,i2)) ++ return true; ++ } } } -@@ -1917,44 +1929,23 @@ +@@ -2044,46 +2054,22 @@ public void setBlockTileEntity(int i, int j, int k, TileEntity tileentity) { @@ -102,15 +109,14 @@ - } - } - } -+ if(tileentity==null || tileentity.isInvalid()) -+ return; -+ List dest=scanningTileEntities ? addedTileEntityList : -+ loadedTileEntityList; -+ if(tileentity.canUpdate()) dest.add(tileentity); -+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); -+ if(chunk != null) { -+ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity); -+ } ++ if(tileentity==null || tileentity.isInvalid()) ++ return; ++ List dest=scanningTileEntities ? addedTileEntityList : loadedTileEntityList; ++ if(tileentity.canUpdate()) dest.add(tileentity); ++ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); ++ if(chunk != null) { ++ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity); ++ } } public void removeBlockTileEntity(int i, int j, int k) @@ -119,10 +125,12 @@ - if(tileentity != null && scanningTileEntities) - { - tileentity.invalidate(); +- addedTileEntityList.remove(tileentity); - } else - { - if(tileentity != null) - { +- addedTileEntityList.remove(tileentity); - loadedTileEntityList.remove(tileentity); - } - Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); @@ -131,14 +139,14 @@ - chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); - } - } -+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); -+ if(chunk != null) { -+ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); -+ } ++ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); ++ if(chunk != null) { ++ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); ++ } } public void func_35455_a(TileEntity tileentity) -@@ -1977,13 +1968,18 @@ +@@ -2106,13 +2092,18 @@ public boolean isBlockNormalCube(int i, int j, int k) { Block block = Block.blocksList[getBlockId(i, j, k)]; @@ -150,7 +158,7 @@ - return block.blockMaterial.getIsOpaque() && block.renderAsNormalBlock(); - } + if(block == null) return false; -+ return block.isBlockNormalCube(this,i,j,k); ++ return block.isBlockNormalCube(this,i,j,k); + } + + /* FORGE: Determine if the given block is considered solid on the @@ -160,33 +168,24 @@ + { + Block block = Block.blocksList[getBlockId(i, j, k)]; + if(block == null) return false; -+ return block.isBlockSolidOnSide(this,i,j,k,side); ++ return block.isBlockSolidOnSide(this,i,j,k,side); } - public void saveWorldIndirectly(IProgressUpdate iprogressupdate) -@@ -2308,7 +2304,7 @@ + public boolean func_41082_b(int i, int j, int k, boolean flag) +@@ -2531,7 +2522,7 @@ private int computeBlockLightValue(int i, int j, int k, int l, int i1, int j1) { - int k1 = Block.lightValue[i1]; -+ int k1=(i1==0)?0:Block.blocksList[i1].getLightValue(this,j,k,l); ++ int k1 = (i1==0) ? 0 : Block.blocksList[i1].getLightValue(this,j,k,l); int l1 = getSavedLightValue(EnumSkyBlock.Block, j - 1, k, l) - j1; int i2 = getSavedLightValue(EnumSkyBlock.Block, j + 1, k, l) - j1; int j2 = getSavedLightValue(EnumSkyBlock.Block, j, k - 1, l) - j1; -@@ -2679,6 +2675,7 @@ +@@ -2940,6 +2931,7 @@ { block = null; } -+ if(block!=null && block.isBlockReplaceable(this,j,k,l)) block=null; ++ if (block != null && block.isBlockReplaceable(this,j,k,l)) block = null; return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1); } -@@ -3193,7 +3190,7 @@ - public int lightningFlash; - public boolean editingBlocks; - private long lockTimestamp; -- protected int autosavePeriod; -+ public int autosavePeriod; - public int difficultySetting; - public Random rand; - public boolean isNewWorld; diff --git a/forge/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch b/forge/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch index cbf615ac7..c605eecbe 100644 --- a/forge/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/WorldRenderer.java.patch @@ -9,19 +9,27 @@ import java.util.*; import org.lwjgl.opengl.GL11; -@@ -125,8 +127,9 @@ +@@ -18,7 +20,6 @@ + + public World worldObj; + private int glRenderList; +- private static Tessellator tessellator; + public static int chunksUpdated = 0; + public int posX; + public int posY; +@@ -160,8 +161,9 @@ GL11.glTranslatef((float)(-sizeDepth) / 2.0F, (float)(-sizeHeight) / 2.0F, (float)(-sizeDepth) / 2.0F); GL11.glScalef(f, f, f); GL11.glTranslatef((float)sizeDepth / 2.0F, (float)sizeHeight / 2.0F, (float)sizeDepth / 2.0F); - tessellator.startDrawingQuads(); - tessellator.setTranslationD(-posX, -posY, -posZ); -+ ForgeHooksClient.beforeRenderPass(i2); ++ ForgeHooksClient.beforeRenderPass(i2); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setTranslationD(-posX, -posY, -posZ); } if(i2 == 0 && Block.isBlockContainer[i3]) { -@@ -142,15 +145,13 @@ +@@ -177,15 +179,13 @@ { flag1 = true; } @@ -34,23 +42,23 @@ - { - flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2); - } -+ if(j3>i2) flag=true; -+ if(!ForgeHooksClient.canRenderInPass(block,i2)) -+ continue; ++ if (j3 > i2) flag = true; ++ if(!ForgeHooksClient.canRenderInPass(block,i2)) ++ continue; + -+ ForgeHooksClient.beforeBlockRender(block, renderblocks); -+ flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2); -+ ForgeHooksClient.afterBlockRender(block, renderblocks); ++ ForgeHooksClient.beforeBlockRender(block, renderblocks); ++ flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2); ++ ForgeHooksClient.afterBlockRender(block, renderblocks); } } -@@ -159,10 +160,11 @@ +@@ -194,10 +194,11 @@ if(flag2) { -- tessellator.draw(); -+ ForgeHooksClient.afterRenderPass(i2); -+ Tessellator.instance.draw(); +- bytesDrawn += tessellator.draw(); ++ ForgeHooksClient.afterRenderPass(i2); ++ bytesDrawn += Tessellator.instance.draw(); GL11.glPopMatrix(); GL11.glEndList(); - tessellator.setTranslationD(0.0D, 0.0D, 0.0D); @@ -58,17 +66,9 @@ } else { flag1 = false; -@@ -255,7 +257,6 @@ - - public World worldObj; - private int glRenderList; -- private static Tessellator tessellator; - public static int chunksUpdated = 0; - public int posX; - public int posY; -@@ -286,8 +287,4 @@ - public List tileEntityRenderers; - private List tileEntities; +@@ -288,8 +289,4 @@ + needsUpdate = true; + } - static - { diff --git a/forge/patches/minecraft_server/net/minecraft/src/Block.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Block.java.patch index e9bf71902..19277633b 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Block.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Block.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft_server/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.ForgeHooks; import java.util.ArrayList; import java.util.Random; -@@ -218,24 +219,40 @@ +@@ -384,26 +385,41 @@ return 1; } @@ -16,14 +16,14 @@ + */ + public int quantityDropped(int i, Random random) + { -+ return quantityDropped(random); ++ return quantityDropped(random); + } -+ - public int idDropped(int i, Random random) ++ + public int idDropped(int i, Random random, int j) { return blockID; } - +- + /* FORGE: This function isnt called by Minecraft anymore. Use + * blockStrength(EntityPlayer,int) instead. + */ @@ -40,51 +40,52 @@ - { - return entityplayer.getCurrentPlayerStrVsBlock(this) / blockHardness / 30F; - } -+ return blockStrength(entityplayer,0); -+ } -+ ++ return blockStrength(entityplayer); + } +- ++ + /* FORGE: This function returns the complete list of drops for a block. + */ + public ArrayList getBlockDropped(World world, -+ int i, int j, int k, int md) { -+ ArrayList tr=new ArrayList(); -+ -+ int q=quantityDropped(md,world.rand); -+ for(int n=0; n0) { -+ tr.add(new ItemStack(id,1,damageDropped(md))); -+ } -+ } -+ return tr; - } - - public final void dropBlockAsItem(World world, int i, int j, int k, int l) -@@ -249,20 +266,12 @@ ++ int i, int j, int k, int md) { ++ ArrayList tr = new ArrayList(); ++ ++ int q = quantityDropped(md, world.rand); ++ for(int n = 0; n < q; n++) { ++ int id = idDropped(md, world.rand, 0); ++ if (id > 0) { ++ tr.add(new ItemStack(id, 1, damageDropped(md))); ++ } ++ } ++ return tr; ++ } ++ + public final void dropBlockAsItem(World world, int i, int j, int k, int l, int i1) + { + dropBlockAsItemWithChance(world, i, j, k, l, 1.0F, i1); +@@ -415,18 +431,14 @@ { return; } -- int i1 = quantityDropped(world.rand); -- for(int j1 = 0; j1 < i1; j1++) -- { -+ ArrayList ar=getBlockDropped(world,i,j,k,l); -+ for(ItemStack ist : ar) { +- int j1 = func_40162_a(i1, world.rand); +- for(int k1 = 0; k1 < j1; k1++) ++ ArrayList ar = getBlockDropped(world,i,j,k,l); ++ for (ItemStack ist : ar) + { if(world.rand.nextFloat() > f) -- { + { continue; -- } -- int k1 = idDropped(l, world.rand); -- if(k1 > 0) + } +- int l1 = idDropped(l, world.rand, i1); +- if(l1 > 0) - { -- dropBlockAsItem_do(world, i, j, k, new ItemStack(k1, 1, damageDropped(l))); +- dropBlockAsItem_do(world, i, j, k, new ItemStack(l1, 1, damageDropped(l))); - } -+ dropBlockAsItem_do(world, i, j, k, ist); ++ dropBlockAsItem_do(world, i, j, k, ist); } -- - } - protected void dropBlockAsItem_do(World world, int i, int j, int k, ItemStack itemstack) -@@ -529,6 +538,96 @@ + } +@@ -725,6 +737,96 @@ return blockMaterial.getMaterialMobility(); } diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch index 5e0acf20a..686923fc0 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockChest.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000 -@@ -328,23 +328,23 @@ +@@ -339,23 +339,23 @@ { return true; } diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch index 09c53056b..64ee6042a 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockCrops.java.patch @@ -8,18 +8,27 @@ // Referenced classes of package net.minecraft.src: // BlockFlower, Block, World, EntityItem, -@@ -103,27 +104,16 @@ - return blockIndexInTexture + j; +@@ -108,28 +109,16 @@ + return 6; } -- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f) +- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1) - { -- super.dropBlockAsItemWithChance(world, i, j, k, l, f); +- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0); - if(world.singleplayerWorld) - { - return; -- } -- for(int i1 = 0; i1 < 3; i1++) ++ public ArrayList getBlockDropped(World world, ++ int i, int j, int k, int md) { ++ ArrayList tr = new ArrayList(); ++ if (md == 7) tr.add(new ItemStack(Item.wheat)); ++ ++ for(int n = 0; n < 3; n++) { ++ if (world.rand.nextInt(15) <= md) ++ tr.add(new ItemStack(Item.seeds)); + } +- int j1 = 3 + i1; +- for(int k1 = 0; k1 < j1; k1++) - { - if(world.rand.nextInt(15) <= l) - { @@ -33,16 +42,7 @@ - } - } - -+ public ArrayList getBlockDropped(World world, -+ int i, int j, int k, int md) { -+ ArrayList tr=new ArrayList(); -+ if(md==7) tr.add(new ItemStack(Item.wheat)); -+ -+ for(int n=0; n<3; n++) { -+ if(world.rand.nextInt(15) <= md) -+ tr.add(new ItemStack(Item.seeds)); -+ } -+ return tr; ++ return tr; } - public int idDropped(int i, Random random) + public int idDropped(int i, Random random, int j) diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch index 1aba3da75..9aacbc33c 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockDoor.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -100,7 +100,7 @@ +@@ -105,7 +105,7 @@ { if(blockMaterial == Material.iron) { @@ -9,7 +9,7 @@ } int l = world.getBlockMetadata(i, j, k); if((l & 8) != 0) -@@ -167,7 +167,7 @@ +@@ -172,7 +172,7 @@ world.setBlockWithNotify(i, j, k, 0); flag = true; } @@ -18,7 +18,7 @@ { world.setBlockWithNotify(i, j, k, 0); flag = true; -@@ -231,7 +231,7 @@ +@@ -235,7 +235,7 @@ return false; } else { diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch index 7cf02273c..2956eb84f 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockLadder.java.patch @@ -12,7 +12,7 @@ public boolean isOpaqueCube() { return false; -@@ -52,37 +57,37 @@ +@@ -57,37 +62,37 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -58,7 +58,7 @@ { i1 = 5; } -@@ -93,19 +98,19 @@ +@@ -98,19 +103,19 @@ { int i1 = world.getBlockMetadata(i, j, k); boolean flag = false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch index 09b539626..f9fe3e569 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockLever.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000 -@@ -35,44 +35,44 @@ +@@ -40,44 +40,44 @@ public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l) { @@ -55,7 +55,7 @@ } public void onBlockPlaced(World world, int i, int j, int k, int l) -@@ -81,23 +81,23 @@ +@@ -86,23 +86,23 @@ int j1 = i1 & 8; i1 &= 7; i1 = -1; @@ -84,7 +84,7 @@ { i1 = 1; } -@@ -119,27 +119,27 @@ +@@ -124,27 +124,27 @@ { int i1 = world.getBlockMetadata(i, j, k) & 7; boolean flag = false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch index eff38e4bb..f9dc5e2af 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockPressurePlate.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000 -@@ -46,7 +46,8 @@ +@@ -48,7 +48,8 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -10,7 +10,7 @@ } public void onBlockAdded(World world, int i, int j, int k) -@@ -56,7 +57,8 @@ +@@ -58,7 +59,8 @@ public void onNeighborBlockChange(World world, int i, int j, int k, int l) { boolean flag = false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch index 7034891be..16c10b78d 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockRail.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000 -@@ -16,12 +16,12 @@ +@@ -18,12 +18,12 @@ public static final boolean isRailBlockAt(World world, int i, int j, int k) { int l = world.getBlockId(i, j, k); @@ -15,7 +15,7 @@ } protected BlockRail(int i, int j, boolean flag) -@@ -92,7 +92,7 @@ +@@ -99,7 +99,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -24,7 +24,7 @@ } public void onBlockAdded(World world, int i, int j, int k) -@@ -116,23 +116,23 @@ +@@ -123,23 +123,23 @@ j1 &= 7; } boolean flag = false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch index 66372a4a8..0c363d96f 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000 -@@ -27,7 +27,7 @@ +@@ -35,7 +35,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -9,7 +9,7 @@ { return false; } else -@@ -38,7 +38,7 @@ +@@ -46,7 +46,7 @@ public boolean canBlockStay(World world, int i, int j, int k) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch index ec300c094..e03ef196c 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockRedstoneWire.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.*; import java.util.*; -@@ -43,7 +44,7 @@ +@@ -51,7 +52,7 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { @@ -17,14 +17,14 @@ } private void updateAndPropagateCurrentStrength(World world, int i, int j, int k) -@@ -413,6 +414,10 @@ +@@ -421,6 +422,10 @@ { return false; } -+ if(Block.blocksList[i1] instanceof IConnectRedstone) { -+ IConnectRedstone icr=(IConnectRedstone)Block.blocksList[i1]; -+ return icr.canConnectRedstone(iblockaccess,i,j,k,l); -+ } - if(Block.blocksList[i1].canProvidePower()) ++ if(Block.blocksList[i1] instanceof IConnectRedstone) { ++ IConnectRedstone icr=(IConnectRedstone)Block.blocksList[i1]; ++ return icr.canConnectRedstone(iblockaccess,i,j,k,l); ++ } + if(Block.blocksList[i1].canProvidePower() && l != -1) { return true; diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch index 31118139a..5af36c4fd 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockTallGrass.java.patch @@ -13,7 +13,7 @@ // BlockFlower, Item, World, EntityPlayer, @@ -41,13 +44,17 @@ - public int idDropped(int i, Random random) + public int idDropped(int i, Random random, int j) { - if(random.nextInt(8) == 0) - { @@ -34,4 +34,4 @@ + return tr; } - public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) + public int func_40162_a(int i, Random random) diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch index 6a8d951fa..10c371951 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockTorch.java.patch @@ -1,104 +1,107 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000 -@@ -36,24 +36,24 @@ +@@ -41,7 +41,7 @@ private boolean canPlaceTorchOn(World world, int i, int j, int k) { -- return world.isBlockNormalCube(i, j, k) || world.getBlockId(i, j, k) == Block.fence.blockID; -+ return world.isBlockSolidOnSide(i, j, k,1) || world.getBlockId(i, j, k) == Block.fence.blockID; - } +- if(world.func_41047_b(i, j, k, true)) ++ if(world.isBlockSolidOnSide(i, j, k, 1)) + { + return true; + } else +@@ -53,19 +53,19 @@ public boolean canPlaceBlockAt(World world, int i, int j, int k) { -- if(world.isBlockNormalCube(i - 1, j, k)) +- if(world.func_41047_b(i - 1, j, k, true)) + if(world.isBlockSolidOnSide(i - 1, j, k,5)) { return true; } -- if(world.isBlockNormalCube(i + 1, j, k)) +- if(world.func_41047_b(i + 1, j, k, true)) + if(world.isBlockSolidOnSide(i + 1, j, k,4)) { return true; } -- if(world.isBlockNormalCube(i, j, k - 1)) -+ if(world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(world.func_41047_b(i, j, k - 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k-1,3)) { return true; } -- if(world.isBlockNormalCube(i, j, k + 1)) -+ if(world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(world.func_41047_b(i, j, k + 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k+1,2)) { return true; } -@@ -67,19 +67,19 @@ +@@ -79,19 +79,19 @@ { i1 = 5; } -- if(l == 2 && world.isBlockNormalCube(i, j, k + 1)) -+ if(l == 2 && world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(l == 2 && world.func_41047_b(i, j, k + 1, true)) ++ if(l == 2 && world.isBlockSolidOnSide(i, j, k+1,2)) { i1 = 4; } -- if(l == 3 && world.isBlockNormalCube(i, j, k - 1)) -+ if(l == 3 && world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(l == 3 && world.func_41047_b(i, j, k - 1, true)) ++ if(l == 3 && world.isBlockSolidOnSide(i, j, k-1,3)) { i1 = 3; } -- if(l == 4 && world.isBlockNormalCube(i + 1, j, k)) +- if(l == 4 && world.func_41047_b(i + 1, j, k, true)) + if(l == 4 && world.isBlockSolidOnSide(i + 1, j, k,4)) { i1 = 2; } -- if(l == 5 && world.isBlockNormalCube(i - 1, j, k)) +- if(l == 5 && world.func_41047_b(i - 1, j, k, true)) + if(l == 5 && world.isBlockSolidOnSide(i - 1, j, k,5)) { i1 = 1; } -@@ -97,19 +97,19 @@ +@@ -109,19 +109,19 @@ public void onBlockAdded(World world, int i, int j, int k) { -- if(world.isBlockNormalCube(i - 1, j, k)) +- if(world.func_41047_b(i - 1, j, k, true)) + if(world.isBlockSolidOnSide(i - 1, j, k,5)) { world.setBlockMetadataWithNotify(i, j, k, 1); } else -- if(world.isBlockNormalCube(i + 1, j, k)) +- if(world.func_41047_b(i + 1, j, k, true)) + if(world.isBlockSolidOnSide(i + 1, j, k,4)) { world.setBlockMetadataWithNotify(i, j, k, 2); } else -- if(world.isBlockNormalCube(i, j, k - 1)) -+ if(world.isBlockSolidOnSide(i, j, k - 1,3)) +- if(world.func_41047_b(i, j, k - 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k-1,3)) { world.setBlockMetadataWithNotify(i, j, k, 3); } else -- if(world.isBlockNormalCube(i, j, k + 1)) -+ if(world.isBlockSolidOnSide(i, j, k + 1,2)) +- if(world.func_41047_b(i, j, k + 1, true)) ++ if(world.isBlockSolidOnSide(i, j, k+1,2)) { world.setBlockMetadataWithNotify(i, j, k, 4); } else -@@ -126,19 +126,19 @@ +@@ -138,19 +138,19 @@ { int i1 = world.getBlockMetadata(i, j, k); boolean flag = false; -- if(!world.isBlockNormalCube(i - 1, j, k) && i1 == 1) +- if(!world.func_41047_b(i - 1, j, k, true) && i1 == 1) + if(!world.isBlockSolidOnSide(i - 1, j, k,5) && i1 == 1) { flag = true; } -- if(!world.isBlockNormalCube(i + 1, j, k) && i1 == 2) +- if(!world.func_41047_b(i + 1, j, k, true) && i1 == 2) + if(!world.isBlockSolidOnSide(i + 1, j, k,4) && i1 == 2) { flag = true; } -- if(!world.isBlockNormalCube(i, j, k - 1) && i1 == 3) -+ if(!world.isBlockSolidOnSide(i, j, k - 1,3) && i1 == 3) +- if(!world.func_41047_b(i, j, k - 1, true) && i1 == 3) ++ if(!world.isBlockSolidOnSide(i, j, k-1,3) && i1 == 3) { flag = true; } -- if(!world.isBlockNormalCube(i, j, k + 1) && i1 == 4) -+ if(!world.isBlockSolidOnSide(i, j, k + 1,2) && i1 == 4) +- if(!world.func_41047_b(i, j, k + 1, true) && i1 == 4) ++ if(!world.isBlockSolidOnSide(i, j, k+1,2) && i1 == 4) { flag = true; } diff --git a/forge/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch b/forge/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch index 6e2fcc1cd..250d9a282 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/BlockTrapDoor.java.patch @@ -1,36 +1,40 @@ --- ../src_base/minecraft_server/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000 -@@ -130,7 +130,7 @@ +@@ -11,7 +11,10 @@ + + public class BlockTrapDoor extends Block + { +- ++ /* FORGE: Set this to allow trapdoors to remain free-floating ++ */ ++ public static boolean disableValidation=false; ++ + protected BlockTrapDoor(int i, Material material) + { + super(i, material); +@@ -141,7 +144,7 @@ { j1--; } -- if(!world.isBlockNormalCube(j1, j, k1)) -+ if(!disableValidation && !world.isBlockSolidOnSide(j1, j, k1, (i1&3)+2)) +- if(!func_41006_g(world.getBlockId(j1, j, k1))) ++ if(!(func_41006_g(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1&3)+2))) { world.setBlockWithNotify(i, j, k, 0); - dropBlockAsItem(world, i, j, k, i1); -@@ -172,6 +172,7 @@ + dropBlockAsItem(world, i, j, k, i1, 0); +@@ -186,6 +189,7 @@ public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l) { -+ if(disableValidation) return true; ++ if(disableValidation) return true; if(l == 0) { return false; -@@ -196,11 +197,15 @@ +@@ -210,7 +214,7 @@ { i--; } -- return world.isBlockNormalCube(i, j, k); -+ return world.isBlockSolidOnSide(i, j, k, l); +- return func_41006_g(world.getBlockId(i, j, k)); ++ return func_41006_g(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l); } public static boolean isTrapdoorOpen(int i) - { - return (i & 4) != 0; - } -+ -+ /* FORGE: Set this to allow trapdoors to remain free-floating -+ */ -+ public static boolean disableValidation=false; - } diff --git a/forge/patches/minecraft_server/net/minecraft/src/Chunk.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Chunk.java.patch index 1b328d5e1..6d7110c8b 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Chunk.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Chunk.java.patch @@ -1,113 +1,22 @@ --- ../src_base/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.*; import java.io.PrintStream; import java.util.*; -@@ -68,16 +69,12 @@ - - public void generateSkylightMap() - { -- worldObj.getClass(); - int i = 128 - 1; - for(int j = 0; j < 16; j++) - { - for(int l = 0; l < 16; l++) - { -- worldObj.getClass(); - int j1 = 128 - 1; -- worldObj.getClass(); -- worldObj.getClass(); - int k1; - for(k1 = j << 11 | l << 7; j1 > 0 && Block.lightOpacity[blocks[(k1 + j1) - 1] & 0xff] == 0; j1--) { } - heightMap[l << 4 | j] = (byte)j1; -@@ -90,7 +87,6 @@ - continue; - } - int l1 = 15; -- worldObj.getClass(); - int i2 = 128 - 1; - do - { -@@ -128,7 +124,6 @@ - - private void func_35633_i() - { -- worldObj.getClass(); - if(worldObj.doChunksNearChunkExist(xPosition * 16 + 8, 128 / 2, zPosition * 16 + 8, 16)) - { - for(int i = 0; i < 16; i++) -@@ -190,7 +185,6 @@ - { - if(l > k) - { -- worldObj.getClass(); - if(worldObj.doChunksNearChunkExist(i, 128 / 2, j, 16)) - { - for(int i1 = k; i1 < l; i1++) -@@ -211,8 +205,6 @@ - { - i1 = j; - } -- worldObj.getClass(); -- worldObj.getClass(); - for(int j1 = i << 11 | k << 7; i1 > 0 && Block.lightOpacity[blocks[(j1 + i1) - 1] & 0xff] == 0; i1--) { } - if(i1 == l) - { -@@ -225,7 +217,6 @@ - lowestBlockHeight = i1; - } else - { -- worldObj.getClass(); - int k1 = 128 - 1; - for(int i2 = 0; i2 < 16; i2++) - { -@@ -294,8 +285,6 @@ - - public int getBlockID(int i, int j, int k) - { -- worldObj.getClass(); -- worldObj.getClass(); - return blocks[i << 11 | k << 7 | j] & 0xff; - } - -@@ -308,8 +297,6 @@ - field_35637_c[j1] = -999; - } - int k1 = heightMap[k << 4 | i] & 0xff; -- worldObj.getClass(); -- worldObj.getClass(); - int l1 = blocks[i << 11 | k << 7 | j] & 0xff; - if(l1 == l && data.getNibble(i, j, k) == i1) - { -@@ -317,12 +304,17 @@ +@@ -325,6 +326,7 @@ } int i2 = xPosition * 16 + i; int j2 = zPosition * 16 + k; -- worldObj.getClass(); -- worldObj.getClass(); -+ if (Block.blocksList[l1] instanceof IOverrideReplace) { -+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[l1]; -+ if (!iovr.canReplaceBlock(worldObj, i2, j, j2, l)) -+ return iovr.getReplacedSuccess(); -+ } -+ - blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); -- if(l1 != 0 && !worldObj.singleplayerWorld) -- { -- Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2); -+ if(l1 != 0) { -+ if(!worldObj.singleplayerWorld) -+ Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2); -+ removeChunkBlockTileEntity(i,j,k); - } - data.setNibble(i, j, k, i1); - if(!worldObj.worldProvider.hasNoSky) -@@ -354,7 +346,7 @@ ++ + blocks[i << worldObj.field_35250_b | k << worldObj.worldYBits | j] = (byte)(byte0 & 0xff); + if(l1 != 0) + { +@@ -367,7 +369,7 @@ TileEntity tileentity = getChunkBlockTileEntity(i, j, k); if(tileentity == null) { @@ -116,7 +25,7 @@ worldObj.setBlockTileEntity(i, j, k, tileentity); } if(tileentity != null) -@@ -362,14 +354,6 @@ +@@ -375,14 +377,6 @@ tileentity.func_35164_g(); } } @@ -131,40 +40,22 @@ } isModified = true; return true; -@@ -384,8 +368,6 @@ - field_35637_c[i1] = -999; - } - int j1 = heightMap[i1] & 0xff; -- worldObj.getClass(); -- worldObj.getClass(); - int k1 = blocks[i << 11 | k << 7 | j] & 0xff; - if(k1 == l) - { -@@ -393,12 +375,18 @@ +@@ -404,10 +398,13 @@ } int l1 = xPosition * 16 + i; int i2 = zPosition * 16 + k; -- worldObj.getClass(); -- worldObj.getClass(); -+ -+ if (Block.blocksList[k1] instanceof IOverrideReplace) { -+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[k1]; -+ if (!iovr.canReplaceBlock(worldObj, l1, j, i2, l)) -+ return iovr.getReplacedSuccess(); -+ } -+ - blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); -- if(k1 != 0) -- { ++ + blocks[i << worldObj.field_35250_b | k << worldObj.worldYBits | j] = (byte)(byte0 & 0xff); + if(k1 != 0) + { - Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); -+ if(k1 != 0) { -+ if(!worldObj.singleplayerWorld) -+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); -+ removeChunkBlockTileEntity(i,j,k); ++ if (!worldObj.singleplayerWorld) ++ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2); ++ worldObj.removeBlockTileEntity(l1, j, i2); } data.setNibble(i, j, k, 0); if(Block.lightOpacity[byte0 & 0xff] != 0) -@@ -426,7 +414,7 @@ +@@ -435,7 +432,7 @@ TileEntity tileentity = getChunkBlockTileEntity(i, j, k); if(tileentity == null) { @@ -173,7 +64,7 @@ worldObj.setBlockTileEntity(i, j, k, tileentity); } if(tileentity != null) -@@ -434,14 +422,6 @@ +@@ -443,14 +440,6 @@ tileentity.func_35164_g(); } } @@ -188,7 +79,7 @@ } isModified = true; return true; -@@ -568,6 +548,11 @@ +@@ -586,6 +575,11 @@ { ChunkPosition chunkposition = new ChunkPosition(i, j, k); TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition); @@ -200,7 +91,7 @@ if(tileentity == null) { int l = getBlockID(i, j, k); -@@ -577,18 +562,23 @@ +@@ -595,18 +589,23 @@ } if(tileentity == null) { @@ -231,7 +122,7 @@ } } -@@ -600,7 +590,7 @@ +@@ -618,7 +617,7 @@ setChunkBlockTileEntity(i, j, k, tileentity); if(isChunkLoaded) { @@ -240,7 +131,7 @@ } } -@@ -617,6 +607,8 @@ +@@ -634,6 +633,8 @@ return; } else { @@ -249,47 +140,3 @@ tileentity.validate(); chunkTileEntityMap.put(chunkposition, tileentity); return; -@@ -766,8 +758,6 @@ - { - for(int k3 = k; k3 < j1; k3++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int k4 = k2 << 11 | k3 << 7 | j; - int k5 = i1 - j; - System.arraycopy(blocks, k4, abyte0, k1, k5); -@@ -780,8 +770,6 @@ - { - for(int l3 = k; l3 < j1; l3++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int l4 = (l2 << 11 | l3 << 7 | j) >> 1; - int l5 = (i1 - j) / 2; - System.arraycopy(data.data, l4, abyte0, k1, l5); -@@ -794,8 +782,6 @@ - { - for(int i4 = k; i4 < j1; i4++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int i5 = (i3 << 11 | i4 << 7 | j) >> 1; - int i6 = (i1 - j) / 2; - System.arraycopy(blocklightMap.data, i5, abyte0, k1, i6); -@@ -808,8 +794,6 @@ - { - for(int j4 = k; j4 < j1; j4++) - { -- worldObj.getClass(); -- worldObj.getClass(); - int j5 = (j3 << 11 | j4 << 7 | j) >> 1; - int j6 = (i1 - j) / 2; - System.arraycopy(skylightMap.data, j5, abyte0, k1, j6); -@@ -857,7 +841,6 @@ - int l = field_35637_c[k]; - if(l == -999) - { -- worldObj.getClass(); - int i1 = 128 - 1; - for(l = -1; i1 > 0 && l == -1;) - { diff --git a/forge/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch b/forge/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch index 607f48d7d..fcf04d4ff 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/EntityLiving.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000 -@@ -600,7 +600,9 @@ +@@ -771,7 +771,9 @@ int i = MathHelper.floor_double(posX); int j = MathHelper.floor_double(boundingBox.minY); int k = MathHelper.floor_double(posZ); diff --git a/forge/patches/minecraft_server/net/minecraft/src/EntityPigZombie.java.patch b/forge/patches/minecraft_server/net/minecraft/src/EntityPigZombie.java.patch index 3d14ddb8f..7093b0392 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/EntityPigZombie.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/EntityPigZombie.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000 -@@ -90,7 +90,7 @@ +@@ -94,7 +94,7 @@ return super.attackEntityFrom(damagesource, i); } diff --git a/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch b/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch index e55a83b31..b7fb291f7 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch @@ -11,7 +11,7 @@ // Referenced classes of package net.minecraft.src: // EntityLiving, InventoryPlayer, FoodStats, PlayerCapabilities, // ContainerPlayer, World, ChunkCoordinates, DataWatcher, -@@ -433,6 +437,8 @@ +@@ -493,6 +497,8 @@ worldObj.entityJoinedWorld(entityitem); } @@ -20,8 +20,8 @@ public float getCurrentPlayerStrVsBlock(Block block) { float f = inventory.getStrVsBlock(block); -@@ -455,6 +461,32 @@ - return f; +@@ -521,6 +527,32 @@ + return f1; } + /* FORGE: Extended to allow metadata. @@ -41,11 +41,11 @@ + } + if(func_35184_a(Potion.digSpeed)) + { -+ f *= 1.0F + (float)(func_35187_b(Potion.digSpeed).func_35652_c() + 1) * 0.2F; ++ f *= 1.0F + (float)(func_35187_b(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + if(func_35184_a(Potion.digSlowdown)) + { -+ f *= 1.0F - (float)(func_35187_b(Potion.digSlowdown).func_35652_c() + 1) * 0.2F; ++ f *= 1.0F - (float)(func_35187_b(Potion.digSlowdown).getAmplifier() + 1) * 0.2F; + } + return f; + } @@ -53,33 +53,35 @@ public boolean canHarvestBlock(Block block) { return inventory.canHarvestBlock(block); -@@ -615,6 +647,25 @@ +@@ -718,7 +750,26 @@ + } protected void damageEntity(DamageSource damagesource, int i) - { -+ boolean doRegularComputation = true; +- { ++ { ++ boolean doRegularComputation = true; + int initialDamage = i; -+ ++ + for (ItemStack stack : inventory.armorInventory) { + if (stack != null && stack.getItem() instanceof ISpecialArmor) { + ISpecialArmor armor = (ISpecialArmor) stack.getItem(); -+ ++ + ArmorProperties props = armor.getProperties(this, initialDamage, i); + i = i - props.damageRemove; + doRegularComputation = doRegularComputation -+ && props.allowRegularComputation; ++ && props.allowRegularComputation; + } + } -+ ++ + if (!doRegularComputation) { + super.damageEntity(damagesource, i); + return; + } + - if(!damagesource.func_35083_b() && func_35180_G()) + if(!damagesource.unblockable() && func_35180_G()) { i = 1 + i >> 1; -@@ -668,7 +719,9 @@ +@@ -770,7 +821,9 @@ public void destroyCurrentEquippedItem() { @@ -89,7 +91,7 @@ } public double getYOffset() -@@ -757,6 +810,10 @@ +@@ -896,6 +949,10 @@ public EnumStatus sleepInBedAt(int i, int j, int k) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/Explosion.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Explosion.java.patch index 7ee22e874..d6143143f 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Explosion.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Explosion.java.patch @@ -1,28 +1,26 @@ --- ../src_base/minecraft_server/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.ISpecialResistance; import java.util.*; -@@ -66,7 +67,16 @@ - int i5 = worldObj.getBlockId(j4, k4, l4); - if(i5 > 0) +@@ -76,7 +77,14 @@ + int k3 = worldObj.getBlockId(l2, i3, j3); + if(k3 > 0) { -- f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; -+ if(Block.blocksList[i5] instanceof ISpecialResistance) { -+ ISpecialResistance isr=(ISpecialResistance) -+ Block.blocksList[i5]; -+ f1-=(isr.getSpecialExplosionResistance( -+ worldObj,j4,k4,l4, -+ explosionX,explosionY,explosionZ, -+ exploder) + 0.3F) * f2; -+ } else { -+ f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; -+ } +- f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2; ++ if (Block.blocksList[k3] instanceof ISpecialResistance){ ++ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[k3]; ++ f1 -= (isr.getSpecialExplosionResistance(worldObj, l2, i3, j3, ++ explosionX, explosionY, explosionZ, exploder) + 0.3F) * f2; ++ } else { ++ f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2; ++ } ++ } if(f1 > 0.0F) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch b/forge/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch index 70d851bf1..740a81dad 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/FurnaceRecipes.java.patch @@ -8,7 +8,15 @@ // Referenced classes of package net.minecraft.src: // Block, ItemStack, Item -@@ -21,6 +22,7 @@ +@@ -15,6 +16,7 @@ + + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + private Map smeltingList; ++ private Map metaSmeltingList; + + public static final FurnaceRecipes smelting() + { +@@ -24,6 +26,7 @@ private FurnaceRecipes() { smeltingList = new HashMap(); @@ -16,7 +24,7 @@ addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron)); addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold)); addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond)); -@@ -40,11 +42,32 @@ +@@ -46,11 +49,32 @@ smeltingList.put(Integer.valueOf(i), itemstack); } @@ -49,10 +57,3 @@ public Map getSmeltingList() { return smeltingList; -@@ -52,5 +75,6 @@ - - private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); - private Map smeltingList; -+ private Map metaSmeltingList; - - } diff --git a/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch index 545acffb2..a2c313796 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch @@ -1,6 +1,16 @@ --- ../src_base/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000 -@@ -66,6 +66,13 @@ +@@ -175,6 +175,9 @@ + private String field_39006_bR; + private String itemName; + ++ // FORGE: To disable repair recipes. ++ protected boolean canRepair=true; ++ + protected Item(int i) + { + maxStackSize = 64; +@@ -219,6 +222,13 @@ return 1.0F; } @@ -14,3 +24,23 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { return itemstack; +@@ -266,6 +276,19 @@ + return maxDamage > 0 && !hasSubtypes; + } + ++ /* FORGE: Called by CraftingManager to determine if an item is repairable. ++ */ ++ public boolean isRepairable() { ++ return canRepair && isDamageable(); ++ } ++ ++ /* FORGE: Call to disable repair recipes. ++ */ ++ public Item setNoRepair() { ++ canRepair=false; ++ return this; ++ } ++ + public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) + { + return false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch b/forge/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch index ad858eb81..90b3b62eb 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/ItemBucket.java.patch @@ -7,9 +7,9 @@ +import net.minecraft.src.forge.MinecraftForge; + // Referenced classes of package net.minecraft.src: - // Item, EntityPlayer, Vec3D, MathHelper, - // World, MovingObjectPosition, EnumMovingObjectType, Material, -@@ -56,6 +58,12 @@ + // Item, EntityPlayer, MovingObjectPosition, EnumMovingObjectType, + // World, Material, PlayerCapabilities, ItemStack, +@@ -46,6 +48,12 @@ } if(isFull == 0) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch b/forge/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch index 30e1b2bb6..094891bc5 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/ItemDye.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft_server/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,6 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; +import net.minecraft.src.forge.ForgeHooks; import java.util.Random; -@@ -29,13 +30,18 @@ +@@ -39,13 +40,18 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) { @@ -28,7 +28,7 @@ if(i1 == Block.sapling.blockID) { if(!world.singleplayerWorld) -@@ -102,13 +108,7 @@ +@@ -112,13 +118,7 @@ world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1); continue; } diff --git a/forge/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch b/forge/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch index 42658b8f9..6175d136a 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/ItemInWorldManager.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,7 +3,8 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; - @@ -10,7 +10,7 @@ // Referenced classes of package net.minecraft.src: // EntityPlayer, PlayerCapabilities, World, Block, -@@ -66,7 +67,8 @@ +@@ -81,7 +82,8 @@ if(j != 0) { Block block = Block.blocksList[j]; @@ -20,7 +20,7 @@ if(f >= 1.0F) { field_22050_k = false; -@@ -93,7 +95,7 @@ +@@ -108,7 +110,7 @@ { Block.blocksList[i1].onBlockClicked(thisWorld, i, j, k, thisPlayer); } @@ -29,7 +29,7 @@ { blockHarvessted(i, j, k); } else -@@ -113,7 +115,7 @@ +@@ -128,7 +130,7 @@ if(i1 != 0) { Block block = Block.blocksList[i1]; @@ -38,7 +38,7 @@ if(f >= 0.7F) { blockHarvessted(i, j, k); -@@ -135,11 +137,10 @@ +@@ -150,11 +152,10 @@ { Block block = Block.blocksList[thisWorld.getBlockId(i, j, k)]; int l = thisWorld.getBlockMetadata(i, j, k); @@ -54,16 +54,16 @@ return flag; } -@@ -164,7 +165,7 @@ - thisPlayer.destroyCurrentEquippedItem(); - } - } -- if(flag && thisPlayer.canHarvestBlock(Block.blocksList[l])) -+ if(flag && Block.blocksList[l].canHarvestBlock(thisPlayer,i1)) +@@ -170,7 +171,7 @@ + } else + { + ItemStack itemstack = thisPlayer.getCurrentEquippedItem(); +- boolean flag1 = thisPlayer.canHarvestBlock(Block.blocksList[l]); ++ boolean flag1 = Block.blocksList[l].canHarvestBlock(thisPlayer, i1); + if(itemstack != null) { - Block.blocksList[l].harvestBlock(thisWorld, thisPlayer, i, j, k, i1); - } -@@ -188,6 +189,7 @@ + itemstack.onDestroyBlock(l, i, j, k, thisPlayer); +@@ -204,6 +205,7 @@ if(itemstack1.stackSize == 0) { entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null; @@ -71,7 +71,7 @@ } return true; } else -@@ -198,6 +200,11 @@ +@@ -214,6 +216,11 @@ public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l) { @@ -83,7 +83,7 @@ int i1 = world.getBlockId(i, j, k); if(i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer)) { -@@ -217,7 +224,11 @@ +@@ -233,7 +240,11 @@ return flag; } else { diff --git a/forge/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch b/forge/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch index 4bc57d9f2..9b0391dc2 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/ItemTool.java.patch @@ -9,7 +9,18 @@ // Referenced classes of package net.minecraft.src: // Item, EnumToolMaterial, ItemStack, Block, -@@ -37,6 +39,14 @@ +@@ -13,8 +15,8 @@ + { + + private Block blocksEffectiveAgainst[]; +- protected float efficiencyOnProperMaterial; +- private int damageVsEntity; ++ public float efficiencyOnProperMaterial; ++ public int damageVsEntity; + protected EnumToolMaterial toolMaterial; + + protected ItemTool(int i, int j, EnumToolMaterial enumtoolmaterial, Block ablock[]) +@@ -42,6 +44,14 @@ return 1.0F; } @@ -24,13 +35,3 @@ public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { itemstack.damageItem(2, entityliving1); -@@ -55,7 +65,7 @@ - } - - private Block blocksEffectiveAgainst[]; -- private float efficiencyOnProperMaterial; -- private int damageVsEntity; -+ public float efficiencyOnProperMaterial; -+ public int damageVsEntity; - protected EnumToolMaterial toolMaterial; - } diff --git a/forge/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch b/forge/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch index 38011b3cf..8fc9d52b0 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/MovingObjectPosition.java.patch @@ -1,10 +1,12 @@ --- ../src_base/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000 -@@ -35,4 +35,7 @@ +@@ -18,6 +18,9 @@ public int sideHit; public Vec3D hitVec; public Entity entityHit; -+ -+ // Added for RedPower subblocks. -+ public int subHit=-1; - } ++ ++ //Added for RedPower SubBlocks. ++ public int subHit = -1; + + public MovingObjectPosition(int i, int j, int k, int l, Vec3D vec3d) + { diff --git a/forge/patches/minecraft_server/net/minecraft/src/Packet100OpenWindow.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Packet100OpenWindow.java.patch index c79e7b22e..9eda3eae1 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Packet100OpenWindow.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Packet100OpenWindow.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/Packet100OpenWindow.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Packet100OpenWindow.java 0000-00-00 00:00:00.000000000 -0000 -@@ -33,9 +33,9 @@ +@@ -38,9 +38,9 @@ throws IOException { windowId = datainputstream.readByte(); diff --git a/forge/patches/minecraft_server/net/minecraft/src/Packet230ModLoader.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Packet230ModLoader.java.patch index 6b83f5ee9..44dc80c55 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Packet230ModLoader.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Packet230ModLoader.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000 -@@ -71,7 +71,10 @@ +@@ -79,7 +79,10 @@ })); } byte abyte0[] = new byte[k1]; diff --git a/forge/patches/minecraft_server/net/minecraft/src/Packet24MobSpawn.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Packet24MobSpawn.java.patch index b024e03f0..886ae732c 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Packet24MobSpawn.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Packet24MobSpawn.java.patch @@ -1,16 +1,7 @@ --- ../src_base/minecraft_server/net/minecraft/src/Packet24MobSpawn.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/Packet24MobSpawn.java 0000-00-00 00:00:00.000000000 -0000 -@@ -34,7 +34,7 @@ - throws IOException - { - entityId = datainputstream.readInt(); -- type = datainputstream.readByte(); -+ type = datainputstream.readByte()&0xFF; - xPosition = datainputstream.readInt(); - yPosition = datainputstream.readInt(); - zPosition = datainputstream.readInt(); -@@ -67,7 +67,7 @@ - } +@@ -15,7 +15,7 @@ + { public int entityId; - public byte type; @@ -18,3 +9,12 @@ public int xPosition; public int yPosition; public int zPosition; +@@ -44,7 +44,7 @@ + throws IOException + { + entityId = datainputstream.readInt(); +- type = datainputstream.readByte(); ++ type = datainputstream.readByte() & 0xFF; + xPosition = datainputstream.readInt(); + yPosition = datainputstream.readInt(); + zPosition = datainputstream.readInt(); diff --git a/forge/patches/minecraft_server/net/minecraft/src/PlayerInstance.java.patch b/forge/patches/minecraft_server/net/minecraft/src/PlayerInstance.java.patch index bf56c4732..1547e7a4b 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/PlayerInstance.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/PlayerInstance.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java 0000-00-00 00:00:00.000000000 -0000 -@@ -168,12 +168,11 @@ +@@ -183,12 +183,11 @@ sendPacketToPlayersInInstance(new Packet52MultiBlockChange(chunkX, chunkZ, blocksToUpdate, numBlocksToUpdate, worldserver)); for(int k = 0; k < numBlocksToUpdate; k++) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch b/forge/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch index 39b6ed4f9..5295fbac5 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/SlotCrafting.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000 @@ -3,7 +3,7 @@ - // Decompiler options: packimports(3) braces deadcode + // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; - @@ -9,8 +9,8 @@ // Referenced classes of package net.minecraft.src: // Slot, EntityPlayer, ItemStack, Block, -@@ -60,6 +60,7 @@ - thePlayer.addStat(AchievementList.buildSword, 1); +@@ -71,6 +71,7 @@ + thePlayer.addStat(AchievementList.bookcase, 1); } ModLoader.TakenFromCrafting(thePlayer, itemstack); + ForgeHooks.onTakenFromCrafting(thePlayer, itemstack, craftMatrix); diff --git a/forge/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch b/forge/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch index ef84f71cb..2645f52f6 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/TileEntity.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000 -@@ -61,6 +61,13 @@ +@@ -72,6 +72,13 @@ { } diff --git a/forge/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch b/forge/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch index 5511bd75c..96e465c15 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/TileEntityFurnace.java.patch @@ -16,8 +16,8 @@ + implements IInventory, ISidedInventory { - public TileEntityFurnace() -@@ -28,6 +29,16 @@ + private ItemStack furnaceItemStacks[]; +@@ -33,6 +34,16 @@ return furnaceItemStacks.length; } @@ -34,7 +34,7 @@ public ItemStack getStackInSlot(int i) { return furnaceItemStacks[i]; -@@ -176,7 +187,7 @@ +@@ -181,7 +192,7 @@ { return false; } @@ -43,7 +43,7 @@ if(itemstack == null) { return false; -@@ -189,13 +200,9 @@ +@@ -194,13 +205,9 @@ { return false; } @@ -60,7 +60,7 @@ } public void smeltItem() -@@ -204,23 +211,29 @@ +@@ -209,23 +216,29 @@ { return; } diff --git a/forge/patches/minecraft_server/net/minecraft/src/World.java.patch b/forge/patches/minecraft_server/net/minecraft/src/World.java.patch index 0b57d2df1..8dfd2463e 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/World.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/World.java.patch @@ -1,6 +1,15 @@ --- ../src_base/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000 -@@ -183,7 +183,11 @@ +@@ -51,7 +51,7 @@ + public int lightningFlash; + public boolean editingBlocks; + private long lockTimestamp; +- protected int autosavePeriod; ++ public int autosavePeriod; + public int difficultySetting; + public Random rand; + public boolean isNewWorld; +@@ -244,7 +244,11 @@ public boolean isAirBlock(int i, int j, int k) { @@ -13,7 +22,7 @@ } public boolean blockExists(int i, int j, int k) -@@ -1124,7 +1128,7 @@ +@@ -1207,7 +1211,7 @@ Chunk chunk = getChunkFromChunkCoords(tileentity.xCoord >> 4, tileentity.zCoord >> 4); if(chunk != null) { @@ -22,7 +31,7 @@ } } } -@@ -1151,15 +1155,15 @@ +@@ -1235,15 +1239,15 @@ { loadedTileEntityList.add(tileentity1); } @@ -40,7 +49,7 @@ } } while(true); addedTileEntityList.clear(); -@@ -1168,13 +1172,19 @@ +@@ -1254,13 +1258,19 @@ public void addTileEntity(Collection collection) { @@ -67,7 +76,7 @@ } public void updateEntity(Entity entity) -@@ -1372,6 +1382,9 @@ +@@ -1460,6 +1470,9 @@ if(j2 == Block.fire.blockID || j2 == Block.lavaMoving.blockID || j2 == Block.lavaStill.blockID) { return true; @@ -77,7 +86,7 @@ } } -@@ -1590,44 +1603,23 @@ +@@ -1700,46 +1713,22 @@ public void setBlockTileEntity(int i, int j, int k, TileEntity tileentity) { @@ -99,15 +108,14 @@ - } - } - } -+ if(tileentity==null || tileentity.isInvalid()) -+ return; -+ List dest=scanningTileEntities ? addedTileEntityList : -+ loadedTileEntityList; -+ if(tileentity.canUpdate()) dest.add(tileentity); -+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); -+ if(chunk != null) { -+ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity); -+ } ++ if(tileentity==null || tileentity.isInvalid()) ++ return; ++ List dest=scanningTileEntities ? addedTileEntityList : loadedTileEntityList; ++ if(tileentity.canUpdate()) dest.add(tileentity); ++ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); ++ if(chunk != null) { ++ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity); ++ } } public void removeBlockTileEntity(int i, int j, int k) @@ -116,10 +124,12 @@ - if(tileentity != null && scanningTileEntities) - { - tileentity.invalidate(); +- addedTileEntityList.remove(tileentity); - } else - { - if(tileentity != null) - { +- addedTileEntityList.remove(tileentity); - loadedTileEntityList.remove(tileentity); - } - Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); @@ -128,14 +138,14 @@ - chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); - } - } -+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); -+ if(chunk != null) { -+ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); -+ } ++ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4); ++ if(chunk != null) { ++ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf); ++ } } public void func_35239_a(TileEntity tileentity) -@@ -1650,13 +1642,18 @@ +@@ -1762,13 +1751,18 @@ public boolean isBlockNormalCube(int i, int j, int k) { Block block = Block.blocksList[getBlockId(i, j, k)]; @@ -160,8 +170,8 @@ + return block.isBlockSolidOnSide(this,i,j,k,side); } - public void calculateInitialSkylight() -@@ -1976,7 +1973,7 @@ + public boolean func_41047_b(int i, int j, int k, boolean flag) +@@ -2179,7 +2173,7 @@ private int func_35241_e(int i, int j, int k, int l, int i1, int j1) { @@ -170,7 +180,7 @@ int l1 = getSavedLightValue(EnumSkyBlock.Block, j - 1, k, l) - j1; int i2 = getSavedLightValue(EnumSkyBlock.Block, j + 1, k, l) - j1; int j2 = getSavedLightValue(EnumSkyBlock.Block, j, k - 1, l) - j1; -@@ -2315,6 +2312,7 @@ +@@ -2556,6 +2550,7 @@ { block = null; } @@ -178,12 +188,3 @@ return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1); } -@@ -2759,7 +2757,7 @@ - public int field_27080_i; - public boolean editingBlocks; - private long lockTimestamp; -- protected int autosavePeriod; -+ public int autosavePeriod; - public int difficultySetting; - public Random rand; - public boolean isNewWorld; diff --git a/forge/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch b/forge/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch index 5bd29eb80..05a7cfd0f 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/WorldServer.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000 -@@ -54,15 +54,20 @@ +@@ -63,15 +63,20 @@ public List getTileEntityList(int i, int j, int k, int l, int i1, int j1) { ArrayList arraylist = new ArrayList(); diff --git a/forge/setup.bat b/forge/setup.bat index 46837586a..fba467b75 100755 --- a/forge/setup.bat +++ b/forge/setup.bat @@ -10,9 +10,13 @@ pushd .. >nul pushd src >nul ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ..\forge\modLoaderMP.patch ..\forge\modLoaderMP-win.patch ..\runtime\bin\applydiff.exe -uf -p2 < ..\forge\modLoaderMP-win.patch - ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ..\forge\mlprop.patch ..\forge\mlprop-win.patch - ..\runtime\bin\applydiff.exe -uf -p1 < ..\forge\mlprop-win.patch - del ..\forge\mlprop-win.patch ..\forge\modLoaderMP-win.patch >nul 1>nul + rem ..\runtime\bin\python\python_mcp ..\forge\lfcr.py ..\forge\mlprop.patch ..\forge\mlprop-win.patch + rem ..\runtime\bin\applydiff.exe -uf -p1 < ..\forge\mlprop-win.patch + rem del ..\forge\mlprop-win.patch ..\forge\modLoaderMP-win.patch >nul 1>nul + del minecraft\net\minecraft\src\MLProp.java + copy ..\forge\MLProp.java minecraft\net\minecraft\src\MLProp.java + del minecraft_server\net\minecraft\src\MLProp.java + copy ..\forge\MLProp.java minecraft_server\net\minecraft\src\MLProp.java popd >nul cmd /C updatemd5.bat diff --git a/forge/setup.sh b/forge/setup.sh index 0a4db9b42..64750ecf8 100755 --- a/forge/setup.sh +++ b/forge/setup.sh @@ -25,7 +25,6 @@ if [ ! -d src_base ] ; then find . -name *.java -exec sed -i 's/\r//g' \{\} \; patch -p2 -i ../forge/modLoaderMP.patch - patch -p1 -i ../forge/mlprop.patch popd > /dev/null