diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index a836418b81..f89f1bb0bc 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -53,142 +53,141 @@ public class Block { -@@ -132,7 +153,8 @@ +@@ -110,7 +131,8 @@ - public static Block getBlockById(int p_149729_0_) + public static Block func_149729_e(int p_149729_0_) { -- return (Block)blockRegistry.getObjectById(p_149729_0_); -+ Block ret = (Block)blockRegistry.getObjectById(p_149729_0_); -+ return ret == null ? Blocks.air : ret; +- return (Block)field_149771_c.func_148754_a(p_149729_0_); ++ Block ret = (Block)field_149771_c.func_148754_a(p_149729_0_); ++ return ret == null ? Blocks.field_150350_a : ret; } - public static Block getBlockFromItem(Item p_149634_0_) -@@ -517,9 +539,10 @@ - return this.needsRandomTick; + public static Block func_149634_a(Item p_149634_0_) +@@ -481,9 +503,10 @@ + return this.field_149789_z; } + @Deprecated //Forge: New Metadata sensitive version. - public boolean hasTileEntity() + public boolean func_149716_u() { -- return this.isBlockContainer; +- return this.field_149758_A; + return hasTileEntity(0); } - // JAVADOC METHOD $$ func_149676_a -@@ -538,13 +561,13 @@ - public int getMixedBrightnessForBlock(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) + public final void func_149676_a(float p_149676_1_, float p_149676_2_, float p_149676_3_, float p_149676_4_, float p_149676_5_, float p_149676_6_) +@@ -500,13 +523,13 @@ + public int func_149677_c(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { - Block block = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); -- int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue()); -+ int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); + Block block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); +- int l = p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); ++ int l = p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); if (l == 0 && block instanceof BlockSlab) { --p_149677_3_; - block = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); -- return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue()); -+ return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); + block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); +- return p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); ++ return p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); } else { -@@ -649,7 +672,13 @@ - // JAVADOC METHOD $$ func_149726_b - public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} +@@ -595,7 +618,13 @@ -- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} -+ public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + public void func_149726_b(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} + +- public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} ++ public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (hasTileEntity(p_149749_6_) && !(this instanceof BlockContainer)) + { -+ p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); ++ p_149749_1_.func_147475_p(p_149749_2_, p_149749_3_, p_149749_4_); + } + } - // JAVADOC METHOD $$ func_149745_a - public int quantityDropped(Random p_149745_1_) -@@ -665,8 +694,7 @@ - // JAVADOC METHOD $$ func_149737_a - public float getPlayerRelativeBlockHardness(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) + public int func_149745_a(Random p_149745_1_) { -- float f = this.getBlockHardness(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); -- return f < 0.0F ? 0.0F : (!p_149737_1_.canHarvestBlock(this) ? p_149737_1_.getCurrentPlayerStrVsBlock(this, false) / f / 100.0F : p_149737_1_.getCurrentPlayerStrVsBlock(this, true) / f / 30.0F); +@@ -609,8 +638,7 @@ + + public float func_149737_a(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) + { +- float f = this.func_149712_f(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); +- return f < 0.0F ? 0.0F : (!p_149737_1_.func_146099_a(this) ? p_149737_1_.func_146096_a(this, false) / f / 100.0F : p_149737_1_.func_146096_a(this, true) / f / 30.0F); + return ForgeHooks.blockStrength(this, p_149737_1_, p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); } - // JAVADOC METHOD $$ func_149697_b -@@ -680,18 +708,14 @@ + public final void func_149697_b(World p_149697_1_, int p_149697_2_, int p_149697_3_, int p_149697_4_, int p_149697_5_, int p_149697_6_) +@@ -622,18 +650,14 @@ { - if (!p_149690_1_.isRemote) + if (!p_149690_1_.field_72995_K) { -- int j1 = this.quantityDroppedWithBonus(p_149690_7_, p_149690_1_.rand); +- int j1 = this.func_149679_a(p_149690_7_, p_149690_1_.field_73012_v); + ArrayList items = getDrops(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_); + p_149690_6_ = ForgeEventFactory.fireBlockHarvesting(items, p_149690_1_, this, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_, p_149690_6_, false, harvesters.get()); - for (int k1 = 0; k1 < j1; ++k1) + for (ItemStack item : items) { - if (p_149690_1_.rand.nextFloat() <= p_149690_6_) + if (p_149690_1_.field_73012_v.nextFloat() <= p_149690_6_) { -- Item item = this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_); +- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_); - - if (item != null) - { -- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.damageDropped(p_149690_5_))); +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_))); - } -+ this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, item); ++ this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, item); } } } -@@ -897,7 +921,7 @@ - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -827,7 +851,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable(); -+ return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); +- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j(); ++ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); } - // JAVADOC METHOD $$ func_149727_a -@@ -1008,26 +1032,36 @@ - p_149636_2_.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); - p_149636_2_.addExhaustion(0.025F); + public boolean func_149727_a(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) +@@ -920,25 +944,35 @@ + p_149636_2_.func_71064_a(StatList.field_75934_C[func_149682_b(this)], 1); + p_149636_2_.func_71020_j(0.025F); -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) -+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_)) ++ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_)) { + ArrayList items = new ArrayList(); - ItemStack itemstack = this.createStackedBlock(p_149636_6_); + ItemStack itemstack = this.func_149644_j(p_149636_6_); if (itemstack != null) { -- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); + items.add(itemstack); } + + ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_); + for (ItemStack is : items) + { -+ this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); ++ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); + } } else { + harvesters.set(p_149636_2_); - int i1 = EnchantmentHelper.getFortuneModifier(p_149636_2_); - this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); + int i1 = EnchantmentHelper.func_77517_e(p_149636_2_); + this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); + harvesters.set(null); } } - // JAVADOC METHOD $$ func_149700_E - protected boolean canSilkHarvest() + protected boolean func_149700_E() { -- return this.renderAsNormalBlock() && !this.isBlockContainer; +- return this.func_149686_d() && !this.field_149758_A; + Integer meta = silk_check_meta.get(); -+ return this.renderAsNormalBlock() && !this.hasTileEntity(meta == null ? 0 : meta); ++ return this.func_149686_d() && !this.hasTileEntity(meta == null ? 0 : meta); } - // JAVADOC METHOD $$ func_149644_j -@@ -1228,6 +1262,1065 @@ + protected ItemStack func_149644_j(int p_149644_1_) +@@ -1114,6 +1148,1065 @@ return null; } @@ -206,12 +205,12 @@ + */ + public int getLightValue(IBlockAccess world, int x, int y, int z) + { -+ Block block = world.getBlock(x, y, z); ++ Block block = world.func_147439_a(x, y, z); + if (block != this) + { + return block.getLightValue(world, x, y, z); + } -+ return getLightValue(); ++ return func_149750_m(); + } + + /** @@ -242,7 +241,7 @@ + */ + public boolean isNormalCube(IBlockAccess world, int x, int y, int z) + { -+ return getMaterial().isOpaque() && renderAsNormalBlock() && !canProvidePower(); ++ return func_149688_o().func_76218_k() && func_149686_d() && !func_149744_f(); + } + + /** @@ -257,7 +256,7 @@ + */ + public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) + { -+ int meta = world.getBlockMetadata(x, y, z); ++ int meta = world.func_72805_g(x, y, z); + + if (this instanceof BlockSlab) + { @@ -299,7 +298,7 @@ + */ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { -+ return blockMaterial.isReplaceable(); ++ return field_149764_J.func_76222_j(); + } + + /** @@ -331,7 +330,7 @@ + */ + public boolean isAir(IBlockAccess world, int x, int y, int z) + { -+ return getMaterial() == Material.air; ++ return func_149688_o() == Material.field_151579_a; + } + + /** @@ -366,7 +365,7 @@ + */ + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) + { -+ return world.setBlockToAir(x, y, z); ++ return world.func_147468_f(x, y, z); + } + + /** @@ -382,7 +381,7 @@ + */ + public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { -+ return Blocks.fire.getFlammability(this); ++ return Blocks.field_150480_ab.getFlammability(this); + } + + /** @@ -414,7 +413,7 @@ + */ + public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { -+ return Blocks.fire.getEncouragement(this); ++ return Blocks.field_150480_ab.getEncouragement(this); + } + + /** @@ -432,11 +431,11 @@ + */ + public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) + { -+ if (this == Blocks.netherrack && side == UP) ++ if (this == Blocks.field_150424_aL && side == UP) + { + return true; + } -+ if ((world.provider instanceof WorldProviderEnd) && this == Blocks.bedrock && side == UP) ++ if ((world.field_73011_w instanceof WorldProviderEnd) && this == Blocks.field_150357_h && side == UP) + { + return true; + } @@ -471,7 +470,7 @@ + { + if (isTileProvider) + { -+ return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); ++ return ((ITileEntityProvider)this).func_149915_a(world, metadata); + } + return null; + } @@ -487,7 +486,7 @@ + */ + public int quantityDropped(int meta, int fortune, Random random) + { -+ return quantityDroppedWithBonus(fortune, random); ++ return func_149679_a(fortune, random); + } + + /** @@ -505,13 +504,13 @@ + { + ArrayList ret = new ArrayList(); + -+ int count = quantityDropped(metadata, fortune, world.rand); ++ int count = quantityDropped(metadata, fortune, world.field_73012_v); + for(int i = 0; i < count; i++) + { -+ Item item = getItemDropped(metadata, world.rand, fortune); ++ Item item = func_149650_a(metadata, world.field_73012_v, fortune); + if (item != null) + { -+ ret.add(new ItemStack(item, 1, damageDropped(metadata))); ++ ret.add(new ItemStack(item, 1, func_149692_a(metadata))); + } + } + return ret; @@ -531,7 +530,7 @@ + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { + silk_check_meta.set(metadata);; -+ boolean ret = this.canSilkHarvest(); ++ boolean ret = this.func_149700_E(); + silk_check_meta.set(null); + return ret; + } @@ -549,7 +548,7 @@ + */ + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) + { -+ int meta = world.getBlockMetadata(x, y, z); ++ int meta = world.func_72805_g(x, y, z); + if (this instanceof BlockSlab) + { + return (((meta & 8) == 8) || func_149730_j()); @@ -575,7 +574,7 @@ + */ + public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player) + { -+ return this == Blocks.bed; ++ return this == Blocks.field_150324_C; + } + + /** @@ -624,7 +623,7 @@ + */ + public int getBedDirection(IBlockAccess world, int x, int y, int z) + { -+ return BlockBed.getDirection(world.getBlockMetadata(x, y, z)); ++ return BlockBed.func_149895_l(world.func_72805_g(x, y, z)); + } + + /** @@ -638,7 +637,7 @@ + */ + public boolean isBedFoot(IBlockAccess world, int x, int y, int z) + { -+ return BlockBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z)); ++ return BlockBed.func_149975_b(world.func_72805_g(x, y, z)); + } + + /** @@ -676,7 +675,7 @@ + */ + public boolean isLeaves(IBlockAccess world, int x, int y, int z) + { -+ return getMaterial() == Material.leaves; ++ return func_149688_o() == Material.field_151584_j; + } + + /** @@ -737,7 +736,7 @@ + */ + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { -+ return getExplosionResistance(par1Entity); ++ return func_149638_a(par1Entity); + } + + /** @@ -753,8 +752,8 @@ + */ + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) + { -+ world.setBlockToAir(x, y, z); -+ onBlockDestroyedByExplosion(world, x, y, z, explosion); ++ world.func_147468_f(x, y, z); ++ func_149723_a(world, x, y, z, explosion); + } + + /** @@ -777,7 +776,7 @@ + */ + public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + { -+ return canProvidePower() && side != -1; ++ return func_149744_f() && side != -1; + } + + /** @@ -798,7 +797,7 @@ + } + else + { -+ return this == Blocks.fence || this == Blocks.nether_brick_fence || this == Blocks.glass || this == Blocks.cobblestone_wall; ++ return this == Blocks.field_150422_aJ || this == Blocks.field_150386_bk || this == Blocks.field_150359_w || this == Blocks.field_150463_bK; + } + } + @@ -810,7 +809,7 @@ + */ + public boolean canRenderInPass(int pass) + { -+ return pass == getRenderBlockPass(); ++ return pass == func_149701_w(); + } + + /** @@ -821,15 +820,15 @@ + */ + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { -+ Item item = getItem(world, x, y, z); ++ Item item = func_149694_d(world, x, y, z); + + if (item == null) + { + return null; + } + -+ Block block = item instanceof ItemBlock && !isFlowerPot() ? Block.getBlockFromItem(item) : this; -+ return new ItemStack(item, 1, block.getDamageValue(world, x, y, z)); ++ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this; ++ return new ItemStack(item, 1, block.func_149643_k(world, x, y, z)); + } + + /** @@ -904,35 +903,35 @@ + Block plant = plantable.getPlant(world, x, y + 1, z); + EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z); + -+ if (plant == Blocks.cactus && this == Blocks.cactus) ++ if (plant == Blocks.field_150434_aF && this == Blocks.field_150434_aF) + { + return true; + } + -+ if (plant == Blocks.reeds && this == Blocks.reeds) ++ if (plant == Blocks.field_150436_aH && this == Blocks.field_150436_aH) + { + return true; + } + -+ if (plantable instanceof BlockBush && ((BlockBush)plantable).canPlaceBlockOn(this)) ++ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this)) + { + return true; + } + + switch (plantType) + { -+ case Desert: return this == Blocks.sand; -+ case Nether: return this == Blocks.soul_sand; -+ case Crop: return this == Blocks.farmland; ++ case Desert: return this == Blocks.field_150354_m; ++ case Nether: return this == Blocks.field_150425_aM; ++ case Crop: return this == Blocks.field_150458_ak; + case Cave: return isSideSolid(world, x, y, z, UP); -+ case Plains: return this == Blocks.grass || this == Blocks.dirt; -+ case Water: return world.getBlock(x, y, z).getMaterial() == Material.water && world.getBlockMetadata(x, y, z) == 0; ++ case Plains: return this == Blocks.field_150349_c || this == Blocks.field_150346_d; ++ case Water: return world.func_147439_a(x, y, z).func_149688_o() == Material.field_151586_h && world.func_72805_g(x, y, z) == 0; + case Beach: -+ boolean isBeach = this == Blocks.grass || this == Blocks.dirt || this == Blocks.sand; -+ boolean hasWater = (world.getBlock(x - 1, y, z ).getMaterial() == Material.water || -+ world.getBlock(x + 1, y, z ).getMaterial() == Material.water || -+ world.getBlock(x, y, z - 1).getMaterial() == Material.water || -+ world.getBlock(x, y, z + 1).getMaterial() == Material.water); ++ boolean isBeach = this == Blocks.field_150349_c || this == Blocks.field_150346_d || this == Blocks.field_150354_m; ++ boolean hasWater = (world.func_147439_a(x - 1, y, z ).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x + 1, y, z ).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x, y, z - 1).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x, y, z + 1).func_149688_o() == Material.field_151586_h); + return isBeach && hasWater; + } + @@ -958,9 +957,9 @@ + */ + public void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { -+ if (this == Blocks.grass || this == Blocks.farmland) ++ if (this == Blocks.field_150349_c || this == Blocks.field_150458_ak) + { -+ world.setBlock(x, y, z, Blocks.dirt, 0, 2); ++ world.func_147465_d(x, y, z, Blocks.field_150346_d, 0, 2); + } + } + @@ -977,9 +976,9 @@ + */ + public boolean isFertile(World world, int x, int y, int z) + { -+ if (this == Blocks.farmland) ++ if (this == Blocks.field_150458_ak) + { -+ return world.getBlockMetadata(x, y, z) > 0; ++ return world.func_72805_g(x, y, z) > 0; + } + + return false; @@ -1001,7 +1000,7 @@ + */ + public int getLightOpacity(IBlockAccess world, int x, int y, int z) + { -+ return getLightOpacity(); ++ return func_149717_k(); + } + + /** @@ -1017,11 +1016,11 @@ + { + if (entity instanceof EntityWither) + { -+ return this != Blocks.bedrock && this != Blocks.end_portal && this != Blocks.end_portal_frame && this != Blocks.command_block; ++ return this != Blocks.field_150357_h && this != Blocks.field_150384_bq && this != Blocks.field_150378_br && this != Blocks.field_150483_bI; + } + else if (entity instanceof EntityDragon) + { -+ return this != Blocks.obsidian && this != Blocks.end_stone && this != Blocks.bedrock; ++ return this != Blocks.field_150343_Z && this != Blocks.field_150377_bs && this != Blocks.field_150357_h; + } + + return true; @@ -1041,7 +1040,7 @@ + */ + public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) + { -+ return this == Blocks.emerald_block || this == Blocks.gold_block || this == Blocks.diamond_block || this == Blocks.iron_block; ++ return this == Blocks.field_150475_bE || this == Blocks.field_150340_R || this == Blocks.field_150484_ah || this == Blocks.field_150339_S; + } + + /** @@ -1086,7 +1085,7 @@ + */ + public float getEnchantPowerBonus(World world, int x, int y, int z) + { -+ return this == Blocks.bookshelf ? 1 : 0; ++ return this == Blocks.field_150342_X ? 1 : 0; + } + + /** @@ -1101,12 +1100,12 @@ + */ + public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) + { -+ if (this == Blocks.wool) ++ if (this == Blocks.field_150325_L) + { -+ int meta = world.getBlockMetadata(x, y, z); ++ int meta = world.func_72805_g(x, y, z); + if (meta != colour) + { -+ world.setBlockMetadataWithNotify(x, y, z, colour, 3); ++ world.func_72921_c(x, y, z, colour, 3); + return true; + } + } @@ -1151,7 +1150,7 @@ + */ + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) + { -+ return isNormalCube(); ++ return func_149721_r(); + } + + /** @@ -1244,7 +1243,7 @@ + */ + public boolean isToolEffective(String type, int metadata) + { -+ if ("pickaxe".equals(type) && (this == Blocks.redstone_ore || this == Blocks.lit_redstone_ore || this == Blocks.obsidian)) ++ if ("pickaxe".equals(type) && (this == Blocks.field_150450_ax || this == Blocks.field_150439_ay || this == Blocks.field_150343_Z)) + return false; + if (harvestTool[metadata] == null) return false; + return harvestTool[metadata].equals(type); @@ -1253,4 +1252,4 @@ + public static class SoundType { - public final String soundName; + public final String field_150501_a; diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch index 77c6902b97..04a0d41774 100644 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBush.java.patch @@ -15,25 +15,25 @@ { private static final String __OBFID = "CL_00000208"; -@@ -28,7 +33,7 @@ - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -27,7 +32,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canPlaceBlockOn(p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); -+ return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); +- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); ++ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); } - // JAVADOC METHOD $$ func_149854_a -@@ -63,7 +68,7 @@ - // JAVADOC METHOD $$ func_149718_j - public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + protected boolean func_149854_a(Block p_149854_1_) +@@ -57,7 +62,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -- return this.canPlaceBlockOn(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); -+ return p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); +- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } - // JAVADOC METHOD $$ func_149668_a -@@ -89,4 +94,37 @@ + public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) +@@ -79,4 +84,37 @@ { return 1; } @@ -41,21 +41,21 @@ + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { -+ if (this == Blocks.wheat) return Crop; -+ if (this == Blocks.carrots) return Crop; -+ if (this == Blocks.potatoes) return Crop; -+ if (this == Blocks.melon_stem) return Crop; -+ if (this == Blocks.pumpkin_stem) return Crop; -+ if (this == Blocks.deadbush) return Desert; -+ if (this == Blocks.waterlily) return Water; -+ if (this == Blocks.red_mushroom) return Cave; -+ if (this == Blocks.brown_mushroom) return Cave; -+ if (this == Blocks.nether_wart) return Nether; -+ if (this == Blocks.sapling) return Plains; -+ if (this == Blocks.tallgrass) return Plains; -+ if (this == Blocks.double_plant) return Plains; -+ if (this == Blocks.red_flower) return Plains; -+ if (this == Blocks.yellow_flower) return Plains; ++ if (this == Blocks.field_150464_aj) return Crop; ++ if (this == Blocks.field_150459_bM) return Crop; ++ if (this == Blocks.field_150469_bN) return Crop; ++ if (this == Blocks.field_150394_bc) return Crop; ++ if (this == Blocks.field_150393_bb) return Crop; ++ if (this == Blocks.field_150330_I) return Desert; ++ if (this == Blocks.field_150392_bi) return Water; ++ if (this == Blocks.field_150337_Q) return Cave; ++ if (this == Blocks.field_150338_P) return Cave; ++ if (this == Blocks.field_150388_bm) return Nether; ++ if (this == Blocks.field_150345_g) return Plains; ++ if (this == Blocks.field_150329_H) return Plains; ++ if (this == Blocks.field_150398_cm) return Plains; ++ if (this == Blocks.field_150328_O) return Plains; ++ if (this == Blocks.field_150327_N) return Plains; + return Plains; + } + @@ -68,6 +68,6 @@ + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { -+ return world.getBlockMetadata(x, y, z); ++ return world.func_72805_g(x, y, z); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch index 2968826c47..c460728736 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockButton.java.patch @@ -10,11 +10,11 @@ public abstract class BlockButton extends Block { private final boolean field_150047_a; -@@ -54,13 +57,20 @@ - // JAVADOC METHOD $$ func_149707_d - public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -49,12 +52,19 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); +- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || + (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || @@ -22,48 +22,47 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST)); } - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); + return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) || + (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) || + (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) || + (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH)); } - // JAVADOC METHOD $$ func_149660_a -@@ -70,19 +80,21 @@ + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -63,19 +73,21 @@ int k1 = j1 & 8; j1 &= 7; -- if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) +- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) + ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_); + + if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { j1 = 4; } -- else if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) +- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) + else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { j1 = 3; } -- else if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) +- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) + else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { j1 = 2; } -- else if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) +- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) + else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { j1 = 1; } -@@ -96,7 +108,11 @@ +@@ -89,7 +101,11 @@ private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_) { -- return p_150045_1_.getBlock(p_150045_2_ - 1, p_150045_3_, p_150045_4_).isNormalCube() ? 1 : (p_150045_1_.getBlock(p_150045_2_ + 1, p_150045_3_, p_150045_4_).isNormalCube() ? 2 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ - 1).isNormalCube() ? 3 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ + 1).isNormalCube() ? 4 : 1))); +- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1))); + if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1; + if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2; + if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3; @@ -71,30 +70,30 @@ + return 1; } - // JAVADOC METHOD $$ func_149695_a -@@ -107,22 +123,22 @@ - int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -99,22 +115,22 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7; boolean flag = false; -- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 1) +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 2) +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && l == 3) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && l == 4) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index 56c37bfef3..b79414ad8b 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -15,18 +15,18 @@ { @SideOnly(Side.CLIENT) private IIcon field_150041_a; -@@ -135,7 +139,7 @@ +@@ -125,7 +129,7 @@ else { - Block block = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); -- return block == Blocks.cactus || block == Blocks.sand; + Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); +- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m; + return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } } -@@ -152,4 +156,22 @@ - this.field_150041_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); - this.field_150040_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); +@@ -141,4 +145,22 @@ + this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top"); + this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom"); } + + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch index 1bdf355848..baac7a2db4 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockChest.java.patch @@ -9,36 +9,36 @@ public class BlockChest extends BlockContainer { private final Random field_149955_b = new Random(); -@@ -416,7 +418,7 @@ +@@ -407,7 +409,7 @@ { return null; } -- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_).isNormalCube()) +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r()) + else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN)) { return null; } -@@ -424,19 +426,19 @@ +@@ -415,19 +417,19 @@ { return null; } -- else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) -+ else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) +- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) { return null; } -- else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) -+ else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) +- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) { return null; } -- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) -+ else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) { return null; } -- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) -+ else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) { return null; } diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index 487b57ba63..5e271ea592 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -8,11 +8,11 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; -@@ -173,6 +174,13 @@ - // JAVADOC METHOD $$ func_149690_a - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -160,6 +161,13 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { -+ super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } + + @Override @@ -22,24 +22,24 @@ int j1 = func_149987_c(p_149690_5_); byte b0 = 1; -@@ -183,8 +191,9 @@ +@@ -170,8 +178,9 @@ for (int k1 = 0; k1 < b0; ++k1) { -- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.dye, 1, 3)); -+ dropped.add(new ItemStack(Items.dye, 1, 3)); +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3)); ++ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3)); } + return dropped; } - // JAVADOC METHOD $$ func_149694_d -@@ -231,4 +240,10 @@ + @SideOnly(Side.CLIENT) +@@ -216,4 +225,10 @@ ++j1; - p_149853_1_.setBlockMetadataWithNotify(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2); + p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2); } + + @Override -+ public Item getItemDropped(int par1, Random par2Random, int par3) ++ public Item func_149650_a(int par1, Random par2Random, int par3) + { + return null; + } diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index 5500c7f0c0..16dd140952 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -16,26 +16,26 @@ public class BlockCrops extends BlockBush implements IGrowable { -@@ -91,11 +93,11 @@ +@@ -89,11 +91,11 @@ { float f1 = 0.0F; -- if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1) == Blocks.farmland) -+ if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) +- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak) ++ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) { f1 = 1.0F; -- if (p_149864_1_.getBlockMetadata(l, p_149864_3_ - 1, i1) > 0) -+ if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) +- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0) ++ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) { f1 = 3.0F; } -@@ -150,22 +152,6 @@ - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -145,22 +147,6 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); - -- if (!p_149690_1_.isRemote) +- if (!p_149690_1_.field_72995_K) - { - if (p_149690_5_ >= 7) - { @@ -43,17 +43,17 @@ - - for (int k1 = 0; k1 < j1; ++k1) - { -- if (p_149690_1_.rand.nextInt(15) <= p_149690_5_) +- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_) - { -- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); - } - } - } - } } - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -211,4 +197,23 @@ + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -204,4 +190,23 @@ { this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); } @@ -67,7 +67,7 @@ + { + for (int i = 0; i < 3 + fortune; ++i) + { -+ if (world.rand.nextInt(15) <= metadata) ++ if (world.field_73012_v.nextInt(15) <= metadata) + { + ret.add(new ItemStack(this.func_149866_i(), 1, 0)); + } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index 651fa6bbf2..554d64cff0 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java -@@ -258,7 +258,7 @@ +@@ -249,7 +249,7 @@ { - if (this.blockMaterial == Material.iron) + if (this.field_149764_J == Material.field_151573_f) { - return true; + return false; //Allow items to interact with the door } else { -@@ -379,7 +379,7 @@ - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -367,7 +367,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_3_ >= 255 ? false : World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); -+ return p_149742_3_ >= p_149742_1_.getHeight() - 1 ? false : World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); +- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); ++ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); } - // JAVADOC METHOD $$ func_149656_h + public int func_149656_h() diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch index 66be5939f6..49187fdb1e 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java -@@ -86,6 +86,7 @@ - // JAVADOC METHOD $$ func_149718_j - public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) +@@ -81,6 +81,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -+ if (p_149718_1_.getBlock(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. - int l = p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_, p_149718_4_); - return func_149887_c(l) ? p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.getBlock(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); ++ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. + int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_); + return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); } diff --git a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch index 200b96e8e3..c38ada9c6a 100644 --- a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFalling.java +++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java -@@ -88,7 +88,7 @@ +@@ -84,7 +84,7 @@ { - Block block = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_); + Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_); -- if (block.blockMaterial == Material.air) +- if (block.field_149764_J == Material.field_151579_a) + if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_)) { return true; } -@@ -98,6 +98,7 @@ +@@ -94,6 +94,7 @@ } else { + //TODO: King, take a look here when doing liquids! - Material material = block.blockMaterial; - return material == Material.water ? true : material == Material.lava; + Material material = block.field_149764_J; + return material == Material.field_151586_h ? true : material == Material.field_151587_i; } diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch index 7f2c532db5..d964fd5321 100644 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -9,11 +9,11 @@ public class BlockFarmland extends Block { -@@ -100,7 +102,7 @@ +@@ -94,7 +96,7 @@ { - Block block = p_149822_1_.getBlock(l, p_149822_3_ + 1, i1); + Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1); -- if (block == Blocks.wheat || block == Blocks.melon_stem || block == Blocks.pumpkin_stem || block == Blocks.potatoes || block == Blocks.carrots) +- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM) + if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block)) { return true; diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index c5f51d9b5e..362ffb861e 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -30,7 +30,7 @@ private IIcon[] field_149850_M; private static final String __OBFID = "CL_00000245"; @@ -54,10 +61,10 @@ - Blocks.fire.func_149842_a(getIdFromBlock(Blocks.carpet), 60, 20); + Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20); } + @Deprecated // Use setFireInfo @@ -38,44 +38,44 @@ { - this.field_149849_a[p_149842_1_] = p_149842_2_; - this.field_149848_b[p_149842_1_] = p_149842_3_; -+ this.setFireInfo((Block)Block.blockRegistry.getObjectById(p_149842_1_), p_149842_2_, p_149842_3_); ++ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_); } - // JAVADOC METHOD $$ func_149668_a -@@ -101,13 +108,8 @@ + public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) +@@ -94,13 +101,8 @@ { - if (p_149674_1_.getGameRules().getGameRuleBooleanValue("doFireTick")) + if (p_149674_1_.func_82736_K().func_82766_b("doFireTick")) { -- boolean flag = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.netherrack; -+ boolean flag = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); +- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL; ++ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); -- if (p_149674_1_.provider instanceof WorldProviderEnd && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.bedrock) +- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h) - { - flag = true; - } - - if (!this.canPlaceBlockAt(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) + if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { - p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); -@@ -135,7 +137,7 @@ - p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); +@@ -128,7 +130,7 @@ + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); } } -- else if (!flag && !this.canBlockCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0) +- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0) + else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0) { - p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); } -@@ -149,12 +151,12 @@ +@@ -142,12 +144,12 @@ b0 = -50; } -- this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); -- this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); -- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l); -- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l); -- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l); -- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l); + this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST ); + this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST ); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP ); @@ -85,29 +85,29 @@ for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1) { -@@ -209,10 +211,16 @@ +@@ -201,10 +203,16 @@ + return false; } - // JAVADOC METHOD $$ func_149841_a + @Deprecated - private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) + private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) { -- int j1 = this.field_149848_b[Block.getIdFromBlock(p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_))]; +- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))]; + this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP); + } + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face) + { -+ int j1 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); ++ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); + if (p_149841_6_.nextInt(p_149841_5_) < j1) { - boolean flag = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; -@@ -243,7 +251,12 @@ - // JAVADOC METHOD $$ func_149847_e - private boolean canNeighborBurn(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) + boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W; +@@ -234,7 +242,12 @@ + + private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) { -- return this.canBlockCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); +- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); + return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) || + this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) || @@ -116,8 +116,8 @@ + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH); } - // JAVADOC METHOD $$ func_149845_m -@@ -257,12 +270,13 @@ + private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) +@@ -247,12 +260,13 @@ } else { @@ -137,77 +137,77 @@ return l; } } -@@ -274,15 +288,16 @@ +@@ -262,15 +276,16 @@ + return false; } - // JAVADOC METHOD $$ func_149844_e + @Deprecated - public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) + public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) { -- return this.field_149849_a[Block.getIdFromBlock(p_149844_1_.getBlock(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; +- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; + return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP); } + @Deprecated public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) { -- int i1 = this.field_149849_a[Block.getIdFromBlock(p_149846_1_.getBlock(p_149846_2_, p_149846_3_, p_149846_4_))]; +- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))]; - return i1 > p_149846_5_ ? i1 : p_149846_5_; + return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP); } - // JAVADOC METHOD $$ func_149742_c -@@ -330,9 +345,9 @@ + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -314,9 +329,9 @@ float f1; float f2; -- if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) -+ if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) +- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) ++ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) { -- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) -+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) { for (l = 0; l < 2; ++l) { -@@ -343,7 +358,7 @@ +@@ -327,7 +342,7 @@ } } -- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) -+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) { for (l = 0; l < 2; ++l) { -@@ -354,7 +369,7 @@ +@@ -338,7 +353,7 @@ } } -- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) -+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) { for (l = 0; l < 2; ++l) { -@@ -365,7 +380,7 @@ +@@ -349,7 +364,7 @@ } } -- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) -+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) { for (l = 0; l < 2; ++l) { -@@ -376,7 +391,7 @@ +@@ -360,7 +375,7 @@ } } -- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) -+ if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) { for (l = 0; l < 2; ++l) { -@@ -422,4 +437,101 @@ +@@ -405,4 +420,101 @@ { - return MapColor.tntColor; + return MapColor.field_151656_f; } + + /*================================= Forge Start ======================================*/ @@ -220,8 +220,8 @@ + + public void setFireInfo(Block block, int encouragement, int flammibility) + { -+ if (block == Blocks.air) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); -+ int id = Block.getIdFromBlock(block); ++ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); ++ int id = Block.func_149682_b(block); + this.field_149849_a[id] = encouragement; + this.field_149848_b[id] = flammibility; + @@ -253,7 +253,7 @@ + + for (Entry e : blockInfo.entrySet()) + { -+ int id = Block.getIdFromBlock(e.getKey()); ++ int id = Block.func_149682_b(e.getKey()); + if (id >= 0 && id < 4096) + { + field_149849_a[id] = e.getValue().encouragement; @@ -264,13 +264,13 @@ + + public int getFlammability(Block block) + { -+ int id = Block.getIdFromBlock(block); ++ int id = Block.func_149682_b(block); + return id >= 0 && id < 4096 ? field_149848_b[id] : 0; + } + + public int getEncouragement(Block block) + { -+ int id = Block.getIdFromBlock(block); ++ int id = Block.func_149682_b(block); + return id >= 0 && id < 4096 ? field_149849_a[id] : 0; + } + @@ -286,7 +286,7 @@ + */ + public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { -+ return world.getBlock(x, y, z).isFlammable(world, x, y, z, face); ++ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face); + } + + /** @@ -302,7 +302,7 @@ + */ + public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) + { -+ int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face); ++ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face); + return (newChance > oldChance ? newChance : oldChance); + } + /*================================= Forge Start ======================================*/ diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch index d29a955866..48d3edddf1 100644 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -1,37 +1,37 @@ --- ../src-base/minecraft/net/minecraft/block/BlockGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java -@@ -45,7 +45,7 @@ +@@ -43,7 +43,7 @@ { - if (!p_149674_1_.isRemote) + if (!p_149674_1_.field_72995_K) { -- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) -+ if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) +- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) ++ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) { - p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d); } -@@ -58,7 +58,7 @@ +@@ -56,7 +56,7 @@ int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; - Block block = p_149674_1_.getBlock(i1, j1 + 1, k1); + Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); -- if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.getLightOpacity() <= 2) -+ if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) +- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) ++ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) { - p_149674_1_.setBlock(i1, j1, k1, Blocks.grass); + p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c); } -@@ -188,15 +188,7 @@ +@@ -184,15 +184,7 @@ } else { -- String s = p_149853_1_.getBiomeGenForCoords(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1); -- logger.debug("Flower in " + p_149853_1_.getBiomeGenForCoords(i1, k1).biomeName + ": " + s); +- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1); +- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s); - BlockFlower blockflower = BlockFlower.func_149857_e(s); - -- if (blockflower != null && blockflower.canBlockStay(p_149853_1_, i1, j1, k1)) +- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1)) - { - int i2 = BlockFlower.func_149856_f(s); -- p_149853_1_.setBlock(i1, j1, k1, blockflower, i2, 3); +- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3); - } -+ p_149853_1_.getBiomeGenForCoords(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1); ++ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1); } } diff --git a/patches/minecraft/net/minecraft/block/BlockIce.java.patch b/patches/minecraft/net/minecraft/block/BlockIce.java.patch index 39b2a7fa33..7ea2dab9c6 100644 --- a/patches/minecraft/net/minecraft/block/BlockIce.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockIce.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockIce.java +++ ../src-work/minecraft/net/minecraft/block/BlockIce.java -@@ -46,7 +46,7 @@ - p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); - p_149636_2_.addExhaustion(0.025F); +@@ -43,7 +43,7 @@ + p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); + p_149636_2_.func_71020_j(0.025F); -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) -+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_)) ++ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_)) { - ItemStack itemstack = this.createStackedBlock(p_149636_6_); + ItemStack itemstack = this.func_149644_j(p_149636_6_); diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index 25e6e6dc9f..c586c85af7 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -15,73 +15,72 @@ public class BlockLadder extends Block { private static final String __OBFID = "CL_00000262"; -@@ -86,7 +90,10 @@ - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -79,29 +83,32 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); } - // JAVADOC METHOD $$ func_149660_a -@@ -94,22 +101,22 @@ + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { int j1 = p_149660_9_; -- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) +- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) + if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { j1 = 2; } -- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) +- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) + if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { j1 = 3; } -- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) +- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) + if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { j1 = 4; } -- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) +- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) + if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { j1 = 5; } -@@ -123,22 +130,22 @@ - int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); +@@ -114,22 +121,22 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_); boolean flag = false; -- if (l == 2 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube()) +- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r()) + if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH)) { flag = true; } -- if (l == 3 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube()) +- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r()) + if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH)) { flag = true; } -- if (l == 4 && p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube()) +- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r()) + if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST)) { flag = true; } -- if (l == 5 && p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube()) +- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r()) + if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST)) { flag = true; } -@@ -157,4 +164,10 @@ +@@ -147,4 +154,10 @@ { return 1; } diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index ae87315ff9..657366d381 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -19,47 +19,47 @@ { int[] field_150128_a; @SideOnly(Side.CLIENT) -@@ -84,10 +86,10 @@ +@@ -82,10 +84,10 @@ { for (int l1 = -b0; l1 <= b0; ++l1) { -- if (p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).getMaterial() == Material.leaves) -+ Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) ++ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) { -- int i2 = p_149749_1_.getBlockMetadata(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); -- p_149749_1_.setBlockMetadataWithNotify(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); +- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); + block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); } } } -@@ -130,9 +132,9 @@ +@@ -127,9 +129,9 @@ { - Block block = p_149674_1_.getBlock(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); + Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); -- if (block != Blocks.log && block != Blocks.log2) +- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s) + if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { -- if (block.getMaterial() == Material.leaves) +- if (block.func_149688_o() == Material.field_151584_j) + if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; } -@@ -288,13 +290,7 @@ - // JAVADOC METHOD $$ func_149636_a - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -281,13 +283,7 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { -- if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); -- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.getItemFromBlock(this), 1, p_149636_6_ & 3)); +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3)); - } - else - { - super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } -@@ -330,4 +326,38 @@ +@@ -318,4 +314,38 @@ } public abstract String[] func_150125_e(); @@ -75,7 +75,7 @@ + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); ++ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3)); + return ret; + } + @@ -83,13 +83,13 @@ + public void beginLeavesDecay(World world, int x, int y, int z) + { + -+ int i2 = world.getBlockMetadata(x, y, z); ++ int i2 = world.func_72805_g(x, y, z); + + if ((i2 & 8) == 0) + { -+ world.setBlockMetadataWithNotify(x, y, z, i2 | 8, 4); ++ world.func_72921_c(x, y, z, i2 | 8, 4); + } -+ world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4); ++ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4); + } + + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockLever.java.patch b/patches/minecraft/net/minecraft/block/BlockLever.java.patch index a2929b115f..940121ed08 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLever.java.patch @@ -10,11 +10,11 @@ public class BlockLever extends Block { private static final String __OBFID = "CL_00000264"; -@@ -47,13 +50,24 @@ - // JAVADOC METHOD $$ func_149707_d - public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -42,12 +45,23 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 0 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_ + 1, p_149707_4_).isNormalCube() ? true : (p_149707_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())))); +- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())))); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) || + (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) || @@ -24,10 +24,9 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); } - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube() ? true : (World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_ + 1, p_149742_4_).isNormalCube())))); +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r())))); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || @@ -36,93 +35,93 @@ + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN ); } - // JAVADOC METHOD $$ func_149660_a -@@ -63,32 +77,32 @@ + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -56,32 +70,32 @@ int j1 = p_149660_9_ & 7; byte b0 = -1; -- if (p_149660_5_ == 0 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_ + 1, p_149660_4_).isNormalCube()) +- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r()) + if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN)) { b0 = 0; } -- if (p_149660_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) +- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) + if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP)) { b0 = 5; } -- if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) +- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { b0 = 4; } -- if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) +- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { b0 = 3; } -- if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) +- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { b0 = 2; } -- if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) +- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { b0 = 1; } -@@ -156,42 +170,42 @@ - int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; +@@ -147,42 +161,42 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7; boolean flag = false; -- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 1) +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 2) +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && l == 3) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && l == 4) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) { flag = true; } -- if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5) +- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5) { flag = true; } -- if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6) +- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && l == 0) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && l == 7) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch index 22690b5227..002dbc4138 100644 --- a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java +++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java -@@ -69,7 +69,7 @@ +@@ -67,7 +67,7 @@ { for (int l1 = -1; l1 <= 1; ++l1) { -- int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).waterColorMultiplier; -+ int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier(); +- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H; ++ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier(); l += (i2 & 16711680) >> 16; i1 += (i2 & 65280) >> 8; j1 += i2 & 255; diff --git a/patches/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch index 457680239f..3fe642a147 100644 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLog.java.patch @@ -8,25 +8,25 @@ import net.minecraft.world.World; public abstract class BlockLog extends BlockRotatedPillar -@@ -54,14 +55,10 @@ +@@ -53,14 +54,10 @@ { for (int l1 = -b0; l1 <= b0; ++l1) { -- if (p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).getMaterial() == Material.leaves) -+ Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) ++ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) { -- int i2 = p_149749_1_.getBlockMetadata(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); - - if ((i2 & 8) == 0) - { -- p_149749_1_.setBlockMetadataWithNotify(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); +- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); - } + block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); } } } -@@ -80,4 +77,16 @@ +@@ -79,4 +76,16 @@ { return this.field_150166_b[p_150161_1_ % this.field_150166_b.length]; } diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index 6d3a0b61a4..a5892b958c 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -8,12 +8,12 @@ import net.minecraft.world.World; public class BlockMobSpawner extends BlockContainer -@@ -39,10 +40,15 @@ - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -36,10 +37,15 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); -- int j1 = 15 + p_149690_1_.rand.nextInt(15) + p_149690_1_.rand.nextInt(15); -- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); +- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15); +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); } + private Random rand = new Random(); @@ -23,6 +23,6 @@ + return 15 + rand.nextInt(15) + rand.nextInt(15); + } + - // JAVADOC METHOD $$ func_149662_c - public boolean isOpaqueCube() + public boolean func_149662_c() { + return false; diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch index e53a3d34b7..666debf3b2 100644 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch @@ -8,12 +8,12 @@ public class BlockMushroom extends BlockBush implements IGrowable { -@@ -89,7 +90,7 @@ +@@ -85,7 +86,7 @@ if (p_149718_3_ >= 0 && p_149718_3_ < 256) { - Block block = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); -- return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.canPlaceBlockOn(block); -+ return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); + Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); +- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block); ++ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } else { diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch index 4b8ec6e7b2..db2d47ee40 100644 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java +++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java -@@ -39,7 +39,7 @@ +@@ -37,7 +37,7 @@ { - if (!p_149674_1_.isRemote) + if (!p_149674_1_.field_72995_K) { -- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) -+ if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) +- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) ++ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) { - p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d); } -@@ -52,7 +52,7 @@ +@@ -50,7 +50,7 @@ int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; - Block block = p_149674_1_.getBlock(i1, j1 + 1, k1); + Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); -- if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.getLightOpacity() <= 2) -+ if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) +- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) ++ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) { - p_149674_1_.setBlock(i1, j1, k1, this); + p_149674_1_.func_147449_b(i1, j1, k1, this); } diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch index 552fd39787..306da85741 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -16,34 +16,50 @@ public class BlockNetherWart extends BlockBush { -@@ -35,7 +37,7 @@ - // JAVADOC METHOD $$ func_149718_j - public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) +@@ -33,7 +35,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -- return this.canPlaceBlockOn(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); -+ return super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); +- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); } - // JAVADOC METHOD $$ func_149674_a -@@ -68,6 +70,8 @@ - // JAVADOC METHOD $$ func_149690_a - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) +@@ -62,25 +64,28 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { -+ super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); +- if (!p_149690_1_.field_72995_K) ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + /* - if (!p_149690_1_.isRemote) ++ if (!p_149690_1_.isRemote) { int j1 = 1; -@@ -87,6 +91,7 @@ - this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.nether_wart)); + + if (p_149690_5_ >= 3) + { +- j1 = 2 + p_149690_1_.field_73012_v.nextInt(3); ++ j1 = 2 + p_149690_1_.rand.nextInt(3); + + if (p_149690_7_ > 0) + { +- j1 += p_149690_1_.field_73012_v.nextInt(p_149690_7_ + 1); ++ j1 += p_149690_1_.rand.nextInt(p_149690_7_ + 1); + } + } + + for (int k1 = 0; k1 < j1; ++k1) + { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151075_bm)); ++ this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.nether_wart)); } } + */ } - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -117,4 +122,23 @@ - this.field_149883_a[i] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + i); + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -109,4 +114,23 @@ + this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i); } } + @@ -55,12 +71,12 @@ + + if (metadata >= 3) + { -+ count = 2 + world.rand.nextInt(3) + (fortune > 0 ? world.rand.nextInt(fortune + 1) : 0); ++ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0); + } + + for (int i = 0; i < count; i++) + { -+ ret.add(new ItemStack(Items.nether_wart)); ++ ret.add(new ItemStack(Items.field_151075_bm)); + } + + return ret; diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch index cd7bf11388..7ab468920a 100644 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOre.java.patch @@ -8,51 +8,51 @@ import net.minecraft.world.World; public class BlockOre extends Block -@@ -54,34 +55,40 @@ - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -51,34 +52,40 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } -- if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) +- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this)) + private Random rand = new Random(); + @Override + public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) + { -+ if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this)) ++ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) { int j1 = 0; - if (this == Blocks.coal_ore) + if (this == Blocks.field_150365_q) { -- j1 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 0, 2); -+ j1 = MathHelper.getRandomIntegerInRange(rand, 0, 2); +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2); ++ j1 = MathHelper.func_76136_a(rand, 0, 2); } - else if (this == Blocks.diamond_ore) + else if (this == Blocks.field_150482_ag) { -- j1 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 3, 7); -+ j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7); +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7); ++ j1 = MathHelper.func_76136_a(rand, 3, 7); } - else if (this == Blocks.emerald_ore) + else if (this == Blocks.field_150412_bA) { -- j1 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 3, 7); -+ j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7); +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7); ++ j1 = MathHelper.func_76136_a(rand, 3, 7); } - else if (this == Blocks.lapis_ore) + else if (this == Blocks.field_150369_x) { -- j1 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 2, 5); -+ j1 = MathHelper.getRandomIntegerInRange(rand, 2, 5); +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5); ++ j1 = MathHelper.func_76136_a(rand, 2, 5); } - else if (this == Blocks.quartz_ore) + else if (this == Blocks.field_150449_bY) { -- j1 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 2, 5); -+ j1 = MathHelper.getRandomIntegerInRange(rand, 2, 5); +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5); ++ j1 = MathHelper.func_76136_a(rand, 2, 5); } -- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + return j1; } + return 0; } - // JAVADOC METHOD $$ func_149692_a + public int func_149692_a(int p_149692_1_) diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch index dd717f87c8..24b8608606 100644 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -9,14 +9,14 @@ public class BlockPane extends Block { -@@ -67,10 +69,10 @@ - // JAVADOC METHOD $$ func_149743_a - public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) +@@ -62,10 +64,10 @@ + + public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { -- boolean flag = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); -- boolean flag1 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); -- boolean flag2 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); -- boolean flag3 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); +- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); +- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); +- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); +- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); + boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST ); @@ -24,14 +24,14 @@ if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { -@@ -124,10 +126,10 @@ +@@ -117,10 +119,10 @@ float f1 = 0.5625F; float f2 = 0.4375F; float f3 = 0.5625F; -- boolean flag = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); -- boolean flag1 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); -- boolean flag2 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); -- boolean flag3 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); +- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); +- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); +- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); +- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); + boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST ); @@ -39,14 +39,14 @@ if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { -@@ -195,4 +197,10 @@ - this.blockIcon = p_149651_1_.registerIcon(this.field_150101_M); - this.field_150102_N = p_149651_1_.registerIcon(this.field_150100_a); +@@ -186,4 +188,10 @@ + this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M); + this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a); } + + public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) + { -+ return canPaneConnectToBlock(world.getBlock(x, y, z)) || ++ return func_150098_a(world.func_147439_a(x, y, z)) || + world.isSideSolid(x, y, z, dir.getOpposite(), false); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index afdddbb6af..4fe844e47e 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -8,58 +8,58 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityPiston; import net.minecraft.util.AxisAlignedBB; -@@ -380,7 +381,8 @@ +@@ -360,7 +361,8 @@ return false; } - return !(p_150080_0_ instanceof ITileEntityProvider); -+ return !(p_150080_1_.getBlock(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))); ++ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_))); + } } -@@ -396,14 +398,14 @@ +@@ -375,14 +377,14 @@ { if (l1 < 13) { - if (j1 <= 0 || j1 >= 255) -+ if (j1 <= 0 || j1 >= p_150077_0_.getHeight()) ++ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K()) { return false; } - Block block = p_150077_0_.getBlock(i1, j1, k1); + Block block = p_150077_0_.func_147439_a(i1, j1, k1); -- if (block.getMaterial() != Material.air) +- if (block.func_149688_o() != Material.field_151579_a) + if (!block.isAir(p_150077_0_, i1, j1, k1)) { - if (!canPushBlock(block, p_150077_0_, i1, j1, k1, true)) + if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true)) { -@@ -442,14 +444,14 @@ +@@ -420,14 +422,14 @@ { if (l1 < 13) { - if (j1 <= 0 || j1 >= 255) -+ if (j1 <= 0 || j1 >= p_150079_1_.getHeight()) ++ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K()) { return false; } - Block block = p_150079_1_.getBlock(i1, j1, k1); + Block block = p_150079_1_.func_147439_a(i1, j1, k1); -- if (block.getMaterial() != Material.air) +- if (block.func_149688_o() != Material.field_151579_a) + if (!block.isAir(p_150079_1_, i1, j1, k1)) { - if (!canPushBlock(block, p_150079_1_, i1, j1, k1, true)) + if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true)) { -@@ -470,7 +472,9 @@ +@@ -448,7 +450,9 @@ continue; } -- block.dropBlockAsItem(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), 0); +- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 0); + //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. + float chance = block instanceof BlockSnow ? -1.0f : 1.0f; -+ block.dropBlockAsItemWithChance(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), chance, 0); - p_150079_1_.setBlockToAir(i1, j1, k1); ++ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0); + p_150079_1_.func_147468_f(i1, j1, k1); } } diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch index 20889869f1..ae47c3341c 100644 --- a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java +++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java -@@ -116,7 +116,7 @@ - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -113,7 +113,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); -+ return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); ++ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); } - // JAVADOC METHOD $$ func_149689_a + public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 2243b91949..33a34887f3 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -12,21 +12,21 @@ public static final boolean func_150051_a(Block p_150051_0_) { -- return p_150051_0_ == Blocks.rail || p_150051_0_ == Blocks.golden_rail || p_150051_0_ == Blocks.detector_rail || p_150051_0_ == Blocks.activator_rail; +- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc; + return p_150051_0_ instanceof BlockRailBase; } protected BlockRailBase(boolean p_i45389_1_) -@@ -85,7 +86,7 @@ - // JAVADOC METHOD $$ func_149645_b - public int getRenderType() +@@ -78,7 +79,7 @@ + + public int func_149645_b() { - return 9; + return renderType; } - // JAVADOC METHOD $$ func_149745_a -@@ -205,6 +206,111 @@ + public int func_149745_a(Random p_149745_1_) +@@ -193,6 +194,111 @@ } } @@ -42,7 +42,7 @@ + */ + public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z) + { -+ return isPowered(); ++ return func_150050_e(); + } + + /** @@ -86,8 +86,8 @@ + */ + public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) + { -+ int meta = world.getBlockMetadata(x, y, z); -+ if(isPowered()) ++ int meta = world.func_72805_g(x, y, z); ++ if(func_150050_e()) + { + meta = meta & 7; + } @@ -138,7 +138,7 @@ public class Rail { private World field_150660_b; -@@ -214,6 +320,7 @@ +@@ -202,6 +308,7 @@ private final boolean field_150656_f; private List field_150657_g = new ArrayList(); private static final String __OBFID = "CL_00000196"; @@ -146,12 +146,12 @@ public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_) { -@@ -221,19 +328,10 @@ +@@ -209,19 +316,10 @@ this.field_150661_c = p_i45388_3_; this.field_150658_d = p_i45388_4_; this.field_150659_e = p_i45388_5_; -- Block block = p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); -- int l = p_i45388_2_.getBlockMetadata(p_i45388_3_, p_i45388_4_, p_i45388_5_); +- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); +- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_); - - if (((BlockRailBase)block).field_150053_a) - { @@ -163,14 +163,14 @@ - this.field_150656_f = false; - } - -+ BlockRailBase block = (BlockRailBase)p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); ++ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); + int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_); + this.field_150656_f = block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); + canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); this.func_150648_a(l); } -@@ -424,7 +522,7 @@ +@@ -412,7 +510,7 @@ } } @@ -179,7 +179,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { -@@ -437,7 +535,7 @@ +@@ -425,7 +523,7 @@ } } @@ -188,7 +188,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) { -@@ -582,7 +680,7 @@ +@@ -570,7 +668,7 @@ } } @@ -197,7 +197,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { -@@ -595,7 +693,7 @@ +@@ -583,7 +681,7 @@ } } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch index 24ae97a262..706b86c329 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java -@@ -237,4 +237,19 @@ +@@ -228,4 +228,19 @@ { return new TileEntityComparator(); } @@ -10,7 +10,7 @@ + { + if (y == tileY && world instanceof World) + { -+ onNeighborBlockChange((World)world, x, y, z, world.getBlock(tileX, tileY, tileZ)); ++ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ)); + } + } + diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index f2a50c2bdd..b9f957d198 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -8,24 +8,24 @@ import net.minecraft.world.World; public class BlockRedstoneOre extends Block -@@ -96,12 +97,17 @@ - public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -88,12 +89,17 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } -- if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) +- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this)) + private Random rand = new Random(); + @Override // World, meta, fortune + public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) + { -+ if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this)) ++ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) { -- int j1 = 1 + p_149690_1_.rand.nextInt(5); -- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); +- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5); +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + return 1 + rand.nextInt(5); } + return 0; } - // JAVADOC METHOD $$ func_149734_b + @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index fc84df494d..dc64874228 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -415,7 +415,7 @@ +@@ -405,7 +405,7 @@ } - else if (!Blocks.unpowered_repeater.func_149907_e(block)) + else if (!Blocks.field_150413_aR.func_149907_e(block)) { -- return block.canProvidePower() && p_150174_4_ != -1; +- return block.func_149744_f() && p_150174_4_ != -1; + return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_); } else diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index 7db32e8651..0b6296a504 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -13,18 +13,18 @@ { private static final String __OBFID = "CL_00000300"; -@@ -59,7 +63,7 @@ - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -57,7 +61,7 @@ + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { - Block block = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); -- return block == this ? true : (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand ? false : (p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).getMaterial() == Material.water ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).getMaterial() == Material.water)))); + Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h)))); + return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this); } - // JAVADOC METHOD $$ func_149695_a -@@ -130,4 +134,22 @@ + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -120,4 +124,22 @@ { - return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeGrassColor(p_149720_2_, p_149720_3_, p_149720_4_); + return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_); } + + @Override @@ -42,6 +42,6 @@ + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { -+ return world.getBlockMetadata(x, y, z); ++ return world.func_72805_g(x, y, z); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index ce9966ca66..0a382e1163 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSapling.java +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java -@@ -73,6 +73,7 @@ +@@ -71,6 +71,7 @@ public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_) { + if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return; - int l = p_149878_1_.getBlockMetadata(p_149878_2_, p_149878_3_, p_149878_4_) & 7; + int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7; Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); int i1 = 0; diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index d11274fe39..01e426c740 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -8,29 +8,28 @@ import java.util.Iterator; import java.util.Random; import net.minecraft.block.material.Material; -@@ -118,9 +119,6 @@ +@@ -108,8 +109,6 @@ return p_149692_1_; } -- // JAVADOC METHOD $$ func_149690_a -- public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} +- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} - - // JAVADOC METHOD $$ func_149681_a - public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) + public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { -@@ -130,29 +128,38 @@ - p_149681_1_.setBlockMetadataWithNotify(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4); + if (p_149681_6_.field_71075_bZ.field_75098_d) +@@ -118,29 +117,38 @@ + p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4); } -+ this.dropBlockAsItem(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); ++ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); + - super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); } - public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { -- if (!p_149749_1_.isRemote) -+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); +- if (!p_149749_1_.field_72995_K) ++ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + @Override @@ -40,24 +39,24 @@ { if ((p_149749_6_ & 8) == 0) { - ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); - TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); + TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_); + if (tileentityskull == null) return ret; + if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_145907_c() != null && tileentityskull.func_145907_c().length() > 0) { - itemstack.setTagCompound(new NBTTagCompound()); - itemstack.getTagCompound().setString("SkullOwner", tileentityskull.func_145907_c()); + itemstack.func_77982_d(new NBTTagCompound()); + itemstack.func_77978_p().func_74778_a("SkullOwner", tileentityskull.func_145907_c()); } -- this.dropBlockAsItem(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack); +- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack); + ret.add(itemstack); } - -- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); +- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); } + return ret; } - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index 83c8795c4a..759c69a1cc 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,54 +1,53 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSnow.java +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java -@@ -79,7 +79,7 @@ - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -73,7 +73,7 @@ + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { - Block block = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); -- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; -+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; + Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; ++ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; } - // JAVADOC METHOD $$ func_149695_a -@@ -92,7 +92,6 @@ + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -85,7 +85,6 @@ { - if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) + if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) { -- this.dropBlockAsItem(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.getBlockMetadata(p_150155_2_, p_150155_3_, p_150155_4_), 0); - p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_); +- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0); + p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_); return false; } -@@ -105,10 +104,8 @@ - // JAVADOC METHOD $$ func_149636_a - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -97,10 +96,8 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - int i1 = p_149636_6_ & 7; -- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.snowball, i1 + 1, 0)); -+ super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); - p_149636_1_.setBlockToAir(p_149636_3_, p_149636_4_, p_149636_5_); -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0)); ++ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_); +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); } - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -119,7 +116,7 @@ - // JAVADOC METHOD $$ func_149745_a - public int quantityDropped(Random p_149745_1_) + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -110,14 +107,13 @@ + + public int func_149745_a(Random p_149745_1_) { - return 0; + return 1; } - // JAVADOC METHOD $$ func_149674_a -@@ -127,7 +124,6 @@ + public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { - if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) + if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) { -- this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); - p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); +- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); } } -@@ -138,4 +134,34 @@ +@@ -127,4 +123,34 @@ { - return p_149646_5_ == 1 ? true : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); } + + /** @@ -77,7 +76,7 @@ + */ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { -+ int meta = world.getBlockMetadata(x, y, z); -+ return meta >= 7 ? false : blockMaterial.isReplaceable(); ++ int meta = world.func_72805_g(x, y, z); ++ return meta >= 7 ? false : field_149764_J.func_76222_j(); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 041984ed9b..41d698267f 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -16,46 +16,68 @@ public class BlockStem extends BlockBush implements IGrowable { -@@ -103,7 +105,7 @@ +@@ -101,7 +103,7 @@ - Block block = p_149674_1_.getBlock(j1, p_149674_3_ - 1, k1); + Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1); -- if (p_149674_1_.getBlock(j1, p_149674_3_, k1).blockMaterial == Material.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) -+ if (p_149674_1_.isAirBlock(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.dirt || block == Blocks.grass)) +- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) ++ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) { - p_149674_1_.setBlock(j1, p_149674_3_, k1, this.field_149877_a); + p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a); } -@@ -146,11 +148,11 @@ - Block block8 = p_149875_1_.getBlock(l, p_149875_3_ - 1, i1); +@@ -144,11 +146,11 @@ + Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1); float f1 = 0.0F; -- if (block8 == Blocks.farmland) +- if (block8 == Blocks.field_150458_ak) + if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this)) { f1 = 1.0F; -- if (p_149875_1_.getBlockMetadata(l, p_149875_3_ - 1, i1) > 0) +- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0) + if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1)) { f1 = 3.0F; } -@@ -224,6 +226,7 @@ +@@ -215,28 +217,30 @@ { - super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); +- if (!p_149690_1_.field_72995_K) + /* - if (!p_149690_1_.isRemote) ++ if (!p_149690_1_.isRemote) { Item item = null; -@@ -246,6 +249,7 @@ + +- if (this.field_149877_a == Blocks.field_150423_aK) ++ if (this.field_149877_a == Blocks.pumpkin) + { +- item = Items.field_151080_bb; ++ item = Items.pumpkin_seeds; + } + +- if (this.field_149877_a == Blocks.field_150440_ba) ++ if (this.field_149877_a == Blocks.melon_block) + { +- item = Items.field_151081_bc; ++ item = Items.melon_seeds; + } + + for (int j1 = 0; j1 < 3; ++j1) + { +- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_) ++ if (p_149690_1_.rand.nextInt(15) <= p_149690_5_) + { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item)); ++ this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item)); } } } + */ } - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -293,4 +297,22 @@ + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -282,4 +286,22 @@ { this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); } @@ -67,8 +89,8 @@ + ArrayList ret = new ArrayList(); + + Item item = null; -+ item = field_149877_a == Blocks.pumpkin ? Items.pumpkin_seeds : item; -+ item = field_149877_a == Blocks.melon_block ? Items.melon_seeds : item; ++ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item; ++ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item; + + for (int i = 0; item != null && i < 3; i++) + { diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index 51fa903f9c..29668a9828 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -20,31 +20,31 @@ { private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"}; @SideOnly(Side.CLIENT) -@@ -75,7 +78,7 @@ +@@ -71,7 +74,7 @@ - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { -- return p_149650_2_.nextInt(8) == 0 ? Items.wheat_seeds : null; +- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null; + return null; } - // JAVADOC METHOD $$ func_149679_a -@@ -87,13 +90,7 @@ - // JAVADOC METHOD $$ func_149636_a - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + public int func_149679_a(int p_149679_1_, Random p_149679_2_) +@@ -81,13 +84,7 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { -- if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); -- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.tallgrass, 1, p_149636_6_)); +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_)); - } - else - { - super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } -@@ -151,4 +148,28 @@ - Blocks.double_plant.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2); +@@ -143,4 +140,28 @@ + Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2); } } + @@ -52,7 +52,7 @@ + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); -+ if (world.rand.nextInt(8) != 0) return ret; ++ if (world.field_73012_v.nextInt(8) != 0) return ret; + ItemStack seed = ForgeHooks.getGrassSeed(world); + if (seed != null) ret.add(seed); + return ret; @@ -68,7 +68,7 @@ + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); -+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); ++ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z))); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch index 939491edd1..046a08b75c 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -8,19 +8,18 @@ public class BlockTorch extends Block { -@@ -55,14 +56,18 @@ +@@ -51,13 +52,17 @@ else { - Block block = p_150107_1_.getBlock(p_150107_2_, p_150107_3_, p_150107_4_); -- return block == Blocks.fence || block == Blocks.nether_brick_fence || block == Blocks.glass || block == Blocks.cobblestone_wall; + Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_); +- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK; + return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_); } } - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); +- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) || @@ -28,81 +27,81 @@ + func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); } - // JAVADOC METHOD $$ func_149660_a -@@ -75,22 +80,22 @@ + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -69,22 +74,22 @@ j1 = 5; } -- if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) +- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) { j1 = 4; } -- if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) +- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) { j1 = 3; } -- if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) { j1 = 2; } -- if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) { j1 = 1; } -@@ -114,19 +119,19 @@ +@@ -106,19 +111,19 @@ { - if (p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_) == 0) + if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0) { -- if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) +- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) + if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true)) { - p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2); + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2); } -- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) +- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true)) { - p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2); + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2); } -- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) +- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true)) { - p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2); + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2); } -- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) +- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true)) { - p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2); + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2); } -@@ -152,22 +157,22 @@ - int l = p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_); +@@ -143,22 +148,22 @@ + int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_); boolean flag = false; -- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1) +- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1) + if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1) { flag = true; } -- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2) +- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2) + if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2) { flag = true; } -- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3) +- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3) + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3) { flag = true; } -- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4) +- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4) + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch index 8583073fe6..764ccd8925 100644 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -13,37 +13,37 @@ private static final String __OBFID = "CL_00000327"; protected BlockTrapDoor(Material p_i45434_1_) -@@ -173,7 +176,7 @@ +@@ -163,7 +166,7 @@ --i1; } -- if (!func_150119_a(p_149695_1_.getBlock(i1, p_149695_3_, j1))) -+ if (!(func_150119_a(p_149695_1_.getBlock(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2)))) +- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1))) ++ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2)))) { - p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); - this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); -@@ -231,6 +234,7 @@ - // JAVADOC METHOD $$ func_149707_d - public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_); + this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); +@@ -218,6 +221,7 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + if (disableValidation) return true; if (p_149707_5_ == 0) { return false; -@@ -261,7 +265,7 @@ +@@ -248,7 +252,7 @@ --p_149707_2_; } -- return func_150119_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_)); -+ return func_150119_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP); +- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)); ++ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP); } } -@@ -272,6 +276,7 @@ +@@ -259,6 +263,7 @@ private static boolean func_150119_a(Block p_150119_0_) { + if (disableValidation) return true; - return p_150119_0_.blockMaterial.isOpaque() && p_150119_0_.renderAsNormalBlock() || p_150119_0_ == Blocks.glowstone || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; + return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; } } diff --git a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch index de38069940..d2686dfbd0 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch @@ -10,11 +10,11 @@ public class BlockTripWireHook extends Block { private static final String __OBFID = "CL_00000329"; -@@ -53,13 +56,20 @@ - // JAVADOC METHOD $$ func_149707_d - public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -47,34 +50,41 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); +- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || + (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || @@ -22,77 +22,75 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); } - // JAVADOC METHOD $$ func_149742_c - public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); } - // JAVADOC METHOD $$ func_149660_a -@@ -67,22 +77,22 @@ + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { byte b0 = 0; -- if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) +- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) { b0 = 2; } -- if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) +- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) { b0 = 0; } -- if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) { b0 = 1; } -- if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) { b0 = 3; } -@@ -107,22 +117,22 @@ +@@ -97,22 +107,22 @@ int i1 = l & 3; boolean flag = false; -- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && i1 == 3) +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && i1 == 1) +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && i1 == 0) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0) { flag = true; } -- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && i1 == 2) +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2) { flag = true; } -@@ -143,7 +153,7 @@ +@@ -133,7 +143,7 @@ boolean flag3 = (p_150136_6_ & 8) == 8; boolean flag4 = !p_150136_5_; boolean flag5 = false; -- boolean flag6 = !World.doesBlockHaveSolidTopSurface(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); +- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); + boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP); - int l1 = Direction.offsetX[k1]; - int i2 = Direction.offsetZ[k1]; + int l1 = Direction.field_71583_a[k1]; + int i2 = Direction.field_71581_b[k1]; int j2 = 0; diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index 93d2548370..8f92202167 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -24,18 +24,18 @@ { private static final String __OBFID = "CL_00000330"; -@@ -389,14 +393,28 @@ - // JAVADOC METHOD $$ func_149636_a - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -375,14 +379,28 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { -- if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); -- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.vine, 1, 0)); +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0)); - } - else - { - super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } + diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 9b65c068bf..6569649b8b 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -15,16 +15,16 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.LWJGLException; -@@ -274,7 +282,7 @@ - this.startTimerHackThread(); - this.session = par1Session; - logger.info("Setting user: " + par1Session.getUsername()); -- logger.info("(Session ID is " + par1Session.getSessionID() + ")"); +@@ -245,7 +253,7 @@ + this.func_71389_H(); + this.field_71449_j = p_i1014_1_; + field_147123_G.info("Setting user: " + p_i1014_1_.func_111285_a()); +- field_147123_G.info("(Session ID is " + p_i1014_1_.func_111286_b() + ")"); + //logger.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid... - this.isDemo = par5; - this.displayWidth = par2; - this.displayHeight = par3; -@@ -450,7 +458,7 @@ + this.field_71459_aj = p_i1014_5_; + this.field_71443_c = p_i1014_2_; + this.field_71440_d = p_i1014_3_; +@@ -419,7 +427,7 @@ try { @@ -33,32 +33,32 @@ } catch (LWJGLException lwjglexception) { -@@ -550,7 +558,7 @@ - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); +@@ -518,7 +526,7 @@ + this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o); FMLClientHandler.instance().finishMinecraftLoading(); - this.checkGLError("Post startup"); -- this.ingameGUI = new GuiIngame(this); -+ this.ingameGUI = new GuiIngameForge(this); + this.func_71361_d("Post startup"); +- this.field_71456_v = new GuiIngame(this); ++ this.field_71456_v = new GuiIngameForge(this); - if (this.serverName != null) + if (this.field_71475_ae != null) { -@@ -737,11 +745,6 @@ - // JAVADOC METHOD $$ func_147108_a - public void displayGuiScreen(GuiScreen p_147108_1_) +@@ -701,11 +709,6 @@ + + public void func_147108_a(GuiScreen p_147108_1_) { -- if (this.currentScreen != null) +- if (this.field_71462_r != null) - { -- this.currentScreen.onGuiClosed(); +- this.field_71462_r.func_146281_b(); - } - - if (p_147108_1_ == null && this.theWorld == null) + if (p_147108_1_ == null && this.field_71441_e == null) { p_147108_1_ = new GuiMainMenu(); -@@ -751,6 +754,17 @@ +@@ -715,6 +718,17 @@ p_147108_1_ = new GuiGameOver(); } -+ GuiScreen old = this.currentScreen; ++ GuiScreen old = this.field_71462_r; + GuiOpenEvent event = new GuiOpenEvent(p_147108_1_); + + if (MinecraftForge.EVENT_BUS.post(event)) return; @@ -66,47 +66,47 @@ + p_147108_1_ = event.gui; + if (old != null && p_147108_1_ != old) + { -+ old.onGuiClosed(); ++ old.func_146281_b(); + } + if (p_147108_1_ instanceof GuiMainMenu) { - this.gameSettings.showDebugInfo = false; -@@ -1341,7 +1355,7 @@ + this.field_71474_y.field_74330_P = false; +@@ -1296,7 +1310,7 @@ - if (this.thePlayer.isCurrentToolAdventureModeExempt(i, j, k)) + if (this.field_71439_g.func_82246_f(i, j, k)) { -- this.effectRenderer.addBlockHitEffects(i, j, k, this.objectMouseOver.sideHit); -+ this.effectRenderer.addBlockHitEffects(i, j, k, this.objectMouseOver); - this.thePlayer.swingItem(); +- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e); ++ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x); + this.field_71439_g.func_71038_i(); } } -@@ -1422,11 +1436,12 @@ - int j = this.objectMouseOver.blockY; - int k = this.objectMouseOver.blockZ; +@@ -1377,11 +1391,12 @@ + int j = this.field_71476_x.field_72312_c; + int k = this.field_71476_x.field_72309_d; -- if (this.theWorld.getBlock(i, j, k).getMaterial() != Material.air) -+ if (!this.theWorld.getBlock(i, j, k).isAir(theWorld, i, j, k)) +- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a) ++ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k)) { - int l = itemstack != null ? itemstack.stackSize : 0; + int l = itemstack != null ? itemstack.field_77994_a : 0; -- if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, i, j, k, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) -+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_BLOCK, i, j, k, this.objectMouseOver.sideHit).isCanceled(); -+ if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, i, j, k, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) +- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f)) ++ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e).isCanceled(); ++ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f)) { flag = false; - this.thePlayer.swingItem(); -@@ -1453,7 +1468,8 @@ + this.field_71439_g.func_71038_i(); +@@ -1408,7 +1423,8 @@ { - ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g(); -- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) -+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1).isCanceled(); -+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) +- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) ++ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1).isCanceled(); ++ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) { - this.entityRenderer.itemRenderer.resetEquippedProgress2(); + this.field_71460_t.field_78516_c.func_78445_c(); } -@@ -1655,6 +1671,8 @@ +@@ -1607,6 +1623,8 @@ while (Mouse.next()) { @@ -114,28 +114,28 @@ + i = Mouse.getEventButton(); - if (isRunningOnMac && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) -@@ -2125,6 +2143,11 @@ - // JAVADOC METHOD $$ func_71353_a - public void loadWorld(WorldClient par1WorldClient, String par2Str) + if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) +@@ -2074,6 +2092,11 @@ + + public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_) { -+ if (theWorld != null) ++ if (field_71441_e != null) + { -+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(theWorld)); ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(field_71441_e)); + } + - if (par1WorldClient == null) + if (p_71353_1_ == null) { - NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); -@@ -2137,6 +2160,18 @@ - if (this.theIntegratedServer != null) + NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); +@@ -2086,6 +2109,18 @@ + if (this.field_71437_Z != null) { - this.theIntegratedServer.initiateShutdown(); -+ if (loadingScreen != null) + this.field_71437_Z.func_71263_m(); ++ if (field_71461_s != null) + { -+ this.loadingScreen.resetProgresAndWorkingMessage("Shutting down internal server..."); ++ this.field_71461_s.func_73719_c("Shutting down internal server..."); + } -+ while (!theIntegratedServer.isServerStopped()) ++ while (!field_71437_Z.func_71241_aa()) + { + try + { @@ -145,131 +145,130 @@ + } } - this.theIntegratedServer = null; -@@ -2292,113 +2327,10 @@ - if (this.objectMouseOver != null) + this.field_71437_Z = null; +@@ -2234,113 +2269,10 @@ + if (this.field_71476_x != null) { - boolean flag = this.thePlayer.capabilities.isCreativeMode; + boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; - int i = 0; - boolean flag1 = false; - Item item; int j; -- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) +- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) - { -- j = this.objectMouseOver.blockX; -- int k = this.objectMouseOver.blockY; -- int l = this.objectMouseOver.blockZ; -- Block block = this.theWorld.getBlock(j, k, l); +- j = this.field_71476_x.field_72311_b; +- int k = this.field_71476_x.field_72312_c; +- int l = this.field_71476_x.field_72309_d; +- Block block = this.field_71441_e.func_147439_a(j, k, l); - -- if (block.getMaterial() == Material.air) +- if (block.func_149688_o() == Material.field_151579_a) - { - return; - } - -- item = block.getItem(this.theWorld, j, k, l); +- item = block.func_149694_d(this.field_71441_e, j, k, l); - - if (item == null) - { - return; - } - -- flag1 = item.getHasSubtypes(); -- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; -- i = block1.getDamageValue(this.theWorld, j, k, l); +- flag1 = item.func_77614_k(); +- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block; +- i = block1.func_149643_k(this.field_71441_e, j, k, l); - } - else - { -- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) +- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag) - { - return; - } - -- if (this.objectMouseOver.entityHit instanceof EntityPainting) +- if (this.field_71476_x.field_72308_g instanceof EntityPainting) - { -- item = Items.painting; +- item = Items.field_151159_an; - } -- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) +- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) - { -- item = Items.lead; +- item = Items.field_151058_ca; - } -- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) +- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) - { -- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit; -- ItemStack itemstack = entityitemframe.getDisplayedItem(); +- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g; +- ItemStack itemstack = entityitemframe.func_82335_i(); - - if (itemstack == null) - { -- item = Items.item_frame; +- item = Items.field_151160_bD; - } - else - { -- item = itemstack.getItem(); -- i = itemstack.getItemDamage(); +- item = itemstack.func_77973_b(); +- i = itemstack.func_77960_j(); - flag1 = true; - } - } -- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) +- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) - { -- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit; +- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g; - -- if (entityminecart.getMinecartType() == 2) +- if (entityminecart.func_94087_l() == 2) - { -- item = Items.furnace_minecart; +- item = Items.field_151109_aJ; - } -- else if (entityminecart.getMinecartType() == 1) +- else if (entityminecart.func_94087_l() == 1) - { -- item = Items.chest_minecart; +- item = Items.field_151108_aI; - } -- else if (entityminecart.getMinecartType() == 3) +- else if (entityminecart.func_94087_l() == 3) - { -- item = Items.tnt_minecart; +- item = Items.field_151142_bV; - } -- else if (entityminecart.getMinecartType() == 5) +- else if (entityminecart.func_94087_l() == 5) - { -- item = Items.hopper_minecart; +- item = Items.field_151140_bW; - } -- else if (entityminecart.getMinecartType() == 6) +- else if (entityminecart.func_94087_l() == 6) - { -- item = Items.command_block_minecart; +- item = Items.field_151095_cc; - } - else - { -- item = Items.minecart; +- item = Items.field_151143_au; - } - } -- else if (this.objectMouseOver.entityHit instanceof EntityBoat) +- else if (this.field_71476_x.field_72308_g instanceof EntityBoat) - { -- item = Items.boat; +- item = Items.field_151124_az; - } - else - { -- item = Items.spawn_egg; -- i = EntityList.getEntityID(this.objectMouseOver.entityHit); +- item = Items.field_151063_bx; +- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g); - flag1 = true; - -- if (i <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(i))) +- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i))) - { - return; - } - } - } - -- this.thePlayer.inventory.func_146030_a(item, i, flag1, flag); +- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag); - -+ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return; ++ if (!ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return; + // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions if (flag) { - j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; -@@ -2568,9 +2500,16 @@ - par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); + j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c; +@@ -2507,8 +2439,15 @@ + p_70001_1_.func_76472_a("gl_max_texture_size", Integer.valueOf(func_71369_N())); } + //Forge: Adds a optimization to the getGLMaximumTextureSize, only calculate it once. + private static int max_texture_size = -1; - // JAVADOC METHOD $$ func_71369_N - public static int getGLMaximumTextureSize() + public static int func_71369_N() { + if (max_texture_size != -1) + { @@ -279,7 +278,7 @@ for (int i = 16384; i > 0; i >>= 1) { GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); -@@ -2578,6 +2517,7 @@ +@@ -2516,6 +2455,7 @@ if (j != 0) { diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index 26f95ffd8c..9c60d31aae 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -12,7 +12,7 @@ @SideOnly(Side.CLIENT) public class SoundManager { -@@ -81,6 +86,7 @@ +@@ -69,6 +74,7 @@ { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); @@ -20,11 +20,11 @@ } catch (SoundSystemException soundsystemexception) { -@@ -92,6 +98,7 @@ +@@ -80,6 +86,7 @@ { - this.unloadSoundSystem(); - this.loadSoundSystem(); + this.func_148613_b(); + this.func_148608_i(); + MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this)); } - // JAVADOC METHOD $$ func_148608_i + private synchronized void func_148608_i() diff --git a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch index 2a3300fd4a..ad795cf29d 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java -@@ -157,7 +157,8 @@ +@@ -151,7 +151,8 @@ } } -- public float getEyeHeight() +- public float func_70047_e() + @Override + public float getDefaultEyeHeight() { diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index cb2d4da3f0..694d6082b6 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -10,7 +10,7 @@ @SideOnly(Side.CLIENT) public class EntityPlayerSP extends AbstractClientPlayer -@@ -331,7 +334,7 @@ +@@ -325,7 +328,7 @@ f *= 1.0F - f1 * 0.15F; } @@ -18,44 +18,44 @@ + return ForgeHooksClient.getOffsetFOV(this, f); } - // JAVADOC METHOD $$ func_71053_j -@@ -494,20 +497,45 @@ - return this.worldObj.getBlock(par1, par2, par3).isNormalCube(); + public void func_71053_j() +@@ -479,20 +482,45 @@ + return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r(); } + private boolean isHeadspaceFree(int x, int y, int z, int height) + { + for (int i1 = 0; i1 < height; i1++) + { -+ if (isBlockTranslucent(x, y + i1, z + 1)) return false; ++ if (func_71153_f(x, y + i1, z + 1)) return false; + } + return true; + } + protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) { -+ if (this.noClip) ++ if (this.field_70145_X) + { + return false; + } - int i = MathHelper.floor_double(p_145771_1_); - int j = MathHelper.floor_double(p_145771_3_); - int k = MathHelper.floor_double(p_145771_5_); + int i = MathHelper.func_76128_c(p_145771_1_); + int j = MathHelper.func_76128_c(p_145771_3_); + int k = MathHelper.func_76128_c(p_145771_5_); double d3 = p_145771_1_ - (double)i; double d4 = p_145771_5_ - (double)k; -- if (this.isBlockTranslucent(i, j, k) || this.isBlockTranslucent(i, j + 1, k)) -+ int entHeight = Math.max(Math.round(this.height), 1); +- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k)) ++ int entHeight = Math.max(Math.round(this.field_70131_O), 1); + + boolean inTranslucentBlock = true; + + for (int i1 = 0; i1 < entHeight; i1++) { -- boolean flag = !this.isBlockTranslucent(i - 1, j, k) && !this.isBlockTranslucent(i - 1, j + 1, k); -- boolean flag1 = !this.isBlockTranslucent(i + 1, j, k) && !this.isBlockTranslucent(i + 1, j + 1, k); -- boolean flag2 = !this.isBlockTranslucent(i, j, k - 1) && !this.isBlockTranslucent(i, j + 1, k - 1); -- boolean flag3 = !this.isBlockTranslucent(i, j, k + 1) && !this.isBlockTranslucent(i, j + 1, k + 1); -+ if (!this.isBlockTranslucent(i, j + i1, k)) +- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k); +- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k); +- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1); +- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1); ++ if (!this.func_71153_f(i, j + i1, k)) + { + inTranslucentBlock = false; + } @@ -70,16 +70,16 @@ byte b0 = -1; double d5 = 9999.0D; -@@ -596,6 +624,12 @@ +@@ -576,6 +604,12 @@ - public void playSound(String par1Str, float par2, float par3) + public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_) { -+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, par1Str, par2, par3); ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } -+ par1Str = event.name; - this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, par1Str, par2, par3, false); ++ p_85030_1_ = event.name; + this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false); } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch index 9ed0f3cd13..7c8ff4de68 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch @@ -16,20 +16,20 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.input.Keyboard; -@@ -139,6 +141,7 @@ +@@ -131,6 +133,7 @@ public void func_146403_a(String p_146403_1_) { - this.mc.ingameGUI.getChatGUI().addToSentMessages(p_146403_1_); -+ if (ClientCommandHandler.instance.executeCommand(mc.thePlayer, p_146403_1_) == 1) return; - this.mc.thePlayer.sendChatMessage(p_146403_1_); + this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_); ++ if (ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) == 1) return; + this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_); } -@@ -315,13 +318,14 @@ - this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); +@@ -305,13 +308,14 @@ + this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1); } -- this.inputField.writeText((String)this.field_146412_t.get(this.field_146413_s++)); -+ this.inputField.writeText(EnumChatFormatting.getTextWithoutFormattingCodes((String)this.field_146412_t.get(this.field_146413_s++))); +- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); ++ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++))); } private void func_146405_a(String p_146405_1_, String p_146405_2_) @@ -37,10 +37,10 @@ if (p_146405_1_.length() >= 1) { + ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); - this.mc.thePlayer.sendQueue.addToSendQueue(new C14PacketTabComplete(p_146405_1_)); + this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_)); this.field_146414_r = true; } -@@ -445,6 +449,13 @@ +@@ -433,6 +437,13 @@ String[] astring1 = p_146406_1_; int i = p_146406_1_.length; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index e7a3a6e414..717664a40a 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -@@ -323,7 +323,7 @@ +@@ -320,7 +320,7 @@ } - else if (p_146284_1_.id == 8) + else if (p_146284_1_.field_146127_k == 8) { -- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.field_146334_a)); -+ WorldType.worldTypes[field_146331_K].onCustomizeButton(mc, this); +- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a)); ++ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this); } } } -@@ -341,7 +341,7 @@ - this.field_146326_C.visible = this.field_146344_y; - this.field_146320_D.visible = this.field_146344_y; - this.field_146321_E.visible = this.field_146344_y; -- this.field_146322_F.visible = this.field_146344_y && WorldType.worldTypes[this.field_146331_K] == WorldType.FLAT; -+ this.field_146322_F.visible = this.field_146344_y && WorldType.worldTypes[this.field_146331_K].isCustomizable(); +@@ -338,7 +338,7 @@ + this.field_146326_C.field_146125_m = this.field_146344_y; + this.field_146320_D.field_146125_m = this.field_146344_y; + this.field_146321_E.field_146125_m = this.field_146344_y; +- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c; ++ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable(); if (this.field_146344_y) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 1d121f7ced..f4265e7c73 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -8,11 +8,11 @@ import org.apache.commons.io.Charsets; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -630,6 +631,7 @@ - this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215); +@@ -614,6 +615,7 @@ + this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215); } } -+ ForgeHooksClient.renderMainMenu(this, fontRendererObj, width, height); ++ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m); String s1 = "Copyright Mojang AB. Do not distribute!"; - this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); + this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index a25263176e..d6775a21ac 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java -@@ -123,7 +123,9 @@ +@@ -111,7 +111,9 @@ } } -+ FontRenderer font = p_146285_1_.getItem().getFontRenderer(p_146285_1_); ++ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_); this.func_146283_a(list, p_146285_2_, p_146285_3_); -+ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? fontRendererObj : font)); ++ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); } - // JAVADOC METHOD $$ func_146279_a -@@ -134,6 +136,11 @@ + protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) +@@ -121,6 +123,11 @@ protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) { -+ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, fontRendererObj); ++ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q); + } + + protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) @@ -22,21 +22,21 @@ if (!p_146283_1_.isEmpty()) { GL11.glDisable(GL12.GL_RESCALE_NORMAL); -@@ -146,7 +153,7 @@ +@@ -133,7 +140,7 @@ while (iterator.hasNext()) { String s = (String)iterator.next(); -- int l = this.fontRendererObj.getStringWidth(s); -+ int l = font.getStringWidth(s); +- int l = this.field_146289_q.func_78256_a(s); ++ int l = font.func_78256_a(s); if (l > k) { -@@ -191,7 +198,7 @@ +@@ -178,7 +185,7 @@ for (int i2 = 0; i2 < p_146283_1_.size(); ++i2) { String s1 = (String)p_146283_1_.get(i2); -- this.fontRendererObj.drawStringWithShadow(s1, j2, k2, -1); -+ font.drawStringWithShadow(s1, j2, k2, -1); +- this.field_146289_q.func_78261_a(s1, j2, k2, -1); ++ font.func_78261_a(s1, j2, k2, -1); if (i2 == 0) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index 8aeda2329c..cdfaaa2e99 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch @@ -1,39 +1,39 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java -@@ -314,16 +314,7 @@ +@@ -294,16 +294,7 @@ GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); - Tessellator tessellator = Tessellator.instance; -- this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + Tessellator tessellator = Tessellator.field_78398_a; +- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float f1 = 32.0F; -- tessellator.startDrawingQuads(); -- tessellator.setColorOpaque_I(2105376); -- tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); -- tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); -- tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); -- tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); -- tessellator.draw(); +- tessellator.func_78382_b(); +- tessellator.func_78378_d(2105376); +- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); +- tessellator.func_78381_a(); + drawContainerBackground(tessellator); - l1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2; - i2 = this.top + 4 - (int)this.amountScrolled; + l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + i2 = this.field_148153_b + 4 - (int)this.field_148169_q; -@@ -499,4 +490,18 @@ +@@ -475,4 +466,18 @@ { - return this.slotHeight; + return this.field_148149_f; } + + protected void drawContainerBackground(Tessellator tessellator) + { -+ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); ++ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f1 = 32.0F; -+ tessellator.startDrawingQuads(); -+ tessellator.setColorOpaque_I(2105376); -+ tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); -+ tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); -+ tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); -+ tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); -+ tessellator.draw(); ++ tessellator.func_78382_b(); ++ tessellator.func_78378_d(2105376); ++ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); ++ tessellator.func_78381_a(); + } } diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch index 48069d6d69..80ae41c0c4 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -23,10 +23,10 @@ this.field_146562_a = p_i45026_1_; @@ -58,6 +65,14 @@ short short2 = 141; - this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12); - this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2); + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_76004_f.field_75993_a * 24 - short1 / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_76004_f.field_75991_b * 24 - short2 / 2); + minecraftAchievements.clear(); -+ for (Object achievement : AchievementList.achievementList) ++ for (Object achievement : AchievementList.field_76007_e) + { + if (!AchievementPage.isAchievementInPages((Achievement)achievement)) + { @@ -35,57 +35,57 @@ + } } - // JAVADOC METHOD $$ func_73866_w_ -@@ -66,6 +81,7 @@ - this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); - this.buttonList.clear(); - this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); -+ this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); + public void func_73866_w_() +@@ -65,6 +80,7 @@ + this.field_146297_k.func_147114_u().func_147297_a(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.field_146292_n.clear(); + this.field_146292_n.add(new GuiOptionButton(1, this.field_146294_l / 2 + 24, this.field_146295_m / 2 + 74, 80, 20, I18n.func_135052_a("gui.done", new Object[0]))); ++ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); } - protected void actionPerformed(GuiButton p_146284_1_) -@@ -76,6 +92,16 @@ + protected void func_146284_a(GuiButton p_146284_1_) +@@ -75,6 +91,16 @@ { - this.mc.displayGuiScreen(this.field_146562_a); + this.field_146297_k.func_147108_a(this.field_146562_a); } + -+ if (p_146284_1_.id == 2) ++ if (p_146284_1_.field_146127_k == 2) + { + currentPage++; + if (currentPage >= AchievementPage.getAchievementPages().size()) + { + currentPage = -1; + } -+ button.displayString = AchievementPage.getTitle(currentPage); ++ button.field_146126_j = AchievementPage.getTitle(currentPage); + } } } -@@ -343,11 +369,12 @@ +@@ -339,11 +365,12 @@ int i4; int j5; -- for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3) +- for (i3 = 0; i3 < AchievementList.field_76007_e.size(); ++i3) + List achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (i3 = 0; i3 < achievementList.size(); ++i3) { -- Achievement achievement1 = (Achievement)AchievementList.achievementList.get(i3); +- Achievement achievement1 = (Achievement)AchievementList.field_76007_e.get(i3); + Achievement achievement1 = achievementList.get(i3); -- if (achievement1.parentAchievement != null) -+ if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) +- if (achievement1.field_75992_c != null) ++ if (achievement1.field_75992_c != null && achievementList.contains(achievement1.field_75992_c)) { - j3 = achievement1.displayColumn * 24 - k + 11; - k3 = achievement1.displayRow * 24 - l + 11; -@@ -404,9 +431,9 @@ + j3 = achievement1.field_75993_a * 24 - k + 11; + k3 = achievement1.field_75991_b * 24 - l + 11; +@@ -400,9 +427,9 @@ int i5; int l4; -- for (j5 = 0; j5 < AchievementList.achievementList.size(); ++j5) +- for (j5 = 0; j5 < AchievementList.field_76007_e.size(); ++j5) + for (j5 = 0; j5 < achievementList.size(); ++j5) { -- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(j5); +- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(j5); + Achievement achievement2 = (Achievement)achievementList.get(j5); - l4 = achievement2.displayColumn * 24 - k; - i5 = achievement2.displayRow * 24 - l; + l4 = achievement2.field_75993_a * 24 - k; + i5 = achievement2.field_75991_b * 24 - l; diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch index eeb56f9f17..9a7c81eac2 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -8,29 +8,29 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; -@@ -123,7 +124,11 @@ +@@ -112,7 +113,11 @@ } } + //Forge: Force lighting to be disabled as there are some issue where lighting would + //incorrectly be applied based on items that are in the inventory. + GL11.glDisable(GL11.GL_LIGHTING); - this.drawGuiContainerForegroundLayer(par1, par2); + this.func_146979_b(p_73863_1_, p_73863_2_); + GL11.glEnable(GL11.GL_LIGHTING); - InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; - ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack; + InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by; + ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.func_70445_o() : this.field_147012_x; -@@ -187,8 +192,11 @@ +@@ -176,8 +181,11 @@ GL11.glTranslatef(0.0F, 0.0F, 32.0F); - this.zLevel = 200.0F; - itemRender.zLevel = 200.0F; -- itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); -- itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.draggedStack == null ? 0 : 8), p_146982_4_); + this.field_73735_i = 200.0F; + field_146296_j.field_77023_b = 200.0F; +- field_146296_j.func_82406_b(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_); +- field_146296_j.func_94148_a(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + FontRenderer font = null; -+ if (p_146982_1_ != null) font = p_146982_1_.getItem().getFontRenderer(p_146982_1_); -+ if (font == null) font = fontRendererObj; -+ itemRender.renderItemAndEffectIntoGUI(font, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); -+ itemRender.renderItemOverlayIntoGUI(font, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.draggedStack == null ? 0 : 8), p_146982_4_); - this.zLevel = 0.0F; - itemRender.zLevel = 0.0F; ++ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_); ++ if (font == null) font = field_146289_q; ++ field_146296_j.func_82406_b(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_); ++ field_146296_j.func_94148_a(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + this.field_73735_i = 0.0F; + field_146296_j.field_77023_b = 0.0F; } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index 43e1dd78b8..b8c171c2f4 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,64 +1,64 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -53,6 +53,8 @@ +@@ -49,6 +49,8 @@ private boolean field_147057_D; private CreativeCrafting field_147059_E; private static final String __OBFID = "CL_00000752"; + private static int tabPage = 0; + private int maxPages = 0; - public GuiContainerCreative(EntityPlayer par1EntityPlayer) + public GuiContainerCreative(EntityPlayer p_i1088_1_) { -@@ -190,7 +192,7 @@ +@@ -185,7 +187,7 @@ return; } -- if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2)) -+ if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 +- if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2)) ++ if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2) && ItemStack.func_77970_a(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 { if (p_146984_3_ == 0) { -@@ -266,6 +268,13 @@ - this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); - this.field_147059_E = new CreativeCrafting(this.mc); - this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E); -+ int tabCount = CreativeTabs.creativeTabArray.length; +@@ -260,6 +262,13 @@ + this.func_147050_b(CreativeTabs.field_78032_a[i]); + this.field_147059_E = new CreativeCrafting(this.field_146297_k); + this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E); ++ int tabCount = CreativeTabs.field_78032_a.length; + if (tabCount > 12) + { -+ buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); -+ buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">")); ++ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<")); ++ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">")); + maxPages = ((tabCount - 12) / 10) + 1; + } } else { -@@ -289,7 +298,7 @@ - // JAVADOC METHOD $$ func_73869_a - protected void keyTyped(char par1, int par2) +@@ -281,7 +290,7 @@ + + protected void func_73869_a(char p_73869_1_, int p_73869_2_) { -- if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) -+ if (!CreativeTabs.creativeTabArray[selectedTabIndex].hasSearchBar()) +- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a()) ++ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar()) { - if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) + if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D)) { -@@ -326,6 +335,15 @@ +@@ -318,6 +327,15 @@ { - GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; - containercreative.itemList.clear(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; + containercreative.field_148330_a.clear(); + -+ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex]; -+ if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch) ++ CreativeTabs tab = CreativeTabs.field_78032_a[field_147058_w]; ++ if (tab.hasSearchBar() && tab != CreativeTabs.field_78027_g) + { -+ tab.displayAllReleventItems(containercreative.itemList); ++ tab.func_78018_a(containercreative.field_148330_a); + updateFilteredItems(containercreative); + return; + } + - Iterator iterator = Item.itemRegistry.iterator(); + Iterator iterator = Item.field_150901_e.iterator(); while (iterator.hasNext()) -@@ -337,7 +355,13 @@ - item.getSubItems(item, (CreativeTabs)null, containercreative.itemList); +@@ -329,7 +347,13 @@ + item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a); } } + updateFilteredItems(containercreative); @@ -68,19 +68,19 @@ + private void updateFilteredItems(GuiContainerCreative.ContainerCreative containercreative) + { + Iterator iterator; - Enchantment[] aenchantment = Enchantment.enchantmentsList; + Enchantment[] aenchantment = Enchantment.field_77331_b; int j = aenchantment.length; -@@ -392,7 +416,7 @@ +@@ -383,7 +407,7 @@ { - CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; -- if (creativetabs.drawInForegroundOfTab()) -+ if (creativetabs != null && creativetabs.drawInForegroundOfTab()) +- if (creativetabs.func_78019_g()) ++ if (creativetabs != null && creativetabs.func_78019_g()) { GL11.glDisable(GL11.GL_BLEND); - this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); -@@ -413,7 +437,7 @@ + this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752); +@@ -403,7 +427,7 @@ { CreativeTabs creativetabs = acreativetabs[k1]; @@ -89,42 +89,42 @@ { return; } -@@ -437,7 +461,7 @@ +@@ -426,7 +450,7 @@ { CreativeTabs creativetabs = acreativetabs[k1]; - if (this.func_147049_a(creativetabs, l, i1)) + if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) { - this.setCurrentCreativeTab(creativetabs); + this.func_147050_b(creativetabs); return; -@@ -451,11 +475,13 @@ - // JAVADOC METHOD $$ func_147055_p - private boolean needsScrollBars() +@@ -439,11 +463,13 @@ + + private boolean func_147055_p() { -+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == null) return false; - return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e(); ++ if (CreativeTabs.field_78032_a[field_147058_w] == null) return false; + return field_147058_w != CreativeTabs.field_78036_m.func_78021_a() && CreativeTabs.field_78032_a[field_147058_w].func_78017_i() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); } - private void setCurrentCreativeTab(CreativeTabs p_147050_1_) + private void func_147050_b(CreativeTabs p_147050_1_) { + if (p_147050_1_ == null) return; - int i = selectedTabIndex; - selectedTabIndex = p_147050_1_.getTabIndex(); - GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; -@@ -524,7 +550,7 @@ + int i = field_147058_w; + field_147058_w = p_147050_1_.func_78021_a(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; +@@ -512,7 +538,7 @@ - if (this.searchField != null) + if (this.field_147062_A != null) { -- if (p_147050_1_ == CreativeTabs.tabAllSearch) +- if (p_147050_1_ == CreativeTabs.field_78027_g) + if (p_147050_1_.hasSearchBar()) { - this.searchField.setVisible(true); - this.searchField.setCanLoseFocus(false); -@@ -622,23 +648,45 @@ + this.field_147062_A.func_146189_e(true); + this.field_147062_A.func_146205_d(false); +@@ -608,23 +634,45 @@ - super.drawScreen(par1, par2, par3); - CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + CreativeTabs[] acreativetabs = CreativeTabs.field_78032_a; - int i2 = acreativetabs.length; + int start = tabPage * 10; + int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2); @@ -137,39 +137,39 @@ CreativeTabs creativetabs = acreativetabs[j2]; + if (creativetabs == null) continue; - if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) + if (this.func_147052_b(creativetabs, p_73863_1_, p_73863_2_)) { + rendered = true; break; } } -+ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, par1, par2)) ++ if (!rendered && func_147052_b(CreativeTabs.field_78027_g, p_73863_1_, p_73863_2_)) + { -+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, par1, par2); ++ func_147052_b(CreativeTabs.field_78036_m, p_73863_1_, p_73863_2_); + } + - if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.func_146978_c(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, par1, par2)) + if (this.field_147064_C != null && field_147058_w == CreativeTabs.field_78036_m.func_78021_a() && this.func_146978_c(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, p_73863_1_, p_73863_2_)) { - this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), par1, par2); + this.func_146279_a(I18n.func_135052_a("inventory.binSlot", new Object[0]), p_73863_1_, p_73863_2_); } + if (maxPages != 0) + { + String page = String.format("%d / %d", tabPage + 1, maxPages + 1); -+ int width = fontRendererObj.getStringWidth(page); ++ int width = field_146289_q.func_78256_a(page); + GL11.glDisable(GL11.GL_LIGHTING); -+ this.zLevel = 300.0F; -+ itemRender.zLevel = 300.0F; -+ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); -+ this.zLevel = 0.0F; -+ itemRender.zLevel = 0.0F; ++ this.field_73735_i = 300.0F; ++ field_146296_j.field_77023_b = 300.0F; ++ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1); ++ this.field_73735_i = 0.0F; ++ field_146296_j.field_77023_b = 0.0F; + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); } -@@ -707,17 +755,37 @@ +@@ -693,17 +741,37 @@ int k = acreativetabs.length; int l; @@ -181,11 +181,11 @@ + for (l = start; l < k; ++l) { CreativeTabs creativetabs1 = acreativetabs[l]; - this.mc.getTextureManager().bindTexture(field_147061_u); + this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); + if (creativetabs1 == null) continue; + - if (creativetabs1.getTabIndex() != selectedTabIndex) + if (creativetabs1.func_78021_a() != field_147058_w) { this.func_147051_a(creativetabs1); } @@ -193,28 +193,28 @@ + if (tabPage != 0) + { -+ if (creativetabs != CreativeTabs.tabAllSearch) ++ if (creativetabs != CreativeTabs.field_78027_g) + { -+ this.mc.getTextureManager().bindTexture(field_147061_u); -+ func_147051_a(CreativeTabs.tabAllSearch); ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78027_g); + } -+ if (creativetabs != CreativeTabs.tabInventory) ++ if (creativetabs != CreativeTabs.field_78036_m) + { -+ this.mc.getTextureManager().bindTexture(field_147061_u); -+ func_147051_a(CreativeTabs.tabInventory); ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78036_m); + } + } + - this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); - this.searchField.drawTextBox(); -@@ -732,6 +800,14 @@ - this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); + this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f())); + this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g); + this.field_147062_A.func_146194_f(); +@@ -718,6 +786,14 @@ + this.func_73729_b(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); } + if (creativetabs == null || creativetabs.getTabPage() != tabPage) + { -+ if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory) ++ if (creativetabs != CreativeTabs.field_78027_g && creativetabs != CreativeTabs.field_78036_m) + { + return; + } @@ -222,41 +222,41 @@ + this.func_147051_a(creativetabs); - if (creativetabs == CreativeTabs.tabInventory) -@@ -742,6 +818,15 @@ + if (creativetabs == CreativeTabs.field_78036_m) +@@ -728,6 +804,15 @@ protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { + if (p_147049_1_.getTabPage() != tabPage) + { -+ if (p_147049_1_ != CreativeTabs.tabAllSearch && -+ p_147049_1_ != CreativeTabs.tabInventory) ++ if (p_147049_1_ != CreativeTabs.field_78027_g && ++ p_147049_1_ != CreativeTabs.field_78036_m) + { + return false; + } + } + - int k = p_147049_1_.getTabColumn(); + int k = p_147049_1_.func_78020_k(); int l = 28 * k; byte b0 = 0; -@@ -843,6 +928,7 @@ +@@ -828,6 +913,7 @@ } GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. - this.drawTexturedModalRect(l, i1, j, k, 28, b0); - this.zLevel = 100.0F; - itemRender.zLevel = 100.0F; -@@ -869,6 +955,15 @@ + this.func_73729_b(l, i1, j, k, 28, b0); + this.field_73735_i = 100.0F; + field_146296_j.field_77023_b = 100.0F; +@@ -854,6 +940,15 @@ { - this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); } + -+ if (p_146284_1_.id == 101) ++ if (p_146284_1_.field_146127_k == 101) + { + tabPage = Math.max(tabPage - 1, 0); + } -+ else if (p_146284_1_.id == 102) ++ else if (p_146284_1_.field_146127_k == 102) + { + tabPage = Math.min(tabPage + 1, maxPages); + } diff --git a/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch index e02350c181..81a81f25fe 100644 --- a/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java -@@ -208,7 +208,7 @@ - GuiScreenCreateOnlineWorld.logger.error("Couldn\'t create world"); +@@ -202,7 +202,7 @@ + GuiScreenCreateOnlineWorld.field_146765_a.error("Couldn\'t create world"); this.func_148416_a(unsupportedencodingexception.getLocalizedMessage()); } - catch (IOException ioexception) + catch (@SuppressWarnings("hiding") IOException ioexception) { - GuiScreenCreateOnlineWorld.logger.error("Could not parse response creating world"); + GuiScreenCreateOnlineWorld.field_146765_a.error("Could not parse response creating world"); this.func_148416_a(ioexception.getLocalizedMessage()); diff --git a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch index 0215b27c9b..3a4d6c6068 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch @@ -7,4 +7,4 @@ -@SideOnly(Side.CLIENT) public abstract class ModelBase { - public float onGround; + public float field_78095_p; diff --git a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch index aaed796527..436e2120f5 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -7,12 +7,12 @@ -@SideOnly(Side.CLIENT) public class ModelBox { - // JAVADOC FIELD $$ field_78253_h -@@ -86,6 +85,7 @@ + private PositionTextureVertex[] field_78253_h; +@@ -77,6 +76,7 @@ + } } - // JAVADOC METHOD $$ func_78245_a + @SideOnly(Side.CLIENT) - public void render(Tessellator par1Tessellator, float par2) + public void func_78245_a(Tessellator p_78245_1_, float p_78245_2_) { - for (int i = 0; i < this.quadList.length; ++i) + for (int i = 0; i < this.field_78254_i.length; ++i) diff --git a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch index 5aeb32d88d..86bde1f925 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -7,36 +7,36 @@ -@SideOnly(Side.CLIENT) public class ModelRenderer { - // JAVADOC FIELD $$ field_78801_a -@@ -110,6 +109,7 @@ - this.rotationPointZ = par3; + public float field_78801_a; +@@ -102,6 +101,7 @@ + this.field_78798_e = p_78793_3_; } + @SideOnly(Side.CLIENT) - public void render(float par1) + public void func_78785_a(float p_78785_1_) { - if (!this.isHidden) -@@ -192,6 +192,7 @@ + if (!this.field_78807_k) +@@ -184,6 +184,7 @@ } } + @SideOnly(Side.CLIENT) - public void renderWithRotation(float par1) + public void func_78791_b(float p_78791_1_) { - if (!this.isHidden) -@@ -228,6 +229,7 @@ + if (!this.field_78807_k) +@@ -219,6 +220,7 @@ + } } - // JAVADOC METHOD $$ func_78794_c + @SideOnly(Side.CLIENT) - public void postRender(float par1) + public void func_78794_c(float p_78794_1_) { - if (!this.isHidden) -@@ -270,6 +272,7 @@ + if (!this.field_78807_k) +@@ -260,6 +262,7 @@ + } } - // JAVADOC METHOD $$ func_78788_d + @SideOnly(Side.CLIENT) - private void compileDisplayList(float par1) + private void func_78788_d(float p_78788_1_) { - this.displayList = GLAllocation.generateDisplayLists(1); + this.field_78811_r = GLAllocation.func_74526_a(1); diff --git a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch index b749815ae8..8d92e8afdd 100644 --- a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -10,4 +10,4 @@ -@SideOnly(Side.CLIENT) public class PositionTextureVertex { - public Vec3 vector3D; + public Vec3 field_78243_a; diff --git a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch index b9b30e48d4..c318d7ea06 100644 --- a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch @@ -11,4 +11,4 @@ -@SideOnly(Side.CLIENT) public class TexturedQuad { - public PositionTextureVertex[] vertexPositions; + public PositionTextureVertex[] field_78239_a; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index f6a2c5aeaf..d575e9cce9 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java -@@ -63,6 +63,7 @@ - Chunk chunk = new Chunk(this.worldObj, par1, par2); - this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(par1, par2), chunk); - this.chunkListing.add(chunk); +@@ -56,6 +56,7 @@ + Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_); + this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk); + this.field_73237_c.add(chunk); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); - chunk.isChunkLoaded = true; + chunk.field_76636_d = true; return chunk; } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 22e71c9200..aeca0eff95 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -11,75 +11,75 @@ @SideOnly(Side.CLIENT) public class PlayerControllerMP { -@@ -105,6 +109,12 @@ - // JAVADOC METHOD $$ func_78751_a - public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) +@@ -88,6 +92,12 @@ + + public boolean func_78751_a(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_) { -+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem() != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, mc.thePlayer)) ++ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC(); ++ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_78751_1_, p_78751_2_, p_78751_3_, field_78776_a.field_71439_g)) + { + return false; + } + - if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) + if (this.field_78779_k.func_82752_c() && !this.field_78776_a.field_71439_g.func_82246_f(p_78751_1_, p_78751_2_, p_78751_3_)) { return false; -@@ -126,7 +136,7 @@ +@@ -109,7 +119,7 @@ { - worldclient.playAuxSFX(2001, par1, par2, par3, Block.getIdFromBlock(block) + (worldclient.getBlockMetadata(par1, par2, par3) << 12)); - int i1 = worldclient.getBlockMetadata(par1, par2, par3); -- boolean flag = worldclient.setBlockToAir(par1, par2, par3); -+ boolean flag = block.removedByPlayer(worldclient, mc.thePlayer, par1, par2, par3); + worldclient.func_72926_e(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.func_149682_b(block) + (worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_) << 12)); + int i1 = worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_); +- boolean flag = worldclient.func_147468_f(p_78751_1_, p_78751_2_, p_78751_3_); ++ boolean flag = block.removedByPlayer(worldclient, field_78776_a.field_71439_g, p_78751_1_, p_78751_2_, p_78751_3_); if (flag) { -@@ -327,11 +337,18 @@ - float f2 = (float)par8Vec3.zCoord - (float)par6; +@@ -304,11 +314,18 @@ + float f2 = (float)p_78760_8_.field_72449_c - (float)p_78760_6_; boolean flag = false; -- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2)) -+ if (par3ItemStack != null && -+ par3ItemStack.getItem() != null && -+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2)) +- if ((!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null) && p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2)) ++ if (p_78760_3_ != null && ++ p_78760_3_.func_77973_b() != null && ++ p_78760_3_.func_77973_b().onItemUseFirst(p_78760_3_, p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2)) { - flag = true; + return true; } -+ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().doesSneakBypassUse(par2World, par4, par5, par6, par1EntityPlayer)) ++ if (!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null || p_78760_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_)) + { -+ flag = par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2); ++ flag = p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2); + } + - if (!flag && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock) + if (!flag && p_78760_3_ != null && p_78760_3_.func_77973_b() instanceof ItemBlock) { - ItemBlock itemblock = (ItemBlock)par3ItemStack.getItem(); -@@ -363,7 +380,15 @@ + ItemBlock itemblock = (ItemBlock)p_78760_3_.func_77973_b(); +@@ -340,7 +357,15 @@ } else { -- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2); -+ if (!par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2)) +- return p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2); ++ if (!p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2)) + { + return false; + } -+ if (par3ItemStack.stackSize <= 0) ++ if (p_78760_3_.field_77994_a <= 0) + { -+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, par3ItemStack)); ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78760_1_, p_78760_3_)); + } + return true; } } -@@ -383,9 +408,10 @@ +@@ -359,9 +384,10 @@ { - par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1; + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1; -- if (itemstack1.stackSize == 0) -+ if (itemstack1.stackSize <= 0) +- if (itemstack1.field_77994_a == 0) ++ if (itemstack1.field_77994_a <= 0) { - par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; -+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, itemstack1)); + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null; ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78769_1_, itemstack1)); } return true; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index 50eddb0e2d..84ebab846d 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -10,29 +10,29 @@ @SideOnly(Side.CLIENT) public class WorldClient extends World { -@@ -56,8 +59,11 @@ - super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_2_, p_i45063_5_); - this.sendQueue = p_i45063_1_; - this.difficultySetting = p_i45063_4_; -- this.setSpawnLocation(8, 64, 8); - this.mapStorage = p_i45063_1_.mapStorageOrigin; -+ this.isRemote = true; +@@ -51,8 +54,11 @@ + super(new SaveHandlerMP(), "MpServer", WorldProvider.func_76570_a(p_i45063_3_), p_i45063_2_, p_i45063_5_); + this.field_73035_a = p_i45063_1_; + this.field_73013_u = p_i45063_4_; +- this.func_72950_A(8, 64, 8); + this.field_72988_C = p_i45063_1_.field_147305_a; ++ this.field_72995_K = true; + this.finishSetup(); -+ this.setSpawnLocation(8, 64, 8); ++ this.func_72950_A(8, 64, 8); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this)); } - // JAVADOC METHOD $$ func_72835_b -@@ -275,6 +281,12 @@ - // JAVADOC METHOD $$ func_72979_l - protected void updateWeather() + public void func_72835_b() +@@ -261,6 +267,12 @@ + + protected void func_72979_l() { -+ super.updateWeather(); ++ super.func_72979_l(); + } + + @Override + public void updateWeatherBody() + { - if (!this.provider.hasNoSky) + if (!this.field_73011_w.field_76576_e) { ; diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 464b2edf07..e9168396bf 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -9,26 +9,26 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -706,7 +708,11 @@ - // JAVADOC METHOD $$ func_147251_a - public void handleChat(S02PacketChat p_147251_1_) +@@ -675,7 +677,11 @@ + + public void func_147251_a(S02PacketChat p_147251_1_) { -- this.gameController.ingameGUI.getChatGUI().printChatMessage(p_147251_1_.func_148915_c()); +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c()); + ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c()); + if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null) + { -+ this.gameController.ingameGUI.getChatGUI().printChatMessage(event.message); ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(event.message); + } } - // JAVADOC METHOD $$ func_147279_a -@@ -1160,6 +1166,10 @@ + public void func_147279_a(S0BPacketAnimation p_147279_1_) +@@ -1115,6 +1121,10 @@ { - tileentity.readFromNBT(p_147273_1_.func_148857_g()); + tileentity.func_145839_a(p_147273_1_.func_148857_g()); } + else + { -+ tileentity.onDataPacket(netManager, p_147273_1_); ++ tileentity.onDataPacket(field_147302_e, p_147273_1_); + } } } diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index b7984404c9..d53bc9485e 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -12,63 +12,63 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -@@ -72,7 +74,10 @@ +@@ -70,7 +72,10 @@ try { -- entityfx.onUpdate(); +- entityfx.func_70071_h_(); + if (entityfx != null) + { -+ entityfx.onUpdate(); ++ entityfx.func_70071_h_(); + } } catch (Throwable throwable) { -@@ -97,7 +102,7 @@ +@@ -95,7 +100,7 @@ throw new ReportedException(crashreport); } -- if (entityfx.isDead) -+ if (entityfx == null || entityfx.isDead) +- if (entityfx.field_70128_L) ++ if (entityfx == null || entityfx.field_70128_L) { - this.fxLayers[i].remove(j--); + this.field_78876_b[i].remove(j--); } -@@ -147,6 +152,7 @@ - for (int j = 0; j < this.fxLayers[i].size(); ++j) +@@ -144,6 +149,7 @@ + for (int j = 0; j < this.field_78876_b[i].size(); ++j) { - final EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j); + final EntityFX entityfx = (EntityFX)this.field_78876_b[i].get(j); + if (entityfx == null) continue; - tessellator.setBrightness(entityfx.getBrightnessForRender(par2)); + tessellator.func_78380_c(entityfx.func_70070_b(p_78874_2_)); try -@@ -203,6 +209,7 @@ +@@ -200,6 +206,7 @@ for (int i = 0; i < list.size(); ++i) { EntityFX entityfx = (EntityFX)list.get(i); + if (entityfx == null) continue; - tessellator.setBrightness(entityfx.getBrightnessForRender(par2)); - entityfx.renderParticle(tessellator, par2, f2, f6, f3, f4, f5); + tessellator.func_78380_c(entityfx.func_70070_b(p_78872_2_)); + entityfx.func_70539_a(tessellator, p_78872_2_, f2, f6, f3, f4, f5); } -@@ -221,7 +228,7 @@ +@@ -218,7 +225,7 @@ - public void addBlockDestroyEffects(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) + public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) { -- if (p_147215_4_.getMaterial() != Material.air) -+ if (!p_147215_4_.isAir(worldObj, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(worldObj, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this)) +- if (p_147215_4_.func_149688_o() != Material.field_151579_a) ++ if (!p_147215_4_.isAir(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this)) { byte b0 = 4; -@@ -291,4 +298,13 @@ +@@ -287,4 +294,13 @@ { - return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); + return "" + (this.field_78876_b[0].size() + this.field_78876_b[1].size() + this.field_78876_b[2].size()); } + + public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target) + { -+ Block block = worldObj.getBlock(x, y, z); -+ if (block != null && !block.addHitEffects(worldObj, target, this)) ++ Block block = field_78878_a.func_147439_a(x, y, z); ++ if (block != null && !block.addHitEffects(field_78878_a, target, this)) + { -+ addBlockHitEffects(x, y, z, target.sideHit); ++ func_78867_a(x, y, z, target.field_72310_e); + } + } } diff --git a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch index 6c691a33cb..48cca1ab4c 100644 --- a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch @@ -1,33 +1,35 @@ --- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java +++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java -@@ -12,21 +12,28 @@ +@@ -12,20 +12,27 @@ { private Block field_145784_a; private static final String __OBFID = "CL_00000932"; + private int side; - public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15) + public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_) { -+ this(par1World, par2, par4, par6, par8, par10, par12, par14Block, par15, par1World.rand.nextInt(6)); +- super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_); +- this.field_145784_a = p_i1234_14_; +- this.func_110125_a(p_i1234_14_.func_149691_a(0, p_i1234_15_)); +- this.field_70545_g = p_i1234_14_.field_149763_I; ++ this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.field_73012_v.nextInt(6)); + } + + public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15, int side) + { - super(par1World, par2, par4, par6, par8, par10, par12); - this.field_145784_a = par14Block; -- this.setParticleIcon(par14Block.getIcon(0, par15)); -+ this.setParticleIcon(par14Block.getIcon(side, par15)); - this.particleGravity = par14Block.blockParticleGravity; - this.particleRed = this.particleGreen = this.particleBlue = 0.6F; - this.particleScale /= 2.0F; ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.field_145784_a = par14Block; ++ this.func_110125_a(par14Block.func_149691_a(side, par15)); ++ this.field_70545_g = par14Block.field_149763_I; + this.field_70552_h = this.field_70553_i = this.field_70551_j = 0.6F; + this.field_70544_f /= 2.0F; + this.side = side; } - // JAVADOC METHOD $$ func_70596_a - public EntityDiggingFX applyColourMultiplier(int par1, int par2, int par3) + public EntityDiggingFX func_70596_a(int p_70596_1_, int p_70596_2_, int p_70596_3_) { -- if (this.field_145784_a == Blocks.grass) -+ if (this.field_145784_a == Blocks.grass && this.side != 1) +- if (this.field_145784_a == Blocks.field_150349_c) ++ if (this.field_145784_a == Blocks.field_150349_c && this.side != 1) { return this; } diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 55c15506b7..09a97b88b6 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -12,144 +12,144 @@ @SideOnly(Side.CLIENT) public class EntityRenderer implements IResourceManagerReloadListener -@@ -397,7 +402,7 @@ +@@ -358,7 +363,7 @@ if (d3 < d2 || d2 == 0.0D) { -- if (entity == this.mc.renderViewEntity.ridingEntity) -+ if (entity == this.mc.renderViewEntity.ridingEntity && !entity.canRiderInteract()) +- if (entity == this.field_78531_r.field_71451_h.field_70154_o) ++ if (entity == this.field_78531_r.field_71451_h.field_70154_o && !entity.canRiderInteract()) { if (d2 == 0.0D) { -@@ -432,8 +437,15 @@ - // JAVADOC METHOD $$ func_78477_e - private void updateFovModifierHand() +@@ -392,8 +397,15 @@ + + private void func_78477_e() { -- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity; -- this.fovMultiplierTemp = entityplayersp.getFOVMultiplier(); -+ if (mc.renderViewEntity instanceof EntityPlayerSP) +- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h; +- this.field_78501_T = entityplayersp.func_71151_f(); ++ if (field_78531_r.field_71451_h instanceof EntityPlayerSP) + { -+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity; -+ this.fovMultiplierTemp = entityplayersp.getFOVMultiplier(); ++ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h; ++ this.field_78501_T = entityplayersp.func_71151_f(); + } + else + { -+ this.fovMultiplierTemp = mc.thePlayer.getFOVMultiplier(); ++ this.field_78501_T = field_78531_r.field_71439_g.func_71151_f(); + } - this.fovModifierHandPrev = this.fovModifierHand; - this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; + this.field_78506_S = this.field_78507_R; + this.field_78507_R += (this.field_78501_T - this.field_78507_R) * 0.5F; -@@ -457,7 +469,7 @@ +@@ -416,7 +428,7 @@ } else { -- EntityPlayer entityplayer = (EntityPlayer)this.mc.renderViewEntity; -+ EntityLivingBase entityplayer = (EntityLivingBase)this.mc.renderViewEntity; +- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.field_71451_h; ++ EntityLivingBase entityplayer = (EntityLivingBase)this.field_78531_r.field_71451_h; float f1 = 70.0F; - if (par2) -@@ -540,15 +552,7 @@ + if (p_78481_2_) +@@ -497,15 +509,7 @@ - if (!this.mc.gameSettings.debugCamEnable) + if (!this.field_78531_r.field_71474_y.field_74325_U) { -- Block block = this.mc.theWorld.getBlock(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)); +- Block block = this.field_78531_r.field_71441_e.func_147439_a(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v)); - -- if (block == Blocks.bed) +- if (block == Blocks.field_150324_C) - { -- int i = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)); +- int i = this.field_78531_r.field_71441_e.func_72805_g(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v)); - int j = i & 3; - GL11.glRotatef((float)(j * 90), 0.0F, 1.0F, 0.0F); - } - -+ ForgeHooksClient.orientBedCamera(mc, entitylivingbase); - GL11.glRotatef(entitylivingbase.prevRotationYaw + (entitylivingbase.rotationYaw - entitylivingbase.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F); - GL11.glRotatef(entitylivingbase.prevRotationPitch + (entitylivingbase.rotationPitch - entitylivingbase.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F); ++ ForgeHooksClient.orientBedCamera(field_78531_r, entitylivingbase); + GL11.glRotatef(entitylivingbase.field_70126_B + (entitylivingbase.field_70177_z - entitylivingbase.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GL11.glRotatef(entitylivingbase.field_70127_C + (entitylivingbase.field_70125_A - entitylivingbase.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); } -@@ -1253,7 +1257,10 @@ +@@ -1203,7 +1207,10 @@ GL11.glPushMatrix(); - RenderHelper.enableStandardItemLighting(); - this.mc.mcProfiler.endStartSection("entities"); + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); + ForgeHooksClient.setRenderPass(0); - renderglobal.renderEntities(entitylivingbase, frustrum, par1); + renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_); + ForgeHooksClient.setRenderPass(0); + // ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water} - this.enableLightmap((double)par1); - this.mc.mcProfiler.endStartSection("litParticles"); - effectrenderer.renderLitParticles(entitylivingbase, par1); -@@ -1271,7 +1278,10 @@ + this.func_78463_b((double)p_78471_1_); + this.field_78531_r.field_71424_I.func_76318_c("litParticles"); + effectrenderer.func_78872_b(entitylivingbase, p_78471_1_); +@@ -1221,7 +1228,10 @@ entityplayer = (EntityPlayer)entitylivingbase; GL11.glDisable(GL11.GL_ALPHA_TEST); - this.mc.mcProfiler.endStartSection("outline"); -- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, par1); -+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1)) + this.field_78531_r.field_71424_I.func_76318_c("outline"); +- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_)) + { -+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, par1); ++ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); + } GL11.glEnable(GL11.GL_ALPHA_TEST); } } -@@ -1284,14 +1294,17 @@ +@@ -1234,14 +1244,17 @@ entityplayer = (EntityPlayer)entitylivingbase; GL11.glDisable(GL11.GL_ALPHA_TEST); - this.mc.mcProfiler.endStartSection("outline"); -- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, par1); -+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1)) + this.field_78531_r.field_71424_I.func_76318_c("outline"); +- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_)) + { -+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, par1); ++ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); + } GL11.glEnable(GL11.GL_ALPHA_TEST); } - this.mc.mcProfiler.endStartSection("destroyProgress"); + this.field_78531_r.field_71424_I.func_76318_c("destroyProgress"); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 1, 1, 0); -- renderglobal.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)entitylivingbase, par1); -+ renderglobal.drawBlockDamageTexture(Tessellator.instance, entitylivingbase, par1); + OpenGlHelper.func_148821_a(770, 1, 1, 0); +- renderglobal.func_72717_a(Tessellator.field_78398_a, (EntityPlayer)entitylivingbase, p_78471_1_); ++ renderglobal.drawBlockDamageTexture(Tessellator.field_78398_a, entitylivingbase, p_78471_1_); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_CULL_FACE); -@@ -1346,6 +1359,16 @@ - renderglobal.sortAndRender(entitylivingbase, 1, (double)par1); +@@ -1296,6 +1309,16 @@ + renderglobal.func_72719_a(entitylivingbase, 1, (double)p_78471_1_); } -+ if (this.debugViewDirection == 0) //Only render if render pass 0 happens as well. ++ if (this.field_78532_q == 0) //Only render if render pass 0 happens as well. + { -+ RenderHelper.enableStandardItemLighting(); -+ this.mc.mcProfiler.endStartSection("entities"); ++ RenderHelper.func_74519_b(); ++ this.field_78531_r.field_71424_I.func_76318_c("entities"); + ForgeHooksClient.setRenderPass(1); -+ renderglobal.renderEntities(entitylivingbase, frustrum, par1); ++ renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_); + ForgeHooksClient.setRenderPass(-1); -+ RenderHelper.disableStandardItemLighting(); ++ RenderHelper.func_74518_a(); + } + GL11.glDepthMask(true); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); -@@ -1357,9 +1380,12 @@ - this.renderCloudsCheck(renderglobal, par1); +@@ -1307,9 +1330,12 @@ + this.func_82829_a(renderglobal, p_78471_1_); } -+ this.mc.mcProfiler.endStartSection("FRenderLast"); -+ ForgeHooksClient.dispatchRenderLast(renderglobal, par1); ++ this.field_78531_r.field_71424_I.func_76318_c("FRenderLast"); ++ ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_); + - this.mc.mcProfiler.endStartSection("hand"); + this.field_78531_r.field_71424_I.func_76318_c("hand"); -- if (this.cameraZoom == 1.0D) -+ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, par1, j) && this.cameraZoom == 1.0D) +- if (this.field_78503_V == 1.0D) ++ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.field_78503_V == 1.0D) { GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); - this.renderHand(par1, j); -@@ -1477,6 +1503,13 @@ - // JAVADOC METHOD $$ func_78474_d - protected void renderRainSnow(float par1) + this.func_78476_b(p_78471_1_, j); +@@ -1425,6 +1451,13 @@ + + protected void func_78474_d(float p_78474_1_) { + IRenderHandler renderer = null; -+ if ((renderer = this.mc.theWorld.provider.getWeatherRenderer()) != null) ++ if ((renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer()) != null) + { -+ renderer.render(par1, this.mc.theWorld, mc); ++ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r); + return; + } + - float f1 = this.mc.theWorld.getRainStrength(par1); + float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); if (f1 > 0.0F) diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 758a0f52fa..407d4ee1bf 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -22,91 +22,132 @@ @SideOnly(Side.CLIENT) public class ItemRenderer { -@@ -53,13 +61,25 @@ - // JAVADOC METHOD $$ func_78443_a - public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) +@@ -49,32 +57,43 @@ + + public void func_78443_a(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_) { -+ this.renderItem(par1EntityLivingBase, par2ItemStack, par3, EQUIPPED); ++ this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED); + } + -+ // JAVADOC METHOD $$ renderItem + public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3, ItemRenderType type) + { GL11.glPushMatrix(); - TextureManager texturemanager = this.mc.getTextureManager(); - Item item = par2ItemStack.getItem(); - Block block = Block.getBlockFromItem(item); + TextureManager texturemanager = this.field_78455_a.func_110434_K(); +- Item item = p_78443_2_.func_77973_b(); ++ Item item = par2ItemStack.func_77973_b(); + Block block = Block.func_149634_a(item); -- if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) +- if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type); + if (customRenderer != null) { -+ texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber())); -+ ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack); ++ texturemanager.func_110577_a(texturemanager.func_130087_a(par2ItemStack.func_94608_d())); ++ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, par1EntityLivingBase, par2ItemStack); + } -+ else if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) ++ else if (par2ItemStack.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b())) + { - texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + texturemanager.func_110577_a(texturemanager.func_130087_a(0)); - if (par2ItemStack != null && par2ItemStack.getItem() instanceof ItemCloth) -@@ -104,7 +124,7 @@ +- if (p_78443_2_ != null && p_78443_2_.func_77973_b() instanceof ItemCloth) ++ if (par2ItemStack != null && par2ItemStack.func_77973_b() instanceof ItemCloth) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glDepthMask(false); + OpenGlHelper.func_148821_a(770, 771, 1, 0); +- this.field_147720_h.func_147800_a(block, p_78443_2_.func_77960_j(), 1.0F); ++ this.field_147720_h.func_147800_a(block, par2ItemStack.func_77960_j(), 1.0F); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + } + else + { +- this.field_147720_h.func_147800_a(block, p_78443_2_.func_77960_j(), 1.0F); ++ this.field_147720_h.func_147800_a(block, par2ItemStack.func_77960_j(), 1.0F); + } + } + else + { +- IIcon iicon = p_78443_1_.func_70620_b(p_78443_2_, p_78443_3_); ++ IIcon iicon = par1EntityLivingBase.func_70620_b(par2ItemStack, par3); + + if (iicon == null) + { +@@ -82,7 +101,7 @@ + return; + } + +- texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d())); ++ texturemanager.func_110577_a(texturemanager.func_130087_a(par2ItemStack.func_94608_d())); + TextureUtil.func_147950_a(false, false); + Tessellator tessellator = Tessellator.field_78398_a; + float f = iicon.func_94209_e(); +@@ -100,7 +119,7 @@ GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); - renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + func_78439_a(tessellator, f1, f2, f, f3, iicon.func_94211_a(), iicon.func_94216_b(), 0.0625F); -- if (par2ItemStack.hasEffect() && par3 == 0) +- if (p_78443_2_.func_77962_s() && p_78443_3_ == 0) + if (par2ItemStack.hasEffect(par3)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); -@@ -279,7 +299,7 @@ +@@ -132,7 +151,7 @@ + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); +- texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d())); ++ texturemanager.func_110577_a(texturemanager.func_130087_a(par2ItemStack.func_94608_d())); + TextureUtil.func_147945_b(); + } + +@@ -273,7 +292,7 @@ RenderPlayer renderplayer; Render render; -- if (itemstack != null && itemstack.getItem() == Items.filled_map) -+ if (itemstack != null && itemstack.getItem() instanceof ItemMap) +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151098_aY) ++ if (itemstack != null && itemstack.func_77973_b() instanceof ItemMap) { GL11.glPushMatrix(); f13 = 0.8F; -@@ -346,12 +366,21 @@ - tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); - tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); - tessellator.draw(); -- MapData mapdata = Items.filled_map.getMapData(itemstack, this.mc.theWorld); +@@ -340,12 +359,21 @@ + tessellator.func_78374_a((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); + tessellator.func_78374_a((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); + tessellator.func_78381_a(); +- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_78455_a.field_71441_e); - if (mapdata != null) + IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); -+ MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld); ++ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).func_77873_a(itemstack, this.field_78455_a.field_71441_e); + + if (custom == null) { -- this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); +- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false); + if (mapdata != null) + { -+ this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); ++ this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false); + } } + else + { -+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata); ++ custom.renderItem(FIRST_PERSON_MAP, itemstack, field_78455_a.field_71439_g, field_78455_a.func_110434_K(), mapdata); + } GL11.glPopMatrix(); } -@@ -452,17 +481,20 @@ +@@ -446,17 +474,20 @@ - if (itemstack.getItem().requiresMultipleRenderPasses()) + if (itemstack.func_77973_b().func_77623_v()) { -- this.renderItem(entityclientplayermp, itemstack, 0); -- int j1 = itemstack.getItem().getColorFromItemStack(itemstack, 1); +- this.func_78443_a(entityclientplayermp, itemstack, 0); +- int j1 = itemstack.func_77973_b().func_82790_a(itemstack, 1); - f10 = (float)(j1 >> 16 & 255) / 255.0F; - f11 = (float)(j1 >> 8 & 255) / 255.0F; - f12 = (float)(j1 & 255) / 255.0F; - GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F); -- this.renderItem(entityclientplayermp, itemstack, 1); +- this.func_78443_a(entityclientplayermp, itemstack, 1); + this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); -+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) ++ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++) + { -+ int j1 = itemstack.getItem().getColorFromItemStack(itemstack, x); ++ int j1 = itemstack.func_77973_b().func_82790_a(itemstack, x); + f10 = (float)(j1 >> 16 & 255) / 255.0F; + f11 = (float)(j1 >> 8 & 255) / 255.0F; + f12 = (float)(j1 & 255) / 255.0F; @@ -116,7 +157,7 @@ } else { -- this.renderItem(entityclientplayermp, itemstack, 0); +- this.func_78443_a(entityclientplayermp, itemstack, 0); + this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); } diff --git a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index 284d48eac3..b6a1c3b08b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,26 +1,26 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java -@@ -27,6 +27,10 @@ - public static boolean shadersSupported; +@@ -24,6 +24,10 @@ + public static boolean field_148824_g; private static final String __OBFID = "CL_00001179"; + /* Stores the last values sent into setLightmapTextureCoords */ + public static float lastBrightnessX = 0.0f; + public static float lastBrightnessY = 0.0f; + - // JAVADOC METHOD $$ func_77474_a - public static void initializeTextures() + public static void func_77474_a() { -@@ -89,6 +93,12 @@ + field_77477_c = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13; +@@ -82,6 +86,12 @@ { - GL13.glMultiTexCoord2f(par0, par1, par2); + GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); } + -+ if (par0 == lightmapTexUnit) ++ if (p_77475_0_ == field_77476_b) + { -+ lastBrightnessX = par1; -+ lastBrightnessY = par2; ++ lastBrightnessX = p_77475_1_; ++ lastBrightnessY = p_77475_2_; + } } - public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) + public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch index 862b45d87b..b3943bec9e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -9,101 +9,101 @@ @SideOnly(Side.CLIENT) public class RenderBlocks { -@@ -414,9 +416,9 @@ - public boolean renderBlockBed(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) +@@ -336,9 +338,9 @@ + public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) { - Tessellator tessellator = Tessellator.instance; -- int l = this.blockAccess.getBlockMetadata(p_147773_2_, p_147773_3_, p_147773_4_); -- int i1 = BlockBed.getDirection(l); -- boolean flag = BlockBed.isBlockHeadOfBed(l); -+ Block bed = this.blockAccess.getBlock(p_147773_2_, p_147773_3_, p_147773_4_); -+ int i1 = bed.getBedDirection(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); -+ boolean flag = bed.isBedFoot(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); + Tessellator tessellator = Tessellator.field_78398_a; +- int l = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_); +- int i1 = BlockBed.func_149895_l(l); +- boolean flag = BlockBed.func_149975_b(l); ++ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_); ++ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); ++ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); float f = 0.5F; float f1 = 1.0F; float f2 = 0.8F; -@@ -425,6 +427,7 @@ - tessellator.setBrightness(j1); - tessellator.setColorOpaque_F(f, f, f); - IIcon iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 0); -+ if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside - double d0 = (double)iicon.getMinU(); - double d1 = (double)iicon.getMaxU(); - double d2 = (double)iicon.getMinV(); -@@ -441,6 +444,7 @@ - tessellator.setBrightness(p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); - tessellator.setColorOpaque_F(f1, f1, f1); - iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 1); -+ if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside - d0 = (double)iicon.getMinU(); - d1 = (double)iicon.getMaxU(); - d2 = (double)iicon.getMinV(); -@@ -2135,7 +2139,7 @@ +@@ -347,6 +349,7 @@ + tessellator.func_78380_c(j1); + tessellator.func_78386_a(f, f, f); + IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0); ++ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + double d0 = (double)iicon.func_94209_e(); + double d1 = (double)iicon.func_94212_f(); + double d2 = (double)iicon.func_94206_g(); +@@ -363,6 +366,7 @@ + tessellator.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); + tessellator.func_78386_a(f1, f1, f1); + iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1); ++ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + d0 = (double)iicon.func_94209_e(); + d1 = (double)iicon.func_94212_f(); + d2 = (double)iicon.func_94206_g(); +@@ -2037,7 +2041,7 @@ double d9; double d10; -- if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) -+ if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) +- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) ++ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) { float f2 = 0.2F; float f1 = 0.0625F; -@@ -2155,7 +2159,7 @@ +@@ -2057,7 +2061,7 @@ d0 = d5; } -- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) { - tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); - tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); -@@ -2167,7 +2171,7 @@ - tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); +@@ -2069,7 +2073,7 @@ + tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); } -- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) { - tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); - tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); -@@ -2179,7 +2183,7 @@ - tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); +@@ -2081,7 +2085,7 @@ + tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); } -- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) -+ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) { - tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); - tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); -@@ -2191,7 +2195,7 @@ - tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); +@@ -2093,7 +2097,7 @@ + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); } -- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) -+ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) { - tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); - tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); -@@ -2203,7 +2207,7 @@ - tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); +@@ -2105,7 +2109,7 @@ + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); } -- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) { d5 = (double)p_147801_2_ + 0.5D + 0.5D; d6 = (double)p_147801_2_ + 0.5D - 0.5D; -@@ -3217,10 +3221,10 @@ +@@ -3118,10 +3122,10 @@ double d16 = (double)p_147767_2_ + 0.5D + 0.0625D; double d17 = (double)p_147767_4_ + 0.5D - 0.0625D; double d18 = (double)p_147767_4_ + 0.5D + 0.0625D; -- boolean flag = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); -- boolean flag1 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); -- boolean flag2 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); -- boolean flag3 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); -+ boolean flag = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); -+ boolean flag1 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); -+ boolean flag2 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); -+ boolean flag3 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); - boolean flag4 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); - boolean flag5 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); +- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); +- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); +- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); +- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); ++ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); ++ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); ++ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); ++ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); + boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); double d19 = 0.01D; diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 8b386f9e58..ca8521d202 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -10,121 +10,152 @@ @SideOnly(Side.CLIENT) public class RenderGlobal implements IWorldAccess { -@@ -413,8 +416,10 @@ - // JAVADOC METHOD $$ func_147589_a - public void renderEntities(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) +@@ -375,8 +378,10 @@ + + public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) { + int pass = MinecraftForgeClient.getRenderPass(); - if (this.renderEntitiesStartupCounter > 0) + if (this.field_72740_G > 0) { + if (pass > 0) return; - --this.renderEntitiesStartupCounter; + --this.field_72740_G; } else -@@ -425,9 +430,12 @@ - this.theWorld.theProfiler.startSection("prepare"); - TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, p_147589_3_); - RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntity, this.mc.gameSettings, p_147589_3_); +@@ -387,9 +392,12 @@ + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_); + RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_); + if (pass == 0) // no indentation to shrink patch + { - this.countEntitiesTotal = 0; - this.countEntitiesRendered = 0; - this.countEntitiesHidden = 0; + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; + } - EntityLivingBase entitylivingbase1 = this.mc.renderViewEntity; - double d3 = entitylivingbase1.lastTickPosX + (entitylivingbase1.posX - entitylivingbase1.lastTickPosX) * (double)p_147589_3_; - double d4 = entitylivingbase1.lastTickPosY + (entitylivingbase1.posY - entitylivingbase1.lastTickPosY) * (double)p_147589_3_; -@@ -456,13 +464,17 @@ - this.mc.entityRenderer.enableLightmap((double)p_147589_3_); - this.theWorld.theProfiler.endStartSection("global"); - List list = this.theWorld.getLoadedEntityList(); + EntityLivingBase entitylivingbase1 = this.field_72777_q.field_71451_h; + double d3 = entitylivingbase1.field_70142_S + (entitylivingbase1.field_70165_t - entitylivingbase1.field_70142_S) * (double)p_147589_3_; + double d4 = entitylivingbase1.field_70137_T + (entitylivingbase1.field_70163_u - entitylivingbase1.field_70137_T) * (double)p_147589_3_; +@@ -418,13 +426,17 @@ + this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List list = this.field_72769_h.func_72910_y(); + if (pass == 0) // no indentation for smaller patch size + { - this.countEntitiesTotal = list.size(); + this.field_72748_H = list.size(); + } Entity entity; int i; - for (i = 0; i < this.theWorld.weatherEffects.size(); ++i) + for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) { - entity = (Entity)this.theWorld.weatherEffects.get(i); + entity = (Entity)this.field_72769_h.field_73007_j.get(i); + if (!entity.shouldRenderInPass(pass)) continue; - ++this.countEntitiesRendered; + ++this.field_72749_I; - if (entity.isInRangeToRender3d(d0, d1, d2)) -@@ -476,6 +488,7 @@ + if (entity.func_145770_h(d0, d1, d2)) +@@ -438,6 +450,7 @@ for (i = 0; i < list.size(); ++i) { entity = (Entity)list.get(i); + if (!entity.shouldRenderInPass(pass)) continue; - boolean flag = entity.isInRangeToRender3d(d0, d1, d2) && (entity.ignoreFrustumCheck || p_147589_2_.isBoundingBoxInFrustum(entity.boundingBox) || entity.riddenByEntity == this.mc.thePlayer); + boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.field_70158_ak || p_147589_2_.func_78546_a(entity.field_70121_D) || entity.field_70153_n == this.field_72777_q.field_71439_g); if (!flag && entity instanceof EntityLiving) -@@ -501,7 +514,11 @@ +@@ -463,7 +476,11 @@ - for (i = 0; i < this.tileEntities.size(); ++i) + for (i = 0; i < this.field_147598_a.size(); ++i) { -- TileEntityRendererDispatcher.instance.renderTileEntity((TileEntity)this.tileEntities.get(i), p_147589_3_); -+ TileEntity tile = (TileEntity)this.tileEntities.get(i); -+ if (tile.shouldRenderInPass(pass) && p_147589_2_.isBoundingBoxInFrustum(tile.getRenderBoundingBox())) +- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_); ++ TileEntity tile = (TileEntity)this.field_147598_a.get(i); ++ if (tile.shouldRenderInPass(pass) && p_147589_2_.func_78546_a(tile.getRenderBoundingBox())) + { -+ TileEntityRendererDispatcher.instance.renderTileEntity(tile, p_147589_3_); ++ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_); + } } - this.mc.entityRenderer.disableLightmap((double)p_147589_3_); -@@ -978,6 +995,12 @@ - // JAVADOC METHOD $$ func_72714_a - public void renderSky(float par1) + this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_); +@@ -933,6 +950,12 @@ + + public void func_72714_a(float p_72714_1_) { + IRenderHandler skyProvider = null; -+ if ((skyProvider = this.mc.theWorld.provider.getSkyRenderer()) != null) ++ if ((skyProvider = this.field_72777_q.field_71441_e.field_73011_w.getSkyRenderer()) != null) + { -+ skyProvider.render(par1, this.theWorld, mc); ++ skyProvider.render(p_72714_1_, this.field_72769_h, field_72777_q); + return; + } - if (this.mc.theWorld.provider.dimensionId == 1) + if (this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1) { GL11.glDisable(GL11.GL_FOG); -@@ -1216,6 +1239,12 @@ +@@ -1171,6 +1194,12 @@ - public void renderClouds(float par1) + public void func_72718_b(float p_72718_1_) { + IRenderHandler renderer = null; -+ if ((renderer = theWorld.provider.getCloudRenderer()) != null) ++ if ((renderer = field_72769_h.field_73011_w.getCloudRenderer()) != null) + { -+ renderer.render(par1, theWorld, mc); ++ renderer.render(p_72718_1_, field_72769_h, field_72777_q); + return; + } - if (this.mc.theWorld.provider.isSurfaceWorld()) + if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { - if (this.mc.gameSettings.fancyGraphics) -@@ -1619,6 +1648,11 @@ + if (this.field_72777_q.field_71474_y.field_74347_j) +@@ -1571,10 +1600,15 @@ - public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) + public void func_72717_a(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_) { -+ drawBlockDamageTexture(par1Tessellator, (EntityLivingBase)par2EntityPlayer, par3); +- double d0 = p_72717_2_.field_70142_S + (p_72717_2_.field_70165_t - p_72717_2_.field_70142_S) * (double)p_72717_3_; +- double d1 = p_72717_2_.field_70137_T + (p_72717_2_.field_70163_u - p_72717_2_.field_70137_T) * (double)p_72717_3_; +- double d2 = p_72717_2_.field_70136_U + (p_72717_2_.field_70161_v - p_72717_2_.field_70136_U) * (double)p_72717_3_; ++ drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_); + } -+ + + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) + { - double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; - double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; - double d2 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3; -@@ -1845,12 +1879,15 @@ ++ double d0 = par2EntityPlayer.field_70142_S + (par2EntityPlayer.field_70165_t - par2EntityPlayer.field_70142_S) * (double)par3; ++ double d1 = par2EntityPlayer.field_70137_T + (par2EntityPlayer.field_70163_u - par2EntityPlayer.field_70137_T) * (double)par3; ++ double d2 = par2EntityPlayer.field_70136_U + (par2EntityPlayer.field_70161_v - par2EntityPlayer.field_70136_U) * (double)par3; ++ + if (!this.field_72738_E.isEmpty()) { - ItemRecord itemrecord = ItemRecord.getRecord(par1Str); + OpenGlHelper.func_148821_a(774, 768, 1, 0); +@@ -1584,9 +1618,9 @@ + GL11.glPolygonOffset(-3.0F, -3.0F); + GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glEnable(GL11.GL_ALPHA_TEST); +- p_72717_1_.func_78382_b(); +- p_72717_1_.func_78373_b(-d0, -d1, -d2); +- p_72717_1_.func_78383_c(); ++ par1Tessellator.func_78382_b(); ++ par1Tessellator.func_78373_b(-d0, -d1, -d2); ++ par1Tessellator.func_78383_c(); + Iterator iterator = this.field_72738_E.values().iterator(); + + while (iterator.hasNext()) +@@ -1611,8 +1645,8 @@ + } + } + +- p_72717_1_.func_78381_a(); +- p_72717_1_.func_78373_b(0.0D, 0.0D, 0.0D); ++ par1Tessellator.func_78381_a(); ++ par1Tessellator.func_78373_b(0.0D, 0.0D, 0.0D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); +@@ -1789,12 +1823,15 @@ + { + ItemRecord itemrecord = ItemRecord.func_150926_b(p_72702_1_); + ResourceLocation resource = null; if (itemrecord != null) { - this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); -+ resource = itemrecord.getRecordResource(par1Str); + this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i()); ++ resource = itemrecord.getRecordResource(p_72702_1_); } -- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(par1Str), (float)par2, (float)par3, (float)par4); -+ if (resource == null) resource = new ResourceLocation(par1Str); -+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)par2, (float)par3, (float)par4); - this.mapSoundPositions.put(chunkcoordinates, positionedsoundrecord); - this.mc.getSoundHandler().playSound(positionedsoundrecord); +- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_72702_1_), (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_); ++ if (resource == null) resource = new ResourceLocation(p_72702_1_); ++ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_); + this.field_147593_P.put(chunkcoordinates, positionedsoundrecord); + this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord); } diff --git a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch index 99aea99f80..c8b812eaa6 100644 --- a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch @@ -8,10 +8,14 @@ import java.util.PriorityQueue; import net.minecraft.client.shader.TesselatorVertexState; import net.minecraft.client.util.QuadComparator; -@@ -15,14 +16,21 @@ +@@ -15,10 +16,17 @@ @SideOnly(Side.CLIENT) public class Tessellator { +- private ByteBuffer field_78394_d; +- private IntBuffer field_147568_c; +- private FloatBuffer field_147566_d; +- private ShortBuffer field_147567_e; + private static int nativeBufferSize = 0x200000; + private static int trivertsInBuffer = (nativeBufferSize / 48) * 6; + public static boolean renderingWorldRenderer = false; @@ -19,31 +23,23 @@ + private int rawBufferSize = 0; + public int textureID = 0; + - // JAVADOC FIELD $$ field_78394_d -- private ByteBuffer byteBuffer; -+ private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); - // JAVADOC FIELD $$ field_147568_c -- private IntBuffer intBuffer; -+ private static IntBuffer intBuffer = byteBuffer.asIntBuffer(); - // JAVADOC FIELD $$ field_147566_d -- private FloatBuffer floatBuffer; -+ private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); - // JAVADOC FIELD $$ field_147567_e -- private ShortBuffer shortBuffer; -+ private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); - // JAVADOC FIELD $$ field_78405_h - private int[] rawBuffer; - // JAVADOC FIELD $$ field_78406_i -@@ -67,14 +75,17 @@ ++ private static ByteBuffer field_78394_d = GLAllocation.func_74524_c(nativeBufferSize * 4); ++ private static IntBuffer field_147568_c = field_78394_d.asIntBuffer(); ++ private static FloatBuffer field_147566_d = field_78394_d.asFloatBuffer(); ++ private static ShortBuffer field_147567_e = field_78394_d.asShortBuffer(); + private int[] field_78405_h; + private int field_78406_i; + private double field_78403_j; +@@ -44,14 +52,17 @@ - private Tessellator(int par1) + private Tessellator(int p_i1250_1_) { -- this.bufferSize = par1; -- this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4); -- this.intBuffer = this.byteBuffer.asIntBuffer(); -- this.floatBuffer = this.byteBuffer.asFloatBuffer(); -- this.shortBuffer = this.byteBuffer.asShortBuffer(); -- this.rawBuffer = new int[par1]; +- this.field_78388_E = p_i1250_1_; +- this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4); +- this.field_147568_c = this.field_78394_d.asIntBuffer(); +- this.field_147566_d = this.field_78394_d.asFloatBuffer(); +- this.field_147567_e = this.field_78394_d.asShortBuffer(); +- this.field_78405_h = new int[p_i1250_1_]; } + public Tessellator() @@ -52,98 +48,98 @@ + + static + { -+ instance.defaultTexture = true; ++ field_78398_a.defaultTexture = true; + } + - // JAVADOC METHOD $$ func_78381_a - public int draw() + public int func_78381_a() { -@@ -86,12 +97,15 @@ + if (!this.field_78415_z) +@@ -62,12 +73,15 @@ { - this.isDrawing = false; + this.field_78415_z = false; -- if (this.vertexCount > 0) +- if (this.field_78406_i > 0) + int offs = 0; -+ while (offs < vertexCount) ++ while (offs < field_78406_i) { -+ int vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5); - this.intBuffer.clear(); -- this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); -+ this.intBuffer.put(this.rawBuffer, offs * 8, vtc * 8); - this.byteBuffer.position(0); -- this.byteBuffer.limit(this.rawBufferIndex * 4); -+ this.byteBuffer.limit(vtc * 32); ++ int vtc = Math.min(field_78406_i - offs, nativeBufferSize >> 5); + this.field_147568_c.clear(); +- this.field_147568_c.put(this.field_78405_h, 0, this.field_147569_p); ++ this.field_147568_c.put(this.field_78405_h, offs * 8, vtc * 8); + this.field_78394_d.position(0); +- this.field_78394_d.limit(this.field_147569_p * 4); ++ this.field_78394_d.limit(vtc * 32); + offs += vtc; - if (this.hasTexture) + if (this.field_78400_o) { -@@ -126,7 +140,7 @@ - this.floatBuffer.position(0); - GL11.glVertexPointer(3, 32, this.floatBuffer); +@@ -102,7 +116,7 @@ + this.field_147566_d.position(0); + GL11.glVertexPointer(3, 32, this.field_147566_d); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); -- GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); -+ GL11.glDrawArrays(this.drawMode, 0, vtc); +- GL11.glDrawArrays(this.field_78409_u, 0, this.field_78406_i); ++ GL11.glDrawArrays(this.field_78409_u, 0, vtc); GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); - if (this.hasTexture) -@@ -152,6 +166,12 @@ + if (this.field_78400_o) +@@ -128,6 +142,12 @@ } } -+ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) ++ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3)) + { + rawBufferSize = 0x10000; -+ rawBuffer = new int[rawBufferSize]; ++ field_78405_h = new int[rawBufferSize]; + } + - int i = this.rawBufferIndex * 4; - this.reset(); + int i = this.field_147569_p * 4; + this.func_78379_d(); return i; -@@ -186,6 +206,14 @@ +@@ -162,6 +182,14 @@ - public void setVertexState(TesselatorVertexState p_147565_1_) + public void func_147565_a(TesselatorVertexState p_147565_1_) { -+ while (p_147565_1_.getRawBuffer().length > rawBufferSize && rawBufferSize > 0) ++ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0) + { + rawBufferSize <<= 1; + } -+ if (rawBufferSize > rawBuffer.length) ++ if (rawBufferSize > field_78405_h.length) + { -+ rawBuffer = new int[rawBufferSize]; ++ field_78405_h = new int[rawBufferSize]; + } - System.arraycopy(p_147565_1_.getRawBuffer(), 0, this.rawBuffer, 0, p_147565_1_.getRawBuffer().length); - this.rawBufferIndex = p_147565_1_.getRawBufferIndex(); - this.vertexCount = p_147565_1_.getVertexCount(); -@@ -330,6 +358,19 @@ - // JAVADOC METHOD $$ func_78377_a - public void addVertex(double par1, double par3, double par5) + System.arraycopy(p_147565_1_.func_147572_a(), 0, this.field_78405_h, 0, p_147565_1_.func_147572_a().length); + this.field_147569_p = p_147565_1_.func_147576_b(); + this.field_78406_i = p_147565_1_.func_147575_c(); +@@ -296,6 +324,19 @@ + + public void func_78377_a(double p_78377_1_, double p_78377_3_, double p_78377_5_) { -+ if (rawBufferIndex >= rawBufferSize - 32) ++ if (field_147569_p >= rawBufferSize - 32) + { + if (rawBufferSize == 0) + { + rawBufferSize = 0x10000; -+ rawBuffer = new int[rawBufferSize]; ++ field_78405_h = new int[rawBufferSize]; + } + else + { + rawBufferSize *= 2; -+ rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize); ++ field_78405_h = Arrays.copyOf(field_78405_h, rawBufferSize); + } + } - ++this.addedVertices; + ++this.field_78411_s; - if (this.hasTexture) -@@ -358,12 +399,6 @@ - this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); - this.rawBufferIndex += 8; - ++this.vertexCount; + if (this.field_78400_o) +@@ -324,12 +365,6 @@ + this.field_78405_h[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.field_78417_x)); + this.field_147569_p += 8; + ++this.field_78406_i; - -- if (this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) +- if (this.field_78406_i % 4 == 0 && this.field_147569_p >= this.field_78388_E - 32) - { -- this.draw(); -- this.isDrawing = true; +- this.func_78381_a(); +- this.field_78415_z = true; - } } - // JAVADOC METHOD $$ func_78378_d + public void func_78378_d(int p_78378_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index 87dc0c4e89..8e74e13463 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -1,24 +1,24 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java -@@ -29,7 +29,7 @@ - // JAVADOC FIELD $$ field_78924_a - public World worldObj; - private int glRenderList = -1; -- private static Tessellator tessellator = Tessellator.instance; +@@ -28,7 +28,7 @@ + private TesselatorVertexState field_147894_y; + public World field_78924_a; + private int field_78942_y = -1; +- private static Tessellator field_78941_z = Tessellator.field_78398_a; + //private static Tessellator tessellator = Tessellator.instance; - public static int chunksUpdated; - public int posX; - public int posY; -@@ -179,7 +179,7 @@ - this.preRenderBlocks(k2); + public static int field_78922_b; + public int field_78923_c; + public int field_78920_d; +@@ -157,7 +157,7 @@ + this.func_147890_b(k2); } -- if (k2 == 0 && block.hasTileEntity()) -+ if (k2 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(j3, l2, i3))) +- if (k2 == 0 && block.func_149716_u()) ++ if (k2 == 0 && block.hasTileEntity(chunkcache.func_72805_g(j3, l2, i3))) { - TileEntity tileentity = chunkcache.getTileEntity(j3, l2, i3); + TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3); -@@ -195,7 +195,9 @@ +@@ -173,7 +173,9 @@ { flag = true; } @@ -27,42 +27,42 @@ + if (!block.canRenderInPass(k2)) continue; + { - flag1 |= renderblocks.renderBlockByRenderType(block, j3, l2, i3); + flag1 |= renderblocks.func_147805_b(block, j3, l2, i3); -@@ -254,21 +256,22 @@ +@@ -232,21 +234,22 @@ GL11.glTranslatef(-8.0F, -8.0F, -8.0F); GL11.glScalef(f, f, f); GL11.glTranslatef(8.0F, 8.0F, 8.0F); -- tessellator.startDrawingQuads(); -- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); -+ Tessellator.instance.startDrawingQuads(); -+ Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); +- field_78941_z.func_78382_b(); +- field_78941_z.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e)); ++ Tessellator.field_78398_a.func_78382_b(); ++ Tessellator.field_78398_a.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e)); } - private void postRenderBlocks(int p_147891_1_, EntityLivingBase p_147891_2_) + private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_) { - if (p_147891_1_ == 1 && !this.skipRenderPass[p_147891_1_]) + if (p_147891_1_ == 1 && !this.field_78928_m[p_147891_1_]) { -- this.vertexState = tessellator.getVertexState((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); -+ this.vertexState = Tessellator.instance.getVertexState((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); +- this.field_147894_y = field_78941_z.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v); ++ this.field_147894_y = Tessellator.field_78398_a.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v); } -- this.bytesDrawn += tessellator.draw(); +- this.field_78917_C += field_78941_z.func_78381_a(); + //ForgeHooksClient.afterRenderPass(l1); Noop fo now, TODO: Event if anyone needs -+ this.bytesDrawn += Tessellator.instance.draw(); ++ this.field_78917_C += Tessellator.field_78398_a.func_78381_a(); GL11.glPopMatrix(); GL11.glEndList(); -- tessellator.setTranslation(0.0D, 0.0D, 0.0D); -+ Tessellator.instance.setTranslation(0.0D, 0.0D, 0.0D); +- field_78941_z.func_78373_b(0.0D, 0.0D, 0.0D); ++ Tessellator.field_78398_a.func_78373_b(0.0D, 0.0D, 0.0D); } - public void updateRendererSort(EntityLivingBase p_147889_1_) -@@ -276,7 +279,7 @@ - if (this.vertexState != null && !this.skipRenderPass[1]) + public void func_147889_b(EntityLivingBase p_147889_1_) +@@ -254,7 +257,7 @@ + if (this.field_147894_y != null && !this.field_78928_m[1]) { - this.preRenderBlocks(1); -- tessellator.setVertexState(this.vertexState); -+ Tessellator.instance.setVertexState(this.vertexState); - this.postRenderBlocks(1, p_147889_1_); + this.func_147890_b(1); +- field_78941_z.func_147565_a(this.field_147894_y); ++ Tessellator.field_78398_a.func_147565_a(this.field_147894_y); + this.func_147891_a(1, p_147889_1_); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch index 4c26c425ca..a0150e0fbd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch @@ -16,98 +16,98 @@ @SideOnly(Side.CLIENT) public class RenderBiped extends RenderLiving -@@ -50,11 +56,13 @@ +@@ -49,11 +55,13 @@ this.field_82425_h = new ModelBiped(0.5F); } + @Deprecated //Use the more sensitive version getArmorResource below - public static ResourceLocation func_110857_a(ItemArmor par0ItemArmor, int par1) + public static ResourceLocation func_110857_a(ItemArmor p_110857_0_, int p_110857_1_) { - return func_110858_a(par0ItemArmor, par1, (String)null); + return func_110858_a(p_110857_0_, p_110857_1_, (String)null); } + @Deprecated //Use the more sensitive version getArmorResource below - public static ResourceLocation func_110858_a(ItemArmor par0ItemArmor, int par1, String par2Str) + public static ResourceLocation func_110858_a(ItemArmor p_110858_0_, int p_110858_1_, String p_110858_2_) { - String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {bipedArmorFilenamePrefix[par0ItemArmor.renderIndex], Integer.valueOf(par1 == 2 ? 2 : 1), par2Str == null ? "" : String.format("_%s", new Object[]{par2Str})}); -@@ -81,7 +89,7 @@ + String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {field_82424_k[p_110858_0_.field_77880_c], Integer.valueOf(p_110858_1_ == 2 ? 2 : 1), p_110858_2_ == null ? "" : String.format("_%s", new Object[]{p_110858_2_})}); +@@ -79,7 +87,7 @@ if (item instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; -- this.bindTexture(func_110857_a(itemarmor, par2)); -+ this.bindTexture(getArmorResource(par1EntityLiving, itemstack, par2, null)); - ModelBiped modelbiped = par2 == 2 ? this.field_82425_h : this.field_82423_g; - modelbiped.bipedHead.showModel = par2 == 0; - modelbiped.bipedHeadwear.showModel = par2 == 0; -@@ -90,14 +98,16 @@ - modelbiped.bipedLeftArm.showModel = par2 == 1; - modelbiped.bipedRightLeg.showModel = par2 == 2 || par2 == 3; - modelbiped.bipedLeftLeg.showModel = par2 == 2 || par2 == 3; -+ modelbiped = ForgeHooksClient.getArmorModel(par1EntityLiving, itemstack, par2, modelbiped); - this.setRenderPassModel(modelbiped); - modelbiped.onGround = this.mainModel.onGround; - modelbiped.isRiding = this.mainModel.isRiding; - modelbiped.isChild = this.mainModel.isChild; +- this.func_110776_a(func_110857_a(itemarmor, p_130006_2_)); ++ this.func_110776_a(getArmorResource(p_130006_1_, itemstack, p_130006_2_, null)); + ModelBiped modelbiped = p_130006_2_ == 2 ? this.field_82425_h : this.field_82423_g; + modelbiped.field_78116_c.field_78806_j = p_130006_2_ == 0; + modelbiped.field_78114_d.field_78806_j = p_130006_2_ == 0; +@@ -88,14 +96,16 @@ + modelbiped.field_78113_g.field_78806_j = p_130006_2_ == 1; + modelbiped.field_78123_h.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3; + modelbiped.field_78124_i.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3; ++ modelbiped = ForgeHooksClient.getArmorModel(p_130006_1_, itemstack, p_130006_2_, modelbiped); + this.func_77042_a(modelbiped); + modelbiped.field_78095_p = this.field_77045_g.field_78095_p; + modelbiped.field_78093_q = this.field_77045_g.field_78093_q; + modelbiped.field_78091_s = this.field_77045_g.field_78091_s; -- if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) +- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH) + //Move out of if to allow for more then just CLOTH to have color -+ int j = itemarmor.getColor(itemstack); ++ int j = itemarmor.func_82814_b(itemstack); + if (j != -1) { -- int j = itemarmor.getColor(itemstack); +- int j = itemarmor.func_82814_b(itemstack); float f1 = (float)(j >> 16 & 255) / 255.0F; float f2 = (float)(j >> 8 & 255) / 255.0F; float f3 = (float)(j & 255) / 255.0F; -@@ -135,7 +145,7 @@ +@@ -133,7 +143,7 @@ if (item instanceof ItemArmor) { -- this.bindTexture(func_110858_a((ItemArmor)item, par2, "overlay")); -+ this.bindTexture(getArmorResource(par1EntityLivingBase, itemstack, par2, "overlay")); +- this.func_110776_a(func_110858_a((ItemArmor)item, p_82408_2_, "overlay")); ++ this.func_110776_a(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); float f1 = 1.0F; GL11.glColor3f(1.0F, 1.0F, 1.0F); } -@@ -188,9 +198,12 @@ - this.modelBipedMain.bipedHead.postRender(0.0625F); - item = itemstack1.getItem(); +@@ -184,9 +194,12 @@ + this.field_77071_a.field_78116_c.func_78794_c(0.0625F); + item = itemstack1.func_77973_b(); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); + if (item instanceof ItemBlock) { -- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) -+ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) +- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) { f1 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); -@@ -233,7 +246,10 @@ - this.modelBipedMain.bipedRightArm.postRender(0.0625F); +@@ -229,7 +242,10 @@ + this.field_77071_a.field_78112_f.func_78794_c(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); -- if (item instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) +- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (item instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) ++ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -@@ -289,7 +305,10 @@ +@@ -285,7 +301,10 @@ f3 = (float)(i >> 8 & 255) / 255.0F; float f4 = (float)(i & 255) / 255.0F; GL11.glColor4f(f2, f3, f4, 1.0F); -- this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, j); -+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) +- this.field_76990_c.field_78721_f.func_78443_a(p_130005_1_, itemstack, j); ++ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++) + { -+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, x); ++ this.field_76990_c.field_78721_f.func_78443_a(p_130005_1_, itemstack, x); + } } } else -@@ -344,4 +363,33 @@ +@@ -336,4 +355,33 @@ { - this.doRender((EntityLiving)par1Entity, par2, par4, par6, par8, par9); + this.func_76986_a((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } + + /*=================================== FORGE START =========================================*/ @@ -122,9 +122,9 @@ + */ + public static ResourceLocation getArmorResource(Entity entity, ItemStack stack, int slot, String type) + { -+ ItemArmor item = (ItemArmor)stack.getItem(); ++ ItemArmor item = (ItemArmor)stack.func_77973_b(); + String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", -+ bipedArmorFilenamePrefix[item.renderIndex], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ field_82424_k[item.field_77880_c], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); + + s1 = ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); + ResourceLocation resourcelocation = (ResourceLocation)field_110859_k.get(s1); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch index 8b48bd640b..832cf7feac 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -17,85 +17,119 @@ @SideOnly(Side.CLIENT) public class RenderItem extends Render { -@@ -56,7 +59,7 @@ - this.bindEntityTexture(par1EntityItem); - this.random.setSeed(187L); +@@ -53,7 +56,7 @@ + this.func_110777_b(p_77014_1_); + this.field_77025_h.setSeed(187L); GL11.glPushMatrix(); -- float f2 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F; -+ float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; - float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI); +- float f2 = MathHelper.func_76126_a(((float)p_77014_1_.field_70292_b + p_77014_9_) / 10.0F + p_77014_1_.field_70290_d) * 0.1F + 0.1F; ++ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_77014_1_.field_70292_b + p_77014_9_) / 10.0F + p_77014_1_.field_70290_d) * 0.1F + 0.1F : 0F; + float f3 = (((float)p_77014_1_.field_70292_b + p_77014_9_) / 20.0F + p_77014_1_.field_70290_d) * (180F / (float)Math.PI); byte b0 = 1; -@@ -80,12 +83,19 @@ +@@ -77,12 +80,19 @@ b0 = 5; } + b0 = getMiniBlockCount(itemstack, b0); + - GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6); + GL11.glTranslatef((float)p_77014_2_, (float)p_77014_4_ + f2, (float)p_77014_6_); GL11.glEnable(GL12.GL_RESCALE_NORMAL); float f7; float f6; int k; -+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, field_147909_c, b0)) ++ if (ForgeHooksClient.renderEntityItem(p_77014_1_, itemstack, f2, f3, field_77025_h, field_76990_c.field_78724_e, field_147909_c, b0)) + { + ; + } + else // Code Style break here to prevent the patch from editing this line - if (itemstack.getItemSpriteNumber() == 0 && itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + if (itemstack.func_94608_d() == 0 && itemstack.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) { - Block block = Block.getBlockFromItem(itemstack.getItem()); -@@ -140,7 +150,7 @@ + Block block = Block.func_149634_a(itemstack.func_77973_b()); +@@ -137,7 +147,7 @@ { float f5; -- if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses()) -+ if (/*itemstack.getItemSpriteNumber() == 1 &&*/ itemstack.getItem().requiresMultipleRenderPasses()) +- if (itemstack.func_94608_d() == 1 && itemstack.func_77973_b().func_77623_v()) ++ if (/*itemstack.getItemSpriteNumber() == 1 &&*/ itemstack.func_77973_b().func_77623_v()) { - if (renderInFrame) + if (field_82407_g) { -@@ -152,10 +162,10 @@ +@@ -149,10 +159,10 @@ GL11.glScalef(0.5F, 0.5F, 0.5F); } - for (int j = 0; j <= 1; ++j) -+ for (int j = 0; j < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++j) ++ for (int j = 0; j < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++j) { - this.random.setSeed(187L); -- IIcon iicon1 = itemstack.getItem().getIconFromDamageForRenderPass(itemstack.getItemDamage(), j); -+ IIcon iicon1 = itemstack.getItem().getIcon(itemstack, j); + this.field_77025_h.setSeed(187L); +- IIcon iicon1 = itemstack.func_77973_b().func_77618_c(itemstack.func_77960_j(), j); ++ IIcon iicon1 = itemstack.func_77973_b().getIcon(itemstack, j); - if (this.renderWithColor) + if (this.field_77024_a) { -@@ -164,11 +174,11 @@ +@@ -161,11 +171,11 @@ f6 = (float)(k >> 8 & 255) / 255.0F; f7 = (float)(k & 255) / 255.0F; GL11.glColor4f(f5, f6, f7, 1.0F); -- this.renderDroppedItem(par1EntityItem, iicon1, b0, par9, f5, f6, f7); -+ this.renderDroppedItem(par1EntityItem, iicon1, b0, par9, f5, f6, f7, j); +- this.func_77020_a(p_77014_1_, iicon1, b0, p_77014_9_, f5, f6, f7); ++ this.renderDroppedItem(p_77014_1_, iicon1, b0, p_77014_9_, f5, f6, f7, j); } else { -- this.renderDroppedItem(par1EntityItem, iicon1, b0, par9, 1.0F, 1.0F, 1.0F); -+ this.renderDroppedItem(par1EntityItem, iicon1, b0, par9, 1.0F, 1.0F, 1.0F, j); +- this.func_77020_a(p_77014_1_, iicon1, b0, p_77014_9_, 1.0F, 1.0F, 1.0F); ++ this.renderDroppedItem(p_77014_1_, iicon1, b0, p_77014_9_, 1.0F, 1.0F, 1.0F, j); } } } -@@ -227,6 +237,12 @@ - // JAVADOC METHOD $$ func_77020_a - private void renderDroppedItem(EntityItem par1EntityItem, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7) +@@ -222,19 +232,24 @@ + + private void func_77020_a(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_) { -+ this.renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); ++ this.renderDroppedItem(p_77020_1_, p_77020_2_, p_77020_3_, p_77020_4_, p_77020_5_, p_77020_6_, p_77020_7_, 0); + } + -+ // JAVADOC METHOD $$ renderDroppedItem + private void renderDroppedItem(EntityItem par1EntityItem, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) + { - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.field_78398_a; - if (par2Icon == null) -@@ -281,11 +297,24 @@ +- if (p_77020_2_ == null) ++ if (par2Icon == null) + { + TextureManager texturemanager = Minecraft.func_71410_x().func_110434_K(); +- ResourceLocation resourcelocation = texturemanager.func_130087_a(p_77020_1_.func_92059_d().func_94608_d()); +- p_77020_2_ = ((TextureMap)texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); ++ ResourceLocation resourcelocation = texturemanager.func_130087_a(par1EntityItem.func_92059_d().func_94608_d()); ++ par2Icon = ((TextureMap)texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); + } + +- float f14 = ((IIcon)p_77020_2_).func_94209_e(); +- float f15 = ((IIcon)p_77020_2_).func_94212_f(); +- float f4 = ((IIcon)p_77020_2_).func_94206_g(); +- float f5 = ((IIcon)p_77020_2_).func_94210_h(); ++ float f14 = ((IIcon)par2Icon).func_94209_e(); ++ float f15 = ((IIcon)par2Icon).func_94212_f(); ++ float f4 = ((IIcon)par2Icon).func_94206_g(); ++ float f5 = ((IIcon)par2Icon).func_94210_h(); + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.25F; +@@ -250,12 +265,12 @@ + } + else + { +- GL11.glRotatef((((float)p_77020_1_.field_70292_b + p_77020_4_) / 20.0F + p_77020_1_.field_70290_d) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef((((float)par1EntityItem.field_70292_b + par4) / 20.0F + par1EntityItem.field_70290_d) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + float f9 = 0.0625F; + f10 = 0.021875F; +- ItemStack itemstack = p_77020_1_.func_92059_d(); ++ ItemStack itemstack = par1EntityItem.func_92059_d(); + int j = itemstack.field_77994_a; + byte b0; + +@@ -276,11 +291,24 @@ b0 = 4; } @@ -109,9 +143,9 @@ + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + if (k > 0 && shouldSpreadItems()) + { -+ float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; -+ float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; -+ float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ float x = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ float y = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ float z = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + GL11.glTranslatef(x, y, f9 + f10); + } + else @@ -119,55 +153,134 @@ + GL11.glTranslatef(0f, 0f, f9 + f10); + } - if (itemstack.getItemSpriteNumber() == 0) + if (itemstack.func_94608_d() == 0) { -@@ -299,7 +328,7 @@ - GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f15, f4, f14, f5, ((IIcon)par2Icon).getIconWidth(), ((IIcon)par2Icon).getIconHeight(), f9); +@@ -291,10 +319,10 @@ + this.func_110776_a(TextureMap.field_110576_c); + } -- if (itemstack.hasEffect()) +- GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); +- ItemRenderer.func_78439_a(tessellator, f15, f4, f14, f5, ((IIcon)p_77020_2_).func_94211_a(), ((IIcon)p_77020_2_).func_94216_b(), f9); ++ GL11.glColor4f(par5, par6, par7, 1.0F); ++ ItemRenderer.func_78439_a(tessellator, f15, f4, f14, f5, ((IIcon)par2Icon).func_94211_a(), ((IIcon)par2Icon).func_94216_b(), f9); + +- if (itemstack.func_77962_s()) + if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); -@@ -368,6 +397,12 @@ - // JAVADOC METHOD $$ func_77015_a - public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) +@@ -330,7 +358,7 @@ + } + else + { +- for (int l = 0; l < p_77020_3_; ++l) ++ for (int l = 0; l < par3; ++l) + { + GL11.glPushMatrix(); + +@@ -347,7 +375,7 @@ + GL11.glRotatef(180.0F - this.field_76990_c.field_78735_i, 0.0F, 1.0F, 0.0F); + } + +- GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); ++ GL11.glColor4f(par5, par6, par7, 1.0F); + tessellator.func_78382_b(); + tessellator.func_78375_b(0.0F, 1.0F, 0.0F); + tessellator.func_78374_a((double)(0.0F - f7), (double)(0.0F - f8), 0.0D, (double)f14, (double)f5); +@@ -362,8 +390,13 @@ + + public void func_77015_a(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_) { -+ this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); +- int k = p_77015_3_.func_77960_j(); +- Object object = p_77015_3_.func_77954_c(); ++ this.renderItemIntoGUI(p_77015_1_, p_77015_2_, p_77015_3_, p_77015_4_, p_77015_5_, false); + } + -+ // JAVADOC METHOD $$ renderItemIntoGUI + public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) + { - int k = par3ItemStack.getItemDamage(); - Object object = par3ItemStack.getIconIndex(); ++ int k = par3ItemStack.func_77960_j(); ++ Object object = par3ItemStack.func_77954_c(); GL11.glEnable(GL11.GL_BLEND); -@@ -426,11 +461,13 @@ + OpenGlHelper.func_148821_a(770, 771, 1, 0); + float f3; +@@ -371,18 +404,18 @@ + int l; + float f; + +- if (p_77015_3_.func_94608_d() == 0 && RenderBlocks.func_147739_a(Block.func_149634_a(p_77015_3_.func_77973_b()).func_149645_b())) ++ if (par3ItemStack.func_94608_d() == 0 && RenderBlocks.func_147739_a(Block.func_149634_a(par3ItemStack.func_77973_b()).func_149645_b())) + { +- p_77015_2_.func_110577_a(TextureMap.field_110575_b); +- Block block = Block.func_149634_a(p_77015_3_.func_77973_b()); ++ par2TextureManager.func_110577_a(TextureMap.field_110575_b); ++ Block block = Block.func_149634_a(par3ItemStack.func_77973_b()); + GL11.glPushMatrix(); +- GL11.glTranslatef((float)(p_77015_4_ - 2), (float)(p_77015_5_ + 3), -3.0F + this.field_77023_b); ++ GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.field_77023_b); + GL11.glScalef(10.0F, 10.0F, 10.0F); + GL11.glTranslatef(1.0F, 0.5F, 1.0F); + GL11.glScalef(1.0F, 1.0F, -1.0F); + GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); +- l = p_77015_3_.func_77973_b().func_82790_a(p_77015_3_, 0); ++ l = par3ItemStack.func_77973_b().func_82790_a(par3ItemStack, 0); + f4 = (float)(l >> 16 & 255) / 255.0F; + f3 = (float)(l >> 8 & 255) / 255.0F; + f = (float)(l & 255) / 255.0F; +@@ -398,11 +431,11 @@ + this.field_147913_i.field_147844_c = true; + GL11.glPopMatrix(); + } +- else if (p_77015_3_.func_77973_b().func_77623_v()) ++ else if (par3ItemStack.func_77973_b().func_77623_v()) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); +- p_77015_2_.func_110577_a(TextureMap.field_110576_c); ++ par2TextureManager.func_110577_a(TextureMap.field_110576_c); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); +@@ -412,20 +445,22 @@ + Tessellator tessellator = Tessellator.field_78398_a; + tessellator.func_78382_b(); + tessellator.func_78378_d(-1); +- tessellator.func_78377_a((double)(p_77015_4_ - 2), (double)(p_77015_5_ + 18), (double)this.field_77023_b); +- tessellator.func_78377_a((double)(p_77015_4_ + 18), (double)(p_77015_5_ + 18), (double)this.field_77023_b); +- tessellator.func_78377_a((double)(p_77015_4_ + 18), (double)(p_77015_5_ - 2), (double)this.field_77023_b); +- tessellator.func_78377_a((double)(p_77015_4_ - 2), (double)(p_77015_5_ - 2), (double)this.field_77023_b); ++ tessellator.func_78377_a((double)(par4 - 2), (double)(par5 + 18), (double)this.field_77023_b); ++ tessellator.func_78377_a((double)(par4 + 18), (double)(par5 + 18), (double)this.field_77023_b); ++ tessellator.func_78377_a((double)(par4 + 18), (double)(par5 - 2), (double)this.field_77023_b); ++ tessellator.func_78377_a((double)(par4 - 2), (double)(par5 - 2), (double)this.field_77023_b); + tessellator.func_78381_a(); GL11.glColorMask(true, true, true, true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); -- OpenGlHelper.glBlendFunc(770, 771, 1, 0); +- OpenGlHelper.func_148821_a(770, 771, 1, 0); - for (l = 0; l <= 1; ++l) -+ Item item = par3ItemStack.getItem(); ++ Item item = par3ItemStack.func_77973_b(); + for (l = 0; l < item.getRenderPasses(k); ++l) { -- IIcon iicon = par3ItemStack.getItem().getIconFromDamageForRenderPass(k, l); -+ OpenGlHelper.glBlendFunc(770, 771, 1, 0); -+ par2TextureManager.bindTexture(item.getSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); +- IIcon iicon = p_77015_3_.func_77973_b().func_77618_c(k, l); +- int i1 = p_77015_3_.func_77973_b().func_82790_a(p_77015_3_, l); ++ OpenGlHelper.func_148821_a(770, 771, 1, 0); ++ par2TextureManager.func_110577_a(item.func_94901_k() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); + IIcon iicon = item.getIcon(par3ItemStack, l); - int i1 = par3ItemStack.getItem().getColorFromItemStack(par3ItemStack, l); ++ int i1 = par3ItemStack.func_77973_b().func_82790_a(par3ItemStack, l); f = (float)(i1 >> 16 & 255) / 255.0F; float f1 = (float)(i1 >> 8 & 255) / 255.0F; -@@ -441,7 +478,18 @@ + float f2 = (float)(i1 & 255) / 255.0F; +@@ -435,7 +470,18 @@ GL11.glColor4f(f, f1, f2, 1.0F); } +- this.func_94149_a(p_77015_4_, p_77015_5_, iicon, 16, 16); + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, ad renderEffect can derp them up. + GL11.glEnable(GL11.GL_ALPHA_TEST); + - this.renderIcon(par4, par5, iicon, 16, 16); ++ this.func_94149_a(par4, par5, iicon, 16, 16); + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_LIGHTING); @@ -179,14 +292,34 @@ } GL11.glDisable(GL11.GL_ALPHA_TEST); -@@ -468,8 +516,19 @@ +@@ -444,15 +490,15 @@ + else + { + GL11.glDisable(GL11.GL_LIGHTING); +- ResourceLocation resourcelocation = p_77015_2_.func_130087_a(p_77015_3_.func_94608_d()); +- p_77015_2_.func_110577_a(resourcelocation); ++ ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.func_94608_d()); ++ par2TextureManager.func_110577_a(resourcelocation); + + if (object == null) + { + object = ((TextureMap)Minecraft.func_71410_x().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno"); + } + +- l = p_77015_3_.func_77973_b().func_82790_a(p_77015_3_, 0); ++ l = par3ItemStack.func_77973_b().func_82790_a(par3ItemStack, 0); + f4 = (float)(l >> 16 & 255) / 255.0F; + f3 = (float)(l >> 8 & 255) / 255.0F; + f = (float)(l & 255) / 255.0F; +@@ -462,8 +508,19 @@ GL11.glColor4f(f4, f3, f, 1.0F); } +- this.func_94149_a(p_77015_4_, p_77015_5_, (IIcon)object, 16, 16); + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, ad renderEffect can derp them up. + GL11.glEnable(GL11.GL_ALPHA_TEST); + - this.renderIcon(par4, par5, (IIcon)object, 16, 16); ++ this.func_94149_a(par4, par5, (IIcon)object, 16, 16); + + GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_LIGHTING); @@ -199,33 +332,44 @@ } GL11.glEnable(GL11.GL_CULL_FACE); -@@ -484,7 +543,10 @@ +@@ -477,7 +534,10 @@ try { -- this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); -+ if (!ForgeHooksClient.renderInventoryItem(this.field_147909_c, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float)par4, (float)par5)) +- this.func_77015_a(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_); ++ if (!ForgeHooksClient.renderInventoryItem(this.field_147909_c, p_82406_2_, p_82406_3_, field_77024_a, field_77023_b, (float)p_82406_4_, (float)p_82406_5_)) + { -+ this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); ++ this.renderItemIntoGUI(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_, true); + } } catch (Throwable throwable) { -@@ -525,6 +587,7 @@ +@@ -518,26 +578,45 @@ throw new ReportedException(crashreport); } +- if (p_82406_3_.func_77962_s()) + /* Forge: Bugfix, Move this to a per-render pass, modders must handle themselves - if (par3ItemStack.hasEffect()) ++ if (par3ItemStack.hasEffect()) { GL11.glDepthFunc(GL11.GL_EQUAL); -@@ -540,11 +603,29 @@ + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); +- p_82406_2_.func_110577_a(field_110798_h); ++ par2TextureManager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); +- this.func_77018_a(p_82406_4_ * 431278612 + p_82406_5_ * 32178161, p_82406_4_ - 2, p_82406_5_ - 2, 20, 20); ++ this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } + */ - this.zLevel -= 50.0F; + this.field_77023_b -= 50.0F; } } @@ -234,11 +378,11 @@ + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); -+ manager.bindTexture(RES_ITEM_GLINT); ++ manager.func_110577_a(field_110798_h); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); -+ this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); ++ this.func_77018_a(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); @@ -246,12 +390,12 @@ + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + - private void renderGlint(int par1, int par2, int par3, int par4, int par5) + private void func_77018_a(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) { for (int j1 = 0; j1 < 2; ++j1) -@@ -649,4 +730,42 @@ +@@ -638,4 +717,42 @@ { - this.doRender((EntityItem)par1Entity, par2, par4, par6, par8, par9); + this.func_76986_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } + + /*==================================== FORGE START ===========================================*/ diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index ebaee25195..c23b896d0f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java -@@ -219,11 +219,13 @@ - if (p_147938_4_.isPlayerSleeping()) +@@ -212,11 +212,13 @@ + if (p_147938_4_.func_70608_bn()) { - Block block = p_147938_1_.getBlock(MathHelper.floor_double(p_147938_4_.posX), MathHelper.floor_double(p_147938_4_.posY), MathHelper.floor_double(p_147938_4_.posZ)); -+ int x = MathHelper.floor_double(p_147938_4_.posX); -+ int y = MathHelper.floor_double(p_147938_4_.posY); -+ int z = MathHelper.floor_double(p_147938_4_.posZ); + Block block = p_147938_1_.func_147439_a(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v)); ++ int x = MathHelper.func_76128_c(p_147938_4_.field_70165_t); ++ int y = MathHelper.func_76128_c(p_147938_4_.field_70163_u); ++ int z = MathHelper.func_76128_c(p_147938_4_.field_70161_v); -- if (block == Blocks.bed) +- if (block == Blocks.field_150324_C) + if (block.isBed(p_147938_1_, x, y, z, p_147938_4_)) { -- int i = p_147938_1_.getBlockMetadata(MathHelper.floor_double(p_147938_4_.posX), MathHelper.floor_double(p_147938_4_.posY), MathHelper.floor_double(p_147938_4_.posZ)); +- int i = p_147938_1_.func_72805_g(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v)); - int j = i & 3; + int j = block.getBedDirection(p_147938_1_, x, y, z); - this.playerViewY = (float)(j * 90 + 180); - this.playerViewX = 0.0F; + this.field_78735_i = (float)(j * 90 + 180); + this.field_78732_j = 0.0F; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 32757a9a4f..b9959b1dc0 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -23,11 +23,11 @@ @SideOnly(Side.CLIENT) public class RenderPlayer extends RendererLivingEntity -@@ -46,6 +55,13 @@ +@@ -45,6 +54,13 @@ { - ItemStack itemstack = par1AbstractClientPlayer.inventory.armorItemInSlot(3 - par2); + ItemStack itemstack = p_77107_1_.field_71071_by.func_70440_f(3 - p_77107_2_); -+ RenderPlayerEvent.SetArmorModel event = new RenderPlayerEvent.SetArmorModel(par1AbstractClientPlayer, this, 3 - par2, par3, itemstack); ++ RenderPlayerEvent.SetArmorModel event = new RenderPlayerEvent.SetArmorModel(p_77107_1_, this, 3 - p_77107_2_, p_77107_3_, itemstack); + MinecraftForge.EVENT_BUS.post(event); + if (event.result != -1) + { @@ -36,135 +36,135 @@ + if (itemstack != null) { - Item item = itemstack.getItem(); -@@ -53,7 +69,7 @@ + Item item = itemstack.func_77973_b(); +@@ -52,7 +68,7 @@ if (item instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; -- this.bindTexture(RenderBiped.func_110857_a(itemarmor, par2)); -+ this.bindTexture(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, null)); - ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate; - modelbiped.bipedHead.showModel = par2 == 0; - modelbiped.bipedHeadwear.showModel = par2 == 0; -@@ -62,14 +78,16 @@ - modelbiped.bipedLeftArm.showModel = par2 == 1; - modelbiped.bipedRightLeg.showModel = par2 == 2 || par2 == 3; - modelbiped.bipedLeftLeg.showModel = par2 == 2 || par2 == 3; -+ modelbiped = ForgeHooksClient.getArmorModel(par1AbstractClientPlayer, itemstack, par2, modelbiped); - this.setRenderPassModel(modelbiped); - modelbiped.onGround = this.mainModel.onGround; - modelbiped.isRiding = this.mainModel.isRiding; - modelbiped.isChild = this.mainModel.isChild; +- this.func_110776_a(RenderBiped.func_110857_a(itemarmor, p_77107_2_)); ++ this.func_110776_a(RenderBiped.getArmorResource(p_77107_1_, itemstack, p_77107_2_, null)); + ModelBiped modelbiped = p_77107_2_ == 2 ? this.field_77111_i : this.field_77108_b; + modelbiped.field_78116_c.field_78806_j = p_77107_2_ == 0; + modelbiped.field_78114_d.field_78806_j = p_77107_2_ == 0; +@@ -61,14 +77,16 @@ + modelbiped.field_78113_g.field_78806_j = p_77107_2_ == 1; + modelbiped.field_78123_h.field_78806_j = p_77107_2_ == 2 || p_77107_2_ == 3; + modelbiped.field_78124_i.field_78806_j = p_77107_2_ == 2 || p_77107_2_ == 3; ++ modelbiped = ForgeHooksClient.getArmorModel(p_77107_1_, itemstack, p_77107_2_, modelbiped); + this.func_77042_a(modelbiped); + modelbiped.field_78095_p = this.field_77045_g.field_78095_p; + modelbiped.field_78093_q = this.field_77045_g.field_78093_q; + modelbiped.field_78091_s = this.field_77045_g.field_78091_s; -- if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) +- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH) + //Move outside if to allow for more then just CLOTH -+ int j = itemarmor.getColor(itemstack); ++ int j = itemarmor.func_82814_b(itemstack); + if (j != -1) { -- int j = itemarmor.getColor(itemstack); +- int j = itemarmor.func_82814_b(itemstack); float f1 = (float)(j >> 16 & 255) / 255.0F; float f2 = (float)(j >> 8 & 255) / 255.0F; float f3 = (float)(j & 255) / 255.0F; -@@ -107,7 +125,7 @@ +@@ -106,7 +124,7 @@ if (item instanceof ItemArmor) { -- this.bindTexture(RenderBiped.func_110858_a((ItemArmor)item, par2, "overlay")); -+ this.bindTexture(RenderBiped.getArmorResource(par1AbstractClientPlayer, itemstack, par2, "overlay")); +- this.func_110776_a(RenderBiped.func_110858_a((ItemArmor)item, p_130220_2_, "overlay")); ++ this.func_110776_a(RenderBiped.getArmorResource(p_130220_1_, itemstack, p_130220_2_, "overlay")); GL11.glColor3f(1.0F, 1.0F, 1.0F); } } -@@ -116,6 +134,7 @@ - // JAVADOC METHOD $$ func_76986_a - public void doRender(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, float par8, float par9) +@@ -114,6 +132,7 @@ + + public void func_76986_a(AbstractClientPlayer p_130009_1_, double p_130009_2_, double p_130009_4_, double p_130009_6_, float p_130009_8_, float p_130009_9_) { -+ if (MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Pre(par1AbstractClientPlayer, this, par9))) return; ++ if (MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Pre(p_130009_1_, this, p_130009_9_))) return; GL11.glColor3f(1.0F, 1.0F, 1.0F); - ItemStack itemstack = par1AbstractClientPlayer.inventory.getCurrentItem(); - this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = itemstack != null ? 1 : 0; -@@ -146,6 +165,7 @@ - this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false; - this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false; - this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0; -+ MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Post(par1AbstractClientPlayer, this, par9)); + ItemStack itemstack = p_130009_1_.field_71071_by.func_70448_g(); + this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = itemstack != null ? 1 : 0; +@@ -144,6 +163,7 @@ + this.field_77108_b.field_78118_o = this.field_77111_i.field_78118_o = this.field_77109_a.field_78118_o = false; + this.field_77108_b.field_78117_n = this.field_77111_i.field_78117_n = this.field_77109_a.field_78117_n = false; + this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = 0; ++ MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Post(p_130009_1_, this, p_130009_9_)); } - // JAVADOC METHOD $$ func_110775_a -@@ -156,12 +176,18 @@ + protected ResourceLocation func_110775_a(AbstractClientPlayer p_110817_1_) +@@ -153,12 +173,18 @@ - protected void renderEquippedItems(AbstractClientPlayer par1AbstractClientPlayer, float par2) + protected void func_77029_c(AbstractClientPlayer p_77100_1_, float p_77100_2_) { -+ RenderPlayerEvent.Specials.Pre event = new RenderPlayerEvent.Specials.Pre(par1AbstractClientPlayer, this, par2); ++ RenderPlayerEvent.Specials.Pre event = new RenderPlayerEvent.Specials.Pre(p_77100_1_, this, p_77100_2_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + GL11.glColor3f(1.0F, 1.0F, 1.0F); - super.renderEquippedItems(par1AbstractClientPlayer, par2); - super.renderArrowsStuckInEntity(par1AbstractClientPlayer, par2); - ItemStack itemstack = par1AbstractClientPlayer.inventory.armorItemInSlot(3); + super.func_77029_c(p_77100_1_, p_77100_2_); + super.func_85093_e(p_77100_1_, p_77100_2_); + ItemStack itemstack = p_77100_1_.field_71071_by.func_70440_f(3); - if (itemstack != null) + if (itemstack != null && event.renderHelmet) { GL11.glPushMatrix(); - this.modelBipedMain.bipedHead.postRender(0.0625F); -@@ -169,7 +195,10 @@ + this.field_77109_a.field_78116_c.func_78794_c(0.0625F); +@@ -166,7 +192,10 @@ - if (itemstack.getItem() instanceof ItemBlock) + if (itemstack.func_77973_b() instanceof ItemBlock) { -- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) +- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) { f1 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); -@@ -221,6 +250,7 @@ +@@ -218,6 +247,7 @@ } - boolean flag = par1AbstractClientPlayer.getTextureCape().isTextureUploaded(); + boolean flag = p_77100_1_.func_110310_o().func_110557_a(); + flag = event.renderCape && flag; float f5; - if (flag && !par1AbstractClientPlayer.isInvisible() && !par1AbstractClientPlayer.getHideCape()) -@@ -272,7 +302,7 @@ + if (flag && !p_77100_1_.func_82150_aj() && !p_77100_1_.func_82238_cc()) +@@ -269,7 +299,7 @@ - ItemStack itemstack1 = par1AbstractClientPlayer.inventory.getCurrentItem(); + ItemStack itemstack1 = p_77100_1_.field_71071_by.func_70448_g(); - if (itemstack1 != null) + if (itemstack1 != null && event.renderItem) { GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); -@@ -290,7 +320,10 @@ - enumaction = itemstack1.getItemUseAction(); + this.field_77109_a.field_78112_f.func_78794_c(0.0625F); +@@ -287,7 +317,10 @@ + enumaction = itemstack1.func_77975_n(); } -- if (itemstack1.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack1.getItem()).getRenderType())) +- if (itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); + -+ if (is3D || itemstack1.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack1.getItem()).getRenderType())) ++ if (is3D || itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b())) { f3 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -@@ -347,7 +380,7 @@ +@@ -344,7 +377,7 @@ - if (itemstack1.getItem().requiresMultipleRenderPasses()) + if (itemstack1.func_77973_b().func_77623_v()) { - for (k = 0; k <= 1; ++k) -+ for (k = 0; k <= itemstack1.getItem().getRenderPasses(itemstack1.getItemDamage()); ++k) ++ for (k = 0; k <= itemstack1.func_77973_b().getRenderPasses(itemstack1.func_77960_j()); ++k) { - int i = itemstack1.getItem().getColorFromItemStack(itemstack1, k); + int i = itemstack1.func_77973_b().func_82790_a(itemstack1, k); f12 = (float)(i >> 16 & 255) / 255.0F; -@@ -369,6 +402,7 @@ +@@ -366,6 +399,7 @@ GL11.glPopMatrix(); } -+ MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Specials.Post(par1AbstractClientPlayer, this, par2)); ++ MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Specials.Post(p_77100_1_, this, p_77100_2_)); } - // JAVADOC METHOD $$ func_77041_b + protected void func_77041_b(AbstractClientPlayer p_77104_1_, float p_77104_2_) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch index 8e2a6c1786..3a7a58bdbc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch @@ -11,15 +11,15 @@ @SideOnly(Side.CLIENT) public class RenderSnowMan extends RenderLiving -@@ -39,7 +43,10 @@ +@@ -38,7 +42,10 @@ GL11.glPushMatrix(); - this.snowmanModel.head.postRender(0.0625F); + this.field_77094_a.field_78195_c.func_78794_c(0.0625F); -- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) +- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) { float f1 = 0.625F; GL11.glTranslatef(0.0F, -0.34375F, 0.0F); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch index e9689d1abb..c7a95ae7a9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -10,54 +10,54 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -@@ -33,6 +36,9 @@ - protected ModelBase renderPassModel; +@@ -32,6 +35,9 @@ + protected ModelBase field_77046_h; private static final String __OBFID = "CL_00001012"; + public static float NAME_TAG_RANGE = 64.0f; + public static float NAME_TAG_RANGE_SNEAK = 32.0f; + - public RendererLivingEntity(ModelBase par1ModelBase, float par2) + public RendererLivingEntity(ModelBase p_i1261_1_, float p_i1261_2_) { - this.mainModel = par1ModelBase; -@@ -66,6 +72,7 @@ - // JAVADOC METHOD $$ func_76986_a - public void doRender(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) + this.field_77045_g = p_i1261_1_; +@@ -62,6 +68,7 @@ + + public void func_76986_a(EntityLivingBase p_130000_1_, double p_130000_2_, double p_130000_4_, double p_130000_6_, float p_130000_8_, float p_130000_9_) { -+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(par1EntityLivingBase, this, par2, par4, par6))) return; ++ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(p_130000_1_, this, p_130000_2_, p_130000_4_, p_130000_6_))) return; GL11.glPushMatrix(); GL11.glDisable(GL11.GL_CULL_FACE); - this.mainModel.onGround = this.renderSwingProgress(par1EntityLivingBase, par9); -@@ -275,6 +282,7 @@ + this.field_77045_g.field_78095_p = this.func_77040_d(p_130000_1_, p_130000_9_); +@@ -271,6 +278,7 @@ GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); - this.passSpecialRender(par1EntityLivingBase, par2, par4, par6); -+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(par1EntityLivingBase, this, par2, par4, par6)); + this.func_77033_b(p_130000_1_, p_130000_2_, p_130000_4_, p_130000_6_); ++ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(p_130000_1_, this, p_130000_2_, p_130000_4_, p_130000_6_)); } - // JAVADOC METHOD $$ func_77036_a -@@ -428,6 +436,7 @@ - // JAVADOC METHOD $$ func_77033_b - protected void passSpecialRender(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) + protected void func_77036_a(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) +@@ -416,6 +424,7 @@ + + protected void func_77033_b(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_) { -+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(par1EntityLivingBase, this, par2, par4, par6))) return; ++ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_))) return; GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - if (this.func_110813_b(par1EntityLivingBase)) -@@ -435,7 +444,7 @@ + if (this.func_110813_b(p_77033_1_)) +@@ -423,7 +432,7 @@ float f = 1.6F; float f1 = 0.016666668F * f; - double d3 = par1EntityLivingBase.getDistanceSqToEntity(this.renderManager.livingPlayer); -- float f2 = par1EntityLivingBase.isSneaking() ? 32.0F : 64.0F; -+ float f2 = par1EntityLivingBase.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + double d3 = p_77033_1_.func_70068_e(this.field_76990_c.field_78734_h); +- float f2 = p_77033_1_.func_70093_af() ? 32.0F : 64.0F; ++ float f2 = p_77033_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; if (d3 < (double)(f2 * f2)) { -@@ -479,6 +488,7 @@ +@@ -467,6 +476,7 @@ } } } -+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(par1EntityLivingBase, this, par2, par4, par6)); ++ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_)); } - protected boolean func_110813_b(EntityLivingBase par1EntityLivingBase) + protected boolean func_110813_b(EntityLivingBase p_110813_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch index 128585eceb..d1d9830e59 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java -@@ -164,7 +164,7 @@ +@@ -161,7 +161,7 @@ if (flag4 ^ flag5) { diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch index 0f80fa72e9..6b84351f11 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -15,9 +15,9 @@ @SideOnly(Side.CLIENT) public class TextureAtlasSprite implements IIcon -@@ -437,4 +439,28 @@ +@@ -427,4 +429,28 @@ { - return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; + return "TextureAtlasSprite{name=\'" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}'; } + + /** diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch index 164e240941..a320f4a8bc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -8,58 +8,58 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -92,11 +93,14 @@ +@@ -91,11 +92,14 @@ - public void loadTextureAtlas(IResourceManager par1ResourceManager) + public void func_110571_b(IResourceManager p_110571_1_) { -+ registerIcons(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed. ++ func_110573_f(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed. + - int i = Minecraft.getGLMaximumTextureSize(); - Stitcher stitcher = new Stitcher(i, i, true, 0, this.mipmapLevels); - this.mapUploadedSprites.clear(); - this.listAnimatedSprites.clear(); + int i = Minecraft.func_71369_N(); + Stitcher stitcher = new Stitcher(i, i, true, 0, this.field_147636_j); + this.field_94252_e.clear(); + this.field_94258_i.clear(); int j = Integer.MAX_VALUE; + ForgeHooksClient.onTextureStitchedPre(this); - Iterator iterator = this.mapRegisteredSprites.entrySet().iterator(); + Iterator iterator = this.field_110574_e.entrySet().iterator(); TextureAtlasSprite textureatlassprite; -@@ -107,6 +111,16 @@ +@@ -106,6 +110,16 @@ textureatlassprite = (TextureAtlasSprite)entry.getValue(); - ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); + ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); -+ if (textureatlassprite.hasCustomLoader(par1ResourceManager, resourcelocation)) ++ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) + { -+ if (!textureatlassprite.load(par1ResourceManager, resourcelocation)) ++ if (!textureatlassprite.load(p_110571_1_, resourcelocation)) + { -+ j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); -+ stitcher.addSprite(textureatlassprite); ++ j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b())); ++ stitcher.func_110934_a(textureatlassprite); + } + continue; + } + try { - IResource iresource = par1ResourceManager.getResource(resourcelocation1); -@@ -275,6 +289,7 @@ + IResource iresource = p_110571_1_.func_110536_a(resourcelocation1); +@@ -274,6 +288,7 @@ textureatlassprite = (TextureAtlasSprite)iterator2.next(); - textureatlassprite.copyFrom(this.missingImage); + textureatlassprite.func_94217_a(this.field_94249_f); } + ForgeHooksClient.onTextureStitchedPost(this); } - private ResourceLocation completeResourceLocation(ResourceLocation p_147634_1_, int p_147634_2_) -@@ -348,7 +363,7 @@ + private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) +@@ -347,7 +362,7 @@ { throw new IllegalArgumentException("Name cannot be null!"); } -- else if (par1Str.indexOf(47) == -1 && par1Str.indexOf(92) == -1) -+ else if (par1Str.indexOf(92) == -1) // Disable backslashes (\) in texture asset paths. +- else if (p_94245_1_.indexOf(47) == -1 && p_94245_1_.indexOf(92) == -1) ++ else if (p_94245_1_.indexOf(92) == -1) // Disable backslashes (\) in texture asset paths. { - Object object = (TextureAtlasSprite)this.mapRegisteredSprites.get(par1Str); + Object object = (TextureAtlasSprite)this.field_110574_e.get(p_94245_1_); -@@ -404,4 +419,37 @@ +@@ -403,4 +418,37 @@ { - this.anisotropicFiltering = p_147632_1_; + this.field_147637_k = p_147632_1_; } + + //=================================================================================================== @@ -74,7 +74,7 @@ + */ + public TextureAtlasSprite getTextureExtry(String name) + { -+ return (TextureAtlasSprite)mapRegisteredSprites.get(name); ++ return (TextureAtlasSprite)field_110574_e.get(name); + } + + /** @@ -87,9 +87,9 @@ + */ + public boolean setTextureEntry(String name, TextureAtlasSprite entry) + { -+ if (!mapRegisteredSprites.containsKey(name)) ++ if (!field_110574_e.containsKey(name)) + { -+ mapRegisteredSprites.put(name, entry); ++ field_110574_e.put(name, entry); + return true; + } + return false; diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch index 7524588a80..4f04836f0d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch @@ -13,12 +13,12 @@ { + try + { - ((BlockChest)block).func_149954_e(p_147502_1_.getWorldObj(), p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); + ((BlockChest)block).func_149954_e(p_147502_1_.func_145831_w(), p_147502_1_.field_145851_c, p_147502_1_.field_145848_d, p_147502_1_.field_145849_e); + } + catch (ClassCastException e) + { -+ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); ++ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147502_1_.field_145851_c, p_147502_1_.field_145848_d, p_147502_1_.field_145849_e); + } - i = p_147502_1_.getBlockMetadata(); + i = p_147502_1_.func_145832_p(); } diff --git a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch index 44ce33ebbd..f3b566d757 100644 --- a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -9,13 +9,13 @@ import org.lwjgl.opengl.GL11; @@ -118,8 +119,8 @@ - if (this.useDepth) + if (this.field_147619_e) { - EXTFramebufferObject.glBindRenderbufferEXT(36161, this.depthBuffer); -- EXTFramebufferObject.glRenderbufferStorageEXT(36161, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); -- EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36096, 36161, this.depthBuffer); -+ EXTFramebufferObject.glRenderbufferStorageEXT(36161, MinecraftForgeClient.getStencilBits() > 0 ? 35056 /* ARBFramebufferObject.GL_DEPTH24_STENCIL8 */ : 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); -+ EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, MinecraftForgeClient.getStencilBits() > 0 ? 33306 /* ARBFramebufferObject.GL_DEPTH_STENCIL_ATTACHMENT */ : 36096, 36161, this.depthBuffer); + EXTFramebufferObject.glBindRenderbufferEXT(36161, this.field_147624_h); +- EXTFramebufferObject.glRenderbufferStorageEXT(36161, 33190, this.field_147622_a, this.field_147620_b); +- EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36096, 36161, this.field_147624_h); ++ EXTFramebufferObject.glRenderbufferStorageEXT(36161, MinecraftForgeClient.getStencilBits() > 0 ? 35056 /* ARBFramebufferObject.GL_DEPTH24_STENCIL8 */ : 33190, this.field_147622_a, this.field_147620_b); ++ EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, MinecraftForgeClient.getStencilBits() > 0 ? 33306 /* ARBFramebufferObject.GL_DEPTH_STENCIL_ATTACHMENT */ : 36096, 36161, this.field_147624_h); } - this.framebufferClear(); + this.func_147614_f(); diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index ac7ccd7e92..78f0141792 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -9,12 +9,12 @@ + public class CommandHandler implements ICommandManager { - private static final Logger logger = LogManager.getLogger(); -@@ -49,6 +52,16 @@ + private static final Logger field_147175_a = LogManager.getLogger(); +@@ -47,6 +50,16 @@ - if (icommand.canCommandSenderUseCommand(par1ICommandSender)) + if (icommand.func_71519_b(p_71556_1_)) { -+ CommandEvent event = new CommandEvent(icommand, par1ICommandSender, astring); ++ CommandEvent event = new CommandEvent(icommand, p_71556_1_, astring); + if (MinecraftForge.EVENT_BUS.post(event)) + { + if (event.exception != null) @@ -26,4 +26,4 @@ + if (i > -1) { - EntityPlayerMP[] aentityplayermp = PlayerSelector.matchPlayers(par1ICommandSender, astring[i]); + EntityPlayerMP[] aentityplayermp = PlayerSelector.func_82380_c(p_71556_1_, astring[i]); diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch index 9fd48f3b01..58b5938d26 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReport.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java -@@ -330,7 +330,8 @@ +@@ -315,7 +315,8 @@ StackTraceElement stacktraceelement = null; StackTraceElement stacktraceelement1 = null; diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index 60b2224d3a..2294ae87a3 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -1,16 +1,16 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java -@@ -132,8 +132,11 @@ +@@ -127,8 +127,11 @@ } else { -- this.stackTrace = new StackTraceElement[astacktraceelement.length - 3 - par1]; -- System.arraycopy(astacktraceelement, 3 + par1, this.stackTrace, 0, this.stackTrace.length); -+ int len = astacktraceelement.length - 3 - par1; +- this.field_85075_d = new StackTraceElement[astacktraceelement.length - 3 - p_85073_1_]; +- System.arraycopy(astacktraceelement, 3 + p_85073_1_, this.field_85075_d, 0, this.field_85075_d.length); ++ int len = astacktraceelement.length - 3 - p_85073_1_; + // Really Mojang, Still, god damn... + if (len <= 0) len = astacktraceelement.length; -+ this.stackTrace = new StackTraceElement[len]; -+ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.stackTrace, 0, this.stackTrace.length); - return this.stackTrace.length; ++ this.field_85075_d = new StackTraceElement[len]; ++ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.field_85075_d, 0, this.field_85075_d.length); + return this.field_85075_d.length; } } diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch index 2d2f2e451c..27f77dff3e 100644 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch +++ b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/creativetab/CreativeTabs.java +++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java -@@ -140,8 +140,22 @@ +@@ -138,8 +138,22 @@ private ItemStack field_151245_t; private static final String __OBFID = "CL_00000005"; @@ -9,50 +9,49 @@ + this(getNextID(), lable); + } + - public CreativeTabs(int par1, String par2Str) + public CreativeTabs(int p_i1853_1_, String p_i1853_2_) { -+ if (par1 >= creativeTabArray.length) ++ if (p_i1853_1_ >= field_78032_a.length) + { -+ CreativeTabs[] tmp = new CreativeTabs[par1 + 1]; -+ for (int x = 0; x < creativeTabArray.length; x++) ++ CreativeTabs[] tmp = new CreativeTabs[p_i1853_1_ + 1]; ++ for (int x = 0; x < field_78032_a.length; x++) + { -+ tmp[x] = creativeTabArray[x]; ++ tmp[x] = field_78032_a[x]; + } -+ creativeTabArray = tmp; ++ field_78032_a = tmp; + } - this.tabIndex = par1; - this.tabLabel = par2Str; - creativeTabArray[par1] = this; -@@ -226,6 +240,10 @@ + this.field_78033_n = p_i1853_1_; + this.field_78034_o = p_i1853_2_; + field_78032_a[p_i1853_1_] = this; +@@ -222,12 +236,20 @@ @SideOnly(Side.CLIENT) - public int getTabColumn() + public int func_78020_k() { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) % 10) % 5; ++ return ((field_78033_n - 12) % 10) % 5; + } - return this.tabIndex % 6; + return this.field_78033_n % 6; } -@@ -233,6 +251,10 @@ @SideOnly(Side.CLIENT) - public boolean isTabInFirstRow() + public boolean func_78023_l() { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) % 10) < 5; ++ return ((field_78033_n - 12) % 10) < 5; + } - return this.tabIndex < 6; + return this.field_78033_n < 6; } -@@ -284,10 +306,18 @@ +@@ -278,10 +300,18 @@ { Item item = (Item)iterator.next(); -- if (item != null && item.getCreativeTab() == this) +- if (item != null && item.func_77640_w() == this) + if (item == null) { -- item.getSubItems(item, this, par1List); +- item.func_150895_a(item, this, p_78018_1_); + continue; } + @@ -60,29 +59,29 @@ + { + if (tab == this) + { -+ item.getSubItems(item, this, par1List); ++ item.func_150895_a(item, this, p_78018_1_); + } + } } if (this.func_111225_m() != null) -@@ -326,4 +356,28 @@ +@@ -319,4 +349,28 @@ } } } + + public int getTabPage() + { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) / 10) + 1; ++ return ((field_78033_n - 12) / 10) + 1; + } + return 0; + } + + public static int getNextID() + { -+ return creativeTabArray.length; ++ return field_78032_a.length; + } + + /** @@ -92,6 +91,6 @@ + */ + public boolean hasSearchBar() + { -+ return tabIndex == CreativeTabs.tabAllSearch.tabIndex; ++ return field_78033_n == CreativeTabs.field_78027_g.field_78033_n; + } } diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index 6aa0250ecd..f7218b265c 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java +++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java -@@ -157,6 +157,36 @@ +@@ -123,6 +123,36 @@ public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) {} @@ -12,7 +12,7 @@ + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { -+ return canApply(stack); ++ return func_92089_a(stack); + } + + /** @@ -22,7 +22,7 @@ + */ + public static void addToBookList(Enchantment enchantment) + { -+ com.google.common.collect.ObjectArrays.concat(enchantmentsBookList, enchantment); ++ com.google.common.collect.ObjectArrays.concat(field_92090_c, enchantment); + } + + /** diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 16ffb4f6eb..bb19769e2e 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java -@@ -461,7 +461,8 @@ +@@ -429,7 +429,8 @@ { Enchantment enchantment = aenchantment[k]; -- if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) +- if (enchantment != null && (enchantment.field_77351_y.func_77557_a(item) || flag)) + if (enchantment == null) continue; -+ if (enchantment.canApplyAtEnchantingTable(par1ItemStack) || ((item == Items.book) && enchantment.isAllowedOnBooks())) ++ if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || ((item == Items.field_151122_aG) && enchantment.isAllowedOnBooks())) { - for (int l = enchantment.getMinLevel(); l <= enchantment.getMaxLevel(); ++l) + for (int l = enchantment.func_77319_d(); l <= enchantment.func_77325_b(); ++l) { diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index 36b2243d73..c47db81830 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -44,9 +44,9 @@ public abstract class Entity { -@@ -152,7 +165,14 @@ - protected UUID entityUniqueID; - public Entity.EnumEntitySize myEntitySize; +@@ -116,7 +129,14 @@ + protected UUID field_96093_i; + public Entity.EnumEntitySize field_70168_am; private static final String __OBFID = "CL_00001533"; + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; @@ -56,13 +56,13 @@ + private HashMap extendedProperties; + - public int getEntityId() + public int func_145782_y() { - return this.entityId; -@@ -189,6 +209,15 @@ - this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); - this.dataWatcher.addObject(1, Short.valueOf((short)300)); - this.entityInit(); + return this.field_145783_c; +@@ -153,6 +173,15 @@ + this.field_70180_af.func_75682_a(0, Byte.valueOf((byte)0)); + this.field_70180_af.func_75682_a(1, Short.valueOf((short)300)); + this.func_70088_a(); + + extendedProperties = new HashMap(); + @@ -70,22 +70,22 @@ + + for (IExtendedEntityProperties props : this.extendedProperties.values()) + { -+ props.init(this, par1World); ++ props.init(this, p_i1582_1_); + } } - protected abstract void entityInit(); -@@ -1051,9 +1080,22 @@ + protected abstract void func_70088_a(); +@@ -991,9 +1020,22 @@ - if (block.getMaterial() == par1Material) + if (block.func_149688_o() == p_70055_1_) { -- float f = BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(i, j, k)) - 0.11111111F; +- float f = BlockLiquid.func_149801_b(this.field_70170_p.func_72805_g(i, j, k)) - 0.11111111F; - float f1 = (float)(j + 1) - f; - return d0 < (double)f1; + double filled = 1.0f; //If it's not a liquid assume it's a solid block + if (block instanceof IFluidBlock) + { -+ filled = ((IFluidBlock)block).getFilledPercentage(worldObj, i, j, k); ++ filled = ((IFluidBlock)block).getFilledPercentage(field_70170_p, i, j, k); + } + + if (filled < 0) @@ -101,14 +101,14 @@ } else { -@@ -1360,8 +1402,27 @@ - par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); - par1NBTTagCompound.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits()); - par1NBTTagCompound.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits()); -- this.writeEntityToNBT(par1NBTTagCompound); +@@ -1278,8 +1320,27 @@ + p_70109_1_.func_74768_a("PortalCooldown", this.field_71088_bW); + p_70109_1_.func_74772_a("UUIDMost", this.func_110124_au().getMostSignificantBits()); + p_70109_1_.func_74772_a("UUIDLeast", this.func_110124_au().getLeastSignificantBits()); +- this.func_70014_b(p_70109_1_); + if (customEntityData != null) + { -+ par1NBTTagCompound.setTag("ForgeData", customEntityData); ++ p_70109_1_.func_74782_a("ForgeData", customEntityData); + } + for (String identifier : this.extendedProperties.keySet()) @@ -116,7 +116,7 @@ + try + { + IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.saveNBTData(par1NBTTagCompound); ++ props.saveNBTData(p_70109_1_); + } + catch (Throwable t) + { @@ -125,18 +125,18 @@ + } + } + -+ this.writeEntityToNBT(par1NBTTagCompound); ++ this.func_70014_b(p_70109_1_); + - if (this.ridingEntity != null) + if (this.field_70154_o != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); -@@ -1428,6 +1489,30 @@ +@@ -1345,6 +1406,30 @@ - this.setPosition(this.posX, this.posY, this.posZ); - this.setRotation(this.rotationYaw, this.rotationPitch); -+ if (par1NBTTagCompound.hasKey("ForgeData")) + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.func_70101_b(this.field_70177_z, this.field_70125_A); ++ if (p_70020_1_.func_74764_b("ForgeData")) + { -+ customEntityData = par1NBTTagCompound.getCompoundTag("ForgeData"); ++ customEntityData = p_70020_1_.func_74775_l("ForgeData"); + } + + for (String identifier : this.extendedProperties.keySet()) @@ -144,7 +144,7 @@ + try + { + IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.loadNBTData(par1NBTTagCompound); ++ props.loadNBTData(p_70020_1_); + } + catch (Throwable t) + { @@ -154,48 +154,48 @@ + } + + //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly -+ if (par1NBTTagCompound.hasKey("PersistentIDMSB") && par1NBTTagCompound.hasKey("PersistentIDLSB")) ++ if (p_70020_1_.func_74764_b("PersistentIDMSB") && p_70020_1_.func_74764_b("PersistentIDLSB")) + { -+ this.entityUniqueID = new UUID(par1NBTTagCompound.getLong("PersistentIDMSB"), par1NBTTagCompound.getLong("PersistentIDLSB")); ++ this.field_96093_i = new UUID(p_70020_1_.func_74763_f("PersistentIDMSB"), p_70020_1_.func_74763_f("PersistentIDLSB")); + } - this.readEntityFromNBT(par1NBTTagCompound); + this.func_70037_a(p_70020_1_); - if (this.shouldSetPosAfterLoading()) -@@ -1512,7 +1597,14 @@ + if (this.func_142008_O()) +@@ -1423,7 +1508,14 @@ { - EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); - entityitem.delayBeforeCanPickup = 10; -- this.worldObj.spawnEntityInWorld(entityitem); + EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_); + entityitem.field_145804_b = 10; +- this.field_70170_p.func_72838_d(entityitem); + if (captureDrops) + { + capturedDrops.add(entityitem); + } + else + { -+ this.worldObj.spawnEntityInWorld(entityitem); ++ this.field_70170_p.func_72838_d(entityitem); + } return entityitem; } else -@@ -1782,7 +1874,7 @@ - // JAVADOC METHOD $$ func_70115_ae - public boolean isRiding() +@@ -1676,7 +1768,7 @@ + + public boolean func_70115_ae() { -- return this.ridingEntity != null; -+ return this.ridingEntity != null && ridingEntity.shouldRiderSit(); +- return this.field_70154_o != null; ++ return this.field_70154_o != null && field_70154_o.shouldRiderSit(); } - // JAVADOC METHOD $$ func_70093_af -@@ -2103,7 +2195,7 @@ + public boolean func_70093_af() +@@ -1977,7 +2069,7 @@ public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) { -- return p_145772_6_.getExplosionResistance(this); -+ return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_3_, p_145772_4_, posX, posY + getEyeHeight(), posZ); +- return p_145772_6_.func_149638_a(this); ++ return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_3_, p_145772_4_, field_70165_t, field_70163_u + func_70047_e(), field_70161_v); } public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_) -@@ -2176,6 +2268,174 @@ +@@ -2047,6 +2139,174 @@ public void func_145781_i(int p_145781_1_) {} @@ -233,22 +233,22 @@ + { + if (this instanceof EntityPainting) + { -+ return new ItemStack(Items.painting); ++ return new ItemStack(Items.field_151159_an); + } + else if (this instanceof EntityLeashKnot) + { -+ return new ItemStack(Items.lead); ++ return new ItemStack(Items.field_151058_ca); + } + else if (this instanceof EntityItemFrame) + { -+ ItemStack held = ((EntityItemFrame)this).getDisplayedItem(); ++ ItemStack held = ((EntityItemFrame)this).func_82335_i(); + if (held == null) + { -+ return new ItemStack(Items.item_frame); ++ return new ItemStack(Items.field_151160_bD); + } + else + { -+ return held.copy(); ++ return held.func_77946_l(); + } + } + else if (this instanceof EntityMinecart) @@ -257,14 +257,14 @@ + } + else if (this instanceof EntityBoat) + { -+ return new ItemStack(Items.boat); ++ return new ItemStack(Items.field_151124_az); + } + else + { -+ int id = EntityList.getEntityID(this); -+ if (id > 0 && EntityList.entityEggs.containsKey(id)) ++ int id = EntityList.func_75619_a(this); ++ if (id > 0 && EntityList.field_75627_a.containsKey(id)) + { -+ return new ItemStack(Items.spawn_egg, 1, id); ++ return new ItemStack(Items.field_151063_bx, 1, id); + } + } + return null; @@ -272,7 +272,7 @@ + + public UUID getPersistentID() + { -+ return entityUniqueID; ++ return field_96093_i; + } + + /** @@ -280,7 +280,7 @@ + */ + public final void resetEntityId() + { -+ this.entityId = nextEntityID++; ++ this.field_145783_c = field_70152_a++; + } + + public boolean shouldRenderInPass(int pass) @@ -296,7 +296,7 @@ + */ + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { -+ return type.getCreatureClass().isAssignableFrom(this.getClass()); ++ return type.func_75598_a().isAssignableFrom(this.getClass()); + } + + /** diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 5505b3441f..6ad55fe904 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -10,42 +10,42 @@ public abstract class EntityLiving extends EntityLivingBase { -@@ -130,6 +133,7 @@ - public void setAttackTarget(EntityLivingBase par1EntityLivingBase) +@@ -117,6 +120,7 @@ + public void func_70624_b(EntityLivingBase p_70624_1_) { - this.attackTarget = par1EntityLivingBase; -+ ForgeHooks.onLivingSetAttackTarget(this, par1EntityLivingBase); + this.field_70696_bz = p_70624_1_; ++ ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_); } - // JAVADOC METHOD $$ func_70686_a -@@ -506,10 +510,22 @@ - // JAVADOC METHOD $$ func_70623_bb - protected void despawnEntity() + public boolean func_70686_a(Class p_70686_1_) +@@ -476,10 +480,22 @@ + + protected void func_70623_bb() { + Result result = null; - if (this.persistenceRequired) + if (this.field_82179_bU) { - this.entityAge = 0; + this.field_70708_bq = 0; } -+ else if ((this.entityAge & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT) ++ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT) + { + if (result == Result.DENY) + { -+ this.entityAge = 0; ++ this.field_70708_bq = 0; + } + else + { -+ this.setDead(); ++ this.func_70106_y(); + } + } else { - EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, -1.0D); -@@ -677,7 +693,6 @@ + EntityPlayer entityplayer = this.field_70170_p.func_72890_a(this, -1.0D); +@@ -642,7 +658,6 @@ + return this.field_70170_p.func_72855_b(this.field_70121_D) && this.field_70170_p.func_72945_a(this, this.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(this.field_70121_D); } - // JAVADOC METHOD $$ func_70603_bj - @SideOnly(Side.CLIENT) - public float getRenderSizeModifier() + public float func_70603_bj() { return 1.0F; diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 0ff7691661..412d4ce148 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -16,157 +16,157 @@ public abstract class EntityLivingBase extends Entity { -@@ -254,7 +256,7 @@ +@@ -225,7 +227,7 @@ } } -- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) -+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this)) +- if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o instanceof EntityLivingBase) ++ if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o != null && field_70154_o.shouldDismountInWater(this)) { - this.mountEntity((Entity)null); + this.func_70078_a((Entity)null); } -@@ -408,6 +410,7 @@ +@@ -374,6 +376,7 @@ { - this.entityLivingToAttack = par1EntityLivingBase; - this.revengeTimer = this.ticksExisted; -+ ForgeHooks.onLivingSetAttackTarget(this, par1EntityLivingBase); + this.field_70755_b = p_70604_1_; + this.field_70756_c = this.field_70173_aa; ++ ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_); } - public EntityLivingBase getLastAttacker() -@@ -701,7 +704,6 @@ + public EntityLivingBase func_110144_aD() +@@ -661,7 +664,6 @@ + return this.func_70668_bt() == EnumCreatureAttribute.UNDEAD; } - // JAVADOC METHOD $$ func_70618_n - @SideOnly(Side.CLIENT) - public void removePotionEffectClient(int par1) + public void func_70618_n(int p_70618_1_) { - this.activePotionsMap.remove(Integer.valueOf(par1)); -@@ -773,6 +775,7 @@ - // JAVADOC METHOD $$ func_70097_a - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + this.field_70713_bf.remove(Integer.valueOf(p_70618_1_)); +@@ -730,6 +732,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; - if (this.isEntityInvulnerable()) ++ if (ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_85032_ar()) { return false; -@@ -928,6 +931,7 @@ - // JAVADOC METHOD $$ func_70645_a - public void onDeath(DamageSource par1DamageSource) +@@ -883,6 +886,7 @@ + + public void func_70645_a(DamageSource p_70645_1_) { -+ if (ForgeHooks.onLivingDeath(this, par1DamageSource)) return; - Entity entity = par1DamageSource.getEntity(); ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + Entity entity = p_70645_1_.func_76346_g(); EntityLivingBase entitylivingbase = this.func_94060_bK(); -@@ -952,6 +956,10 @@ - i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); +@@ -907,6 +911,10 @@ + i = EnchantmentHelper.func_77519_f((EntityLivingBase)entity); } + captureDrops = true; + capturedDrops.clear(); + int j = 0; + - if (this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) { - this.dropFewItems(this.recentlyHit > 0, i); -@@ -959,7 +967,7 @@ + this.func_70628_a(this.field_70718_bc > 0, i); +@@ -914,7 +922,7 @@ - if (this.recentlyHit > 0) + if (this.field_70718_bc > 0) { -- int j = this.rand.nextInt(200) - i; -+ j = this.rand.nextInt(200) - i; +- int j = this.field_70146_Z.nextInt(200) - i; ++ j = this.field_70146_Z.nextInt(200) - i; if (j < 5) { -@@ -967,6 +975,16 @@ +@@ -922,6 +930,16 @@ } } } + + captureDrops = false; + -+ if (!ForgeHooks.onLivingDrops(this, par1DamageSource, capturedDrops, i, recentlyHit > 0, j)) ++ if (!ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0, j)) + { + for (EntityItem item : capturedDrops) + { -+ worldObj.spawnEntityInWorld(item); ++ field_70170_p.func_72838_d(item); + } + } } - this.worldObj.setEntityState(this, (byte)3); -@@ -1021,7 +1039,7 @@ - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - Block block = this.worldObj.getBlock(i, j, k); -- return block == Blocks.ladder || block == Blocks.vine; -+ return ForgeHooks.isLivingOnLadder(block, worldObj, i, j, k, this); + this.field_70170_p.func_72960_a(this, (byte)3); +@@ -970,7 +988,7 @@ + int j = MathHelper.func_76128_c(this.field_70121_D.field_72338_b); + int k = MathHelper.func_76128_c(this.field_70161_v); + Block block = this.field_70170_p.func_147439_a(i, j, k); +- return block == Blocks.field_150468_ap || block == Blocks.field_150395_bd; ++ return ForgeHooks.isLivingOnLadder(block, field_70170_p, i, j, k, this); } - // JAVADOC METHOD $$ func_70089_S -@@ -1033,6 +1051,8 @@ - // JAVADOC METHOD $$ func_70069_a - protected void fall(float par1) + public boolean func_70089_S() +@@ -980,6 +998,8 @@ + + protected void func_70069_a(float p_70069_1_) { -+ par1 = ForgeHooks.onLivingFall(this, par1); -+ if (par1 <= 0) return; - super.fall(par1); - PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); - float f1 = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; -@@ -1116,7 +1136,7 @@ ++ p_70069_1_ = ForgeHooks.onLivingFall(this, p_70069_1_); ++ if (p_70069_1_ <= 0) return; + super.func_70069_a(p_70069_1_); + PotionEffect potioneffect = this.func_70660_b(Potion.field_76430_j); + float f1 = potioneffect != null ? (float)(potioneffect.func_76458_c() + 1) : 0.0F; +@@ -1059,7 +1079,7 @@ { if (this instanceof EntityZombie) { -- par2 = par2; +- p_70672_2_ = p_70672_2_; + //par2 = par2; // Forge: Noop Warning } int i; -@@ -1161,6 +1181,8 @@ +@@ -1103,6 +1123,8 @@ { - if (!this.isEntityInvulnerable()) + if (!this.func_85032_ar()) { -+ par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2); -+ if (par2 <= 0) return; - par2 = this.applyArmorCalculations(par1DamageSource, par2); - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - float f1 = par2; -@@ -1213,6 +1235,17 @@ - // JAVADOC METHOD $$ func_71038_i - public void swingItem() ++ p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f1 = p_70665_2_; +@@ -1151,6 +1173,17 @@ + + public void func_71038_i() { -+ ItemStack stack = this.getHeldItem(); ++ ItemStack stack = this.func_70694_bm(); + -+ if (stack != null && stack.getItem() != null) ++ if (stack != null && stack.func_77973_b() != null) + { -+ Item item = stack.getItem(); ++ Item item = stack.func_77973_b(); + if (item.onEntitySwing(this, stack)) + { + return; + } + } + - if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) + if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { - this.swingProgressInt = -1; -@@ -1422,6 +1455,7 @@ + this.field_110158_av = -1; +@@ -1346,6 +1379,7 @@ } - this.isAirBorne = true; + this.field_70160_al = true; + ForgeHooks.onLivingJump(this); } - // JAVADOC METHOD $$ func_70612_e -@@ -1602,6 +1636,7 @@ - // JAVADOC METHOD $$ func_70071_h_ - public void onUpdate() + public void func_70612_e(float p_70612_1_, float p_70612_2_) +@@ -1520,6 +1554,7 @@ + + public void func_70071_h_() { + if (ForgeHooks.onLivingUpdate(this)) return; - super.onUpdate(); + super.func_70071_h_(); - if (!this.worldObj.isRemote) -@@ -2099,4 +2134,42 @@ + if (!this.field_70170_p.field_72995_K) +@@ -2000,4 +2035,42 @@ { - return this.getTeam() != null ? this.getTeam().isSameTeam(par1Team) : false; + return this.func_96124_cp() != null ? this.func_96124_cp().func_142054_a(p_142012_1_) : false; } + + /*** @@ -175,9 +175,9 @@ + */ + public void curePotionEffects(ItemStack curativeItem) + { -+ Iterator potionKey = activePotionsMap.keySet().iterator(); ++ Iterator potionKey = field_70713_bf.keySet().iterator(); + -+ if (worldObj.isRemote) ++ if (field_70170_p.field_72995_K) + { + return; + } @@ -185,12 +185,12 @@ + while (potionKey.hasNext()) + { + Integer key = potionKey.next(); -+ PotionEffect effect = (PotionEffect)activePotionsMap.get(key); ++ PotionEffect effect = (PotionEffect)field_70713_bf.get(key); + + if (effect.isCurativeItem(curativeItem)) + { + potionKey.remove(); -+ onFinishedPotionEffect(effect); ++ func_70688_c(effect); + } + } + } diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch index 5530c4c3ff..1df3009cd4 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch @@ -8,26 +8,26 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; -@@ -25,6 +26,8 @@ +@@ -21,6 +22,8 @@ private double field_151496_k; private static final String __OBFID = "CL_00001595"; + private int failedPathFindingPenalty; + - public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, Class par2Class, double par3, boolean par5) + public EntityAIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) { - this(par1EntityCreature, par3, par5); -@@ -59,8 +62,16 @@ + this(p_i1635_1_, p_i1635_3_, p_i1635_5_); +@@ -54,8 +57,16 @@ } else { -- this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); -- return this.entityPathEntity != null; +- this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); +- return this.field_75438_g != null; + if (-- this.field_75445_i <= 0) + { -+ this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); -+ this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); -+ return this.entityPathEntity != null; ++ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); ++ this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ return this.field_75438_g != null; + } + else + { @@ -36,17 +36,17 @@ } } -@@ -98,8 +109,25 @@ - this.field_151497_i = entitylivingbase.posX; - this.field_151495_j = entitylivingbase.boundingBox.minY; - this.field_151496_k = entitylivingbase.posZ; -- this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); -+ this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7); +@@ -89,8 +100,25 @@ + this.field_151497_i = entitylivingbase.field_70165_t; + this.field_151495_j = entitylivingbase.field_70121_D.field_72338_b; + this.field_151496_k = entitylivingbase.field_70161_v; +- this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ this.field_75445_i = failedPathFindingPenalty + 4 + this.field_75441_b.func_70681_au().nextInt(7); -+ if (this.attacker.getNavigator().getPath() != null) ++ if (this.field_75441_b.func_70661_as().func_75505_d() != null) + { -+ PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); -+ if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) ++ PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c(); ++ if (finalPathPoint != null && entitylivingbase.func_70092_e(finalPathPoint.field_75839_a, finalPathPoint.field_75837_b, finalPathPoint.field_75838_c) < 1) + { + failedPathFindingPenalty = 0; + } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index 13f02e3341..82e4e9967b 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java -@@ -495,9 +495,9 @@ +@@ -477,9 +477,9 @@ { - Block block = this.worldObj.getBlock(k1, l1, i2); + Block block = this.field_70170_p.func_147439_a(k1, l1, i2); -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(worldObj, k1, l1, i2)) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_70170_p, k1, l1, i2)) { -- if (block != Blocks.obsidian && block != Blocks.end_stone && block != Blocks.bedrock && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) -+ if (block.canEntityDestroy(worldObj, k1, l1, i2, this) && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) +- if (block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (block.canEntityDestroy(field_70170_p, k1, l1, i2, this) && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { - flag1 = this.worldObj.setBlockToAir(k1, l1, i2) || flag1; + flag1 = this.field_70170_p.func_147468_f(k1, l1, i2) || flag1; } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch index 745954464f..e2accd93bc 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java -@@ -355,7 +355,7 @@ +@@ -347,7 +347,7 @@ int l = j1 + i2; - Block block = this.worldObj.getBlock(j2, k, l); + Block block = this.field_70170_p.func_147439_a(j2, k, l); -- if (block.getMaterial() != Material.air && block != Blocks.bedrock && block != Blocks.end_portal && block != Blocks.end_portal_frame && block != Blocks.command_block) -+ if (!block.isAir(worldObj, j2, k, l) && block.canEntityDestroy(worldObj, j2, k, l, this)) +- if (block.func_149688_o() != Material.field_151579_a && block != Blocks.field_150357_h && block != Blocks.field_150384_bq && block != Blocks.field_150378_br && block != Blocks.field_150483_bI) ++ if (!block.isAir(field_70170_p, j2, k, l) && block.canEntityDestroy(field_70170_p, j2, k, l, this)) { - flag = this.worldObj.func_147480_a(j2, k, l, true) || flag; + flag = this.field_70170_p.func_147480_a(j2, k, l, true) || flag; } diff --git a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch index 74dc615bf7..4d83b19174 100644 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java -@@ -106,7 +106,8 @@ +@@ -102,7 +102,8 @@ for (int l = 0; l < list.size(); ++l) { Entity entity = (Entity)list.get(l); -- entity.onStruckByLightning(this); +- entity.func_70077_a(this); + if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) -+ entity.onStruckByLightning(this); ++ entity.func_70077_a(this); } } } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index e235a7cbd3..41f326819d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -9,20 +9,20 @@ public class EntityEnderPearl extends EntityThrowable { -@@ -51,6 +53,9 @@ +@@ -50,6 +52,9 @@ - if (entityplayermp.playerNetServerHandler.func_147362_b().isChannelOpen() && entityplayermp.worldObj == this.worldObj) + if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p) { -+ EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); ++ EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.field_70165_t, this.field_70163_u, this.field_70161_v, 5.0F); + if (!MinecraftForge.EVENT_BUS.post(event)) + { // Don't indent to lower patch size - if (this.getThrower().isRiding()) + if (this.func_85052_h().func_70115_ae()) { - this.getThrower().mountEntity((Entity)null); -@@ -59,6 +64,7 @@ - this.getThrower().setPositionAndUpdate(this.posX, this.posY, this.posZ); - this.getThrower().fallDistance = 0.0F; - this.getThrower().attackEntityFrom(DamageSource.fall, 5.0F); + this.func_85052_h().func_70078_a((Entity)null); +@@ -58,6 +63,7 @@ + this.func_85052_h().func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.func_85052_h().field_70143_R = 0.0F; + this.func_85052_h().func_70097_a(DamageSource.field_76379_h, 5.0F); + } } } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index 0d6665c522..18ff726f84 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -15,8 +15,8 @@ public class EntityItem extends Entity { -@@ -33,6 +36,11 @@ - public float hoverStart; +@@ -30,6 +33,11 @@ + public float field_70290_d; private static final String __OBFID = "CL_00001669"; + /** @@ -24,116 +24,115 @@ + */ + public int lifespan = 6000; + - public EntityItem(World par1World, double par2, double par4, double par6) + public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) { - super(par1World); -@@ -49,8 +57,9 @@ + super(p_i1709_1_); +@@ -46,8 +54,9 @@ - public EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) + public EntityItem(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { -- this(par1World, par2, par4, par6); -+ this(par1World, par2, par4, par6); - this.setEntityItemStack(par8ItemStack); -+ this.lifespan = (par8ItemStack.getItem() == null ? 6000 : par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World)); +- this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); ++ this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); + this.func_92058_a(p_i1710_8_); ++ this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.func_77973_b().getEntityLifespan(p_i1710_8_, p_i1710_1_)); } - // JAVADOC METHOD $$ func_70041_e_ -@@ -76,6 +85,15 @@ - // JAVADOC METHOD $$ func_70071_h_ - public void onUpdate() + protected boolean func_70041_e_() +@@ -71,6 +80,15 @@ + + public void func_70071_h_() { -+ ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10); -+ if (stack != null && stack.getItem() != null) ++ ItemStack stack = this.func_70096_w().func_82710_f(10); ++ if (stack != null && stack.func_77973_b() != null) + { -+ if (stack.getItem().onEntityItemUpdate(this)) ++ if (stack.func_77973_b().onEntityItemUpdate(this)) + { + return; + } + } + - if (this.getEntityItem() == null) + if (this.func_92059_d() == null) { - this.setDead(); -@@ -131,8 +149,30 @@ + this.func_70106_y(); +@@ -126,8 +144,30 @@ - ++this.age; + ++this.field_70292_b; -- if (!this.worldObj.isRemote && this.age >= 6000) -+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); +- if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) ++ ItemStack item = func_70096_w().func_82710_f(10); + -+ if (!this.worldObj.isRemote && this.age >= lifespan) ++ if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) { + if (item != null) + { -+ ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj))); ++ ItemExpireEvent event = new ItemExpireEvent(this, (item.func_77973_b() == null ? 6000 : item.func_77973_b().getEntityLifespan(item, field_70170_p))); + if (MinecraftForge.EVENT_BUS.post(event)) + { + lifespan += event.extraLife; + } + else + { -+ this.setDead(); ++ this.func_70106_y(); + } + } + else + { -+ this.setDead(); ++ this.func_70106_y(); + } + } + -+ if (item != null && item.stackSize <= 0) ++ if (item != null && item.field_77994_a <= 0) + { - this.setDead(); + this.func_70106_y(); } } -@@ -254,6 +294,7 @@ +@@ -242,6 +282,7 @@ { - par1NBTTagCompound.setShort("Health", (short)((byte)this.health)); - par1NBTTagCompound.setShort("Age", (short)this.age); -+ par1NBTTagCompound.setInteger("Lifespan", lifespan); + p_70014_1_.func_74777_a("Health", (short)((byte)this.field_70291_e)); + p_70014_1_.func_74777_a("Age", (short)this.field_70292_b); ++ p_70014_1_.func_74768_a("Lifespan", lifespan); if (this.func_145800_j() != null) { -@@ -290,10 +331,17 @@ - NBTTagCompound nbttagcompound1 = par1NBTTagCompound.getCompoundTag("Item"); - this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)); +@@ -277,20 +318,39 @@ + NBTTagCompound nbttagcompound1 = p_70037_1_.func_74775_l("Item"); + this.func_92058_a(ItemStack.func_77949_a(nbttagcompound1)); -- if (this.getEntityItem() == null) -+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); +- if (this.func_92059_d() == null) ++ ItemStack item = func_70096_w().func_82710_f(10); + -+ if (item == null || item.stackSize <= 0) ++ if (item == null || item.field_77994_a <= 0) { - this.setDead(); + this.func_70106_y(); } + -+ if (par1NBTTagCompound.hasKey("Lifespan")) ++ if (p_70037_1_.func_74764_b("Lifespan")) + { -+ lifespan = par1NBTTagCompound.getInteger("Lifespan"); ++ lifespan = p_70037_1_.func_74762_e("Lifespan"); + } } - // JAVADOC METHOD $$ func_70100_b_ -@@ -301,10 +349,22 @@ + public void func_70100_b_(EntityPlayer p_70100_1_) { - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { -+ if (this.delayBeforeCanPickup > 0) ++ if (this.field_145804_b > 0) + { + return; + } + -+ EntityItemPickupEvent event = new EntityItemPickupEvent(par1EntityPlayer, this); ++ EntityItemPickupEvent event = new EntityItemPickupEvent(p_70100_1_, this); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + - ItemStack itemstack = this.getEntityItem(); - int i = itemstack.stackSize; + ItemStack itemstack = this.func_92059_d(); + int i = itemstack.field_77994_a; -- if (this.delayBeforeCanPickup == 0 && (this.field_145802_g == null || 6000 - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && par1EntityPlayer.inventory.addItemStackToInventory(itemstack)) -+ if (this.delayBeforeCanPickup <= 0 && (this.field_145802_g == null || lifespan - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && (event.getResult() == Result.ALLOW || i <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(itemstack))) +- if (this.field_145804_b == 0 && (this.field_145802_g == null || 6000 - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) ++ if (this.field_145804_b <= 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && (event.getResult() == Result.ALLOW || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack))) { - if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) + if (itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150364_r)) { diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index 4a273bc132..3c2d913aed 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -11,8 +11,8 @@ public abstract class EntityMinecart extends Entity { -@@ -45,6 +49,20 @@ - private double velocityZ; +@@ -43,6 +47,20 @@ + private double field_70506_as; private static final String __OBFID = "CL_00001670"; + /* Forge: Minecart Compatibility Layer Integration. */ @@ -29,22 +29,21 @@ + protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical; + protected double dragAir = defaultDragAir; + - public EntityMinecart(World par1World) + public EntityMinecart(World p_i1712_1_) { - super(par1World); -@@ -94,19 +112,27 @@ - // JAVADOC METHOD $$ func_70114_g - public AxisAlignedBB getCollisionBox(Entity par1Entity) + super(p_i1712_1_); +@@ -89,17 +107,25 @@ + + public AxisAlignedBB func_70114_g(Entity p_70114_1_) { + if (getCollisionHandler() != null) + { -+ return getCollisionHandler().getCollisionBox(this, par1Entity); ++ return getCollisionHandler().getCollisionBox(this, p_70114_1_); + } - return par1Entity.canBePushed() ? par1Entity.boundingBox : null; + return p_70114_1_.func_70104_M() ? p_70114_1_.field_70121_D : null; } - // JAVADOC METHOD $$ func_70046_E - public AxisAlignedBB getBoundingBox() + public AxisAlignedBB func_70046_E() { + if (getCollisionHandler() != null) + { @@ -53,45 +52,44 @@ return null; } - // JAVADOC METHOD $$ func_70104_M - public boolean canBePushed() + public boolean func_70104_M() { - return true; + return canBePushed; } - public EntityMinecart(World par1World, double par2, double par4, double par6) -@@ -315,19 +341,20 @@ + public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) +@@ -302,19 +328,20 @@ double d2 = 0.0078125D; - Block block = this.worldObj.getBlock(l, i, i1); + Block block = this.field_70170_p.func_147439_a(l, i, i1); - if (BlockRailBase.func_150051_a(block)) + if (canUseRail() && BlockRailBase.func_150051_a(block)) { -- int j = this.worldObj.getBlockMetadata(l, i, i1); +- int j = this.field_70170_p.func_72805_g(l, i, i1); - this.func_145821_a(l, i, i1, d0, d2, block, j); -+ float railMaxSpeed = ((BlockRailBase)block).getRailMaxSpeed(worldObj, this, l, i, i1); ++ float railMaxSpeed = ((BlockRailBase)block).getRailMaxSpeed(field_70170_p, this, l, i, i1); + double maxSpeed = Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); -+ this.func_145821_a(l, i, i1, maxSpeed, getSlopeAdjustment(), block, ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, l, i, i1)); ++ this.func_145821_a(l, i, i1, maxSpeed, getSlopeAdjustment(), block, ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, l, i, i1)); - if (block == Blocks.activator_rail) + if (block == Blocks.field_150408_cc) { -- this.onActivatorRailPass(l, i, i1, (j & 8) != 0); -+ this.onActivatorRailPass(l, i, i1, (worldObj.getBlockMetadata(l, i, i1) & 8) != 0); +- this.func_96095_a(l, i, i1, (j & 8) != 0); ++ this.func_96095_a(l, i, i1, (field_70170_p.func_72805_g(l, i, i1) & 8) != 0); } } else { - this.func_94088_b(d0); -+ this.func_94088_b(onGround ? d0 : getMaxSpeedAirLateral()); ++ this.func_94088_b(field_70122_E ? d0 : getMaxSpeedAirLateral()); } this.func_145775_I(); -@@ -354,8 +381,19 @@ +@@ -341,8 +368,19 @@ } - this.setRotation(this.rotationYaw, this.rotationPitch); -- List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + this.func_70101_b(this.field_70177_z, this.field_70125_A); +- List list = this.field_70170_p.func_72839_b(this, this.field_70121_D.func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + AxisAlignedBB box; + if (getCollisionHandler() != null) @@ -100,85 +98,85 @@ + } + else + { -+ box = boundingBox.expand(0.2D, 0.0D, 0.2D); ++ box = field_70121_D.func_72314_b(0.2D, 0.0D, 0.2D); + } + -+ List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); ++ List list = this.field_70170_p.func_72839_b(this, box); + if (list != null && !list.isEmpty()) { for (int k = 0; k < list.size(); ++k) -@@ -378,6 +416,8 @@ +@@ -365,6 +403,8 @@ - this.riddenByEntity = null; + this.field_70153_n = null; } + + MinecraftForge.EVENT_BUS.post(new MinecartUpdateEvent(this, l, i, i1)); } } -@@ -406,6 +446,17 @@ - this.motionZ = par1; +@@ -392,6 +432,17 @@ + this.field_70179_y = p_94088_1_; } -+ double moveY = motionY; -+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) ++ double moveY = field_70181_x; ++ if(getMaxSpeedAirVertical() > 0 && field_70181_x > getMaxSpeedAirVertical()) + { + moveY = getMaxSpeedAirVertical(); -+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) ++ if(Math.abs(field_70159_w) < 0.3f && Math.abs(field_70179_y) < 0.3f) + { + moveY = 0.15f; -+ motionY = moveY; ++ field_70181_x = moveY; + } + } + - if (this.onGround) + if (this.field_70122_E) { - this.motionX *= 0.5D; -@@ -413,13 +464,13 @@ - this.motionZ *= 0.5D; + this.field_70159_w *= 0.5D; +@@ -399,13 +450,13 @@ + this.field_70179_y *= 0.5D; } -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -+ this.moveEntity(this.motionX, moveY, this.motionZ); +- this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y); ++ this.func_70091_d(this.field_70159_w, moveY, this.field_70179_y); - if (!this.onGround) + if (!this.field_70122_E) { -- this.motionX *= 0.949999988079071D; -- this.motionY *= 0.949999988079071D; -- this.motionZ *= 0.949999988079071D; -+ this.motionX *= getDragAir(); -+ this.motionY *= getDragAir(); -+ this.motionZ *= getDragAir(); +- this.field_70159_w *= 0.949999988079071D; +- this.field_70181_x *= 0.949999988079071D; +- this.field_70179_y *= 0.949999988079071D; ++ this.field_70159_w *= getDragAir(); ++ this.field_70181_x *= getDragAir(); ++ this.field_70179_y *= getDragAir(); } } -@@ -433,7 +484,7 @@ +@@ -419,7 +470,7 @@ - if (p_145821_8_ == Blocks.golden_rail) + if (p_145821_8_ == Blocks.field_150318_D) { - flag = (p_145821_9_ & 8) != 0; -+ flag = (worldObj.getBlockMetadata(p_145821_1_, p_145821_2_, p_145821_3_) & 8) != 0; ++ flag = (field_70170_p.func_72805_g(p_145821_1_, p_145821_2_, p_145821_3_) & 8) != 0; flag1 = !flag; } -@@ -512,7 +563,7 @@ +@@ -498,7 +549,7 @@ } } - if (flag1) + if (flag1 && shouldDoRailFunctions()) { - d7 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + d7 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); -@@ -560,37 +611,9 @@ - this.posX = d8 + d2 * d7; - this.posZ = d9 + d3 * d7; - this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); -- d12 = this.motionX; -- d13 = this.motionZ; +@@ -546,37 +597,9 @@ + this.field_70165_t = d8 + d2 * d7; + this.field_70161_v = d9 + d3 * d7; + this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)this.field_70129_M, this.field_70161_v); +- d12 = this.field_70159_w; +- d13 = this.field_70179_y; -- if (this.riddenByEntity != null) +- if (this.field_70153_n != null) - { - d12 *= 0.75D; - d13 *= 0.75D; @@ -205,97 +203,97 @@ - d13 = p_145821_4_; - } - -- this.moveEntity(d12, 0.0D, d13); +- this.func_70091_d(d12, 0.0D, d13); - - if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_145821_1_ == aint[0][0] && MathHelper.floor_double(this.posZ) - p_145821_3_ == aint[0][2]) + if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_145821_1_ == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_145821_3_ == aint[0][2]) { - this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); -@@ -627,8 +650,13 @@ - this.motionZ = d6 * (double)(i1 - p_145821_3_); + this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); +@@ -613,8 +636,13 @@ + this.field_70179_y = d6 * (double)(i1 - p_145821_3_); } - if (flag) + if(shouldDoRailFunctions()) { -+ ((BlockRailBase)p_145821_8_).onMinecartPass(worldObj, this, p_145821_1_, p_145821_2_, p_145821_3_); ++ ((BlockRailBase)p_145821_8_).onMinecartPass(field_70170_p, this, p_145821_1_, p_145821_2_, p_145821_3_); + } + + if (flag && shouldDoRailFunctions()) + { - double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); if (d15 > 0.01D) -@@ -698,13 +726,8 @@ +@@ -684,13 +712,8 @@ } else { -- int l = this.worldObj.getBlockMetadata(i, j, k); -+ int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); +- int l = this.field_70170_p.func_72805_g(i, j, k); ++ int l = ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, i, j, k); -- if (((BlockRailBase)block).isPowered()) +- if (((BlockRailBase)block).func_150050_e()) - { - l &= 7; - } - - par3 = (double)j; + p_70495_3_ = (double)j; if (l >= 2 && l <= 5) -@@ -749,14 +772,9 @@ +@@ -735,14 +758,9 @@ if (BlockRailBase.func_150051_a(block)) { -- int l = this.worldObj.getBlockMetadata(i, j, k); -+ int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); - par3 = (double)j; +- int l = this.field_70170_p.func_72805_g(i, j, k); ++ int l = ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, i, j, k); + p_70489_3_ = (double)j; -- if (((BlockRailBase)block).isPowered()) +- if (((BlockRailBase)block).func_150050_e()) - { - l &= 7; - } - if (l >= 2 && l <= 5) { - par3 = (double)(j + 1); -@@ -855,11 +873,17 @@ - // JAVADOC METHOD $$ func_70108_f - public void applyEntityCollision(Entity par1Entity) + p_70489_3_ = (double)(j + 1); +@@ -838,11 +856,17 @@ + + public void func_70108_f(Entity p_70108_1_) { -+ MinecraftForge.EVENT_BUS.post(new MinecartCollisionEvent(this, par1Entity)); ++ MinecraftForge.EVENT_BUS.post(new MinecartCollisionEvent(this, p_70108_1_)); + if (getCollisionHandler() != null) + { -+ getCollisionHandler().onEntityCollision(this, par1Entity); ++ getCollisionHandler().onEntityCollision(this, p_70108_1_); + return; + } - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { - if (par1Entity != this.riddenByEntity) + if (p_70108_1_ != this.field_70153_n) { -- if (par1Entity instanceof EntityLivingBase && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) -+ if (par1Entity instanceof EntityLivingBase && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) +- if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && this.func_94087_l() == 0 && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) ++ if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && canBeRidden() && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) { - par1Entity.mountEntity(this); + p_70108_1_.func_70078_a(this); } -@@ -905,7 +929,7 @@ - double d7 = par1Entity.motionX + this.motionX; - double d8 = par1Entity.motionZ + this.motionZ; +@@ -888,7 +912,7 @@ + double d7 = p_70108_1_.field_70159_w + this.field_70159_w; + double d8 = p_70108_1_.field_70179_y + this.field_70179_y; -- if (((EntityMinecart)par1Entity).getMinecartType() == 2 && this.getMinecartType() != 2) -+ if (((EntityMinecart)par1Entity).isPoweredCart() && !isPoweredCart()) +- if (((EntityMinecart)p_70108_1_).func_94087_l() == 2 && this.func_94087_l() != 2) ++ if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; -@@ -913,7 +937,7 @@ - par1Entity.motionX *= 0.949999988079071D; - par1Entity.motionZ *= 0.949999988079071D; + this.field_70159_w *= 0.20000000298023224D; + this.field_70179_y *= 0.20000000298023224D; +@@ -896,7 +920,7 @@ + p_70108_1_.field_70159_w *= 0.949999988079071D; + p_70108_1_.field_70179_y *= 0.949999988079071D; } -- else if (((EntityMinecart)par1Entity).getMinecartType() != 2 && this.getMinecartType() == 2) -+ else if (((EntityMinecart)par1Entity).isPoweredCart() && !isPoweredCart()) +- else if (((EntityMinecart)p_70108_1_).func_94087_l() != 2 && this.func_94087_l() == 2) ++ else if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) { - par1Entity.motionX *= 0.20000000298023224D; - par1Entity.motionZ *= 0.20000000298023224D; -@@ -1093,4 +1117,216 @@ + p_70108_1_.field_70159_w *= 0.20000000298023224D; + p_70108_1_.field_70179_y *= 0.20000000298023224D; +@@ -1065,4 +1089,216 @@ { - return this.entityName; + return this.field_94102_c; } + /* =================================== FORGE START ===========================================*/ + /** @@ -303,10 +301,10 @@ + * This code handles minecart movement and speed capping when on a rail. + */ + public void moveMinecartOnRail(int x, int y, int z, double par4){ -+ double d12 = this.motionX; -+ double d13 = this.motionZ; ++ double d12 = this.field_70159_w; ++ double d13 = this.field_70179_y; + -+ if (this.riddenByEntity != null) ++ if (this.field_70153_n != null) + { + d12 *= 0.75D; + d13 *= 0.75D; @@ -332,7 +330,7 @@ + d13 = par4; + } + -+ this.moveEntity(d12, 0.0D, d13); ++ this.func_70091_d(d12, 0.0D, d13); + } + + /** @@ -365,25 +363,25 @@ + { + if (this instanceof EntityMinecartFurnace) + { -+ return new ItemStack(Items.furnace_minecart); ++ return new ItemStack(Items.field_151109_aJ); + } + else if (this instanceof EntityMinecartChest) + { -+ return new ItemStack(Items.chest_minecart); ++ return new ItemStack(Items.field_151108_aI); + } + else if (this instanceof EntityMinecartTNT) + { -+ return new ItemStack(Items.tnt_minecart); ++ return new ItemStack(Items.field_151142_bV); + } + else if (this instanceof EntityMinecartHopper) + { -+ return new ItemStack(Items.hopper_minecart); ++ return new ItemStack(Items.field_151140_bW); + } + else if (this instanceof EntityMinecartHopper) + { -+ return new ItemStack(Items.command_block_minecart); ++ return new ItemStack(Items.field_151095_cc); + } -+ return new ItemStack(Items.minecart); ++ return new ItemStack(Items.field_151143_au); + } + + /** @@ -421,7 +419,7 @@ + */ + public boolean isPoweredCart() + { -+ return getMinecartType()== 2; ++ return func_94087_l()== 2; + } + + /** diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index 14cfcc9550..14d600cf6c 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java -@@ -249,6 +249,7 @@ - // JAVADOC METHOD $$ func_130002_c - public boolean interactFirst(EntityPlayer par1EntityPlayer) +@@ -234,6 +234,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, par1EntityPlayer))) return true; - if (!this.worldObj.isRemote) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) { - par1EntityPlayer.displayGUIChest(this); + p_130002_1_.func_71007_a(this); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch index 507f2324ab..7c4ed912d0 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -@@ -20,6 +20,7 @@ - // JAVADOC METHOD $$ func_130002_c - public boolean interactFirst(EntityPlayer par1EntityPlayer) +@@ -19,6 +19,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, par1EntityPlayer))) return true; - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (this.field_70153_n != null && this.field_70153_n instanceof EntityPlayer && this.field_70153_n != p_130002_1_) { return true; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch index 6027a747c1..324b3a1c4f 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -@@ -124,6 +124,7 @@ - // JAVADOC METHOD $$ func_130002_c - public boolean interactFirst(EntityPlayer par1EntityPlayer) - { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, par1EntityPlayer))) return true; - ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); +@@ -122,6 +122,7 @@ - if (itemstack != null && itemstack.getItem() == Items.coal) + public boolean func_130002_c(EntityPlayer p_130002_1_) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + ItemStack itemstack = p_130002_1_.field_71071_by.func_70448_g(); + + if (itemstack != null && itemstack.func_77973_b() == Items.field_151044_h) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch index 2d84a41b09..1c80d61474 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java -@@ -53,6 +53,7 @@ - // JAVADOC METHOD $$ func_130002_c - public boolean interactFirst(EntityPlayer par1EntityPlayer) +@@ -50,6 +50,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, par1EntityPlayer))) return true; - if (!this.worldObj.isRemote) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) { - par1EntityPlayer.displayGUIHopperMinecart(this); + p_130002_1_.func_96125_a(this); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch index 07f12704ac..e259f177d2 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch @@ -9,11 +9,11 @@ public class EntityXPOrb extends Entity { -@@ -218,6 +220,7 @@ +@@ -204,6 +206,7 @@ { - if (this.field_70532_c == 0 && par1EntityPlayer.xpCooldown == 0) + if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) { -+ if (MinecraftForge.EVENT_BUS.post(new PlayerPickupXpEvent(par1EntityPlayer, this))) return; - par1EntityPlayer.xpCooldown = 2; - this.worldObj.playSoundAtEntity(par1EntityPlayer, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); - par1EntityPlayer.onItemPickup(this, 1); ++ if (MinecraftForge.EVENT_BUS.post(new PlayerPickupXpEvent(p_70100_1_, this))) return; + p_70100_1_.field_71090_bL = 2; + this.field_70170_p.func_72956_a(p_70100_1_, "random.orb", 0.1F, 0.5F * ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.8F)); + p_70100_1_.func_71001_a(this, 1); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch index ad1da87e66..60db956180 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -18,57 +18,57 @@ public class EntityEnderman extends EntityMob { - private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); - private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); + private static final UUID field_110192_bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier field_110193_bq = (new AttributeModifier(field_110192_bp, "Attacking speed boost", 6.199999809265137D, 0)).func_111168_a(false); + @Deprecated //DO NOT TOUCH THIS EVER - private static boolean[] carriableBlocks = new boolean[256]; - // JAVADOC FIELD $$ field_70828_e - private int teleportDelay; -@@ -161,7 +166,7 @@ - j = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D); - block = this.worldObj.getBlock(k, i, j); + private static boolean[] field_70827_d = new boolean[256]; + private int field_70828_e; + private int field_70826_g; +@@ -154,7 +159,7 @@ + j = MathHelper.func_76128_c(this.field_70161_v - 2.0D + this.field_70146_Z.nextDouble() * 4.0D); + block = this.field_70170_p.func_147439_a(k, i, j); -- if (carriableBlocks[Block.getIdFromBlock(block)]) +- if (field_70827_d[Block.func_149682_b(block)]) + if (EntityEnderman.getCarriable(block)) { this.func_146081_a(block); - this.setCarryingData(this.worldObj.getBlockMetadata(k, i, j)); -@@ -275,12 +280,16 @@ - // JAVADOC METHOD $$ func_70825_j - protected boolean teleportTo(double par1, double par3, double par5) + this.func_70817_b(this.field_70170_p.func_72805_g(k, i, j)); +@@ -265,12 +270,16 @@ + + protected boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) { -+ EnderTeleportEvent event = new EnderTeleportEvent(this, par1, par3, par5, 0); ++ EnderTeleportEvent event = new EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); + if (MinecraftForge.EVENT_BUS.post(event)){ + return false; + } - double d3 = this.posX; - double d4 = this.posY; - double d5 = this.posZ; -- this.posX = par1; -- this.posY = par3; -- this.posZ = par5; -+ this.posX = event.targetX; -+ this.posY = event.targetY; -+ this.posZ = event.targetZ; + double d3 = this.field_70165_t; + double d4 = this.field_70163_u; + double d5 = this.field_70161_v; +- this.field_70165_t = p_70825_1_; +- this.field_70163_u = p_70825_3_; +- this.field_70161_v = p_70825_5_; ++ this.field_70165_t = event.targetX; ++ this.field_70163_u = event.targetY; ++ this.field_70161_v = event.targetZ; boolean flag = false; - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.posY); -@@ -432,7 +441,7 @@ + int i = MathHelper.func_76128_c(this.field_70165_t); + int j = MathHelper.func_76128_c(this.field_70163_u); +@@ -415,7 +424,7 @@ } } - return false; -+ return super.attackEntityFrom(par1DamageSource, par2); ++ return super.func_70097_a(p_70097_1_, p_70097_2_); } else { -@@ -467,5 +476,23 @@ - carriableBlocks[Block.getIdFromBlock(Blocks.pumpkin)] = true; - carriableBlocks[Block.getIdFromBlock(Blocks.melon_block)] = true; - carriableBlocks[Block.getIdFromBlock(Blocks.mycelium)] = true; -+ for (int x = 0; x < carriableBlocks.length; x++) +@@ -450,5 +459,23 @@ + field_70827_d[Block.func_149682_b(Blocks.field_150423_aK)] = true; + field_70827_d[Block.func_149682_b(Blocks.field_150440_ba)] = true; + field_70827_d[Block.func_149682_b(Blocks.field_150391_bh)] = true; ++ for (int x = 0; x < field_70827_d.length; x++) + { -+ if (carriableBlocks[x]) setCarriable(Block.getBlockById(x), true); ++ if (field_70827_d[x]) setCarriable(Block.func_149729_e(x), true); + } } + diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 87ca01d7d7..79abeaa6ce 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -11,36 +11,36 @@ public class EntityZombie extends EntityMob { -@@ -75,7 +79,7 @@ - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); -- this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); -+ this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * ForgeModContainer.zombieSummonBaseChance); +@@ -74,7 +78,7 @@ + this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(40.0D); + this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.23000000417232513D); + this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D); +- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * 0.10000000149011612D); ++ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * ForgeModContainer.zombieSummonBaseChance); } - protected void entityInit() -@@ -234,12 +238,28 @@ - entitylivingbase = (EntityLivingBase)par1DamageSource.getEntity(); + protected void func_70088_a() +@@ -224,12 +228,28 @@ + entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); } -- if (entitylivingbase != null && this.worldObj.difficultySetting == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) +- if (entitylivingbase != null && this.field_70170_p.field_73013_u == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) + -+ int i = MathHelper.floor_double(this.posX); -+ int j = MathHelper.floor_double(this.posY); -+ int k = MathHelper.floor_double(this.posZ); ++ int i = MathHelper.func_76128_c(this.field_70165_t); ++ int j = MathHelper.func_76128_c(this.field_70163_u); ++ int k = MathHelper.func_76128_c(this.field_70161_v); + -+ SummonAidEvent summonAid = ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(field_110186_bp).getAttributeValue()); ++ SummonAidEvent summonAid = ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, entitylivingbase, this.func_110148_a(field_110186_bp).func_111126_e()); + + if (summonAid.getResult() == Result.DENY) { -- int i = MathHelper.floor_double(this.posX); -- int j = MathHelper.floor_double(this.posY); -- int k = MathHelper.floor_double(this.posZ); -- EntityZombie entityzombie = new EntityZombie(this.worldObj); +- int i = MathHelper.func_76128_c(this.field_70165_t); +- int j = MathHelper.func_76128_c(this.field_70163_u); +- int k = MathHelper.func_76128_c(this.field_70161_v); +- EntityZombie entityzombie = new EntityZombie(this.field_70170_p); + return true; + } -+ else if (summonAid.getResult() == Result.ALLOW || entitylivingbase != null && this.worldObj.difficultySetting == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) ++ else if (summonAid.getResult() == Result.ALLOW || entitylivingbase != null && this.field_70170_p.field_73013_u == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) + { + EntityZombie entityzombie; + if (summonAid.customSummonedAid != null && summonAid.getResult() == Result.ALLOW) @@ -49,26 +49,26 @@ + } + else + { -+ entityzombie = new EntityZombie(this.worldObj); ++ entityzombie = new EntityZombie(this.field_70170_p); + } for (int l = 0; l < 50; ++l) { -@@ -254,7 +274,7 @@ - if (this.worldObj.checkNoEntityCollision(entityzombie.boundingBox) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.boundingBox)) +@@ -244,7 +264,7 @@ + if (this.field_70170_p.func_72855_b(entityzombie.field_70121_D) && this.field_70170_p.func_72945_a(entityzombie, entityzombie.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.field_70121_D)) { - this.worldObj.spawnEntityInWorld(entityzombie); -- entityzombie.setAttackTarget(entitylivingbase); -+ if (entitylivingbase != null) entityzombie.setAttackTarget(entitylivingbase); - entityzombie.onSpawnWithEgg((IEntityLivingData)null); - this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); - entityzombie.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); -@@ -449,7 +469,7 @@ + this.field_70170_p.func_72838_d(entityzombie); +- entityzombie.func_70624_b(entitylivingbase); ++ if (entitylivingbase != null) entityzombie.func_70624_b(entitylivingbase); + entityzombie.func_110161_a((IEntityLivingData)null); + this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); +@@ -430,7 +450,7 @@ - if (par1EntityLivingData1 == null) + if (p_110161_1_1 == null) { -- par1EntityLivingData1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F, null); -+ par1EntityLivingData1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null); +- p_110161_1_1 = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < 0.05F, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, null); ++ p_110161_1_1 = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < ForgeModContainer.zombieBabyChance, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, null); } - if (par1EntityLivingData1 instanceof EntityZombie.GroupData) + if (p_110161_1_1 instanceof EntityZombie.GroupData) diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index b969377497..0a33c197ac 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -20,67 +20,67 @@ { private static final String __OBFID = "CL_00001645"; -@@ -38,32 +42,7 @@ +@@ -37,32 +41,7 @@ } } -- if (itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) { -- this.setDead(); -- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); +- this.func_70106_y(); +- this.field_70170_p.func_72869_a("largeexplode", this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D); - -- if (!this.worldObj.isRemote) +- if (!this.field_70170_p.field_72995_K) - { -- EntityCow entitycow = new EntityCow(this.worldObj); -- entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); -- entitycow.setHealth(this.getHealth()); -- entitycow.renderYawOffset = this.renderYawOffset; -- this.worldObj.spawnEntityInWorld(entitycow); +- EntityCow entitycow = new EntityCow(this.field_70170_p); +- entitycow.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A); +- entitycow.func_70606_j(this.func_110143_aJ()); +- entitycow.field_70761_aq = this.field_70761_aq; +- this.field_70170_p.func_72838_d(entitycow); - - for (int i = 0; i < 5; ++i) - { -- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Blocks.red_mushroom))); +- this.field_70170_p.func_72838_d(new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v, new ItemStack(Blocks.field_150337_Q))); - } - -- itemstack.damageItem(1, par1EntityPlayer); -- this.playSound("mob.sheep.shear", 1.0F, 1.0F); +- itemstack.func_77972_a(1, p_70085_1_); +- this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); - } - - return true; - } - else - { - return super.interact(par1EntityPlayer); + return super.func_70085_c(p_70085_1_); } } -@@ -72,4 +51,30 @@ +@@ -71,4 +50,30 @@ { - return new EntityMooshroom(this.worldObj); + return new EntityMooshroom(this.field_70170_p); } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { -+ return getGrowingAge() >= 0; ++ return func_70874_b() >= 0; + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { -+ setDead(); -+ EntityCow entitycow = new EntityCow(worldObj); -+ entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); -+ entitycow.setHealth(this.getHealth()); -+ entitycow.renderYawOffset = renderYawOffset; -+ worldObj.spawnEntityInWorld(entitycow); -+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); ++ func_70106_y(); ++ EntityCow entitycow = new EntityCow(field_70170_p); ++ entitycow.func_70012_b(field_70165_t, field_70163_u, field_70161_v, field_70177_z, field_70125_A); ++ entitycow.func_70606_j(this.func_110143_aJ()); ++ entitycow.field_70761_aq = field_70761_aq; ++ field_70170_p.func_72838_d(entitycow); ++ field_70170_p.func_72869_a("largeexplode", field_70165_t, field_70163_u + (double)(field_70131_O / 2.0F), field_70161_v, 0.0D, 0.0D, 0.0D); + + ArrayList ret = new ArrayList(); + for (int i = 0; i < 5; i++) + { -+ ret.add(new ItemStack(Blocks.red_mushroom)); ++ ret.add(new ItemStack(Blocks.field_150337_Q)); + } -+ playSound("mob.sheep.shear", 1.0F, 1.0F); ++ func_85030_a("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch index aa93b62b6f..f110d1d71d 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java -@@ -298,7 +298,7 @@ +@@ -281,7 +281,7 @@ - Block block = this.worldObj.getBlock(i, j - 1, k); + Block block = this.field_70170_p.func_147439_a(i, j - 1, k); -- if (block == Blocks.grass || block.getMaterial() == Material.leaves) -+ if (block == Blocks.grass || block.isLeaves(worldObj, i, j - 1, k)) +- if (block == Blocks.field_150349_c || block.func_149688_o() == Material.field_151584_j) ++ if (block == Blocks.field_150349_c || block.isLeaves(field_70170_p, i, j - 1, k)) { return true; } diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index e96ae71165..98dd31ca5b 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -21,57 +21,57 @@ { private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() { -@@ -130,28 +133,6 @@ - // JAVADOC METHOD $$ func_70085_c - public boolean interact(EntityPlayer par1EntityPlayer) +@@ -124,28 +127,6 @@ + + public boolean func_70085_c(EntityPlayer p_70085_1_) { -- ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); +- ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); - -- if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) - { -- if (!this.worldObj.isRemote) +- if (!this.field_70170_p.field_72995_K) - { -- this.setSheared(true); -- int i = 1 + this.rand.nextInt(3); +- this.func_70893_e(true); +- int i = 1 + this.field_70146_Z.nextInt(3); - - for (int j = 0; j < i; ++j) - { -- EntityItem entityitem = this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor()), 1.0F); -- entityitem.motionY += (double)(this.rand.nextFloat() * 0.05F); -- entityitem.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); -- entityitem.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); +- EntityItem entityitem = this.func_70099_a(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_70896_n()), 1.0F); +- entityitem.field_70181_x += (double)(this.field_70146_Z.nextFloat() * 0.05F); +- entityitem.field_70159_w += (double)((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.1F); +- entityitem.field_70179_y += (double)((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.1F); - } - } - -- itemstack.damageItem(1, par1EntityPlayer); -- this.playSound("mob.sheep.shear", 1.0F, 1.0F); +- itemstack.func_77972_a(1, p_70085_1_); +- this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); - } - - return super.interact(par1EntityPlayer); + return super.func_70085_c(p_70085_1_); } -@@ -305,4 +286,24 @@ +@@ -290,4 +271,24 @@ { - return 15 - ((EntitySheep)par1EntityAnimal).getFleeceColor(); + return 15 - ((EntitySheep)p_90013_1_).func_70896_n(); } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { -+ return !getSheared() && !isChild(); ++ return !func_70892_o() && !func_70631_g_(); + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); -+ setSheared(true); -+ int i = 1 + rand.nextInt(3); ++ func_70893_e(true); ++ int i = 1 + field_70146_Z.nextInt(3); + for (int j = 0; j < i; j++) + { -+ ret.add(new ItemStack(Blocks.wool, 1, getFleeceColor())); ++ ret.add(new ItemStack(Blocks.field_150325_L, 1, func_70896_n())); + } -+ this.playSound("mob.sheep.shear", 1.0F, 1.0F); ++ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch index aecb8713ff..4785b4f689 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java -@@ -189,7 +189,7 @@ - ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); - boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; +@@ -180,7 +180,7 @@ + ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); + boolean flag = itemstack != null && itemstack.func_77973_b() == Items.field_151063_bx; -- if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) -+ if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !par1EntityPlayer.isSneaking()) +- if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_()) ++ if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_() && !p_70085_1_.func_70093_af()) { - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 36eb5dd935..ff5e186b57 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -35,189 +35,187 @@ + private HashMap spawnChunkMap = new HashMap(); + private HashMap spawnForcedMap = new HashMap(); + - // JAVADOC FIELD $$ field_71071_by - public InventoryPlayer inventory = new InventoryPlayer(this); - private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); -@@ -148,6 +167,7 @@ - this.setLocationAndAngles((double)chunkcoordinates.posX + 0.5D, (double)(chunkcoordinates.posY + 1), (double)chunkcoordinates.posZ + 0.5D, 0.0F, 0.0F); + public InventoryPlayer field_71071_by = new InventoryPlayer(this); + private InventoryEnderChest field_71078_a = new InventoryEnderChest(); + public Container field_71069_bz; +@@ -130,6 +149,7 @@ + this.func_70012_b((double)chunkcoordinates.field_71574_a + 0.5D, (double)(chunkcoordinates.field_71572_b + 1), (double)chunkcoordinates.field_71573_c + 0.5D, 0.0F, 0.0F); this.field_70741_aB = 180.0F; - this.fireResistance = 20; + this.field_70174_ab = 20; + this.eyeHeight = this.getDefaultEyeHeight(); } - protected void applyEntityAttributes() -@@ -195,7 +215,8 @@ + protected void func_110147_ax() +@@ -173,7 +193,8 @@ { - if (this.itemInUse != null) + if (this.field_71074_e != null) { -- this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); -+ if (!ForgeEventFactory.onUseItemStop(this, itemInUse, itemInUseCount)) -+ this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); +- this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); ++ if (!ForgeEventFactory.onUseItemStop(this, field_71074_e, field_71072_f)) ++ this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); } - this.clearItemInUse(); -@@ -227,14 +248,23 @@ + this.func_71041_bz(); +@@ -204,14 +225,23 @@ - if (itemstack == this.itemInUse) + if (itemstack == this.field_71074_e) { -- if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) -+ itemInUseCount = ForgeEventFactory.onItemUseTick(this, itemInUse, itemInUseCount); -+ if (itemInUseCount <= 0) +- if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) ++ field_71072_f = ForgeEventFactory.onItemUseTick(this, field_71074_e, field_71072_f); ++ if (field_71072_f <= 0) { -- this.updateItemUse(itemstack, 5); -+ this.onItemUseFinish(); +- this.func_71010_c(itemstack, 5); ++ this.func_71036_o(); } - -- if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) +- if (--this.field_71072_f == 0 && !this.field_70170_p.field_72995_K) + else { -- this.onItemUseFinish(); -+ itemInUse.getItem().onUsingTick(itemInUse, this, itemInUseCount); -+ if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) +- this.func_71036_o(); ++ field_71074_e.func_77973_b().onUsingTick(field_71074_e, this, field_71072_f); ++ if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) + { -+ this.updateItemUse(itemstack, 5); ++ this.func_71010_c(itemstack, 5); + } + -+ if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) ++ if (--this.field_71072_f == 0 && !this.field_70170_p.field_72995_K) + { -+ this.onItemUseFinish(); ++ this.func_71036_o(); + } } } else -@@ -281,7 +311,7 @@ +@@ -258,7 +288,7 @@ - super.onUpdate(); + super.func_70071_h_(); -- if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) -+ if (!this.worldObj.isRemote && this.openContainer != null && !ForgeHooks.canInteractWith(this, this.openContainer)) +- if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !ForgeHooks.canInteractWith(this, this.field_71070_bA)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; -@@ -416,11 +446,13 @@ - int i = this.itemInUse.stackSize; - ItemStack itemstack = this.itemInUse.onFoodEaten(this.worldObj, this); + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; +@@ -389,11 +419,13 @@ + int i = this.field_71074_e.field_77994_a; + ItemStack itemstack = this.field_71074_e.func_77950_b(this.field_70170_p, this); -+ itemstack = ForgeEventFactory.onItemUseFinish(this, itemInUse, itemInUseCount, itemstack); ++ itemstack = ForgeEventFactory.onItemUseFinish(this, field_71074_e, field_71072_f, itemstack); + - if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) + if (itemstack != this.field_71074_e || itemstack != null && itemstack.field_77994_a != i) { - this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = itemstack; -- if (itemstack.stackSize == 0) -+ if (itemstack != null && itemstack.stackSize == 0) +- if (itemstack.field_77994_a == 0) ++ if (itemstack != null && itemstack.field_77994_a == 0) { - this.inventory.mainInventory[this.inventory.currentItem] = null; + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = null; } -@@ -498,11 +530,11 @@ - this.cameraYaw = 0.0F; - this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); +@@ -467,11 +499,11 @@ + this.field_71109_bG = 0.0F; + this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2); -- if (this.ridingEntity instanceof EntityPig) -+ if (this.ridingEntity instanceof EntityLivingBase && ((EntityLivingBase)ridingEntity).shouldRiderFaceForward(this)) +- if (this.field_70154_o instanceof EntityPig) ++ if (this.field_70154_o instanceof EntityLivingBase && ((EntityLivingBase)field_70154_o).shouldRiderFaceForward(this)) { - this.rotationPitch = f1; - this.rotationYaw = f; -- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; -+ this.renderYawOffset = ((EntityLivingBase)this.ridingEntity).renderYawOffset; + this.field_70125_A = f1; + this.field_70177_z = f; +- this.field_70761_aq = ((EntityPig)this.field_70154_o).field_70761_aq; ++ this.field_70761_aq = ((EntityLivingBase)this.field_70154_o).field_70761_aq; } } } -@@ -632,11 +664,15 @@ - // JAVADOC METHOD $$ func_70645_a - public void onDeath(DamageSource par1DamageSource) +@@ -596,11 +628,15 @@ + + public void func_70645_a(DamageSource p_70645_1_) { -+ if (ForgeHooks.onLivingDeath(this, par1DamageSource)) return; - super.onDeath(par1DamageSource); - this.setSize(0.2F, 0.2F); - this.setPosition(this.posX, this.posY, this.posZ); - this.motionY = 0.10000000149011612D; ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + super.func_70645_a(p_70645_1_); + this.func_70105_a(0.2F, 0.2F); + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.field_70181_x = 0.10000000149011612D; + captureDrops = true; + capturedDrops.clear(); + - if (this.getCommandSenderName().equals("Notch")) + if (this.func_70005_c_().equals("Notch")) { - this.func_146097_a(new ItemStack(Items.apple, 1), true, false); -@@ -647,6 +683,20 @@ - this.inventory.dropAllItems(); + this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false); +@@ -611,6 +647,20 @@ + this.field_71071_by.func_70436_m(); } + captureDrops = false; + -+ if (!worldObj.isRemote) ++ if (!field_70170_p.field_72995_K) + { -+ PlayerDropsEvent event = new PlayerDropsEvent(this, par1DamageSource, capturedDrops, recentlyHit > 0); ++ PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); + if (!MinecraftForge.EVENT_BUS.post(event)) + { + for (EntityItem item : capturedDrops) + { -+ joinEntityItemWithWorld(item); ++ func_71012_a(item); + } + } + } + - if (par1DamageSource != null) + if (p_70645_1_ != null) { - this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); -@@ -702,13 +752,26 @@ - // JAVADOC METHOD $$ func_71040_bB - public EntityItem dropOneItem(boolean par1) + this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * (float)Math.PI / 180.0F) * 0.1F); +@@ -662,12 +712,25 @@ + + public EntityItem func_71040_bB(boolean p_71040_1_) { -- return this.func_146097_a(this.inventory.decrStackSize(this.inventory.currentItem, par1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true); -+ ItemStack stack = inventory.getCurrentItem(); +- return this.func_146097_a(this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1), false, true); ++ ItemStack stack = field_71071_by.func_70448_g(); + + if (stack == null) + { + return null; + } + -+ if (stack.getItem().onDroppedByPlayer(stack, this)) ++ if (stack.func_77973_b().onDroppedByPlayer(stack, this)) + { -+ int count = par1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1; -+ return ForgeHooks.onPlayerTossEvent(this, inventory.decrStackSize(inventory.currentItem, count), true); ++ int count = p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1; ++ return ForgeHooks.onPlayerTossEvent(this, field_71071_by.func_70298_a(field_71071_by.field_70461_c, count), true); + } + + return null; } - // JAVADOC METHOD $$ func_71019_a - public EntityItem dropPlayerItemWithRandomChoice(ItemStack par1ItemStack, boolean par2) + public EntityItem func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) { -- return this.func_146097_a(par1ItemStack, false, false); -+ return ForgeHooks.onPlayerTossEvent(this, par1ItemStack, false); +- return this.func_146097_a(p_71019_1_, false, false); ++ return ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false); } public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) -@@ -765,14 +828,26 @@ - // JAVADOC METHOD $$ func_71012_a - public void joinEntityItemWithWorld(EntityItem par1EntityItem) +@@ -723,13 +786,25 @@ + + public void func_71012_a(EntityItem p_71012_1_) { + if (captureDrops) + { -+ capturedDrops.add(par1EntityItem); ++ capturedDrops.add(p_71012_1_); + return; + } - this.worldObj.spawnEntityInWorld(par1EntityItem); + this.field_70170_p.func_72838_d(p_71012_1_); } - // JAVADOC METHOD $$ func_146096_a + @Deprecated //Metadata sensitive version, named getBreakSpeed - public float getCurrentPlayerStrVsBlock(Block p_146096_1_, boolean p_146096_2_) + public float func_146096_a(Block p_146096_1_, boolean p_146096_2_) { -- float f = this.inventory.func_146023_a(p_146096_1_); +- float f = this.field_71071_by.func_146023_a(p_146096_1_); + return getBreakSpeed(p_146096_1_, p_146096_2_, 0); + } + public float getBreakSpeed(Block p_146096_1_, boolean p_146096_2_, int meta) + { -+ ItemStack stack = inventory.getCurrentItem(); -+ float f = (stack == null ? 1.0F : stack.getItem().getDigSpeed(stack, p_146096_1_, meta)); ++ ItemStack stack = field_71071_by.func_70448_g(); ++ float f = (stack == null ? 1.0F : stack.func_77973_b().getDigSpeed(stack, p_146096_1_, meta)); + if (f > 1.0F) { - int i = EnchantmentHelper.getEfficiencyModifier(this); -@@ -782,7 +857,9 @@ + int i = EnchantmentHelper.func_77509_b(this); +@@ -739,7 +814,9 @@ { float f1 = (float)(i * i + 1); @@ -228,7 +226,7 @@ { f += f1 * 0.08F; } -@@ -813,13 +890,14 @@ +@@ -770,12 +847,13 @@ f /= 5.0F; } @@ -237,33 +235,32 @@ + return (f < 0 ? 0 : f); } - // JAVADOC METHOD $$ func_146099_a - public boolean canHarvestBlock(Block p_146099_1_) + public boolean func_146099_a(Block p_146099_1_) { -- return this.inventory.func_146025_b(p_146099_1_); -+ return ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.inventory.func_146025_b(p_146099_1_)); +- return this.field_71071_by.func_146025_b(p_146099_1_); ++ return ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.field_71071_by.func_146025_b(p_146099_1_)); } - // JAVADOC METHOD $$ func_70037_a -@@ -849,6 +927,16 @@ - this.spawnForced = par1NBTTagCompound.getBoolean("SpawnForced"); + public void func_70037_a(NBTTagCompound p_70037_1_) +@@ -804,6 +882,16 @@ + this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); } + NBTTagList spawnlist = null; -+ spawnlist = par1NBTTagCompound.getTagList("Spawns", 10); -+ for (int i = 0; i < spawnlist.tagCount(); i++) ++ spawnlist = p_70037_1_.func_150295_c("Spawns", 10); ++ for (int i = 0; i < spawnlist.func_74745_c(); i++) + { -+ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.getCompoundTagAt(i); -+ int spawndim = spawndata.getInteger("Dim"); -+ this.spawnChunkMap.put(spawndim, new ChunkCoordinates(spawndata.getInteger("SpawnX"), spawndata.getInteger("SpawnY"), spawndata.getInteger("SpawnZ"))); -+ this.spawnForcedMap.put(spawndim, spawndata.getBoolean("SpawnForced")); ++ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.func_150305_b(i); ++ int spawndim = spawndata.func_74762_e("Dim"); ++ this.spawnChunkMap.put(spawndim, new ChunkCoordinates(spawndata.func_74762_e("SpawnX"), spawndata.func_74762_e("SpawnY"), spawndata.func_74762_e("SpawnZ"))); ++ this.spawnForcedMap.put(spawndim, spawndata.func_74767_n("SpawnForced")); + } + - this.foodStats.readNBT(par1NBTTagCompound); - this.capabilities.readCapabilitiesFromNBT(par1NBTTagCompound); + this.field_71100_bB.func_75112_a(p_70037_1_); + this.field_71075_bZ.func_75095_b(p_70037_1_); -@@ -880,6 +968,23 @@ - par1NBTTagCompound.setBoolean("SpawnForced", this.spawnForced); +@@ -834,6 +922,23 @@ + p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d); } + NBTTagList spawnlist = new NBTTagList(); @@ -274,291 +271,289 @@ + Boolean forced = spawnForcedMap.get(entry.getKey()); + if (forced == null) forced = false; + NBTTagCompound spawndata = new NBTTagCompound(); -+ spawndata.setInteger("Dim", entry.getKey()); -+ spawndata.setInteger("SpawnX", spawn.posX); -+ spawndata.setInteger("SpawnY", spawn.posY); -+ spawndata.setInteger("SpawnZ", spawn.posZ); -+ spawndata.setBoolean("SpawnForced", forced); -+ spawnlist.appendTag(spawndata); ++ spawndata.func_74768_a("Dim", entry.getKey()); ++ spawndata.func_74768_a("SpawnX", spawn.field_71574_a); ++ spawndata.func_74768_a("SpawnY", spawn.field_71572_b); ++ spawndata.func_74768_a("SpawnZ", spawn.field_71573_c); ++ spawndata.func_74757_a("SpawnForced", forced); ++ spawnlist.func_74742_a(spawndata); + } -+ par1NBTTagCompound.setTag("Spawns", spawnlist); ++ p_70014_1_.func_74782_a("Spawns", spawnlist); + - this.foodStats.writeNBT(par1NBTTagCompound); - this.capabilities.writeCapabilitiesToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); -@@ -904,7 +1009,7 @@ + this.field_71100_bB.func_75117_b(p_70014_1_); + this.field_71075_bZ.func_75091_a(p_70014_1_); + p_70014_1_.func_74782_a("EnderItems", this.field_71078_a.func_70487_g()); +@@ -855,7 +960,7 @@ - public float getEyeHeight() + public float func_70047_e() { - return 0.12F; + return eyeHeight; } - // JAVADOC METHOD $$ func_71061_d_ -@@ -916,6 +1021,7 @@ - // JAVADOC METHOD $$ func_70097_a - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + protected void func_71061_d_() +@@ -865,6 +970,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; - if (this.isEntityInvulnerable()) ++ if (ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_85032_ar()) { return false; -@@ -1020,12 +1126,15 @@ +@@ -966,12 +1072,15 @@ { - if (!this.isEntityInvulnerable()) + if (!this.func_85032_ar()) { -+ par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2); -+ if (par2 <= 0) return; - if (!par1DamageSource.isUnblockable() && this.isBlocking() && par2 > 0.0F) ++ p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + if (!p_70665_1_.func_76363_c() && this.func_70632_aY() && p_70665_2_ > 0.0F) { - par2 = (1.0F + par2) * 0.5F; + p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; } -- par2 = this.applyArmorCalculations(par1DamageSource, par2); -+ par2 = ArmorProperties.ApplyArmor(this, inventory.armorInventory, par1DamageSource, par2); -+ if (par2 <= 0) return; - par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); - float f1 = par2; - par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); -@@ -1060,6 +1169,7 @@ +- p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); ++ p_70665_2_ = ArmorProperties.ApplyArmor(this, field_71071_by.field_70460_b, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f1 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); +@@ -1005,6 +1114,7 @@ - public boolean interactWith(Entity par1Entity) + public boolean func_70998_m(Entity p_70998_1_) { -+ if (MinecraftForge.EVENT_BUS.post(new EntityInteractEvent(this, par1Entity))) return false; - ItemStack itemstack = this.getCurrentEquippedItem(); - ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; ++ if (MinecraftForge.EVENT_BUS.post(new EntityInteractEvent(this, p_70998_1_))) return false; + ItemStack itemstack = this.func_71045_bC(); + ItemStack itemstack1 = itemstack != null ? itemstack.func_77946_l() : null; -@@ -1112,7 +1222,9 @@ - // JAVADOC METHOD $$ func_71028_bD - public void destroyCurrentEquippedItem() +@@ -1055,7 +1165,9 @@ + + public void func_71028_bD() { -+ ItemStack orig = getCurrentEquippedItem(); - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); ++ ItemStack orig = func_71045_bC(); + this.field_71071_by.func_70299_a(this.field_71071_by.field_70461_c, (ItemStack)null); + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, orig)); } - // JAVADOC METHOD $$ func_70033_W -@@ -1124,6 +1236,15 @@ - // JAVADOC METHOD $$ func_71059_n - public void attackTargetEntityWithCurrentItem(Entity par1Entity) + public double func_70033_W() +@@ -1065,6 +1177,15 @@ + + public void func_71059_n(Entity p_71059_1_) { -+ if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(this, par1Entity))) ++ if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(this, p_71059_1_))) + { + return; + } -+ ItemStack stack = getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onLeftClickEntity(stack, this, par1Entity)) ++ ItemStack stack = func_71045_bC(); ++ if (stack != null && stack.func_77973_b().onLeftClickEntity(stack, this, p_71059_1_)) + { + return; + } - if (par1Entity.canAttackWithItem()) + if (p_71059_1_.func_70075_an()) { - if (!par1Entity.hitByEntity(this)) -@@ -1276,6 +1397,12 @@ - // JAVADOC METHOD $$ func_71018_a - public EntityPlayer.EnumStatus sleepInBedAt(int par1, int par2, int par3) + if (!p_71059_1_.func_85031_j(this)) +@@ -1212,6 +1333,12 @@ + + public EntityPlayer.EnumStatus func_71018_a(int p_71018_1_, int p_71018_2_, int p_71018_3_) { -+ PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(this, par1, par2, par3); ++ PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(this, p_71018_1_, p_71018_2_, p_71018_3_); + MinecraftForge.EVENT_BUS.post(event); + if (event.result != null) + { + return event.result; + } - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { - if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1318,8 +1445,7 @@ + if (this.func_70608_bn() || !this.func_70089_S()) +@@ -1254,8 +1381,7 @@ - if (this.worldObj.blockExists(par1, par2, par3)) + if (this.field_70170_p.func_72899_e(p_71018_1_, p_71018_2_, p_71018_3_)) { -- int i1 = this.worldObj.getBlockMetadata(par1, par2, par3); -- int l = BlockBed.getDirection(i1); -+ int l = worldObj.getBlock(par1, par2, par3).getBedDirection(worldObj, par1, par2, par3); +- int i1 = this.field_70170_p.func_72805_g(p_71018_1_, p_71018_2_, p_71018_3_); +- int l = BlockBed.func_149895_l(i1); ++ int l = field_70170_p.func_147439_a(p_71018_1_, p_71018_2_, p_71018_3_).getBedDirection(field_70170_p, p_71018_1_, p_71018_2_, p_71018_3_); float f1 = 0.5F; float f = 0.5F; -@@ -1387,11 +1513,12 @@ - this.resetHeight(); - ChunkCoordinates chunkcoordinates = this.playerLocation; - ChunkCoordinates chunkcoordinates1 = this.playerLocation; -+ Block block = (chunkcoordinates == null ? null : worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)); +@@ -1322,11 +1448,12 @@ + this.func_71061_d_(); + ChunkCoordinates chunkcoordinates = this.field_71081_bT; + ChunkCoordinates chunkcoordinates1 = this.field_71081_bT; ++ Block block = (chunkcoordinates == null ? null : field_70170_p.func_147439_a(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c)); -- if (chunkcoordinates != null && this.worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ) == Blocks.bed) -+ if (chunkcoordinates != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this)) +- if (chunkcoordinates != null && this.field_70170_p.func_147439_a(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c) == Blocks.field_150324_C) ++ if (chunkcoordinates != null && block.isBed(field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this)) { -- BlockBed.func_149979_a(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, false); -- chunkcoordinates1 = BlockBed.func_149977_a(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, 0); -+ block.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this, false); -+ chunkcoordinates1 = block.getBedSpawnPosition(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this); +- BlockBed.func_149979_a(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, false); +- chunkcoordinates1 = BlockBed.func_149977_a(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, 0); ++ block.setBedOccupied(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this, false); ++ chunkcoordinates1 = block.getBedSpawnPosition(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this); if (chunkcoordinates1 == null) { -@@ -1426,7 +1553,7 @@ - // JAVADOC METHOD $$ func_71065_l - private boolean isInBed() +@@ -1360,7 +1487,7 @@ + + private boolean func_71065_l() { -- return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Blocks.bed; -+ return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ).isBed(worldObj, playerLocation.posX, playerLocation.posY, playerLocation.posZ, this); +- return this.field_70170_p.func_147439_a(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c) == Blocks.field_150324_C; ++ return this.field_70170_p.func_147439_a(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c).isBed(field_70170_p, field_71081_bT.field_71574_a, field_71081_bT.field_71572_b, field_71081_bT.field_71573_c, this); } - // JAVADOC METHOD $$ func_71056_a -@@ -1438,9 +1565,9 @@ - ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); - ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); + public static ChunkCoordinates func_71056_a(World p_71056_0_, ChunkCoordinates p_71056_1_, boolean p_71056_2_) +@@ -1371,9 +1498,9 @@ + ichunkprovider.func_73158_c(p_71056_1_.field_71574_a - 3 >> 4, p_71056_1_.field_71573_c + 3 >> 4); + ichunkprovider.func_73158_c(p_71056_1_.field_71574_a + 3 >> 4, p_71056_1_.field_71573_c + 3 >> 4); -- if (par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Blocks.bed) -+ if (par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).isBed(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null)) +- if (p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c) == Blocks.field_150324_C) ++ if (p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c).isBed(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, null)) { -- ChunkCoordinates chunkcoordinates1 = BlockBed.func_149977_a(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); -+ ChunkCoordinates chunkcoordinates1 = par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).getBedSpawnPosition(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null); +- ChunkCoordinates chunkcoordinates1 = BlockBed.func_149977_a(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, 0); ++ ChunkCoordinates chunkcoordinates1 = p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c).getBedSpawnPosition(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, null); return chunkcoordinates1; } else -@@ -1459,8 +1586,10 @@ +@@ -1391,8 +1518,10 @@ { - if (this.playerLocation != null) + if (this.field_71081_bT != null) { -- int i = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); -- int j = BlockBed.getDirection(i); -+ int x = playerLocation.posX; -+ int y = playerLocation.posY; -+ int z = playerLocation.posZ; -+ int j = worldObj.getBlock(x, y, z).getBedDirection(worldObj, x, y, z); +- int i = this.field_70170_p.func_72805_g(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c); +- int j = BlockBed.func_149895_l(i); ++ int x = field_71081_bT.field_71574_a; ++ int y = field_71081_bT.field_71572_b; ++ int z = field_71081_bT.field_71573_c; ++ int j = field_70170_p.func_147439_a(x, y, z).getBedDirection(field_70170_p, x, y, z); switch (j) { -@@ -1519,19 +1648,26 @@ - public void addChatComponentMessage(IChatComponent p_146105_1_) {} +@@ -1448,18 +1577,25 @@ + + public void func_146105_b(IChatComponent p_146105_1_) {} - // JAVADOC METHOD $$ func_70997_bJ + @Deprecated - public ChunkCoordinates getBedLocation() + public ChunkCoordinates func_70997_bJ() { -- return this.spawnChunk; -+ return getBedLocation(this.dimension); +- return this.field_71077_c; ++ return getBedLocation(this.field_71093_bK); } + @Deprecated - public boolean isSpawnForced() + public boolean func_82245_bX() { -- return this.spawnForced; -+ return isSpawnForced(this.dimension); +- return this.field_82248_d; ++ return isSpawnForced(this.field_71093_bK); } - // JAVADOC METHOD $$ func_71063_a - public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2) + public void func_71063_a(ChunkCoordinates p_71063_1_, boolean p_71063_2_) { -+ if (this.dimension != 0) ++ if (this.field_71093_bK != 0) + { -+ setSpawnChunk(par1ChunkCoordinates, par2, this.dimension); ++ setSpawnChunk(p_71063_1_, p_71063_2_, this.field_71093_bK); + return; + } - if (par1ChunkCoordinates != null) + if (p_71063_1_ != null) { - this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates); -@@ -1713,6 +1849,10 @@ + this.field_71077_c = new ChunkCoordinates(p_71063_1_); +@@ -1633,6 +1769,10 @@ - super.fall(par1); + super.func_70069_a(p_70069_1_); } + else + { -+ MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, par1)); ++ MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_)); + } } protected String func_146067_o(int p_146067_1_) -@@ -1758,11 +1898,6 @@ +@@ -1675,11 +1815,6 @@ } else { -- if (par1ItemStack.getItem().requiresMultipleRenderPasses()) +- if (p_70620_1_.func_77973_b().func_77623_v()) - { -- return par1ItemStack.getItem().getIconFromDamageForRenderPass(par1ItemStack.getItemDamage(), par2); +- return p_70620_1_.func_77973_b().func_77618_c(p_70620_1_.func_77960_j(), p_70620_2_); - } - - if (this.itemInUse != null && par1ItemStack.getItem() == Items.bow) + if (this.field_71074_e != null && p_70620_1_.func_77973_b() == Items.field_151031_f) { - int j = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; -@@ -1782,6 +1917,7 @@ - return Items.bow.getItemIconForUseDuration(0); + int j = p_70620_1_.func_77988_m() - this.field_71072_f; +@@ -1699,6 +1834,7 @@ + return Items.field_151031_f.func_94599_c(0); } } -+ iicon = par1ItemStack.getItem().getIcon(par1ItemStack, par2, this, itemInUse, itemInUseCount); ++ iicon = p_70620_1_.func_77973_b().getIcon(p_70620_1_, p_70620_2_, this, field_71074_e, field_71072_f); } return iicon; -@@ -1872,6 +2008,8 @@ +@@ -1782,6 +1918,8 @@ { - if (par1ItemStack != this.itemInUse) + if (p_71008_1_ != this.field_71074_e) { -+ par2 = ForgeEventFactory.onItemUseStart(this, par1ItemStack, par2); -+ if (par2 <= 0) return; - this.itemInUse = par1ItemStack; - this.itemInUseCount = par2; ++ p_71008_2_ = ForgeEventFactory.onItemUseStart(this, p_71008_1_, p_71008_2_); ++ if (p_71008_2_ <= 0) return; + this.field_71074_e = p_71008_1_; + this.field_71072_f = p_71008_2_; -@@ -1970,6 +2108,17 @@ +@@ -1876,6 +2014,17 @@ } - this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; + this.field_71078_a = p_71049_1_.field_71078_a; + -+ this.spawnChunkMap = par1EntityPlayer.spawnChunkMap; -+ this.spawnForcedMap = par1EntityPlayer.spawnForcedMap; ++ this.spawnChunkMap = p_71049_1_.spawnChunkMap; ++ this.spawnForcedMap = p_71049_1_.spawnForcedMap; + + //Copy over a section of the Entity Data from the old player. + //Allows mods to specify data that persists after players respawn. -+ NBTTagCompound old = par1EntityPlayer.getEntityData(); -+ if (old.hasKey(PERSISTED_NBT_TAG)) ++ NBTTagCompound old = p_71049_1_.getEntityData(); ++ if (old.func_74764_b(PERSISTED_NBT_TAG)) + { -+ getEntityData().setTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG)); ++ getEntityData().func_74782_a(PERSISTED_NBT_TAG, old.func_74775_l(PERSISTED_NBT_TAG)); + } } - // JAVADOC METHOD $$ func_70041_e_ -@@ -2016,7 +2165,14 @@ - // JAVADOC METHOD $$ func_70062_b - public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) + protected boolean func_70041_e_() +@@ -1914,7 +2063,14 @@ + + public void func_70062_b(int p_70062_1_, ItemStack p_70062_2_) { -- this.inventory.armorInventory[par1] = par2ItemStack; -+ if (par1 == 0) +- this.field_71071_by.field_70460_b[p_70062_1_] = p_70062_2_; ++ if (p_70062_1_ == 0) + { -+ this.inventory.mainInventory[this.inventory.currentItem] = par2ItemStack; ++ this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = p_70062_2_; + } + else + { -+ this.inventory.armorInventory[par1 - 1] = par2ItemStack; ++ this.field_71071_by.field_70460_b[p_70062_1_ - 1] = p_70062_2_; + } } - // JAVADOC METHOD $$ func_98034_c -@@ -2062,7 +2218,7 @@ + @SideOnly(Side.CLIENT) +@@ -1959,7 +2115,7 @@ public IChatComponent func_145748_c_() { -- ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getCommandSenderName())); -+ ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getDisplayName())); - chatcomponenttext.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " ")); +- ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); ++ ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.getDisplayName())); + chatcomponenttext.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); return chatcomponenttext; } -@@ -2099,6 +2255,119 @@ +@@ -1996,6 +2152,118 @@ FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); } + /* ======================================== FORGE START =====================================*/ -+ // JAVADOC METHOD $$ getPosition + @SideOnly(Side.CLIENT) + @Override -+ public Vec3 getPosition(float par1) ++ public Vec3 func_70666_h(float par1) + { + if (par1 == 1.0F) + { -+ return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (this.getEyeHeight() - this.getDefaultEyeHeight()), this.posZ); ++ return this.field_70170_p.func_82732_R().func_72345_a(this.field_70165_t, this.field_70163_u + (this.func_70047_e() - this.getDefaultEyeHeight()), this.field_70161_v); + } + else + { -+ double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1; -+ double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1 + (this.getEyeHeight() - this.getDefaultEyeHeight()); -+ double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1; -+ return this.worldObj.getWorldVec3Pool().getVecFromPool(d0, d1, d2); ++ double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)par1; ++ double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)par1 + (this.func_70047_e() - this.getDefaultEyeHeight()); ++ double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)par1; ++ return this.field_70170_p.func_82732_R().func_72345_a(d0, d1, d2); + } + } + @@ -569,7 +564,7 @@ + */ + public ChunkCoordinates getBedLocation(int dimension) + { -+ return dimension == 0 ? spawnChunk : spawnChunkMap.get(dimension); ++ return dimension == 0 ? field_71077_c : spawnChunkMap.get(dimension); + } + + /** @@ -581,7 +576,7 @@ + */ + public boolean isSpawnForced(int dimension) + { -+ if (dimension == 0) return this.spawnForced; ++ if (dimension == 0) return this.field_82248_d; + Boolean forced = this.spawnForcedMap.get(dimension); + return forced == null ? false : forced; + } @@ -599,13 +594,13 @@ + { + if (chunkCoordinates != null) + { -+ spawnChunk = new ChunkCoordinates(chunkCoordinates); -+ spawnForced = forced; ++ field_71077_c = new ChunkCoordinates(chunkCoordinates); ++ field_82248_d = forced; + } + else + { -+ spawnChunk = null; -+ spawnForced = false; ++ field_71077_c = null; ++ field_82248_d = false; + } + return; + } @@ -642,7 +637,7 @@ + { + if(this.displayname == null) + { -+ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.getCommandSenderName()); ++ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); + } + return this.displayname; + } @@ -652,7 +647,7 @@ + */ + public void refreshDisplayName() + { -+ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.getCommandSenderName()); ++ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); + } + /* ======================================== FORGE END =====================================*/ + diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 5854cf55d9..ffce4790da 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -12,91 +12,91 @@ + public class EntityPlayerMP extends EntityPlayer implements ICrafting { - private static final Logger logger = LogManager.getLogger(); -@@ -148,19 +154,11 @@ - p_i45285_4_.thisPlayerMP = this; - this.theItemInWorldManager = p_i45285_4_; - this.renderDistance = p_i45285_1_.getConfigurationManager().getViewDistance(); -- ChunkCoordinates chunkcoordinates = p_i45285_2_.getSpawnPoint(); -+ ChunkCoordinates chunkcoordinates = p_i45285_2_.provider.getRandomizedSpawnPoint(); - int i = chunkcoordinates.posX; - int j = chunkcoordinates.posZ; - int k = chunkcoordinates.posY; + private static final Logger field_147102_bM = LogManager.getLogger(); +@@ -133,19 +139,11 @@ + p_i45285_4_.field_73090_b = this; + this.field_71134_c = p_i45285_4_; + this.field_71142_cm = p_i45285_1_.func_71203_ab().func_72395_o(); +- ChunkCoordinates chunkcoordinates = p_i45285_2_.func_72861_E(); ++ ChunkCoordinates chunkcoordinates = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint(); + int i = chunkcoordinates.field_71574_a; + int j = chunkcoordinates.field_71573_c; + int k = chunkcoordinates.field_71572_b; -- if (!p_i45285_2_.provider.hasNoSky && p_i45285_2_.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) +- if (!p_i45285_2_.field_73011_w.field_76576_e && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) - { -- int l = Math.max(5, p_i45285_1_.getSpawnProtectionSize() - 6); -- i += this.rand.nextInt(l * 2) - l; -- j += this.rand.nextInt(l * 2) - l; -- k = p_i45285_2_.getTopSolidOrLiquidBlock(i, j); +- int l = Math.max(5, p_i45285_1_.func_82357_ak() - 6); +- i += this.field_70146_Z.nextInt(l * 2) - l; +- j += this.field_70146_Z.nextInt(l * 2) - l; +- k = p_i45285_2_.func_72825_h(i, j); - } - - this.mcServer = p_i45285_1_; - this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_148538_i(this.getCommandSenderName()); - this.stepHeight = 0.0F; -@@ -218,7 +216,7 @@ + this.field_71133_b = p_i45285_1_; + this.field_147103_bO = p_i45285_1_.func_71203_ab().func_148538_i(this.func_70005_c_()); + this.field_70138_W = 0.0F; +@@ -199,7 +197,7 @@ - public float getEyeHeight() + public float func_70047_e() { - return 1.62F; -+ return super.getEyeHeight(); ++ return super.func_70047_e(); } - // JAVADOC METHOD $$ func_70071_h_ -@@ -234,7 +232,7 @@ + public void func_70071_h_() +@@ -214,7 +212,7 @@ - this.openContainer.detectAndSendChanges(); + this.field_71070_bA.func_75142_b(); -- if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) -+ if (!this.worldObj.isRemote && !ForgeHooks.canInteractWith(this, this.openContainer)) +- if (!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && !ForgeHooks.canInteractWith(this, this.field_71070_bA)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; -@@ -276,7 +274,8 @@ + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; +@@ -256,7 +254,8 @@ if (chunk.func_150802_k()) { arraylist.add(chunk); -- arraylist1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16)); -+ arraylist1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 15, 256, chunkcoordintpair.chunkZPos * 16 + 15)); +- arraylist1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 16, 256, chunkcoordintpair.field_77275_b * 16 + 16)); ++ arraylist1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 15, 256, chunkcoordintpair.field_77275_b * 16 + 15)); + //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it. iterator1.remove(); } } -@@ -304,6 +303,7 @@ +@@ -284,6 +283,7 @@ { chunk = (Chunk)iterator2.next(); - this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk); -+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.getChunkCoordIntPair(), this)); + this.func_71121_q().func_73039_n().func_85172_a(this, chunk); ++ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.func_76632_l(), this)); } } } -@@ -429,11 +429,25 @@ - // JAVADOC METHOD $$ func_70645_a - public void onDeath(DamageSource par1DamageSource) - { -+ if (ForgeHooks.onLivingDeath(this, par1DamageSource)) return; - this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); +@@ -408,11 +408,25 @@ - if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + this.field_71133_b.func_71203_ab().func_148539_a(this.func_110142_aN().func_151521_b()); + + if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) { + captureDrops = true; + capturedDrops.clear(); + - this.inventory.dropAllItems(); + this.field_71071_by.func_70436_m(); + + captureDrops = false; -+ PlayerDropsEvent event = new PlayerDropsEvent(this, par1DamageSource, capturedDrops, recentlyHit > 0); ++ PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); + if (!MinecraftForge.EVENT_BUS.post(event)) + { + for (EntityItem item : capturedDrops) + { -+ joinEntityItemWithWorld(item); ++ func_71012_a(item); + } + } } - Collection collection = this.worldObj.getScoreboard().func_96520_a(IScoreObjectiveCriteria.deathCount); -@@ -1037,4 +1051,15 @@ + Collection collection = this.field_70170_p.func_96441_U().func_96520_a(IScoreObjectiveCriteria.field_96642_c); +@@ -985,4 +999,15 @@ { return this.field_147103_bO; } diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 0046432e68..864d4ab127 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -325,6 +325,14 @@ - this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); +@@ -311,6 +311,14 @@ + this.field_70462_a[i].func_77945_a(this.field_70458_d.field_70170_p, this.field_70458_d, i, this.field_70461_c == i); } } + -+ for (int i = 0; i < armorInventory.length; i++) ++ for (int i = 0; i < field_70460_b.length; i++) + { -+ if (armorInventory[i] != null) ++ if (field_70460_b[i] != null) + { -+ armorInventory[i].getItem().onArmorTick(player.worldObj, player, armorInventory[i]); ++ field_70460_b[i].func_77973_b().onArmorTick(field_70458_d.field_70170_p, field_70458_d, field_70460_b[i]); + } + } } - // JAVADOC METHOD $$ func_146026_a + public boolean func_146026_a(Item p_146026_1_) diff --git a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch index a7789d7bb4..805491a277 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -8,21 +8,21 @@ import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; import net.minecraft.tileentity.TileEntityBrewingStand; -@@ -203,7 +204,7 @@ +@@ -194,7 +195,7 @@ - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) + public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { -- if (par2ItemStack.getItem() == Items.potionitem && par2ItemStack.getItemDamage() > 0) -+ if (par2ItemStack.getItem() instanceof ItemPotion && par2ItemStack.getItemDamage() > 0) +- if (p_82870_2_.func_77973_b() == Items.field_151068_bn && p_82870_2_.func_77960_j() > 0) ++ if (p_82870_2_.func_77973_b() instanceof ItemPotion && p_82870_2_.func_77960_j() > 0) { - this.player.addStat(AchievementList.potion, 1); + this.field_75244_a.func_71064_a(AchievementList.field_76001_A, 1); } -@@ -214,7 +215,7 @@ - // JAVADOC METHOD $$ func_75243_a_ - public static boolean canHoldPotion(ItemStack par0ItemStack) +@@ -204,7 +205,7 @@ + + public static boolean func_75243_a_(ItemStack p_75243_0_) { -- return par0ItemStack != null && (par0ItemStack.getItem() == Items.potionitem || par0ItemStack.getItem() == Items.glass_bottle); -+ return par0ItemStack != null && (par0ItemStack.getItem() instanceof ItemPotion || par0ItemStack.getItem() == Items.glass_bottle); +- return p_75243_0_ != null && (p_75243_0_.func_77973_b() == Items.field_151068_bn || p_75243_0_.func_77973_b() == Items.field_151069_bo); ++ return p_75243_0_ != null && (p_75243_0_.func_77973_b() instanceof ItemPotion || p_75243_0_.func_77973_b() == Items.field_151069_bo); } } } diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 2a2388136e..e47ea37269 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -8,7 +8,7 @@ public class ContainerEnchantment extends Container { -@@ -125,6 +126,7 @@ +@@ -116,6 +117,7 @@ { i = 0; int j; @@ -16,56 +16,56 @@ for (j = -1; j <= 1; ++j) { -@@ -132,37 +134,15 @@ +@@ -123,37 +125,15 @@ { - if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.posX + k, this.posY, this.posZ + j) && this.worldPointer.isAirBlock(this.posX + k, this.posY + 1, this.posZ + j)) + if ((j != 0 || k != 0) && this.field_75172_h.func_147437_c(this.field_75173_i + k, this.field_75170_j, this.field_75171_k + j) && this.field_75172_h.func_147437_c(this.field_75173_i + k, this.field_75170_j + 1, this.field_75171_k + j)) { -- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j, this.field_75171_k + j * 2) == Blocks.field_150342_X) - { - ++i; - } -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j * 2); -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j, field_75171_k + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j + 1, field_75171_k + j * 2); -- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j + 1, this.field_75171_k + j * 2) == Blocks.field_150342_X) - { - ++i; - } - if (k != 0 && j != 0) { -- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY, this.posZ + j) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j, this.field_75171_k + j) == Blocks.field_150342_X) - { - ++i; - } - -- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY + 1, this.posZ + j) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j + 1, this.field_75171_k + j) == Blocks.field_150342_X) - { - ++i; - } - -- if (this.worldPointer.getBlock(this.posX + k, this.posY, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k, this.field_75170_j, this.field_75171_k + j * 2) == Blocks.field_150342_X) - { - ++i; - } - -- if (this.worldPointer.getBlock(this.posX + k, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k, this.field_75170_j + 1, this.field_75171_k + j * 2) == Blocks.field_150342_X) - { - ++i; - } -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j ); -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j ); -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k, posY, posZ + j * 2); -+ power += ForgeHooks.getEnchantPower(worldPointer, posX + k, posY + 1, posZ + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j, field_75171_k + j ); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j + 1, field_75171_k + j ); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k, field_75170_j, field_75171_k + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k, field_75170_j + 1, field_75171_k + j * 2); } } } -@@ -170,7 +150,7 @@ +@@ -161,7 +141,7 @@ for (j = 0; j < 3; ++j) { -- this.enchantLevels[j] = EnchantmentHelper.calcItemStackEnchantability(this.rand, j, i, itemstack); -+ this.enchantLevels[j] = EnchantmentHelper.calcItemStackEnchantability(this.rand, j, (int)power, itemstack); +- this.field_75167_g[j] = EnchantmentHelper.func_77514_a(this.field_75169_l, j, i, itemstack); ++ this.field_75167_g[j] = EnchantmentHelper.func_77514_a(this.field_75169_l, j, (int)power, itemstack); } - this.detectAndSendChanges(); + this.func_75142_b(); diff --git a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch index 87504b5148..71e2843171 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java -@@ -52,7 +52,8 @@ - // JAVADOC METHOD $$ func_75214_a - public boolean isItemValid(ItemStack par1ItemStack) - { -- return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == k : (par1ItemStack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && par1ItemStack.getItem() != Items.skull ? false : k == 0)); -+ if (par1ItemStack == null) return false; -+ return par1ItemStack.getItem().isValidArmor(par1ItemStack, k, thePlayer); +@@ -48,7 +48,8 @@ + } + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return p_75214_1_ == null ? false : (p_75214_1_.func_77973_b() instanceof ItemArmor ? ((ItemArmor)p_75214_1_.func_77973_b()).field_77881_a == k : (p_75214_1_.func_77973_b() != Item.func_150898_a(Blocks.field_150423_aK) && p_75214_1_.func_77973_b() != Items.field_151144_bL ? false : k == 0)); ++ if (p_75214_1_ == null) return false; ++ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, k, field_82862_h); } - // JAVADOC METHOD $$ func_75212_b @SideOnly(Side.CLIENT) + public IIcon func_75212_b() diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 9a1f56a044..c2eb66a2c3 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java -@@ -383,6 +383,8 @@ +@@ -373,6 +373,8 @@ k2 = Math.max(1, k2 / 2); } -+ if (flag && !itemstack1.getItem().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; ++ if (flag && !itemstack1.func_77973_b().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; + - this.maximumCost = k2 + i; + this.field_82854_e = k2 + i; if (i <= 0) diff --git a/patches/minecraft/net/minecraft/inventory/Slot.java.patch b/patches/minecraft/net/minecraft/inventory/Slot.java.patch index 0a7259c249..c9851f7018 100644 --- a/patches/minecraft/net/minecraft/inventory/Slot.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Slot.java.patch @@ -12,8 +12,8 @@ public class Slot { -@@ -20,6 +22,13 @@ - public int yDisplayPosition; +@@ -15,6 +17,13 @@ + public int field_75221_f; private static final String __OBFID = "CL_00001762"; + /** Position within background texture file, normally -1 which causes no background to be drawn. */ @@ -23,19 +23,19 @@ + @SideOnly(Side.CLIENT) + protected ResourceLocation texture; + - public Slot(IInventory par1IInventory, int par2, int par3, int par4) + public Slot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { - this.inventory = par1IInventory; -@@ -115,7 +124,7 @@ + this.field_75224_c = p_i1824_1_; +@@ -97,7 +106,7 @@ @SideOnly(Side.CLIENT) - public IIcon getBackgroundIconIndex() + public IIcon func_75212_b() { - return null; + return backgroundIcon; } @SideOnly(Side.CLIENT) -@@ -123,4 +132,46 @@ +@@ -105,4 +114,46 @@ { return true; } @@ -48,7 +48,7 @@ + @SideOnly(Side.CLIENT) + public ResourceLocation getBackgroundIconTexture() + { -+ return (texture == null ? TextureMap.locationItemsTexture : texture); ++ return (texture == null ? TextureMap.field_110576_c : texture); + } + + /** @@ -78,7 +78,7 @@ + */ + public int getSlotIndex() + { -+ return slotIndex; ++ return field_75225_a; + } + /*========================================= FORGE END =====================================*/ } diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index e8540b41f8..5126d6546a 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -9,22 +9,22 @@ public class SlotCrafting extends Slot { -@@ -122,10 +124,16 @@ +@@ -115,10 +117,16 @@ { - this.craftMatrix.decrStackSize(i, 1); + this.field_75239_a.func_70298_a(i, 1); -- if (itemstack1.getItem().hasContainerItem()) -+ if (itemstack1.getItem().hasContainerItem(itemstack1)) +- if (itemstack1.func_77973_b().func_77634_r()) ++ if (itemstack1.func_77973_b().hasContainerItem(itemstack1)) { -- ItemStack itemstack2 = new ItemStack(itemstack1.getItem().getContainerItem()); -+ ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); +- ItemStack itemstack2 = new ItemStack(itemstack1.func_77973_b().func_77668_q()); ++ ItemStack itemstack2 = itemstack1.func_77973_b().getContainerItem(itemstack1); -+ if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) ++ if (itemstack2 != null && itemstack2.func_77984_f() && itemstack2.func_77960_j() > itemstack2.func_77958_k()) + { -+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(field_75238_b, itemstack2)); + continue; + } + - if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) + if (!itemstack1.func_77973_b().func_77630_h(itemstack1) || !this.field_75238_b.field_71071_by.func_70441_a(itemstack2)) { - if (this.craftMatrix.getStackInSlot(i) == null) + if (this.field_75239_a.func_70301_a(i) == null) diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 2507837b85..28437f6303 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -43,61 +43,61 @@ public class Item { -@@ -462,6 +472,7 @@ +@@ -448,6 +458,7 @@ + return p_77654_1_; } - // JAVADOC METHOD $$ func_77639_j + @Deprecated - public int getItemStackLimit() + public int func_77639_j() { - return this.maxStackSize; -@@ -595,6 +606,7 @@ + return this.field_77777_bU; +@@ -566,6 +577,7 @@ + return this.field_77700_c; } - // JAVADOC METHOD $$ func_77634_r + @Deprecated // Use ItemStack sensitive version below. - public boolean hasContainerItem() + public boolean func_77634_r() { - return this.containerItem != null; -@@ -662,6 +674,7 @@ + return this.field_77700_c != null; +@@ -623,6 +635,7 @@ } @SideOnly(Side.CLIENT) + @Deprecated - public boolean hasEffect(ItemStack par1ItemStack) + public boolean func_77636_d(ItemStack p_77636_1_) { - return par1ItemStack.isItemEnchanted(); -@@ -676,7 +689,7 @@ - // JAVADOC METHOD $$ func_77616_k - public boolean isItemTool(ItemStack par1ItemStack) + return p_77636_1_.func_77948_v(); +@@ -635,7 +648,7 @@ + + public boolean func_77616_k(ItemStack p_77616_1_) { -- return this.getItemStackLimit() == 1 && this.isDamageable(); -+ return this.getItemStackLimit(par1ItemStack) == 1 && this.isDamageable(); +- return this.func_77639_j() == 1 && this.func_77645_m(); ++ return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m(); } - protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) -@@ -685,7 +698,7 @@ - float f1 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * f; - float f2 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * f; - double d0 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)f; -- double d1 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)f + 1.62D - (double)par2EntityPlayer.yOffset; -+ double d1 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)f + (double)(par1World.isRemote ? par2EntityPlayer.getEyeHeight() - par2EntityPlayer.getDefaultEyeHeight() : par2EntityPlayer.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences - double d2 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)f; - Vec3 vec3 = par1World.getWorldVec3Pool().getVecFromPool(d0, d1, d2); - float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); -@@ -695,6 +708,10 @@ + protected MovingObjectPosition func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) +@@ -644,7 +657,7 @@ + float f1 = p_77621_2_.field_70127_C + (p_77621_2_.field_70125_A - p_77621_2_.field_70127_C) * f; + float f2 = p_77621_2_.field_70126_B + (p_77621_2_.field_70177_z - p_77621_2_.field_70126_B) * f; + double d0 = p_77621_2_.field_70169_q + (p_77621_2_.field_70165_t - p_77621_2_.field_70169_q) * (double)f; +- double d1 = p_77621_2_.field_70167_r + (p_77621_2_.field_70163_u - p_77621_2_.field_70167_r) * (double)f + 1.62D - (double)p_77621_2_.field_70129_M; ++ double d1 = p_77621_2_.field_70167_r + (p_77621_2_.field_70163_u - p_77621_2_.field_70167_r) * (double)f + (double)(p_77621_1_.field_72995_K ? p_77621_2_.func_70047_e() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.func_70047_e()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences + double d2 = p_77621_2_.field_70166_s + (p_77621_2_.field_70161_v - p_77621_2_.field_70166_s) * (double)f; + Vec3 vec3 = p_77621_1_.func_82732_R().func_72345_a(d0, d1, d2); + float f3 = MathHelper.func_76134_b(-f2 * 0.017453292F - (float)Math.PI); +@@ -654,6 +667,10 @@ float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; -+ if (par2EntityPlayer instanceof EntityPlayerMP) ++ if (p_77621_2_ instanceof EntityPlayerMP) + { -+ d3 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); ++ d3 = ((EntityPlayerMP)p_77621_2_).field_71134_c.getBlockReachDistance(); + } - Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); - return par1World.func_147447_a(vec3, vec31, par3, !par3, false); + Vec3 vec31 = vec3.func_72441_c((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); } -@@ -776,6 +793,542 @@ - return this.iconString == null ? "MISSING_ICON_ITEM_" + itemRegistry.getIDForObject(this) + "_" + this.unlocalizedName : this.iconString; +@@ -726,6 +743,542 @@ + return this.field_111218_cA == null ? "MISSING_ICON_ITEM_" + field_150901_e.func_148757_b(this) + "_" + this.field_77774_bZ : this.field_111218_cA; } + /* ======================================== FORGE START =====================================*/ @@ -150,7 +150,7 @@ + */ + public boolean isRepairable() + { -+ return canRepair && isDamageable(); ++ return canRepair && func_77645_m(); + } + + /** @@ -230,7 +230,7 @@ + */ + public int getRenderPasses(int metadata) + { -+ return requiresMultipleRenderPasses() ? 2 : 1; ++ return func_77623_v() ? 2 : 1; + } + + /** @@ -246,7 +246,7 @@ + { + return null; + } -+ return new ItemStack(getContainerItem()); ++ return new ItemStack(func_77668_q()); + } + + /** @@ -256,7 +256,7 @@ + */ + public boolean hasContainerItem(ItemStack stack) + { -+ return hasContainerItem(); ++ return func_77634_r(); + } + + /** @@ -321,7 +321,7 @@ + */ + public CreativeTabs[] getCreativeTabs() + { -+ return new CreativeTabs[]{ getCreativeTab() }; ++ return new CreativeTabs[]{ func_77640_w() }; + } + + /** @@ -347,7 +347,7 @@ + */ + public IIcon getIcon(ItemStack stack, int pass) + { -+ return getIconFromDamageForRenderPass(stack.getItemDamage(), pass); ++ return func_77618_c(stack.func_77960_j(), pass); + } + + /** @@ -364,8 +364,8 @@ + if (this instanceof ItemEnchantedBook) + { + return ((ItemEnchantedBook)this).func_92112_a(rnd, -+ original.theMinimumChanceToGenerateItem, -+ original.theMaximumChanceToGenerateItem, original.itemWeight); ++ original.field_76295_d, ++ original.field_76296_e, original.field_76292_a); + } + return original; + } @@ -410,12 +410,12 @@ + { + if (this instanceof ItemArmor) + { -+ return ((ItemArmor)this).armorType == armorType; ++ return ((ItemArmor)this).field_77881_a == armorType; + } + + if (armorType == 0) + { -+ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; ++ return this == Item.func_150898_a(Blocks.field_150423_aK) || this == Items.field_151144_bL; + } + + return false; @@ -514,7 +514,7 @@ + */ + public int getDamage(ItemStack stack) + { -+ return stack.itemDamage; ++ return stack.field_77991_e; + } + + /** @@ -524,7 +524,7 @@ + */ + public int getDisplayDamage(ItemStack stack) + { -+ return stack.itemDamage; ++ return stack.field_77991_e; + } + + /** @@ -536,7 +536,7 @@ + */ + public int getMaxDamage(ItemStack stack) + { -+ return getMaxDamage(); ++ return func_77612_l(); + } + + /** @@ -546,7 +546,7 @@ + */ + public boolean isDamaged(ItemStack stack) + { -+ return stack.itemDamage > 0; ++ return stack.field_77991_e > 0; + } + + /** @@ -556,11 +556,11 @@ + */ + public void setDamage(ItemStack stack, int damage) + { -+ stack.itemDamage = damage; ++ stack.field_77991_e = damage; + -+ if (stack.itemDamage < 0) ++ if (stack.field_77991_e < 0) + { -+ stack.itemDamage = 0; ++ stack.field_77991_e = 0; + } + } + @@ -581,7 +581,7 @@ + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack par1ItemStack, int pass) + { -+ return hasEffect(par1ItemStack) && (pass == 0 || this != Items.potionitem); ++ return func_77636_d(par1ItemStack) && (pass == 0 || this != Items.field_151068_bn); + } + + /** @@ -593,7 +593,7 @@ + */ + public int getItemStackLimit(ItemStack stack) + { -+ return this.getItemStackLimit(); ++ return this.func_77639_j(); + } + + private HashMap toolClasses = new HashMap(); @@ -639,28 +639,28 @@ public static enum ToolMaterial { WOOD(0, 59, 2.0F, 0.0F, 15), -@@ -796,6 +1349,9 @@ +@@ -741,6 +1294,9 @@ private static final String __OBFID = "CL_00000042"; + //Added by forge for custom Tool materials. + public Item customCraftingMaterial = null; + - private ToolMaterial(int par3, int par4, float par5, float par6, int par7) + private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) { - this.harvestLevel = par3; -@@ -837,7 +1393,15 @@ + this.field_78001_f = p_i1874_3_; +@@ -777,7 +1333,15 @@ public Item func_150995_f() { -- return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); +- return this == WOOD ? Item.func_150898_a(Blocks.field_150344_f) : (this == STONE ? Item.func_150898_a(Blocks.field_150347_e) : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == EMERALD ? Items.field_151045_i : null)))); + switch (this) + { -+ case WOOD: return Item.getItemFromBlock(Blocks.planks); -+ case STONE: return Item.getItemFromBlock(Blocks.cobblestone); -+ case GOLD: return Items.gold_ingot; -+ case IRON: return Items.iron_ingot; -+ case EMERALD: return Items.diamond; ++ case WOOD: return Item.func_150898_a(Blocks.field_150344_f); ++ case STONE: return Item.func_150898_a(Blocks.field_150347_e); ++ case GOLD: return Items.field_151043_k; ++ case IRON: return Items.field_151042_j; ++ case EMERALD: return Items.field_151045_i; + default: return customCraftingMaterial; + } } diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index 14e34af872..8c21039da5 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -1,36 +1,36 @@ --- ../src-base/minecraft/net/minecraft/item/ItemArmor.java +++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java -@@ -235,7 +235,7 @@ +@@ -221,7 +221,7 @@ if (itemstack1 == null) { -- par3EntityPlayer.setCurrentItemOrArmor(i, par1ItemStack.copy()); -+ par3EntityPlayer.setCurrentItemOrArmor(i + 1, par1ItemStack.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. - par1ItemStack.stackSize = 0; +- p_77659_3_.func_70062_b(i, p_77659_1_.func_77946_l()); ++ p_77659_3_.func_70062_b(i + 1, p_77659_1_.func_77946_l()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. + p_77659_1_.field_77994_a = 0; } -@@ -276,6 +276,9 @@ +@@ -259,6 +259,9 @@ private static final String __OBFID = "CL_00001768"; + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; + - private ArmorMaterial(int par3, int[] par4ArrayOfInteger, int par5) + private ArmorMaterial(int p_i1827_3_, int[] p_i1827_4_, int p_i1827_5_) { - this.maxDamageFactor = par3; -@@ -303,7 +306,15 @@ + this.field_78048_f = p_i1827_3_; +@@ -283,7 +286,15 @@ public Item func_151685_b() { -- return this == CLOTH ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null)))); +- return this == CLOTH ? Items.field_151116_aA : (this == CHAIN ? Items.field_151042_j : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == DIAMOND ? Items.field_151045_i : null)))); + switch (this) + { -+ case CLOTH: return Items.leather; -+ case CHAIN: return Items.iron_ingot; -+ case GOLD: return Items.gold_ingot; -+ case IRON: return Items.iron_ingot; -+ case DIAMOND: return Items.diamond; ++ case CLOTH: return Items.field_151116_aA; ++ case CHAIN: return Items.field_151042_j; ++ case GOLD: return Items.field_151043_k; ++ case IRON: return Items.field_151042_j; ++ case DIAMOND: return Items.field_151045_i; + default: return customCraftingMaterial; + } } diff --git a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch index d3cbd0c8cd..b5533470ea 100644 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -1,41 +1,41 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBlock.java +++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java -@@ -54,7 +54,7 @@ +@@ -50,7 +50,7 @@ { - par7 = 1; + p_77648_7_ = 1; } -- else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush) -+ else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(par3World, par4, par5, par6)) +- else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I) ++ else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I && !block.isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) { - if (par7 == 0) + if (p_77648_7_ == 0) { -@@ -104,14 +104,8 @@ - int i1 = this.getMetadata(par1ItemStack.getItemDamage()); - int j1 = this.field_150939_a.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, i1); +@@ -100,14 +100,8 @@ + int i1 = this.func_77647_b(p_77648_1_.func_77960_j()); + int j1 = this.field_150939_a.func_149660_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, i1); -- if (par3World.setBlock(par4, par5, par6, this.field_150939_a, j1, 3)) -+ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, j1)) +- if (p_77648_3_.func_147465_d(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150939_a, j1, 3)) ++ if (placeBlockAt(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, j1)) { -- if (par3World.getBlock(par4, par5, par6) == this.field_150939_a) +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_150939_a) - { -- this.field_150939_a.onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); -- this.field_150939_a.onPostBlockPlaced(par3World, par4, par5, par6, j1); +- this.field_150939_a.func_149689_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_, p_77648_1_); +- this.field_150939_a.func_149714_e(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, j1); - } - - par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150939_a.stepSound.getPitch() * 0.8F); - --par1ItemStack.stackSize; + p_77648_3_.func_72908_a((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150939_a.field_149762_H.func_150496_b(), (this.field_150939_a.field_149762_H.func_150497_c() + 1.0F) / 2.0F, this.field_150939_a.field_149762_H.func_150494_d() * 0.8F); + --p_77648_1_.field_77994_a; } -@@ -133,7 +127,7 @@ +@@ -129,7 +123,7 @@ { p_150936_5_ = 1; } -- else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush) -+ else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(p_150936_1_, p_150936_2_, p_150936_3_, p_150936_4_)) +- else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I) ++ else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I && !block.isReplaceable(p_150936_1_, p_150936_2_, p_150936_3_, p_150936_4_)) { if (p_150936_5_ == 0) { -@@ -205,4 +199,29 @@ - this.field_150938_b = par1IconRegister.registerIcon(s); +@@ -197,4 +191,29 @@ + this.field_150938_b = p_94581_1_.func_94245_a(s); } } + @@ -50,15 +50,15 @@ + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + -+ if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) ++ if (!world.func_147465_d(x, y, z, field_150939_a, metadata, 3)) + { + return false; + } + -+ if (world.getBlock(x, y, z) == field_150939_a) ++ if (world.func_147439_a(x, y, z) == field_150939_a) + { -+ field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); -+ field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); ++ field_150939_a.func_149689_a(world, x, y, z, player, stack); ++ field_150939_a.func_149714_e(world, x, y, z, metadata); + } + + return true; diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index 9035cb5c13..8f47865d36 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -10,13 +10,13 @@ public class ItemBow extends Item { -@@ -29,11 +32,20 @@ - // JAVADOC METHOD $$ func_77615_a - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) +@@ -28,11 +31,20 @@ + + public void func_77615_a(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { -+ int j = this.getMaxItemUseDuration(par1ItemStack) - par4; ++ int j = this.func_77626_a(p_77615_1_) - p_77615_4_; + -+ ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j); ++ ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) + { @@ -24,25 +24,25 @@ + } + j = event.charge; + - boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; + boolean flag = p_77615_3_.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantment.field_77342_w.field_77352_x, p_77615_1_) > 0; - if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow)) + if (flag || p_77615_3_.field_71071_by.func_146028_b(Items.field_151032_g)) { -- int j = this.getMaxItemUseDuration(par1ItemStack) - par4; +- int j = this.func_77626_a(p_77615_1_) - p_77615_4_; float f = (float)j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; -@@ -112,6 +124,13 @@ - // JAVADOC METHOD $$ func_77659_a - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) +@@ -108,6 +120,13 @@ + + public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { -+ ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack); ++ ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) + { + return event.result; + } + - if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow)) + if (p_77659_3_.field_71075_bZ.field_75098_d || p_77659_3_.field_71071_by.func_146028_b(Items.field_151032_g)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + p_77659_3_.func_71008_a(p_77659_1_, this.func_77626_a(p_77659_1_)); diff --git a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch index 3be8a33ed9..bff933b1cd 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -10,35 +10,35 @@ public class ItemBucket extends Item { -@@ -34,6 +37,31 @@ +@@ -32,6 +35,31 @@ } else { -+ FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition); ++ FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition); + if (MinecraftForge.EVENT_BUS.post(event)) + { -+ return par1ItemStack; ++ return p_77659_1_; + } + + if (event.getResult() == Event.Result.ALLOW) + { -+ if (par3EntityPlayer.capabilities.isCreativeMode) ++ if (p_77659_3_.field_71075_bZ.field_75098_d) + { -+ return par1ItemStack; ++ return p_77659_1_; + } + -+ if (--par1ItemStack.stackSize <= 0) ++ if (--p_77659_1_.field_77994_a <= 0) + { + return event.result; + } + -+ if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result)) ++ if (!p_77659_3_.field_71071_by.func_70441_a(event.result)) + { -+ par3EntityPlayer.dropPlayerItemWithRandomChoice(event.result, false); ++ p_77659_3_.func_71019_a(event.result, false); + } + -+ return par1ItemStack; ++ return p_77659_1_; + } - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; + int i = movingobjectposition.field_72311_b; diff --git a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index defdbb5697..30a8765574 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java @@ -24,7 +24,7 @@ - if (!par2World.isRemote) + if (!p_77654_2_.field_72995_K) { -- par3EntityPlayer.clearActivePotions(); -+ par3EntityPlayer.curePotionEffects(par1ItemStack); +- p_77654_3_.func_70674_bp(); ++ p_77654_3_.curePotionEffects(p_77654_1_); } - return par1ItemStack.stackSize <= 0 ? new ItemStack(Items.bucket) : par1ItemStack; + return p_77654_1_.field_77994_a <= 0 ? new ItemStack(Items.field_151133_ar) : p_77654_1_; diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index 098ab6e442..e1f4cf4055 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -18,16 +18,16 @@ public class ItemDye extends Item { -@@ -60,7 +65,7 @@ +@@ -57,7 +62,7 @@ { - if (par1ItemStack.getItemDamage() == 15) + if (p_77648_1_.func_77960_j() == 15) { -- if (func_150919_a(par1ItemStack, par3World, par4, par5, par6)) -+ if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) +- if (func_150919_a(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) ++ if (applyBonemeal(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_)) { - if (!par3World.isRemote) + if (!p_77648_3_.field_72995_K) { -@@ -128,8 +133,30 @@ +@@ -125,8 +130,30 @@ public static boolean func_150919_a(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_) { @@ -38,7 +38,7 @@ + + public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) + { - Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_); + Block block = p_150919_1_.func_147439_a(p_150919_2_, p_150919_3_, p_150919_4_); + BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_); + if (MinecraftForge.EVENT_BUS.post(event)) @@ -48,9 +48,9 @@ + + if (event.getResult() == Result.ALLOW) + { -+ if (!p_150919_1_.isRemote) ++ if (!p_150919_1_.field_72995_K) + { -+ p_150919_0_.stackSize--; ++ p_150919_0_.field_77994_a--; + } + return true; + } @@ -58,20 +58,20 @@ if (block instanceof IGrowable) { IGrowable igrowable = (IGrowable)block; -@@ -175,6 +202,16 @@ - p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); +@@ -172,6 +199,16 @@ + p_150918_0_.func_72869_a("happyVillager", (double)((float)p_150918_1_ + field_77697_d.nextFloat()), (double)p_150918_2_ + (double)field_77697_d.nextFloat() * block.func_149669_A(), (double)((float)p_150918_3_ + field_77697_d.nextFloat()), d0, d1, d2); } } + else + { + for (int i1 = 0; i1 < p_150918_4_; ++i1) + { -+ double d0 = itemRand.nextGaussian() * 0.02D; -+ double d1 = itemRand.nextGaussian() * 0.02D; -+ double d2 = itemRand.nextGaussian() * 0.02D; -+ p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * 1.0f, (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); ++ double d0 = field_77697_d.nextGaussian() * 0.02D; ++ double d1 = field_77697_d.nextGaussian() * 0.02D; ++ double d2 = field_77697_d.nextGaussian() * 0.02D; ++ p_150918_0_.func_72869_a("happyVillager", (double)((float)p_150918_1_ + field_77697_d.nextFloat()), (double)p_150918_2_ + (double)field_77697_d.nextFloat() * 1.0f, (double)((float)p_150918_3_ + field_77697_d.nextFloat()), d0, d1, d2); + } + } } - // JAVADOC METHOD $$ func_111207_a + public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) diff --git a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch index 62bda6e1c8..572f9373a9 100644 --- a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java +++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java -@@ -56,7 +56,7 @@ +@@ -55,7 +55,7 @@ } else { -- if (par3World.getBlock(par4, par5, par6).getMaterial() == Material.air) -+ if (par3World.isAirBlock(par4, par5, par6)) +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).func_149688_o() == Material.field_151579_a) ++ if (p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_, p_77648_6_)) { - par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - par3World.setBlock(par4, par5, par6, Blocks.fire); + p_77648_3_.func_72908_a((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.field_150480_ab); diff --git a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch index d012875c16..4cd796265e 100644 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -16,11 +16,11 @@ public class ItemHoe extends Item { -@@ -31,9 +34,21 @@ +@@ -30,9 +33,21 @@ } else { -+ UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6); ++ UseHoeEvent event = new UseHoeEvent(p_77648_2_, p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; @@ -28,14 +28,14 @@ + + if (event.getResult() == Result.ALLOW) + { -+ par1ItemStack.damageItem(1, par2EntityPlayer); ++ p_77648_1_.func_77972_a(1, p_77648_2_); + return true; + } + - Block block = par3World.getBlock(par4, par5, par6); + Block block = p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_); -- if (par7 != 0 && par3World.getBlock(par4, par5 + 1, par6).getMaterial() == Material.air && (block == Blocks.grass || block == Blocks.dirt)) -+ if (par7 != 0 && par3World.getBlock(par4, par5 + 1, par6).isAir(par3World, par4, par5 + 1, par6) && (block == Blocks.grass || block == Blocks.dirt)) +- if (p_77648_7_ != 0 && p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_).func_149688_o() == Material.field_151579_a && (block == Blocks.field_150349_c || block == Blocks.field_150346_d)) ++ if (p_77648_7_ != 0 && p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.field_150349_c || block == Blocks.field_150346_d)) { - Block block1 = Blocks.farmland; - par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + Block block1 = Blocks.field_150458_ak; + p_77648_3_.func_72908_a((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.field_149762_H.func_150498_e(), (block1.field_149762_H.func_150497_c() + 1.0F) / 2.0F, block1.field_149762_H.func_150494_d() * 0.8F); diff --git a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch index dfda47ab57..1ae2786d9a 100644 --- a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch @@ -8,16 +8,16 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; -@@ -25,7 +26,7 @@ - this.recordName = p_i45350_1_; - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabMisc); +@@ -24,7 +25,7 @@ + this.field_150929_a = p_i45350_1_; + this.field_77777_bU = 1; + this.func_77637_a(CreativeTabs.field_78026_f); - field_150928_b.put(p_i45350_1_, this); + field_150928_b.put("records." + p_i45350_1_, this); //Forge Bug Fix: RenderGlobal adds a "records." when looking up below. } - // JAVADOC METHOD $$ func_77617_a -@@ -83,4 +84,15 @@ + @SideOnly(Side.CLIENT) +@@ -77,4 +78,15 @@ { return (ItemRecord)field_150928_b.get(p_150926_0_); } diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 12b50d0232..687666d937 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -14,17 +14,17 @@ +public class ItemSeedFood extends ItemFood implements IPlantable { private Block field_150908_b; - // JAVADOC FIELD $$ field_82809_c -@@ -27,7 +31,7 @@ + private Block field_82809_c; +@@ -25,7 +29,7 @@ } - else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) + else if (p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) { -- if (par3World.getBlock(par4, par5, par6) == this.soilId && par3World.isAirBlock(par4, par5 + 1, par6)) -+ if (par3World.getBlock(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6)) +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_82809_c && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) ++ if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) { - par3World.setBlock(par4, par5 + 1, par6, this.field_150908_b); - --par1ItemStack.stackSize; -@@ -43,4 +47,22 @@ + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150908_b); + --p_77648_1_.field_77994_a; +@@ -41,4 +45,22 @@ return false; } } diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index be480601d9..697ffac1a8 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -15,17 +15,17 @@ +public class ItemSeeds extends Item implements IPlantable { private Block field_150925_a; - // JAVADOC FIELD $$ field_77838_b -@@ -28,7 +33,7 @@ + private Block field_77838_b; +@@ -26,7 +31,7 @@ } - else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) + else if (p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) { -- if (par3World.getBlock(par4, par5, par6) == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6)) -+ if (par3World.getBlock(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6)) +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_77838_b && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) ++ if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) { - par3World.setBlock(par4, par5 + 1, par6, this.field_150925_a); - --par1ItemStack.stackSize; -@@ -44,4 +49,22 @@ + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a); + --p_77648_1_.field_77994_a; +@@ -42,4 +47,22 @@ return false; } } @@ -33,7 +33,7 @@ + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { -+ return field_150925_a == Blocks.nether_wart ? EnumPlantType.Nether : EnumPlantType.Crop; ++ return field_150925_a == Blocks.field_150388_bm ? EnumPlantType.Nether : EnumPlantType.Crop; + } + + @Override diff --git a/patches/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch index bfc1429ee3..fdded4de9b 100644 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemShears.java.patch @@ -23,48 +23,48 @@ { @@ -20,13 +29,12 @@ - public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + public boolean func_150894_a(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { -- if (p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire) -+ if (p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire && !(p_150894_3_ instanceof IShearable)) +- if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.field_150321_G && p_150894_3_ != Blocks.field_150329_H && p_150894_3_ != Blocks.field_150395_bd && p_150894_3_ != Blocks.field_150473_bD) ++ if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.field_150321_G && p_150894_3_ != Blocks.field_150329_H && p_150894_3_ != Blocks.field_150395_bd && p_150894_3_ != Blocks.field_150473_bD && !(p_150894_3_ instanceof IShearable)) { - return super.onBlockDestroyed(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); + return super.func_150894_a(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); } else { -- p_150894_1_.damageItem(1, p_150894_7_); +- p_150894_1_.func_77972_a(1, p_150894_7_); return true; } } @@ -40,4 +48,69 @@ { - return p_150893_2_ != Blocks.web && p_150893_2_.getMaterial() != Material.leaves ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; + return p_150893_2_ != Blocks.field_150321_G && p_150893_2_.func_149688_o() != Material.field_151584_j ? (p_150893_2_ == Blocks.field_150325_L ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; } + + @Override -+ public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) ++ public boolean func_111207_a(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) + { -+ if (entity.worldObj.isRemote) ++ if (entity.field_70170_p.field_72995_K) + { + return false; + } + if (entity instanceof IShearable) + { + IShearable target = (IShearable)entity; -+ if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) ++ if (target.isShearable(itemstack, entity.field_70170_p, (int)entity.field_70165_t, (int)entity.field_70163_u, (int)entity.field_70161_v)) + { -+ ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); ++ ArrayList drops = target.onSheared(itemstack, entity.field_70170_p, (int)entity.field_70165_t, (int)entity.field_70163_u, (int)entity.field_70161_v, ++ EnchantmentHelper.func_77506_a(Enchantment.field_77346_s.field_77352_x, itemstack)); + + Random rand = new Random(); + for(ItemStack stack : drops) + { -+ EntityItem ent = entity.entityDropItem(stack, 1.0F); -+ ent.motionY += rand.nextFloat() * 0.05F; -+ ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; -+ ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ EntityItem ent = entity.func_70099_a(stack, 1.0F); ++ ent.field_70181_x += rand.nextFloat() * 0.05F; ++ ent.field_70159_w += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ ent.field_70179_y += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + } -+ itemstack.damageItem(1, entity); ++ itemstack.func_77972_a(1, entity); + } + return true; + } @@ -74,18 +74,18 @@ + @Override + public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) + { -+ if (player.worldObj.isRemote) ++ if (player.field_70170_p.field_72995_K) + { + return false; + } -+ Block block = player.worldObj.getBlock(x, y, z); ++ Block block = player.field_70170_p.func_147439_a(x, y, z); + if (block instanceof IShearable) + { + IShearable target = (IShearable)block; -+ if (target.isShearable(itemstack, player.worldObj, x, y, z)) ++ if (target.isShearable(itemstack, player.field_70170_p, x, y, z)) + { -+ ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, -+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); ++ ArrayList drops = target.onSheared(itemstack, player.field_70170_p, x, y, z, ++ EnchantmentHelper.func_77506_a(Enchantment.field_77346_s.field_77352_x, itemstack)); + Random rand = new Random(); + + for(ItemStack stack : drops) @@ -94,13 +94,13 @@ + double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack); -+ entityitem.delayBeforeCanPickup = 10; -+ player.worldObj.spawnEntityInWorld(entityitem); ++ EntityItem entityitem = new EntityItem(player.field_70170_p, (double)x + d, (double)y + d1, (double)z + d2, stack); ++ entityitem.field_145804_b = 10; ++ player.field_70170_p.func_72838_d(entityitem); + } + -+ itemstack.damageItem(1, player); -+ player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); ++ itemstack.func_77972_a(1, player); ++ player.func_71064_a(StatList.field_75934_C[Block.func_149682_b(block)], 1); + } + } + return false; diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 908b44711e..ab329adcb3 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -8,109 +8,105 @@ public final class ItemStack { -@@ -192,7 +193,7 @@ - // JAVADOC METHOD $$ func_77976_d - public int getMaxStackSize() +@@ -180,7 +181,7 @@ + + public int func_77976_d() { -- return this.getItem().getItemStackLimit(); -+ return this.getItem().getItemStackLimit(this); +- return this.func_77973_b().func_77639_j(); ++ return this.func_77973_b().getItemStackLimit(this); } - // JAVADOC METHOD $$ func_77985_e -@@ -204,7 +205,7 @@ - // JAVADOC METHOD $$ func_77984_f - public boolean isItemStackDamageable() + public boolean func_77985_e() +@@ -190,7 +191,7 @@ + + public boolean func_77984_f() { -- return this.field_151002_e.getMaxDamage() <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable"); -+ return this.field_151002_e.getMaxDamage(this) <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable"); +- return this.field_151002_e.func_77612_l() <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable"); ++ return this.field_151002_e.getMaxDamage(this) <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable"); } - public boolean getHasSubtypes() -@@ -215,36 +216,31 @@ - // JAVADOC METHOD $$ func_77951_h - public boolean isItemDamaged() + public boolean func_77981_g() +@@ -200,32 +201,27 @@ + + public boolean func_77951_h() { -- return this.isItemStackDamageable() && this.itemDamage > 0; -+ return this.isItemStackDamageable() && getItem().isDamaged(this); +- return this.func_77984_f() && this.field_77991_e > 0; ++ return this.func_77984_f() && func_77973_b().isDamaged(this); } - // JAVADOC METHOD $$ func_77952_i - public int getItemDamageForDisplay() + public int func_77952_i() { -- return this.itemDamage; -+ return getItem().getDisplayDamage(this); +- return this.field_77991_e; ++ return func_77973_b().getDisplayDamage(this); } - // JAVADOC METHOD $$ func_77960_j - public int getItemDamage() + public int func_77960_j() { -- return this.itemDamage; -+ return getItem().getDamage(this); +- return this.field_77991_e; ++ return func_77973_b().getDamage(this); } - // JAVADOC METHOD $$ func_77964_b - public void setItemDamage(int par1) + public void func_77964_b(int p_77964_1_) { -- this.itemDamage = par1; +- this.field_77991_e = p_77964_1_; - -- if (this.itemDamage < 0) +- if (this.field_77991_e < 0) - { -- this.itemDamage = 0; +- this.field_77991_e = 0; - } -+ getItem().setDamage(this, par1); ++ func_77973_b().setDamage(this, p_77964_1_); } - // JAVADOC METHOD $$ func_77958_k - public int getMaxDamage() + public int func_77958_k() { -- return this.field_151002_e.getMaxDamage(); -+ return getItem().getMaxDamage(this); +- return this.field_151002_e.func_77612_l(); ++ return func_77973_b().getMaxDamage(this); } - // JAVADOC METHOD $$ func_96631_a -@@ -277,8 +273,8 @@ + public boolean func_96631_a(int p_96631_1_, Random p_96631_2_) +@@ -257,8 +253,8 @@ } } -- this.itemDamage += par1; -- return this.itemDamage > this.getMaxDamage(); -+ setItemDamage(getItemDamage() + par1); //Redirect through Item's callback if applicable. -+ return getItemDamage() > getMaxDamage(); +- this.field_77991_e += p_96631_1_; +- return this.field_77991_e > this.func_77958_k(); ++ func_77964_b(func_77960_j() + p_96631_1_); //Redirect through Item's callback if applicable. ++ return func_77960_j() > func_77958_k(); } } -@@ -339,7 +335,7 @@ +@@ -317,7 +313,7 @@ public boolean func_150998_b(Block p_150998_1_) { - return this.field_151002_e.func_150897_b(p_150998_1_); -+ return getItem().canHarvestBlock(p_150998_1_, this); ++ return func_77973_b().canHarvestBlock(p_150998_1_, this); } - public boolean interactWithEntity(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) -@@ -653,16 +649,24 @@ + public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_) +@@ -618,16 +614,24 @@ { - arraylist.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); + arraylist.add("Durability: " + (this.func_77958_k() - this.func_77952_i()) + " / " + this.func_77958_k()); } -+ ForgeEventFactory.onItemTooltip(this, par1EntityPlayer, arraylist, par2); ++ ForgeEventFactory.onItemTooltip(this, p_82840_1_, arraylist, p_82840_2_); return arraylist; } + @Deprecated @SideOnly(Side.CLIENT) - public boolean hasEffect() + public boolean func_77962_s() { -- return this.getItem().hasEffect(this); +- return this.func_77973_b().func_77636_d(this); + return hasEffect(0); } + @SideOnly(Side.CLIENT) + public boolean hasEffect(int pass) + { -+ return this.getItem().hasEffect(this, pass); ++ return this.func_77973_b().hasEffect(this, pass); + } + - public EnumRarity getRarity() + public EnumRarity func_77953_t() { - return this.getItem().getRarity(this); + return this.func_77973_b().func_77613_e(this); diff --git a/patches/minecraft/net/minecraft/item/ItemTool.java.patch b/patches/minecraft/net/minecraft/item/ItemTool.java.patch index 12c60c640a..c59633eb5e 100644 --- a/patches/minecraft/net/minecraft/item/ItemTool.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemTool.java.patch @@ -15,10 +15,10 @@ public class ItemTool extends Item { -@@ -30,6 +32,18 @@ - this.efficiencyOnProperMaterial = p_i45333_2_.getEfficiencyOnProperMaterial(); - this.damageVsEntity = p_i45333_1_ + p_i45333_2_.getDamageVsEntity(); - this.setCreativeTab(CreativeTabs.tabTools); +@@ -28,6 +30,18 @@ + this.field_77864_a = p_i45333_2_.func_77998_b(); + this.field_77865_bY = p_i45333_1_ + p_i45333_2_.func_78000_c(); + this.func_77637_a(CreativeTabs.field_78040_i); + if (this instanceof ItemPickaxe) + { + toolClass = "pickaxe"; @@ -34,8 +34,8 @@ } public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) -@@ -91,4 +105,37 @@ - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0)); +@@ -83,4 +97,37 @@ + multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.field_77865_bY, 0)); return multimap; } + @@ -47,7 +47,7 @@ + int level = super.getHarvestLevel(stack, toolClass); + if (level == -1 && toolClass != null && toolClass.equals(this.toolClass)) + { -+ return this.toolMaterial.getHarvestLevel(); ++ return this.field_77862_b.func_77996_d(); + } + else + { @@ -66,7 +66,7 @@ + { + if (ForgeHooks.isToolEffective(stack, block, meta)) + { -+ return efficiencyOnProperMaterial; ++ return field_77864_a; + } + return super.getDigSpeed(stack, block, meta); + } diff --git a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch index 74df56574c..ed515cbc7a 100644 --- a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/CraftingManager.java +++ ../src-work/minecraft/net/minecraft/item/crafting/CraftingManager.java -@@ -303,7 +303,7 @@ +@@ -299,7 +299,7 @@ } } -- if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isDamageable()) -+ if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) +- if (i == 2 && itemstack.func_77973_b() == itemstack1.func_77973_b() && itemstack.field_77994_a == 1 && itemstack1.field_77994_a == 1 && itemstack.func_77973_b().func_77645_m()) ++ if (i == 2 && itemstack.func_77973_b() == itemstack1.func_77973_b() && itemstack.field_77994_a == 1 && itemstack1.field_77994_a == 1 && itemstack.func_77973_b().isRepairable()) { - Item item = itemstack.getItem(); - int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + Item item = itemstack.func_77973_b(); + int j1 = item.func_77612_l() - itemstack.func_77952_i(); diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index aacbd2ad86..d5a9159a1b 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -@@ -110,6 +110,9 @@ +@@ -107,6 +107,9 @@ public float func_151398_b(ItemStack p_151398_1_) { -+ float ret = p_151398_1_.getItem().getSmeltingExperience(p_151398_1_); ++ float ret = p_151398_1_.func_77973_b().getSmeltingExperience(p_151398_1_); + if (ret != -1) return ret; + - Iterator iterator = this.experienceList.entrySet().iterator(); + Iterator iterator = this.field_77605_c.entrySet().iterator(); Entry entry; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch index 50dfffdad6..ebb53f2b01 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java +++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java -@@ -90,9 +90,9 @@ +@@ -89,9 +89,9 @@ { - this.field_92102_a = new ItemStack(Items.fireworks); + this.field_92102_a = new ItemStack(Items.field_151152_bP); + nbttagcompound = new NBTTagCompound(); if (l > 0) @@ -11,13 +11,13 @@ nbttagcompound1 = new NBTTagCompound(); NBTTagList nbttaglist = new NBTTagList(); -@@ -109,8 +109,8 @@ - nbttagcompound1.setTag("Explosions", nbttaglist); - nbttagcompound1.setByte("Flight", (byte)j); - nbttagcompound.setTag("Fireworks", nbttagcompound1); -- this.field_92102_a.setTagCompound(nbttagcompound); +@@ -108,8 +108,8 @@ + nbttagcompound1.func_74782_a("Explosions", nbttaglist); + nbttagcompound1.func_74774_a("Flight", (byte)j); + nbttagcompound.func_74782_a("Fireworks", nbttagcompound1); +- this.field_92102_a.func_77982_d(nbttagcompound); } -+ this.field_92102_a.setTagCompound(nbttagcompound); //Forge BugFix: NPE Protection ++ this.field_92102_a.func_77982_d(nbttagcompound); //Forge BugFix: NPE Protection return true; } diff --git a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch index 028a939699..d7f9ba99e6 100644 --- a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -8,27 +8,27 @@ import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -@@ -92,7 +90,6 @@ +@@ -90,7 +88,6 @@ return bytearrayoutputstream.toByteArray(); } - @SideOnly(Side.CLIENT) - public static void safeWrite(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException + public static void func_74793_a(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException { - File file2 = new File(par1File.getAbsolutePath() + "_tmp"); -@@ -179,7 +176,6 @@ + File file2 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); +@@ -176,7 +173,6 @@ } } - @SideOnly(Side.CLIENT) - public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException + public static void func_74795_b(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException { - DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(par1File)); -@@ -194,7 +190,6 @@ + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); +@@ -191,7 +187,6 @@ } } - @SideOnly(Side.CLIENT) - public static NBTTagCompound read(File par0File) throws IOException + public static NBTTagCompound func_74797_a(File p_74797_0_) throws IOException { - if (!par0File.exists()) + if (!p_74797_0_.exists()) diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch index 0be14b62ef..afb69e4d77 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch @@ -8,19 +8,19 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -@@ -96,7 +94,6 @@ - this.tagList.add(par1NBTBase); +@@ -90,7 +88,6 @@ + this.field_74747_a.add(p_74742_1_); } - @SideOnly(Side.CLIENT) public void func_150304_a(int p_150304_1_, NBTBase p_150304_2_) { - if (p_150304_1_ >= 0 && p_150304_1_ < this.tagList.size()) -@@ -120,7 +117,6 @@ + if (p_150304_1_ >= 0 && p_150304_1_ < this.field_74747_a.size()) +@@ -113,7 +110,6 @@ + } } - // JAVADOC METHOD $$ func_74744_a - @SideOnly(Side.CLIENT) - public NBTBase removeTag(int par1) + public NBTBase func_74744_a(int p_74744_1_) { - return (NBTBase)this.tagList.remove(par1); + return (NBTBase)this.field_74747_a.remove(p_74744_1_); diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index 5bc4f47d11..6d8ca05a90 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -14,134 +14,134 @@ + public class NetHandlerPlayServer implements INetHandlerPlayServer { - private static final Logger logger = LogManager.getLogger(); -@@ -229,6 +237,11 @@ - this.playerEntity.ridingEntity.updateRiderPosition(); + private static final Logger field_147370_c = LogManager.getLogger(); +@@ -219,6 +227,11 @@ + this.field_147369_b.field_70154_o.func_70043_V(); } -+ if (!this.hasMoved) //Fixes teleportation kick while riding entities ++ if (!this.field_147380_r) //Fixes teleportation kick while riding entities + { + return; + } + - this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); - if (this.hasMoved) -@@ -306,9 +319,10 @@ - d4 = d1 - this.playerEntity.posX; - double d5 = d2 - this.playerEntity.posY; - double d6 = d3 - this.playerEntity.posZ; -- double d7 = Math.min(Math.abs(d4), Math.abs(this.playerEntity.motionX)); -- double d8 = Math.min(Math.abs(d5), Math.abs(this.playerEntity.motionY)); -- double d9 = Math.min(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); + if (this.field_147380_r) +@@ -296,9 +309,10 @@ + d4 = d1 - this.field_147369_b.field_70165_t; + double d5 = d2 - this.field_147369_b.field_70163_u; + double d6 = d3 - this.field_147369_b.field_70161_v; +- double d7 = Math.min(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w)); +- double d8 = Math.min(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x)); +- double d9 = Math.min(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y)); + //BUGFIX: min -> max, grabs the highest distance -+ double d7 = Math.max(Math.abs(d4), Math.abs(this.playerEntity.motionX)); -+ double d8 = Math.max(Math.abs(d5), Math.abs(this.playerEntity.motionY)); -+ double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); ++ double d7 = Math.max(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w)); ++ double d8 = Math.max(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x)); ++ double d9 = Math.max(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y)); double d10 = d7 * d7 + d8 * d8 + d9 * d9; - if (d10 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) -@@ -326,6 +340,11 @@ - this.playerEntity.jump(); + if (d10 > 100.0D && (!this.field_147367_d.func_71264_H() || !this.field_147367_d.func_71214_G().equals(this.field_147369_b.func_70005_c_()))) +@@ -316,6 +330,11 @@ + this.field_147369_b.func_70664_aZ(); } -+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.playerEntity.moveEntity(d4, d5, d6); - this.playerEntity.onGround = p_147347_1_.func_149465_i(); - this.playerEntity.addMovementStat(d4, d5, d6); -@@ -348,10 +367,15 @@ - logger.warn(this.playerEntity.getCommandSenderName() + " moved wrongly!"); + this.field_147369_b.func_70091_d(d4, d5, d6); + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + this.field_147369_b.func_71000_j(d4, d5, d6); +@@ -338,10 +357,15 @@ + field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!"); } -+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.playerEntity.setPositionAndRotation(d1, d2, d3, f1, f2); - boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + this.field_147369_b.func_70080_a(d1, d2, d3, f1, f2); + boolean flag2 = worldserver.func_72945_a(this.field_147369_b, this.field_147369_b.field_70121_D.func_72329_c().func_72331_e((double)f3, (double)f3, (double)f3)).isEmpty(); -- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) -+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) +- if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn()) ++ if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn() && !this.field_147369_b.field_70145_X) { - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2); return; -@@ -359,7 +383,7 @@ +@@ -349,7 +373,7 @@ - AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D); + AxisAlignedBB axisalignedbb = this.field_147369_b.field_70121_D.func_72329_c().func_72314_b((double)f3, (double)f3, (double)f3).func_72321_a(0.0D, -0.55D, 0.0D); -- if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb)) -+ if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb) && !this.playerEntity.capabilities.allowFlying) +- if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb)) ++ if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb) && !this.field_147369_b.field_71075_bZ.field_75101_c) { if (d11 >= -0.03125D) { -@@ -378,6 +402,11 @@ - this.floatingTickCount = 0; +@@ -368,6 +392,11 @@ + this.field_147365_f = 0; } -+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.playerEntity.onGround = p_147347_1_.func_149465_i(); - this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); - this.playerEntity.handleFalling(this.playerEntity.posY - d0, p_147347_1_.func_149465_i()); -@@ -448,7 +477,10 @@ - double d2 = this.playerEntity.posZ - ((double)k + 0.5D); + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); + this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - d0, p_147347_1_.func_149465_i()); +@@ -436,7 +465,10 @@ + double d2 = this.field_147369_b.field_70161_v - ((double)k + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (d3 > 36.0D) -+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1; + dist *= dist; + + if (d3 > dist) { return; } -@@ -510,7 +542,11 @@ +@@ -497,7 +529,11 @@ return; } -- this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); -+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(playerEntity, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1); +- this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_147369_b, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1); + if (event.useItem != Event.Result.DENY) + { -+ this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); ++ this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); + } } - else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit())) + else if (p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z())) { -@@ -521,7 +557,9 @@ +@@ -508,7 +544,9 @@ } else { -- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) -+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; +- if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b)) ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1; + dist *= dist; -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) ++ if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b)) { - this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); + this.field_147369_b.field_71134_c.func_73078_a(this.field_147369_b, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); } -@@ -690,6 +728,8 @@ +@@ -674,6 +712,8 @@ else { - ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), s}); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); + chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); + if (chatcomponenttranslation1 == null) return; - this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false); + this.field_147367_d.func_71203_ab().func_148544_a(chatcomponenttranslation1, false); } -@@ -831,7 +871,7 @@ +@@ -810,7 +850,7 @@ return; } -- this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); -+ this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, playerEntity.dimension, false); +- this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, false); ++ this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); } break; diff --git a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch index 93908ae12f..9dc0a82ab8 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch @@ -17,7 +17,7 @@ public S21PacketChunkData() {} @@ -35,17 +37,22 @@ - this.field_149282_b = p_i45196_1_.zPosition; + this.field_149282_b = p_i45196_1_.field_76647_h; this.field_149279_g = p_i45196_2_; S21PacketChunkData.Extracted extracted = func_149269_a(p_i45196_1_, p_i45196_2_, p_i45196_3_); - Deflater deflater = new Deflater(-1); @@ -44,7 +44,7 @@ } finally { -@@ -76,13 +83,16 @@ +@@ -75,13 +82,16 @@ p_148837_1_.readBytes(field_149286_i, 0, this.field_149285_h); int i = 0; int j; @@ -61,9 +61,9 @@ if (this.field_149279_g) { -@@ -110,6 +120,15 @@ - // JAVADOC METHOD $$ func_148840_b - public void writePacketData(PacketBuffer p_148840_1_) throws IOException +@@ -108,6 +118,15 @@ + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { + if (this.field_149281_e == null) + { diff --git a/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch b/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch index 5124fc18fa..04eb440f48 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch @@ -31,8 +31,8 @@ - - System.arraycopy(extracted.field_150282_a, 0, field_149268_i, j, extracted.field_150282_a.length); j += extracted.field_150282_a.length; - this.field_149266_a[k] = chunk.xPosition; - this.field_149264_b[k] = chunk.zPosition; + this.field_149266_a[k] = chunk.field_76635_g; + this.field_149264_b[k] = chunk.field_76647_h; @@ -59,15 +53,28 @@ this.field_149262_d[k] = extracted.field_150281_c; this.field_149260_f[k] = extracted.field_150282_a; @@ -65,9 +65,9 @@ } finally { -@@ -150,6 +157,16 @@ - // JAVADOC METHOD $$ func_148840_b - public void writePacketData(PacketBuffer p_148840_1_) throws IOException +@@ -148,6 +155,16 @@ + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { + if (this.field_149263_e == null) + { diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch index e2dcc38c0b..1d789ea8fe 100644 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -14,35 +14,35 @@ import net.minecraft.nbt.NBTTagCompound; public class PotionEffect -@@ -21,6 +26,8 @@ +@@ -15,6 +20,8 @@ @SideOnly(Side.CLIENT) - private boolean isPotionDurationMax; + private boolean field_100013_f; private static final String __OBFID = "CL_00001529"; + /** List of ItemStack that can cure the potion effect **/ + private List curativeItems; - public PotionEffect(int par1, int par2) + public PotionEffect(int p_i1574_1_, int p_i1574_2_) { -@@ -38,6 +45,8 @@ - this.duration = par2; - this.amplifier = par3; - this.isAmbient = par4; +@@ -32,6 +39,8 @@ + this.field_76460_b = p_i1576_2_; + this.field_76461_c = p_i1576_3_; + this.field_82724_e = p_i1576_4_; + this.curativeItems = new ArrayList(); -+ this.curativeItems.add(new ItemStack(Items.milk_bucket)); ++ this.curativeItems.add(new ItemStack(Items.field_151117_aB)); } - public PotionEffect(PotionEffect par1PotionEffect) -@@ -45,6 +54,7 @@ - this.potionID = par1PotionEffect.potionID; - this.duration = par1PotionEffect.duration; - this.amplifier = par1PotionEffect.amplifier; -+ this.curativeItems = par1PotionEffect.curativeItems; + public PotionEffect(PotionEffect p_i1577_1_) +@@ -39,6 +48,7 @@ + this.field_76462_a = p_i1577_1_.field_76462_a; + this.field_76460_b = p_i1577_1_.field_76460_b; + this.field_76461_c = p_i1577_1_.field_76461_c; ++ this.curativeItems = p_i1577_1_.curativeItems; } - // JAVADOC METHOD $$ func_76452_a -@@ -210,4 +220,62 @@ + public void func_76452_a(PotionEffect p_76452_1_) +@@ -197,4 +207,62 @@ { - return this.isPotionDurationMax; + return this.field_100013_f; } + + /* ======================================== FORGE START =====================================*/ @@ -65,7 +65,7 @@ + boolean found = false; + for (ItemStack curativeItem : this.curativeItems) + { -+ if (curativeItem.isItemEqual(stack)) ++ if (curativeItem.func_77969_a(stack)) + { + found = true; + } @@ -92,7 +92,7 @@ + boolean found = false; + for (ItemStack curativeItem : this.curativeItems) + { -+ if (curativeItem.isItemEqual(stack)) ++ if (curativeItem.func_77969_a(stack)) + { + found = true; + } diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 35022555e9..3082905909 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -18,46 +18,46 @@ + public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { - private static final Logger logger = LogManager.getLogger(); -@@ -95,7 +100,7 @@ - // JAVADOC FIELD $$ field_71319_s - private int serverPort = -1; - // JAVADOC FIELD $$ field_71305_c -- public WorldServer[] worldServers; -+ public WorldServer[] worldServers = new WorldServer[0]; - // JAVADOC FIELD $$ field_71318_t - private ServerConfigurationManager serverConfigManager; - // JAVADOC FIELD $$ field_71317_u -@@ -125,7 +130,8 @@ + private static final Logger field_147145_h = LogManager.getLogger(); +@@ -89,7 +94,7 @@ + @SideOnly(Side.SERVER) + private String field_71320_r; + private int field_71319_s = -1; +- public WorldServer[] field_71305_c; ++ public WorldServer[] field_71305_c = new WorldServer[0]; + private ServerConfigurationManager field_71318_t; + private boolean field_71317_u = true; + private boolean field_71316_v; +@@ -106,7 +111,8 @@ + private int field_71280_D; private int field_143008_E = 0; - public final long[] tickTimeArray = new long[100]; - // JAVADOC FIELD $$ field_71312_k -- public long[][] timeOfLastDimensionTick; + public final long[] field_71311_j = new long[100]; +- public long[][] field_71312_k; + //public long[][] timeOfLastDimensionTick; + public Hashtable worldTickTimes = new Hashtable(); - private KeyPair serverKeyPair; - // JAVADOC FIELD $$ field_71293_J - private String serverOwner; -@@ -217,8 +223,6 @@ + private KeyPair field_71292_I; + private String field_71293_J; + private String field_71294_K; +@@ -182,8 +188,6 @@ { - this.convertMapIfNeeded(par1Str); - this.setUserMessage("menu.loadingLevel"); -- this.worldServers = new WorldServer[3]; -- this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; - ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true); - WorldInfo worldinfo = isavehandler.loadWorldInfo(); + this.func_71237_c(p_71247_1_); + this.func_71192_d("menu.loadingLevel"); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true); + WorldInfo worldinfo = isavehandler.func_75757_d(); WorldSettings worldsettings; -@@ -238,46 +242,21 @@ - worldsettings.enableBonusChest(); +@@ -203,46 +207,21 @@ + worldsettings.func_77159_a(); } -- for (int j = 0; j < this.worldServers.length; ++j) -+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler)); +- for (int j = 0; j < this.field_71305_c.length; ++j) ++ WorldServer overWorld = (func_71242_L() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, field_71304_b) : new WorldServer(this, isavehandler, p_71247_2_, 0, worldsettings, field_71304_b)); + for (int dim : DimensionManager.getStaticDimensionIDs()) { - byte b0 = 0; -+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler)); -+ world.addWorldAccess(new WorldManager(this, world)); ++ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, worldsettings, overWorld, field_71304_b)); ++ world.func_72954_a(new WorldManager(this, world)); - if (j == 1) - { @@ -71,121 +71,121 @@ - - if (j == 0) - { -- if (this.isDemo()) +- if (this.func_71242_L()) - { -- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler); +- this.field_71305_c[j] = new DemoWorldServer(this, isavehandler, p_71247_2_, b0, this.field_71304_b); - } - else - { -- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, worldsettings, this.theProfiler); +- this.field_71305_c[j] = new WorldServer(this, isavehandler, p_71247_2_, b0, worldsettings, this.field_71304_b); - } - } - else - { -- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, worldsettings, this.worldServers[0], this.theProfiler); +- this.field_71305_c[j] = new WorldServerMulti(this, isavehandler, p_71247_2_, b0, worldsettings, this.field_71305_c[0], this.field_71304_b); - } - -- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j])); +- this.field_71305_c[j].func_72954_a(new WorldManager(this, this.field_71305_c[j])); - - if (!this.isSinglePlayer()) + if (!this.func_71264_H()) { -- this.worldServers[j].getWorldInfo().setGameType(this.getGameType()); -+ world.getWorldInfo().setGameType(this.getGameType()); +- this.field_71305_c[j].func_72912_H().func_76060_a(this.func_71265_f()); ++ world.func_72912_H().func_76060_a(this.func_71265_f()); } -- this.serverConfigManager.setPlayerManager(this.worldServers); +- this.field_71318_t.func_72364_a(this.field_71305_c); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); } -+ this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld }); ++ this.field_71318_t.func_72364_a(new WorldServer[]{ overWorld }); this.func_147139_a(this.func_147135_j()); - this.initialWorldChunkLoad(); + this.func_71222_d(); } -@@ -348,6 +327,7 @@ - if (!this.worldIsBeingDeleted) +@@ -309,6 +288,7 @@ + if (!this.field_71290_O) { - WorldServer[] aworldserver = this.worldServers; + WorldServer[] aworldserver = this.field_71305_c; + if (aworldserver == null) return; //Forge: Just in case, NPE protection as it has been encountered. int i = aworldserver.length; for (int j = 0; j < i; ++j) -@@ -399,9 +379,16 @@ - for (int i = 0; i < this.worldServers.length; ++i) +@@ -359,9 +339,16 @@ + for (int i = 0; i < this.field_71305_c.length; ++i) { - WorldServer worldserver = this.worldServers[i]; + WorldServer worldserver = this.field_71305_c[i]; + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); - worldserver.flush(); + worldserver.func_73041_k(); } -+ WorldServer[] tmp = worldServers; ++ WorldServer[] tmp = field_71305_c; + for (WorldServer world : tmp) + { -+ DimensionManager.setWorld(world.provider.dimensionId, null); ++ DimensionManager.setWorld(world.field_73011_w.field_76574_g, null); + } + - if (this.usageSnooper.isSnooperRunning()) + if (this.field_71307_n.func_76468_d()) { - this.usageSnooper.stopSnooper(); -@@ -630,13 +617,15 @@ - this.theProfiler.startSection("levels"); + this.field_71307_n.func_76470_e(); +@@ -586,13 +573,15 @@ + this.field_71304_b.func_76320_a("levels"); int i; -- for (i = 0; i < this.worldServers.length; ++i) -+ Integer[] ids = DimensionManager.getIDs(this.tickCounter % 200 == 0); +- for (i = 0; i < this.field_71305_c.length; ++i) ++ Integer[] ids = DimensionManager.getIDs(this.field_71315_w % 200 == 0); + for (int x = 0; x < ids.length; x++) { + int id = ids[x]; long j = System.nanoTime(); -- if (i == 0 || this.getAllowNether()) -+ if (id == 0 || this.getAllowNether()) +- if (i == 0 || this.func_71255_r()) ++ if (id == 0 || this.func_71255_r()) { -- WorldServer worldserver = this.worldServers[i]; +- WorldServer worldserver = this.field_71305_c[i]; + WorldServer worldserver = DimensionManager.getWorld(id); - this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); - this.theProfiler.startSection("pools"); - worldserver.getWorldVec3Pool().clear(); -@@ -683,9 +672,11 @@ - this.theProfiler.endSection(); + this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j()); + this.field_71304_b.func_76320_a("pools"); + worldserver.func_82732_R().func_72343_a(); +@@ -639,9 +628,11 @@ + this.field_71304_b.func_76319_b(); } -- this.timeOfLastDimensionTick[i][this.tickCounter % 100] = System.nanoTime() - j; -+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - j; +- this.field_71312_k[i][this.field_71315_w % 100] = System.nanoTime() - j; ++ worldTickTimes.get(id)[this.field_71315_w % 100] = System.nanoTime() - j; } -+ this.theProfiler.endStartSection("dim_unloading"); ++ this.field_71304_b.func_76318_c("dim_unloading"); + DimensionManager.unloadWorlds(worldTickTimes); - this.theProfiler.endStartSection("connection"); - this.func_147137_ag().networkTick(); - this.theProfiler.endStartSection("players"); -@@ -732,7 +723,13 @@ - // JAVADOC METHOD $$ func_71218_a - public WorldServer worldServerForDimension(int par1) + this.field_71304_b.func_76318_c("connection"); + this.func_147137_ag().func_151269_c(); + this.field_71304_b.func_76318_c("players"); +@@ -685,7 +676,13 @@ + + public WorldServer func_71218_a(int p_71218_1_) { -- return par1 == -1 ? this.worldServers[1] : (par1 == 1 ? this.worldServers[2] : this.worldServers[0]); -+ WorldServer ret = DimensionManager.getWorld(par1); +- return p_71218_1_ == -1 ? this.field_71305_c[1] : (p_71218_1_ == 1 ? this.field_71305_c[2] : this.field_71305_c[0]); ++ WorldServer ret = DimensionManager.getWorld(p_71218_1_); + if (ret == null) + { -+ DimensionManager.initDimension(par1); -+ ret = DimensionManager.getWorld(par1); ++ DimensionManager.initDimension(p_71218_1_); ++ ret = DimensionManager.getWorld(p_71218_1_); + } + return ret; } - // JAVADOC METHOD $$ func_71249_w -@@ -1008,6 +1005,7 @@ + public String func_71249_w() +@@ -944,6 +941,7 @@ if (worldserver != null) { + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); - worldserver.flush(); + worldserver.func_73041_k(); } } -@@ -1497,7 +1495,6 @@ +@@ -1414,7 +1412,6 @@ this.field_147141_M = p_155759_1_; } - @SideOnly(Side.SERVER) - public boolean isServerStopped() + public boolean func_71241_aa() { - return this.serverStopped; + return this.field_71316_v; diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index ac20b2c03c..3cbe1472d3 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -10,27 +10,27 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -55,44 +58,23 @@ - protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) +@@ -54,44 +57,23 @@ + protected void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) { - this.convertMapIfNeeded(par1Str); -- this.worldServers = new WorldServer[3]; -- this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; - ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); + this.func_71237_c(p_71247_1_); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.func_71254_M().func_75804_a(p_71247_1_, true); -- for (int j = 0; j < this.worldServers.length; ++j) -+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler)); +- for (int j = 0; j < this.field_71305_c.length; ++j) ++ WorldServer overWorld = (func_71242_L() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, field_71304_b) : new WorldServer(this, isavehandler, p_71247_2_, 0, field_71350_m, field_71304_b)); + for (int dim : DimensionManager.getStaticDimensionIDs()) { - byte b0 = 0; -+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler)); -+ world.addWorldAccess(new WorldManager(this, world)); ++ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, field_71350_m, overWorld, field_71304_b)); ++ world.func_72954_a(new WorldManager(this, world)); - if (j == 1) -+ if (!this.isSinglePlayer()) ++ if (!this.func_71264_H()) { - b0 = -1; -+ world.getWorldInfo().setGameType(getGameType()); ++ world.func_72912_H().func_76060_a(func_71265_f()); } - if (j == 2) @@ -40,26 +40,26 @@ - - if (j == 0) - { -- if (this.isDemo()) +- if (this.func_71242_L()) - { -- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler); +- this.field_71305_c[j] = new DemoWorldServer(this, isavehandler, p_71247_2_, b0, this.field_71304_b); - } - else - { -- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, this.theWorldSettings, this.theProfiler); +- this.field_71305_c[j] = new WorldServer(this, isavehandler, p_71247_2_, b0, this.field_71350_m, this.field_71304_b); - } - } - else - { -- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, this.theWorldSettings, this.worldServers[0], this.theProfiler); +- this.field_71305_c[j] = new WorldServerMulti(this, isavehandler, p_71247_2_, b0, this.field_71350_m, this.field_71305_c[0], this.field_71304_b); - } - -- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j])); -- this.getConfigurationManager().setPlayerManager(this.worldServers); +- this.field_71305_c[j].func_72954_a(new WorldManager(this, this.field_71305_c[j])); +- this.func_71203_ab().func_72364_a(this.field_71305_c); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); } -+ this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld }); ++ this.func_71203_ab().func_72364_a(new WorldServer[]{ overWorld }); this.func_147139_a(this.func_147135_j()); - this.initialWorldChunkLoad(); + this.func_71222_d(); } diff --git a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch index 9d41fb0266..727519aa4a 100644 --- a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -21,210 +21,210 @@ { + /** Forge reach distance */ + private double blockReachDistance = 5.0d; - // JAVADOC FIELD $$ field_73092_a - public World theWorld; - // JAVADOC FIELD $$ field_73090_b -@@ -133,6 +144,13 @@ + public World field_73092_a; + public EntityPlayerMP field_73090_b; + private WorldSettings.GameType field_73091_c; +@@ -126,6 +137,13 @@ { - if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) + if (!this.field_73091_c.func_82752_c() || this.field_73090_b.func_82246_f(p_73074_1_, p_73074_2_, p_73074_3_)) { -+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, par1, par2, par3, par4); ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_73090_b, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + if (event.isCanceled()) + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); + return; + } + - if (this.isCreative()) + if (this.func_73083_d()) { - if (!this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4)) -@@ -142,19 +160,36 @@ + if (!this.field_73092_a.func_72886_a((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_)) +@@ -135,19 +153,36 @@ } else { -- this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4); - this.initialDamage = this.curblockDamage; +- this.field_73092_a.func_72886_a((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + this.field_73089_e = this.field_73100_i; float f = 1.0F; - Block block = this.theWorld.getBlock(par1, par2, par3); + Block block = this.field_73092_a.func_147439_a(p_73074_1_, p_73074_2_, p_73074_3_); -- if (block.getMaterial() != Material.air) +- if (block.func_149688_o() != Material.field_151579_a) + -+ if (!block.isAir(theWorld, par1, par2, par3)) ++ if (!block.isAir(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_)) { -- block.onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); -- f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3); +- block.func_149699_a(this.field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_, this.field_73090_b); +- f = block.func_149737_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_73074_1_, p_73074_2_, p_73074_3_); + if (event.useBlock != Event.Result.DENY) + { -+ block.onBlockClicked(theWorld, par1, par2, par3, thisPlayerMP); -+ theWorld.extinguishFire(thisPlayerMP, par1, par2, par3, par4); ++ block.func_149699_a(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_, field_73090_b); ++ field_73092_a.func_72886_a(field_73090_b, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + } + else + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); + } -+ f = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3); ++ f = block.func_149737_a(field_73090_b, field_73090_b.field_70170_p, p_73074_1_, p_73074_2_, p_73074_3_); } -- if (block.getMaterial() != Material.air && f >= 1.0F) +- if (block.func_149688_o() != Material.field_151579_a && f >= 1.0F) + if (event.useItem == Event.Result.DENY) { + if (f >= 1.0f) + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); + } + return; + } + -+ if (!block.isAir(theWorld, par1, par2, par3) && f >= 1.0F) ++ if (!block.isAir(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_) && f >= 1.0F) + { - this.tryHarvestBlock(par1, par2, par3); + this.func_73084_b(p_73074_1_, p_73074_2_, p_73074_3_); } else -@@ -178,7 +213,7 @@ - int l = this.curblockDamage - this.initialDamage; - Block block = this.theWorld.getBlock(par1, par2, par3); +@@ -171,7 +206,7 @@ + int l = this.field_73100_i - this.field_73089_e; + Block block = this.field_73092_a.func_147439_a(p_73082_1_, p_73082_2_, p_73082_3_); -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, par1, par2, par3)) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_73092_a, p_73082_1_, p_73082_2_, p_73082_3_)) { - float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3) * (float)(l + 1); + float f = block.func_149737_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_73082_1_, p_73082_2_, p_73082_3_) * (float)(l + 1); -@@ -214,7 +249,7 @@ - Block block = this.theWorld.getBlock(par1, par2, par3); - int l = this.theWorld.getBlockMetadata(par1, par2, par3); - block.onBlockHarvested(this.theWorld, par1, par2, par3, l, this.thisPlayerMP); -- boolean flag = this.theWorld.setBlockToAir(par1, par2, par3); -+ boolean flag = block.removedByPlayer(theWorld, thisPlayerMP, par1, par2, par3); +@@ -205,7 +240,7 @@ + Block block = this.field_73092_a.func_147439_a(p_73079_1_, p_73079_2_, p_73079_3_); + int l = this.field_73092_a.func_72805_g(p_73079_1_, p_73079_2_, p_73079_3_); + block.func_149681_a(this.field_73092_a, p_73079_1_, p_73079_2_, p_73079_3_, l, this.field_73090_b); +- boolean flag = this.field_73092_a.func_147468_f(p_73079_1_, p_73079_2_, p_73079_3_); ++ boolean flag = block.removedByPlayer(field_73092_a, field_73090_b, p_73079_1_, p_73079_2_, p_73079_3_); if (flag) { -@@ -227,29 +262,32 @@ - // JAVADOC METHOD $$ func_73084_b - public boolean tryHarvestBlock(int par1, int par2, int par3) +@@ -217,29 +252,32 @@ + + public boolean func_73084_b(int p_73084_1_, int p_73084_2_, int p_73084_3_) { -- if (this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) -+ BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, par1, par2, par3); +- if (this.field_73091_c.func_82752_c() && !this.field_73090_b.func_82246_f(p_73084_1_, p_73084_2_, p_73084_3_)) ++ BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_73084_1_, p_73084_2_, p_73084_3_); + if (event.isCanceled()) { return false; } -- else if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) +- else if (this.field_73091_c.func_77145_d() && this.field_73090_b.func_70694_bm() != null && this.field_73090_b.func_70694_bm().func_77973_b() instanceof ItemSword) - { - return false; - } else { -+ ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, thisPlayerMP)) ++ ItemStack stack = field_73090_b.func_71045_bC(); ++ if (stack != null && stack.func_77973_b().onBlockStartBreak(stack, p_73084_1_, p_73084_2_, p_73084_3_, field_73090_b)) + { + return false; + } - Block block = this.theWorld.getBlock(par1, par2, par3); - int l = this.theWorld.getBlockMetadata(par1, par2, par3); - this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, Block.getIdFromBlock(block) + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); -- boolean flag = this.removeBlock(par1, par2, par3); + Block block = this.field_73092_a.func_147439_a(p_73084_1_, p_73084_2_, p_73084_3_); + int l = this.field_73092_a.func_72805_g(p_73084_1_, p_73084_2_, p_73084_3_); + this.field_73092_a.func_72889_a(this.field_73090_b, 2001, p_73084_1_, p_73084_2_, p_73084_3_, Block.func_149682_b(block) + (this.field_73092_a.func_72805_g(p_73084_1_, p_73084_2_, p_73084_3_) << 12)); +- boolean flag = this.func_73079_d(p_73084_1_, p_73084_2_, p_73084_3_); + boolean flag = false; - if (this.isCreative()) + if (this.func_73083_d()) { -+ flag = this.removeBlock(par1, par2, par3); - this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, this.theWorld)); ++ flag = this.func_73079_d(p_73084_1_, p_73084_2_, p_73084_3_); + this.field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73084_1_, p_73084_2_, p_73084_3_, this.field_73092_a)); } else { - ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); -- boolean flag1 = this.thisPlayerMP.canHarvestBlock(block); -+ boolean flag1 = block.canHarvestBlock(thisPlayerMP, l); + ItemStack itemstack = this.field_73090_b.func_71045_bC(); +- boolean flag1 = this.field_73090_b.func_146099_a(block); ++ boolean flag1 = block.canHarvestBlock(field_73090_b, l); if (itemstack != null) { -@@ -261,12 +299,18 @@ +@@ -251,12 +289,18 @@ } } -+ flag = this.removeBlock(par1, par2, par3); ++ flag = this.func_73079_d(p_73084_1_, p_73084_2_, p_73084_3_); if (flag && flag1) { - block.harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, l); + block.func_149636_a(this.field_73092_a, this.field_73090_b, p_73084_1_, p_73084_2_, p_73084_3_, l); } } + // Drop experience -+ if (!this.isCreative() && flag && event != null) ++ if (!this.func_73083_d() && flag && event != null) + { -+ block.dropXpOnBlockBreak(this.theWorld, par1, par2, par3, event.getExpToDrop()); ++ block.func_149657_c(this.field_73092_a, p_73084_1_, p_73084_2_, p_73084_3_, event.getExpToDrop()); + } return flag; } } -@@ -299,6 +343,7 @@ - if (itemstack1.stackSize == 0) +@@ -288,6 +332,7 @@ + if (itemstack1.field_77994_a == 0) { - par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; -+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thisPlayerMP, itemstack1)); + p_73085_1_.field_71071_by.field_70462_a[p_73085_1_.field_71071_by.field_70461_c] = null; ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(field_73090_b, itemstack1)); } - if (!par1EntityPlayer.isUsingItem()) -@@ -313,27 +358,57 @@ - // JAVADOC METHOD $$ func_73078_a - public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + if (!p_73085_1_.func_71039_bw()) +@@ -301,31 +346,70 @@ + + public boolean func_73078_a(EntityPlayer p_73078_1_, World p_73078_2_, ItemStack p_73078_3_, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) { -- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) -+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(par1EntityPlayer, Action.RIGHT_CLICK_BLOCK, par4, par5, par6, par7); +- if ((!p_73078_1_.func_70093_af() || p_73078_1_.func_70694_bm() == null) && p_73078_2_.func_147439_a(p_73078_4_, p_73078_5_, p_73078_6_).func_149727_a(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(p_73078_1_, Action.RIGHT_CLICK_BLOCK, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_); + if (event.isCanceled()) { - return true; -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par4, par5, par6, theWorld)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, field_73092_a)); + return false; } -- else if (par3ItemStack == null) +- else if (p_73078_3_ == null) + -+ if (par3ItemStack != null && par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10)) ++ if (p_73078_3_ != null && p_73078_3_.func_77973_b().onItemUseFirst(p_73078_3_, p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) { - return false; -+ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); ++ if (p_73078_3_.field_77994_a <= 0) ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_73078_3_); + return true; } -- else if (this.isCreative()) +- else if (this.func_73083_d()) + -+ Block block = par2World.getBlock(par4, par5, par6); -+ boolean isAir = block.isAir(par2World, par4, par5, par6); -+ boolean useBlock = !par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null; -+ if (!useBlock) useBlock = par1EntityPlayer.getHeldItem().getItem().doesSneakBypassUse(par2World, par4, par5, par6, par1EntityPlayer); ++ Block block = p_73078_2_.func_147439_a(p_73078_4_, p_73078_5_, p_73078_6_); ++ boolean isAir = block.isAir(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_); ++ boolean useBlock = !p_73078_1_.func_70093_af() || p_73078_1_.func_70694_bm() == null; ++ if (!useBlock) useBlock = p_73078_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_); + boolean result = false; + + if (useBlock) { -- int i1 = par3ItemStack.getItemDamage(); -- int j1 = par3ItemStack.stackSize; -- boolean flag = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); -- par3ItemStack.setItemDamage(i1); -- par3ItemStack.stackSize = j1; +- int i1 = p_73078_3_.func_77960_j(); +- int j1 = p_73078_3_.field_77994_a; +- boolean flag = p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); +- p_73078_3_.func_77964_b(i1); +- p_73078_3_.field_77994_a = j1; - return flag; + if (event.useBlock != Event.Result.DENY) + { -+ result = block.onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10); ++ result = block.func_149727_a(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + } + else + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par4, par5, par6, theWorld)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, field_73092_a)); + result = event.useItem != Event.Result.ALLOW; + } } - else + -+ if (par3ItemStack != null && !result && event.useItem != Event.Result.DENY) ++ if (p_73078_3_ != null && !result && event.useItem != Event.Result.DENY) { -- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); -+ int meta = par3ItemStack.getItemDamage(); -+ int size = par3ItemStack.stackSize; -+ result = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); -+ if (isCreative()) +- return p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); ++ int meta = p_73078_3_.func_77960_j(); ++ int size = p_73078_3_.field_77994_a; ++ result = p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); ++ if (func_73083_d()) + { -+ par3ItemStack.setItemDamage(meta); -+ par3ItemStack.stackSize = size; ++ p_73078_3_.func_77964_b(meta); ++ p_73078_3_.field_77994_a = size; + } -+ if (par3ItemStack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, par3ItemStack); ++ if (p_73078_3_.field_77994_a <= 0) ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_73078_3_); } + + /* Re-enable if this causes bukkit incompatibility, or re-write client side to only send a single packet per right click. @@ -235,10 +235,9 @@ + return result; } - // JAVADOC METHOD $$ func_73080_a -@@ -341,4 +416,13 @@ + public void func_73080_a(WorldServer p_73080_1_) { - this.theWorld = par1WorldServer; + this.field_73092_a = p_73080_1_; } + + public double getBlockReachDistance() diff --git a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch index a924a20919..ffd28afeaf 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch @@ -18,60 +18,69 @@ public class PlayerManager { -@@ -337,6 +341,8 @@ - this.playersWatchingChunk.remove(par1EntityPlayerMP); - par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); +@@ -320,6 +324,8 @@ + this.field_73263_b.remove(p_73252_1_); + p_73252_1_.field_71129_f.remove(this.field_73264_c); -+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP)); ++ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(field_73264_c, p_73252_1_)); + - if (this.playersWatchingChunk.isEmpty()) + if (this.field_73263_b.isEmpty()) { - long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; -@@ -376,7 +382,7 @@ + long i = (long)this.field_73264_c.field_77276_a + 2147483647L | (long)this.field_73264_c.field_77275_b + 2147483647L << 32; +@@ -357,7 +363,7 @@ - this.flagsYAreasToUpdate |= 1 << (p_151253_2_ >> 4); + this.field_73260_f |= 1 << (p_151253_2_ >> 4); -- if (this.numberOfTilesToUpdate < 64) +- if (this.field_73262_e < 64) + //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run { short short1 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); -@@ -388,6 +394,10 @@ +@@ -369,6 +375,10 @@ } } -+ if (numberOfTilesToUpdate == locationOfBlockChange.length) ++ if (field_73262_e == field_151254_d.length) + { -+ locationOfBlockChange = Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); ++ field_151254_d = Arrays.copyOf(field_151254_d, field_151254_d.length << 1); + } - this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; + this.field_151254_d[this.field_73262_e++] = short1; } } -@@ -420,7 +430,7 @@ - k = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); - this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(i, j, k, PlayerManager.this.theWorldServer)); +@@ -401,7 +411,7 @@ + k = this.field_73264_c.field_77275_b * 16 + (this.field_151254_d[0] >> 8 & 15); + this.func_151251_a(new S23PacketBlockChange(i, j, k, PlayerManager.this.field_72701_a)); -- if (PlayerManager.this.theWorldServer.getBlock(i, j, k).hasTileEntity()) -+ if (PlayerManager.this.theWorldServer.getBlock(i, j, k).hasTileEntity(PlayerManager.this.theWorldServer.getBlockMetadata(i, j, k))) +- if (PlayerManager.this.field_72701_a.func_147439_a(i, j, k).func_149716_u()) ++ if (PlayerManager.this.field_72701_a.func_147439_a(i, j, k).hasTileEntity(PlayerManager.this.field_72701_a.func_72805_g(i, j, k))) { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(i, j, k)); + this.func_151252_a(PlayerManager.this.field_72701_a.func_147438_o(i, j, k)); } -@@ -429,12 +439,13 @@ +@@ -410,37 +420,42 @@ { int l; -- if (this.numberOfTilesToUpdate == 64) -+ if (this.numberOfTilesToUpdate == ForgeModContainer.clumpingThreshold) +- if (this.field_73262_e == 64) ++ if (this.field_73262_e == ForgeModContainer.clumpingThreshold) { - i = this.chunkLocation.chunkXPos * 16; - j = this.chunkLocation.chunkZPos * 16; - this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + i = this.field_73264_c.field_77276_a * 16; + j = this.field_73264_c.field_77275_b * 16; + this.func_151251_a(new S21PacketChunkData(PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b), false, this.field_73260_f)); + /* Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones for (k = 0; k < 16; ++k) { - if ((this.flagsYAreasToUpdate & 1 << k) != 0) -@@ -448,18 +459,22 @@ +- if ((this.field_73260_f & 1 << k) != 0) ++ if ((this.flagsYAreasToUpdate & 1 << k) != 0) + { + l = k << 4; +- List list = PlayerManager.this.field_72701_a.func_147486_a(i, l, j, i + 16, l + 16, j + 16); ++ List list = PlayerManager.this.theWorldServer.func_147486_a(i, l, j, i + 16, l + 16, j + 16); + + for (int i1 = 0; i1 < list.size(); ++i1) + { +- this.func_151252_a((TileEntity)list.get(i1)); ++ this.sendTileToAllPlayersWatchingChunk((TileEntity)list.get(i1)); } } } @@ -79,20 +88,20 @@ } else { - this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); + this.func_151251_a(new S22PacketMultiBlockChange(this.field_73262_e, this.field_151254_d, PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b))); - + } + + { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small -+ WorldServer world = PlayerManager.this.theWorldServer; - for (i = 0; i < this.numberOfTilesToUpdate; ++i) ++ WorldServer world = PlayerManager.this.field_72701_a; + for (i = 0; i < this.field_73262_e; ++i) { - j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); - k = this.locationOfBlockChange[i] & 255; - l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15); + j = this.field_73264_c.field_77276_a * 16 + (this.field_151254_d[i] >> 12 & 15); + k = this.field_151254_d[i] & 255; + l = this.field_73264_c.field_77275_b * 16 + (this.field_151254_d[i] >> 8 & 15); -- if (PlayerManager.this.theWorldServer.getBlock(j, k, l).hasTileEntity()) -+ if (world.getBlock(j, k, l).hasTileEntity(world.getBlockMetadata(j, k, l))) +- if (PlayerManager.this.field_72701_a.func_147439_a(j, k, l).func_149716_u()) ++ if (world.func_147439_a(j, k, l).hasTileEntity(world.func_72805_g(j, k, l))) { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(j, k, l)); + this.func_151252_a(PlayerManager.this.field_72701_a.func_147438_o(j, k, l)); } diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch index f3d80cf476..6d8bc508cb 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -10,104 +10,208 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.WorldSettings; import net.minecraft.world.demo.DemoWorldManager; -@@ -379,13 +381,23 @@ - // JAVADOC METHOD $$ func_72368_a - public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) +@@ -361,13 +363,23 @@ + + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) { -+ World world = mcServer.worldServerForDimension(par2); ++ World world = field_72400_f.func_71218_a(p_72368_2_); + if (world == null) + { -+ par2 = 0; ++ p_72368_2_ = 0; + } -+ else if (!world.provider.canRespawnHere()) ++ else if (!world.field_73011_w.func_76567_e()) + { -+ par2 = world.provider.getRespawnDimension(par1EntityPlayerMP); ++ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); + } + - par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP); - par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP); - par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP); - this.playerEntityList.remove(par1EntityPlayerMP); - this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension).removePlayerEntityDangerously(par1EntityPlayerMP); -- ChunkCoordinates chunkcoordinates = par1EntityPlayerMP.getBedLocation(); -- boolean flag1 = par1EntityPlayerMP.isSpawnForced(); -+ ChunkCoordinates chunkcoordinates = par1EntityPlayerMP.getBedLocation(par2); -+ boolean flag1 = par1EntityPlayerMP.isSpawnForced(par2); - par1EntityPlayerMP.dimension = par2; + p_72368_1_.func_71121_q().func_73039_n().func_72787_a(p_72368_1_); + p_72368_1_.func_71121_q().func_73039_n().func_72790_b(p_72368_1_); + p_72368_1_.func_71121_q().func_73040_p().func_72695_c(p_72368_1_); + this.field_72404_b.remove(p_72368_1_); + this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).func_72973_f(p_72368_1_); +- ChunkCoordinates chunkcoordinates = p_72368_1_.func_70997_bJ(); +- boolean flag1 = p_72368_1_.func_82245_bX(); ++ ChunkCoordinates chunkcoordinates = p_72368_1_.getBedLocation(p_72368_2_); ++ boolean flag1 = p_72368_1_.isSpawnForced(p_72368_2_); + p_72368_1_.field_71093_bK = p_72368_2_; Object object; -@@ -401,6 +413,7 @@ - EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.getGameProfile(), (ItemInWorldManager)object); - entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; - entityplayermp1.clonePlayer(par1EntityPlayerMP, par3); -+ entityplayermp1.dimension = par2; - entityplayermp1.setEntityId(par1EntityPlayerMP.getEntityId()); - WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); - this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver); -@@ -445,6 +458,11 @@ +@@ -383,6 +395,7 @@ + EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), (ItemInWorldManager)object); + entityplayermp1.field_71135_a = p_72368_1_.field_71135_a; + entityplayermp1.func_71049_a(p_72368_1_, p_72368_3_); ++ entityplayermp1.field_71093_bK = p_72368_2_; + entityplayermp1.func_145769_d(p_72368_1_.func_145782_y()); + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK); + this.func_72381_a(entityplayermp1, p_72368_1_, worldserver); +@@ -427,106 +440,120 @@ - public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) + public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_) { -+ transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter()); +- int j = p_72356_1_.field_71093_bK; +- WorldServer worldserver = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); +- p_72356_1_.field_71093_bK = p_72356_2_; +- WorldServer worldserver1 = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); +- p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, p_72356_1_.field_70170_p.field_73013_u, p_72356_1_.field_70170_p.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); +- worldserver.func_72973_f(p_72356_1_); +- p_72356_1_.field_70128_L = false; +- this.func_82448_a(p_72356_1_, j, worldserver, worldserver1); +- this.func_72375_a(p_72356_1_, worldserver); +- p_72356_1_.field_71135_a.func_147364_a(p_72356_1_.field_70165_t, p_72356_1_.field_70163_u, p_72356_1_.field_70161_v, p_72356_1_.field_70177_z, p_72356_1_.field_70125_A); +- p_72356_1_.field_71134_c.func_73080_a(worldserver1); +- this.func_72354_b(p_72356_1_, worldserver1); +- this.func_72385_f(p_72356_1_); +- Iterator iterator = p_72356_1_.func_70651_bq().iterator(); ++ transferPlayerToDimension(p_72356_1_, p_72356_2_, field_72400_f.func_71218_a(p_72356_2_).func_85176_s()); + } -+ + + public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter) + { - int j = par1EntityPlayerMP.dimension; - WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); - par1EntityPlayerMP.dimension = par2; -@@ -452,7 +470,7 @@ - par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S07PacketRespawn(par1EntityPlayerMP.dimension, par1EntityPlayerMP.worldObj.difficultySetting, par1EntityPlayerMP.worldObj.getWorldInfo().getTerrainType(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); - worldserver.removePlayerEntityDangerously(par1EntityPlayerMP); - par1EntityPlayerMP.isDead = false; -- this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1); ++ int j = par1EntityPlayerMP.field_71093_bK; ++ WorldServer worldserver = this.field_72400_f.func_71218_a(par1EntityPlayerMP.field_71093_bK); ++ par1EntityPlayerMP.field_71093_bK = par2; ++ WorldServer worldserver1 = this.field_72400_f.func_71218_a(par1EntityPlayerMP.field_71093_bK); ++ par1EntityPlayerMP.field_71135_a.func_147359_a(new S07PacketRespawn(par1EntityPlayerMP.field_71093_bK, par1EntityPlayerMP.field_70170_p.field_73013_u, par1EntityPlayerMP.field_70170_p.func_72912_H().func_76067_t(), par1EntityPlayerMP.field_71134_c.func_73081_b())); ++ worldserver.func_72973_f(par1EntityPlayerMP); ++ par1EntityPlayerMP.field_70128_L = false; + this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter); - this.func_72375_a(par1EntityPlayerMP, worldserver); - par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); - par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1); -@@ -471,15 +489,23 @@ - // JAVADOC METHOD $$ func_82448_a - public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) - { -- double d0 = par1Entity.posX; -- double d1 = par1Entity.posZ; -- double d2 = 8.0D; -+ transferEntityToWorld(par1Entity, par2, par3WorldServer, par4WorldServer, par4WorldServer.getDefaultTeleporter()); -+ } ++ this.func_72375_a(par1EntityPlayerMP, worldserver); ++ par1EntityPlayerMP.field_71135_a.func_147364_a(par1EntityPlayerMP.field_70165_t, par1EntityPlayerMP.field_70163_u, par1EntityPlayerMP.field_70161_v, par1EntityPlayerMP.field_70177_z, par1EntityPlayerMP.field_70125_A); ++ par1EntityPlayerMP.field_71134_c.func_73080_a(worldserver1); ++ this.func_72354_b(par1EntityPlayerMP, worldserver1); ++ this.func_72385_f(par1EntityPlayerMP); ++ Iterator iterator = par1EntityPlayerMP.func_70651_bq().iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); +- p_72356_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(p_72356_1_.func_145782_y(), potioneffect)); ++ par1EntityPlayerMP.field_71135_a.func_147359_a(new S1DPacketEntityEffect(par1EntityPlayerMP.func_145782_y(), potioneffect)); + } +- FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, j, p_72356_2_); ++ FMLCommonHandler.instance().firePlayerChangedDimensionEvent(par1EntityPlayerMP, j, par2); + } + + public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) + { +- double d0 = p_82448_1_.field_70165_t; +- double d1 = p_82448_1_.field_70161_v; +- double d2 = 8.0D; +- double d3 = p_82448_1_.field_70165_t; +- double d4 = p_82448_1_.field_70163_u; +- double d5 = p_82448_1_.field_70161_v; +- float f = p_82448_1_.field_70177_z; +- p_82448_3_.field_72984_F.func_76320_a("moving"); ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); ++ } + +- if (p_82448_1_.field_71093_bK == -1) + public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer, Teleporter teleporter) + { -+ WorldProvider pOld = par3WorldServer.provider; -+ WorldProvider pNew = par4WorldServer.provider; ++ WorldProvider pOld = par3WorldServer.field_73011_w; ++ WorldProvider pNew = par4WorldServer.field_73011_w; + double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); -+ double d0 = par1Entity.posX * moveFactor; -+ double d1 = par1Entity.posZ * moveFactor; - double d3 = par1Entity.posX; - double d4 = par1Entity.posY; - double d5 = par1Entity.posZ; - float f = par1Entity.rotationYaw; - par3WorldServer.theProfiler.startSection("moving"); - ++ double d0 = par1Entity.field_70165_t * moveFactor; ++ double d1 = par1Entity.field_70161_v * moveFactor; ++ double d3 = par1Entity.field_70165_t; ++ double d4 = par1Entity.field_70163_u; ++ double d5 = par1Entity.field_70161_v; ++ float f = par1Entity.field_70177_z; ++ par3WorldServer.field_72984_F.func_76320_a("moving"); ++ + /* - if (par1Entity.dimension == -1) ++ if (par1Entity.dimension == -1) { d0 /= d2; -@@ -502,7 +528,8 @@ - par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + d1 /= d2; +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); ++ par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.isEntityAlive()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + } + } +- else if (p_82448_1_.field_71093_bK == 0) ++ else if (par1Entity.dimension == 0) + { + d0 *= d2; + d1 *= d2; +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); ++ par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.isEntityAlive()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); } } - else + */ -+ if (par1Entity.dimension == 1) ++ if (par1Entity.field_71093_bK == 1) { ChunkCoordinates chunkcoordinates; -@@ -537,7 +564,7 @@ - if (par1Entity.isEntityAlive()) +- if (p_82448_2_ == 1) ++ if (par2 == 1) { - par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); -- par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, d3, d4, d5, f); -+ teleporter.placeInPortal(par1Entity, d3, d4, d5, f); - par4WorldServer.spawnEntityInWorld(par1Entity); - par4WorldServer.updateEntityWithOptionalForce(par1Entity, false); +- chunkcoordinates = p_82448_4_.func_72861_E(); ++ chunkcoordinates = par4WorldServer.func_72861_E(); } + else + { +- chunkcoordinates = p_82448_4_.func_73054_j(); ++ chunkcoordinates = par4WorldServer.func_73054_j(); + } + + d0 = (double)chunkcoordinates.field_71574_a; +- p_82448_1_.field_70163_u = (double)chunkcoordinates.field_71572_b; ++ par1Entity.field_70163_u = (double)chunkcoordinates.field_71572_b; + d1 = (double)chunkcoordinates.field_71573_c; +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, 90.0F, 0.0F); ++ par1Entity.func_70012_b(d0, par1Entity.field_70163_u, d1, 90.0F, 0.0F); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.func_70089_S()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ par3WorldServer.func_72866_a(par1Entity, false); + } + } + +- p_82448_3_.field_72984_F.func_76319_b(); ++ par3WorldServer.field_72984_F.func_76319_b(); + +- if (p_82448_2_ != 1) ++ if (par2 != 1) + { +- p_82448_3_.field_72984_F.func_76320_a("placing"); ++ par3WorldServer.field_72984_F.func_76320_a("placing"); + d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872); + d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.func_70089_S()) + { +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); +- p_82448_4_.func_85176_s().func_77185_a(p_82448_1_, d3, d4, d5, f); +- p_82448_4_.func_72838_d(p_82448_1_); +- p_82448_4_.func_72866_a(p_82448_1_, false); ++ par1Entity.func_70012_b(d0, par1Entity.field_70163_u, d1, par1Entity.field_70177_z, par1Entity.field_70125_A); ++ teleporter.func_77185_a(par1Entity, d3, d4, d5, f); ++ par4WorldServer.func_72838_d(par1Entity); ++ par4WorldServer.func_72866_a(par1Entity, false); + } + +- p_82448_3_.field_72984_F.func_76319_b(); ++ par3WorldServer.field_72984_F.func_76319_b(); + } + +- p_82448_1_.func_70029_a(p_82448_4_); ++ par1Entity.func_70029_a(par4WorldServer); + } + + public void func_72374_b() diff --git a/patches/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch index fa7f4a762f..206326821c 100644 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatList.java.patch @@ -1,38 +1,38 @@ --- ../src-base/minecraft/net/minecraft/stats/StatList.java +++ ../src-work/minecraft/net/minecraft/stats/StatList.java -@@ -118,7 +118,7 @@ +@@ -94,7 +94,7 @@ if (item != null) { -- int i = Item.getIdFromItem(item); -+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these - objectCraftStats[i] = (new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these + field_75928_D[i] = (new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).func_75971_g(); } } -@@ -136,7 +136,7 @@ +@@ -112,7 +112,7 @@ - if (Item.getItemFromBlock(block) != null) + if (Item.func_150898_a(block) != null) { -- int i = Block.getIdFromBlock(block); -+ int i = Block.getIdFromBlock(block); //TODO: Hook FML's stat change event and re-assign these +- int i = Block.func_149682_b(block); ++ int i = Block.func_149682_b(block); //TODO: Hook FML's stat change event and re-assign these - if (block.getEnableStats()) + if (block.func_149652_G()) { -@@ -159,7 +159,7 @@ +@@ -135,7 +135,7 @@ if (item != null) { -- int i = Item.getIdFromItem(item); -+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these - objectUseStats[i] = (new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these + field_75929_E[i] = (new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).func_75971_g(); if (!(item instanceof ItemBlock)) -@@ -182,7 +182,7 @@ +@@ -158,7 +158,7 @@ if (item != null) { -- int i = Item.getIdFromItem(item); -+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these - if (item.isDamageable()) + if (item.func_77645_m()) { diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 736205acf7..b36a10cfd9 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -11,9 +11,9 @@ import net.minecraft.world.World; import org.apache.logging.log4j.Level; -@@ -296,4 +299,93 @@ - addMapping(TileEntityComparator.class, "Comparator"); - addMapping(TileEntityFlowerPot.class, "FlowerPot"); +@@ -278,4 +281,93 @@ + func_145826_a(TileEntityComparator.class, "Comparator"); + func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); } + + // -- BEGIN FORGE PATCHES -- @@ -73,7 +73,7 @@ + /** + * Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}. + */ -+ public static final AxisAlignedBB INFINITE_EXTENT_AABB = AxisAlignedBB.getBoundingBox(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); ++ public static final AxisAlignedBB INFINITE_EXTENT_AABB = AxisAlignedBB.func_72330_a(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + /** + * Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity} + * Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block @@ -85,18 +85,18 @@ + public AxisAlignedBB getRenderBoundingBox() + { + AxisAlignedBB bb = INFINITE_EXTENT_AABB; -+ Block type = getBlockType(); -+ if (type == Blocks.enchanting_table) ++ Block type = func_145838_q(); ++ if (type == Blocks.field_150381_bn) + { -+ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); ++ bb = AxisAlignedBB.func_72332_a().func_72299_a(field_145851_c, field_145848_d, field_145849_e, field_145851_c + 1, field_145848_d + 1, field_145849_e + 1); + } -+ else if (type == Blocks.chest || type == Blocks.trapped_chest) ++ else if (type == Blocks.field_150486_ae || type == Blocks.field_150447_bR) + { -+ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2); ++ bb = AxisAlignedBB.func_72332_a().func_72299_a(field_145851_c - 1, field_145848_d, field_145849_e - 1, field_145851_c + 2, field_145848_d + 2, field_145849_e + 2); + } -+ else if (type != null && type != Blocks.beacon) ++ else if (type != null && type != Blocks.field_150461_bJ) + { -+ AxisAlignedBB cbb = type.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord, zCoord); ++ AxisAlignedBB cbb = type.func_149668_a(field_145850_b, field_145851_c, field_145848_d, field_145849_e); + if (cbb != null) + { + bb = cbb; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index 5e27aeba72..555b5515b9 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java -@@ -115,7 +115,7 @@ +@@ -110,7 +110,7 @@ { - Block block = this.worldObj.getBlock(l, k, i1); + Block block = this.field_145850_b.func_147439_a(l, k, i1); -- if (block != Blocks.emerald_block && block != Blocks.gold_block && block != Blocks.diamond_block && block != Blocks.iron_block) -+ if (!block.isBeaconBase(this.worldObj, l, k, i1, xCoord, yCoord, zCoord)) +- if (block != Blocks.field_150475_bE && block != Blocks.field_150340_R && block != Blocks.field_150484_ah && block != Blocks.field_150339_S) ++ if (!block.isBeaconBase(this.field_145850_b, l, k, i1, field_145851_c, field_145848_d, field_145849_e)) { flag = false; break; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index d33517b0ef..6bd1efdd9b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -9,50 +9,50 @@ public class TileEntityBrewingStand extends TileEntity implements ISidedInventory { -@@ -109,7 +111,7 @@ +@@ -104,7 +106,7 @@ for (int i = 0; i < 3; ++i) { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) { - int j = this.brewingItemStacks[i].getItemDamage(); + int j = this.field_145945_j[i].func_77960_j(); int k = this.func_145936_c(j, itemstack); -@@ -148,7 +150,7 @@ +@@ -143,7 +145,7 @@ for (int i = 0; i < 3; ++i) { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) { - int j = this.brewingItemStacks[i].getItemDamage(); + int j = this.field_145945_j[i].func_77960_j(); int k = this.func_145936_c(j, itemstack); -@@ -169,9 +171,9 @@ +@@ -164,9 +166,9 @@ } } -- if (itemstack.getItem().hasContainerItem()) -+ if (itemstack.getItem().hasContainerItem(itemstack)) +- if (itemstack.func_77973_b().func_77634_r()) ++ if (itemstack.func_77973_b().hasContainerItem(itemstack)) { -- this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); -+ this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); +- this.field_145945_j[3] = new ItemStack(itemstack.func_77973_b().func_77668_q()); ++ this.field_145945_j[3] = itemstack.func_77973_b().getContainerItem(itemstack); } else { -@@ -182,6 +184,7 @@ - this.brewingItemStacks[3] = null; +@@ -177,6 +179,7 @@ + this.field_145945_j[3] = null; } } -+ MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks)); ++ MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(field_145945_j)); } } -@@ -304,7 +307,7 @@ - // JAVADOC METHOD $$ func_94041_b - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) +@@ -292,7 +295,7 @@ + + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) { -- return par1 == 3 ? par2ItemStack.getItem().isPotionIngredient(par2ItemStack) : par2ItemStack.getItem() == Items.potionitem || par2ItemStack.getItem() == Items.glass_bottle; -+ return par1 == 3 ? par2ItemStack.getItem().isPotionIngredient(par2ItemStack) : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; +- return p_94041_1_ == 3 ? p_94041_2_.func_77973_b().func_150892_m(p_94041_2_) : p_94041_2_.func_77973_b() == Items.field_151068_bn || p_94041_2_.func_77973_b() == Items.field_151069_bo; ++ return p_94041_1_ == 3 ? p_94041_2_.func_77973_b().func_150892_m(p_94041_2_) : p_94041_2_.func_77973_b() instanceof ItemPotion || p_94041_2_.func_77973_b() == Items.field_151069_bo; } @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index bc5011a13e..becd9b9a5b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,34 +1,34 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -@@ -232,8 +232,7 @@ +@@ -217,8 +217,7 @@ - if (this.furnaceItemStacks[1].stackSize == 0) + if (this.field_145957_n[1].field_77994_a == 0) { -- Item item = this.furnaceItemStacks[1].getItem().getContainerItem(); -- this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null; -+ this.furnaceItemStacks[1] = furnaceItemStacks[1].getItem().getContainerItem(furnaceItemStacks[1]); +- Item item = this.field_145957_n[1].func_77973_b().func_77668_q(); +- this.field_145957_n[1] = item != null ? new ItemStack(item) : null; ++ this.field_145957_n[1] = field_145957_n[1].func_77973_b().getContainerItem(field_145957_n[1]); } } } -@@ -278,7 +277,11 @@ +@@ -262,7 +261,11 @@ else { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); -- return itemstack == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize()))); + ItemStack itemstack = FurnaceRecipes.func_77602_a().func_151395_a(this.field_145957_n[0]); +- return itemstack == null ? false : (this.field_145957_n[2] == null ? true : (!this.field_145957_n[2].func_77969_a(itemstack) ? false : (this.field_145957_n[2].field_77994_a < this.func_70297_j_() && this.field_145957_n[2].field_77994_a < this.field_145957_n[2].func_77976_d() ? true : this.field_145957_n[2].field_77994_a < itemstack.func_77976_d()))); + if (itemstack == null) return false; -+ if (this.furnaceItemStacks[2] == null) return true; -+ if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false; -+ int result = furnaceItemStacks[2].stackSize + itemstack.stackSize; -+ return result <= getInventoryStackLimit() && result <= this.furnaceItemStacks[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. ++ if (this.field_145957_n[2] == null) return true; ++ if (!this.field_145957_n[2].func_77969_a(itemstack)) return false; ++ int result = field_145957_n[2].field_77994_a + itemstack.field_77994_a; ++ return result <= func_70297_j_() && result <= this.field_145957_n[2].func_77976_d(); //Forge BugFix: Make it respect stack sizes properly. } } -@@ -295,7 +298,7 @@ +@@ -278,7 +281,7 @@ } - else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) + else if (this.field_145957_n[2].func_77973_b() == itemstack.func_77973_b()) { -- ++this.furnaceItemStacks[2].stackSize; -+ this.furnaceItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items +- ++this.field_145957_n[2].field_77994_a; ++ this.field_145957_n[2].field_77994_a += itemstack.field_77994_a; // Forge BugFix: Results may have multiple items } - --this.furnaceItemStacks[0].stackSize; + --this.field_145957_n[0].field_77994_a; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index bed820709b..9e02922ec6 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -1,38 +1,38 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java -@@ -404,17 +404,30 @@ +@@ -393,17 +393,30 @@ if (itemstack1 == null) { -- p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_); +- p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_); - p_145899_1_ = null; + //Forge: BUGFIX: Again, make things respect max stack sizes. -+ int max = Math.min(p_145899_1_.getMaxStackSize(), p_145899_0_.getInventoryStackLimit()); -+ if (max >= p_145899_1_.stackSize) ++ int max = Math.min(p_145899_1_.func_77976_d(), p_145899_0_.func_70297_j_()); ++ if (max >= p_145899_1_.field_77994_a) + { -+ p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_); ++ p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_); + p_145899_1_ = null; + } + else + { -+ p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_.splitStack(max)); ++ p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_.func_77979_a(max)); + } flag = true; } else if (func_145894_a(itemstack1, p_145899_1_)) { -- int k = p_145899_1_.getMaxStackSize() - itemstack1.stackSize; -- int l = Math.min(p_145899_1_.stackSize, k); -- p_145899_1_.stackSize -= l; -- itemstack1.stackSize += l; +- int k = p_145899_1_.func_77976_d() - itemstack1.field_77994_a; +- int l = Math.min(p_145899_1_.field_77994_a, k); +- p_145899_1_.field_77994_a -= l; +- itemstack1.field_77994_a += l; - flag = l > 0; + //Forge: BUGFIX: Again, make things respect max stack sizes. -+ int max = Math.min(p_145899_1_.getMaxStackSize(), p_145899_0_.getInventoryStackLimit()); -+ if (max > itemstack1.stackSize) ++ int max = Math.min(p_145899_1_.func_77976_d(), p_145899_0_.func_70297_j_()); ++ if (max > itemstack1.field_77994_a) + { -+ int l = Math.min(p_145899_1_.stackSize, max - itemstack1.stackSize); -+ p_145899_1_.stackSize -= l; -+ itemstack1.stackSize += l; ++ int l = Math.min(p_145899_1_.field_77994_a, max - itemstack1.field_77994_a); ++ p_145899_1_.field_77994_a -= l; ++ itemstack1.field_77994_a += l; + flag = l > 0; + } } diff --git a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch index 5fb3f730db..183ba01662 100644 --- a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch +++ b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java +++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java -@@ -20,6 +20,12 @@ - public Entity entityHit; +@@ -13,6 +13,12 @@ + public Entity field_72308_g; private static final String __OBFID = "CL_00000610"; + /** Used to determine what sub-segment is hit */ @@ -10,6 +10,6 @@ + /** Used to add extra hit info */ + public Object hitInfo = null; + - public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3 par5Vec3) + public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) { - this(par1, par2, par3, par4, par5Vec3, true); + this(p_i2303_1_, p_i2303_2_, p_i2303_3_, p_i2303_4_, p_i2303_5_, true); diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch index 5cca61d864..ad9b888bf9 100644 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -17,6 +17,6 @@ + System.out.println("========================================================="); + + } - this.username = p_i45006_1_; - this.playerID = p_i45006_2_; - this.token = p_i45006_3_; + this.field_74286_b = p_i45006_1_; + this.field_148257_b = p_i45006_2_; + this.field_148258_c = p_i45006_3_; diff --git a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch index 8fd38ab460..fc1bd1b912 100644 --- a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch +++ b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch @@ -8,60 +8,60 @@ public class WeightedRandomChestContent extends WeightedRandom.Item { -@@ -38,23 +39,12 @@ - for (int j = 0; j < par3; ++j) +@@ -34,23 +35,12 @@ + for (int j = 0; j < p_76293_3_; ++j) { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent); -- int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + par0Random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(par0Random, par2IInventory); + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76274_a(p_76293_0_, p_76293_1_); +- int k = weightedrandomchestcontent.field_76295_d + p_76293_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_76293_0_, p_76293_2_); -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k) +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= k) + for (ItemStack item : stacks) { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = k; -- par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), itemstack); -+ par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), item); +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = k; +- p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), itemstack); ++ p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), item); } - else - { - for (int l = 0; l < k; ++l) - { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = 1; -- par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), itemstack1); +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = 1; +- p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), itemstack1); - } - } } } -@@ -64,22 +54,11 @@ +@@ -60,22 +50,11 @@ { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(p_150706_0_, p_150706_1_); - int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + p_150706_0_.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1); + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76274_a(p_150706_0_, p_150706_1_); + int k = weightedrandomchestcontent.field_76295_d + p_150706_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); - -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k) +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= k) + ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_150706_0_, p_150706_2_); + for (ItemStack item : stacks) { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = k; -- p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), itemstack); -+ p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), item); +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = k; +- p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), itemstack); ++ p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), item); } - else - { - for (int l = 0; l < k; ++l) - { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = 1; -- p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), itemstack1); +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = 1; +- p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), itemstack1); - } - } } } -@@ -104,4 +83,17 @@ +@@ -100,4 +79,17 @@ return aweightedrandomchestcontent1; } @@ -76,6 +76,6 @@ + */ + protected ItemStack[] generateChestContent(Random random, IInventory newInventory) + { -+ return ChestGenHooks.generateStacks(random, theItemId, theMinimumChanceToGenerateItem, theMaximumChanceToGenerateItem); ++ return ChestGenHooks.generateStacks(random, field_76297_b, field_76295_d, field_76296_e); + } } diff --git a/patches/minecraft/net/minecraft/village/VillageCollection.java.patch b/patches/minecraft/net/minecraft/village/VillageCollection.java.patch index c0eff1ca44..8e1f09121e 100644 --- a/patches/minecraft/net/minecraft/village/VillageCollection.java.patch +++ b/patches/minecraft/net/minecraft/village/VillageCollection.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/village/VillageCollection.java +++ ../src-work/minecraft/net/minecraft/village/VillageCollection.java -@@ -152,7 +152,7 @@ +@@ -147,7 +147,7 @@ { Village village = (Village)iterator.next(); - int j = (int)village.getCenter().getDistanceSquared(villagedoorinfo.posX, villagedoorinfo.posY, villagedoorinfo.posZ); -- int k = 32 + village.getVillageRadius(); -+ float k = 32f + village.getVillageRadius(); //BugFix: Avoid int wrapping + int j = (int)village.func_75577_a().func_71569_e(villagedoorinfo.field_75481_a, villagedoorinfo.field_75479_b, villagedoorinfo.field_75480_c); +- int k = 32 + village.func_75568_b(); ++ float k = 32f + village.func_75568_b(); //BugFix: Avoid int wrapping if (j > k * k) { diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch index a9b34b15ba..49af7c5830 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -8,39 +8,39 @@ public class ChunkCache implements IBlockAccess { -@@ -95,6 +96,8 @@ +@@ -92,6 +93,8 @@ { - int l = (p_147438_1_ >> 4) - this.chunkX; - int i1 = (p_147438_3_ >> 4) - this.chunkZ; -+ if (l < 0 || l >= chunkArray.length || i1 < 0 || i1 >= chunkArray[l].length) return null; -+ if (chunkArray[l][i1] == null) return null; - return this.chunkArray[l][i1].func_150806_e(p_147438_1_ & 15, p_147438_2_, p_147438_3_ & 15); + int l = (p_147438_1_ >> 4) - this.field_72818_a; + int i1 = (p_147438_3_ >> 4) - this.field_72816_b; ++ if (l < 0 || l >= field_72817_c.length || i1 < 0 || i1 >= field_72817_c[l].length) return null; ++ if (field_72817_c[l][i1] == null) return null; + return this.field_72817_c[l][i1].func_150806_e(p_147438_1_ & 15, p_147438_2_, p_147438_3_ & 15); } -@@ -128,6 +131,8 @@ +@@ -123,6 +126,8 @@ { - int l = (par1 >> 4) - this.chunkX; - int i1 = (par3 >> 4) - this.chunkZ; -+ if (l < 0 || l >= chunkArray.length || i1 < 0 || i1 >= chunkArray[l].length) return 0; -+ if (chunkArray[l][i1] == null) return 0; - return this.chunkArray[l][i1].getBlockMetadata(par1 & 15, par2, par3 & 15); + int l = (p_72805_1_ >> 4) - this.field_72818_a; + int i1 = (p_72805_3_ >> 4) - this.field_72816_b; ++ if (l < 0 || l >= field_72817_c.length || i1 < 0 || i1 >= field_72817_c[l].length) return 0; ++ if (field_72817_c[l][i1] == null) return 0; + return this.field_72817_c[l][i1].func_76628_c(p_72805_1_ & 15, p_72805_2_, p_72805_3_ & 15); } } -@@ -146,10 +151,9 @@ +@@ -138,10 +143,9 @@ + return this.field_72815_e.func_82732_R(); } - // JAVADOC METHOD $$ func_147437_c - @SideOnly(Side.CLIENT) - public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) + public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) { -- return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; -+ return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); +- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; ++ return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); } - // JAVADOC METHOD $$ func_72810_a -@@ -259,4 +263,15 @@ + @SideOnly(Side.CLIENT) +@@ -247,4 +251,15 @@ { - return this.getBlock(par1, par2, par3).isProvidingStrongPower(this, par1, par2, par3, par4); + return this.func_147439_a(p_72879_1_, p_72879_2_, p_72879_3_).func_149748_c(this, p_72879_1_, p_72879_2_, p_72879_3_, p_72879_4_); } + + @Override @@ -51,6 +51,6 @@ + return _default; + } + -+ return getBlock(x, y, z).isSideSolid(this, x, y, z, side); ++ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); + } } diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index ac497ce46e..1d9c989469 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,21 +1,21 @@ --- ../src-base/minecraft/net/minecraft/world/Explosion.java +++ ../src-work/minecraft/net/minecraft/world/Explosion.java -@@ -90,7 +90,7 @@ +@@ -86,7 +86,7 @@ - if (block.getMaterial() != Material.air) + if (block.func_149688_o() != Material.field_151579_a) { -- float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder); -+ float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ); +- float f3 = this.field_77283_e != null ? this.field_77283_e.func_145772_a(this, this.field_77287_j, j1, k1, l1, block) : block.func_149638_a(this.field_77283_e); ++ float f3 = this.field_77283_e != null ? this.field_77283_e.func_145772_a(this, this.field_77287_j, j1, k1, l1, block) : block.getExplosionResistance(this.field_77283_e, field_77287_j, j1, k1, l1, field_77284_b, field_77285_c, field_77282_d); f1 -= (f3 + 0.3F) * f2; } -@@ -216,8 +216,7 @@ - block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0); +@@ -211,8 +211,7 @@ + block.func_149690_a(this.field_77287_j, i, j, k, this.field_77287_j.func_72805_g(i, j, k), 1.0F / this.field_77280_f, 0); } -- this.worldObj.setBlock(i, j, k, Blocks.air, 0, 3); -- block.onBlockDestroyedByExplosion(this.worldObj, i, j, k, this); -+ block.onBlockExploded(this.worldObj, i, j, k, this); +- this.field_77287_j.func_147465_d(i, j, k, Blocks.field_150350_a, 0, 3); +- block.func_149723_a(this.field_77287_j, i, j, k, this); ++ block.onBlockExploded(this.field_77287_j, i, j, k, this); } } } diff --git a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch index 6171ab2a14..d4318e346f 100644 --- a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch +++ b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch @@ -8,18 +8,18 @@ public interface IBlockAccess { -@@ -21,7 +22,6 @@ - int getBlockMetadata(int var1, int var2, int var3); +@@ -18,7 +19,6 @@ + + int func_72805_g(int var1, int var2, int var3); - // JAVADOC METHOD $$ func_147437_c - @SideOnly(Side.CLIENT) - boolean isAirBlock(int var1, int var2, int var3); + boolean func_147437_c(int var1, int var2, int var3); - // JAVADOC METHOD $$ func_72807_a -@@ -41,4 +41,16 @@ + @SideOnly(Side.CLIENT) +@@ -33,4 +33,16 @@ + Vec3Pool func_82732_R(); - // JAVADOC METHOD $$ func_72879_k - int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4); + int func_72879_k(int var1, int var2, int var3, int var4); + + /** + * FORGE: isSideSolid, pulled up from {@link World} diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch index c478c7ff25..6735b00a7d 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch @@ -17,49 +17,49 @@ + public final class SpawnerAnimals { - // JAVADOC FIELD $$ field_77193_b -@@ -80,9 +85,12 @@ + private HashMap field_77193_b = new HashMap(); +@@ -78,9 +83,12 @@ { EnumCreatureType enumcreaturetype = aenumcreaturetype[k3]; -- if ((!enumcreaturetype.getPeacefulCreature() || par3) && (enumcreaturetype.getPeacefulCreature() || par2) && (!enumcreaturetype.getAnimal() || par4) && par1WorldServer.countEntities(enumcreaturetype.getCreatureClass()) <= enumcreaturetype.getMaxNumberOfCreature() * this.eligibleChunksForSpawning.size() / 256) -+ if ((!enumcreaturetype.getPeacefulCreature() || par3) && (enumcreaturetype.getPeacefulCreature() || par2) && (!enumcreaturetype.getAnimal() || par4) && par1WorldServer.countEntities(enumcreaturetype, true) <= enumcreaturetype.getMaxNumberOfCreature() * this.eligibleChunksForSpawning.size() / 256) +- if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_) && p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()) <= enumcreaturetype.func_75601_b() * this.field_77193_b.size() / 256) ++ if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_) && p_77192_1_.countEntities(enumcreaturetype, true) <= enumcreaturetype.func_75601_b() * this.field_77193_b.size() / 256) { - Iterator iterator = this.eligibleChunksForSpawning.keySet().iterator(); -+ ArrayList tmp = new ArrayList(eligibleChunksForSpawning.keySet()); + Iterator iterator = this.field_77193_b.keySet().iterator(); ++ ArrayList tmp = new ArrayList(field_77193_b.keySet()); + Collections.shuffle(tmp); + iterator = tmp.iterator(); label110: while (iterator.hasNext()) -@@ -160,13 +168,17 @@ +@@ -158,13 +166,17 @@ - entityliving.setLocationAndAngles((double)f, (double)f1, (double)f2, par1WorldServer.rand.nextFloat() * 360.0F, 0.0F); + entityliving.func_70012_b((double)f, (double)f1, (double)f2, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); -- if (entityliving.getCanSpawnHere()) -+ Result canSpawn = ForgeEventFactory.canEntitySpawn(entityliving, par1WorldServer, f, f1, f2); -+ if (canSpawn == Result.ALLOW || (canSpawn == Result.DEFAULT && entityliving.getCanSpawnHere())) +- if (entityliving.func_70601_bi()) ++ Result canSpawn = ForgeEventFactory.canEntitySpawn(entityliving, p_77192_1_, f, f1, f2); ++ if (canSpawn == Result.ALLOW || (canSpawn == Result.DEFAULT && entityliving.func_70601_bi())) { ++i2; - par1WorldServer.spawnEntityInWorld(entityliving); -- ientitylivingdata = entityliving.onSpawnWithEgg(ientitylivingdata); -+ if (!ForgeEventFactory.doSpecialSpawn(entityliving, par1WorldServer, f, f1, f2)) + p_77192_1_.func_72838_d(entityliving); +- ientitylivingdata = entityliving.func_110161_a(ientitylivingdata); ++ if (!ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, f1, f2)) + { -+ ientitylivingdata = entityliving.onSpawnWithEgg(ientitylivingdata); ++ ientitylivingdata = entityliving.func_110161_a(ientitylivingdata); + } -- if (i2 >= entityliving.getMaxSpawnedInChunk()) +- if (i2 >= entityliving.func_70641_bl()) + if (j2 >= ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { continue label110; } -@@ -210,7 +222,8 @@ +@@ -207,7 +219,8 @@ else { - Block block = par1World.getBlock(par2, par3 - 1, par4); -- return block != Blocks.bedrock && !par1World.getBlock(par2, par3, par4).isNormalCube() && !par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); -+ boolean spawnBlock = block.canCreatureSpawn(par0EnumCreatureType, par1World, par2, par3 - 1, par4); -+ return spawnBlock && block != Blocks.bedrock && !par1World.getBlock(par2, par3, par4).isNormalCube() && !par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); + Block block = p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ - 1, p_77190_4_); +- return block != Blocks.field_150357_h && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149721_r() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149688_o().func_76224_d() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ + 1, p_77190_4_).func_149721_r(); ++ boolean spawnBlock = block.canCreatureSpawn(p_77190_0_, p_77190_1_, p_77190_2_, p_77190_3_ - 1, p_77190_4_); ++ return spawnBlock && block != Blocks.field_150357_h && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149721_r() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149688_o().func_76224_d() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ + 1, p_77190_4_).func_149721_r(); } } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 1800275ff0..c2ccf3625a 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -33,26 +33,54 @@ + + public final MapStorage perWorldStorage; + - // JAVADOC FIELD $$ field_72999_e - public boolean scheduledUpdatesAreImmediate; - // JAVADOC FIELD $$ field_72996_f -@@ -121,6 +148,11 @@ - // JAVADOC METHOD $$ func_72807_a - public BiomeGenBase getBiomeGenForCoords(final int par1, final int par2) + public boolean field_72999_e; + public List field_72996_f = new ArrayList(); + protected List field_72997_g = new ArrayList(); +@@ -98,13 +125,18 @@ + + public BiomeGenBase func_72807_a(final int p_72807_1_, final int p_72807_2_) { -+ return provider.getBiomeGenForCoords(par1, par2); +- if (this.func_72899_e(p_72807_1_, 0, p_72807_2_)) ++ return field_73011_w.getBiomeGenForCoords(p_72807_1_, p_72807_2_); + } + + public BiomeGenBase getBiomeGenForCoordsBody(final int par1, final int par2) + { - if (this.blockExists(par1, 0, par2)) ++ if (this.func_72899_e(par1, 0, par2)) { - Chunk chunk = this.getChunkFromBlockCoords(par1, par2); -@@ -167,7 +199,13 @@ - this.theProfiler = p_i45368_5_; - this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_); - this.provider = p_i45368_3_; -- this.mapStorage = new MapStorage(p_i45368_1_); +- Chunk chunk = this.func_72938_d(p_72807_1_, p_72807_2_); ++ Chunk chunk = this.func_72938_d(par1, par2); + + try + { +- return chunk.func_76591_a(p_72807_1_ & 15, p_72807_2_ & 15, this.field_73011_w.field_76578_c); ++ return chunk.func_76591_a(par1 & 15, par2 & 15, this.field_73011_w.field_76578_c); + } + catch (Throwable throwable) + { +@@ -115,7 +147,7 @@ + private static final String __OBFID = "CL_00000141"; + public String call() + { +- return CrashReportCategory.func_85071_a(p_72807_1_, 0, p_72807_2_); ++ return CrashReportCategory.func_85071_a(par1, 0, par2); + } + }); + throw new ReportedException(crashreport); +@@ -123,7 +155,7 @@ + } + else + { +- return this.field_73011_w.field_76578_c.func_76935_a(p_72807_1_, p_72807_2_); ++ return this.field_73011_w.field_76578_c.func_76935_a(par1, par2); + } + } + +@@ -144,7 +176,13 @@ + this.field_72984_F = p_i45368_5_; + this.field_72986_A = new WorldInfo(p_i45368_4_, p_i45368_2_); + this.field_73011_w = p_i45368_3_; +- this.field_72988_C = new MapStorage(p_i45368_1_); + perWorldStorage = new MapStorage((ISaveHandler)null); + } + @@ -60,33 +88,33 @@ + @SideOnly(Side.CLIENT) + protected void finishSetup() + { - VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages"); if (villagecollection == null) -@@ -181,7 +219,10 @@ - this.villageCollectionObj.func_82566_a(this); +@@ -158,7 +196,10 @@ + this.field_72982_D.func_82566_a(this); } -- p_i45368_3_.registerWorld(this); +- p_i45368_3_.func_76558_a(this); + // Guarantee the dimension ID was not reset by the provider -+ int providerDim = this.provider.dimensionId; -+ this.provider.registerWorld(this); -+ this.provider.dimensionId = providerDim; - this.chunkProvider = this.createChunkProvider(); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); -@@ -196,7 +237,7 @@ - this.lightUpdateBlockList = new int[32768]; - this.saveHandler = p_i45369_1_; - this.theProfiler = p_i45369_5_; -- this.mapStorage = new MapStorage(p_i45369_1_); -+ this.mapStorage = getMapStorage(p_i45369_1_); - this.worldInfo = p_i45369_1_.loadWorldInfo(); ++ int providerDim = this.field_73011_w.field_76574_g; ++ this.field_73011_w.func_76558_a(this); ++ this.field_73011_w.field_76574_g = providerDim; + this.field_73020_y = this.func_72970_h(); + this.func_72966_v(); + this.func_72947_a(); +@@ -173,7 +214,7 @@ + this.field_72994_J = new int[32768]; + this.field_73019_z = p_i45369_1_; + this.field_72984_F = p_i45369_5_; +- this.field_72988_C = new MapStorage(p_i45369_1_); ++ this.field_72988_C = getMapStorage(p_i45369_1_); + this.field_72986_A = p_i45369_1_.func_75757_d(); if (p_i45369_4_ != null) -@@ -224,6 +265,15 @@ - this.provider.registerWorld(this); - this.chunkProvider = this.createChunkProvider(); +@@ -201,6 +242,15 @@ + this.field_73011_w.func_76558_a(this); + this.field_73020_y = this.func_72970_h(); + if (this instanceof WorldServer) + { @@ -97,26 +125,26 @@ + this.perWorldStorage = new MapStorage((ISaveHandler)null); + } + - if (!this.worldInfo.isInitialized()) + if (!this.field_72986_A.func_76070_v()) { try -@@ -249,12 +299,12 @@ - this.worldInfo.setServerInitialized(true); +@@ -226,12 +276,12 @@ + this.field_72986_A.func_76091_d(true); } -- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, "villages"); +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages"); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, "villages"); if (villagecollection == null) { - this.villageCollectionObj = new VillageCollection(this); -- this.mapStorage.setData("villages", this.villageCollectionObj); -+ this.perWorldStorage.setData("villages", this.villageCollectionObj); + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a("villages", this.field_72982_D); ++ this.perWorldStorage.func_75745_a("villages", this.field_72982_D); } else { -@@ -266,6 +316,20 @@ - this.calculateInitialWeather(); +@@ -243,6 +293,20 @@ + this.func_72947_a(); } + private static MapStorage s_mapStorage; @@ -133,147 +161,203 @@ + return s_mapStorage; + } + - // JAVADOC METHOD $$ func_72970_h - protected abstract IChunkProvider createChunkProvider(); + protected abstract IChunkProvider func_72970_h(); -@@ -322,7 +386,8 @@ - // JAVADOC METHOD $$ func_147437_c - public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) + protected void func_72963_a(WorldSettings p_72963_1_) +@@ -296,7 +360,8 @@ + + public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) { -- return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; -+ Block block = this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_); +- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; ++ Block block = this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_); + return block.isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); } - // JAVADOC METHOD $$ func_72899_e -@@ -981,7 +1046,7 @@ - // JAVADOC METHOD $$ func_72935_r - public boolean isDaytime() + public boolean func_72899_e(int p_72899_1_, int p_72899_2_, int p_72899_3_) +@@ -928,7 +993,7 @@ + + public boolean func_72935_r() { -- return this.skylightSubtracted < 4; -+ return provider.isDaytime(); +- return this.field_73008_k < 4; ++ return field_73011_w.isDaytime(); } - // JAVADOC METHOD $$ func_72933_a -@@ -1215,6 +1280,12 @@ - // JAVADOC METHOD $$ func_72956_a - public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) + public MovingObjectPosition func_72933_a(Vec3 p_72933_1_, Vec3 p_72933_2_) +@@ -1159,6 +1224,12 @@ + + public void func_72956_a(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) { -+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(par1Entity, par2Str, par3, par4); ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_72956_1_, p_72956_2_, p_72956_3_, p_72956_4_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } -+ par2Str = event.name; - for (int i = 0; i < this.worldAccesses.size(); ++i) ++ p_72956_2_ = event.name; + for (int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSound(par2Str, par1Entity.posX, par1Entity.posY - (double)par1Entity.yOffset, par1Entity.posZ, par3, par4); -@@ -1224,6 +1295,12 @@ - // JAVADOC METHOD $$ func_85173_a - public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) + ((IWorldAccess)this.field_73021_x.get(i)).func_72704_a(p_72956_2_, p_72956_1_.field_70165_t, p_72956_1_.field_70163_u - (double)p_72956_1_.field_70129_M, p_72956_1_.field_70161_v, p_72956_3_, p_72956_4_); +@@ -1167,6 +1238,12 @@ + + public void func_85173_a(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) { -+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(par1EntityPlayer, par2Str, par3, par4); ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_85173_1_, p_85173_2_, p_85173_3_, p_85173_4_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } -+ par2Str = event.name; - for (int i = 0; i < this.worldAccesses.size(); ++i) ++ p_85173_2_ = event.name; + for (int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(par1EntityPlayer, par2Str, par1EntityPlayer.posX, par1EntityPlayer.posY - (double)par1EntityPlayer.yOffset, par1EntityPlayer.posZ, par3, par4); -@@ -1291,6 +1368,7 @@ - this.playerEntities.add(entityplayer); - this.updateAllPlayersSleepingFlag(); + ((IWorldAccess)this.field_73021_x.get(i)).func_85102_a(p_85173_1_, p_85173_2_, p_85173_1_.field_70165_t, p_85173_1_.field_70163_u - (double)p_85173_1_.field_70129_M, p_85173_1_.field_70161_v, p_85173_3_, p_85173_4_); +@@ -1228,6 +1305,7 @@ + this.field_73010_i.add(entityplayer); + this.func_72854_c(); } -+ if (MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(par1Entity, this)) && !flag) return false; ++ if (MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(p_72838_1_, this)) && !flag) return false; - this.getChunkFromChunkCoords(i, j).addEntity(par1Entity); - this.loadedEntityList.add(par1Entity); -@@ -1487,7 +1565,6 @@ + this.func_72964_e(i, j).func_76612_a(p_72838_1_); + this.field_72996_f.add(p_72838_1_); +@@ -1418,7 +1496,6 @@ + return (int)(f2 * 11.0F); } - // JAVADOC METHOD $$ func_72848_b - @SideOnly(Side.CLIENT) - public void removeWorldAccess(IWorldAccess par1IWorldAccess) + public void func_72848_b(IWorldAccess p_72848_1_) { - this.worldAccesses.remove(par1IWorldAccess); -@@ -1520,6 +1597,12 @@ + this.field_73021_x.remove(p_72848_1_); +@@ -1449,7 +1526,13 @@ @SideOnly(Side.CLIENT) - public Vec3 getSkyColor(Entity par1Entity, float par2) + public Vec3 func_72833_a(Entity p_72833_1_, float p_72833_2_) { -+ return provider.getSkyColor(par1Entity, par2); +- float f1 = this.func_72826_c(p_72833_2_); ++ return field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColorBody(Entity par1Entity, float par2) + { - float f1 = this.getCelestialAngle(par2); - float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; ++ float f1 = this.func_72826_c(par2); + float f2 = MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1536,9 +1619,7 @@ - int i = MathHelper.floor_double(par1Entity.posX); - int j = MathHelper.floor_double(par1Entity.posY); - int k = MathHelper.floor_double(par1Entity.posZ); -- BiomeGenBase biomegenbase = this.getBiomeGenForCoords(i, k); -- float f3 = biomegenbase.getFloatTemperature(i, j, k); -- int l = biomegenbase.getSkyColorByTemp(f3); + if (f2 < 0.0F) +@@ -1462,19 +1545,17 @@ + f2 = 1.0F; + } + +- int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t); +- int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); +- int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); +- BiomeGenBase biomegenbase = this.func_72807_a(i, k); +- float f3 = biomegenbase.func_150564_a(i, j, k); +- int l = biomegenbase.func_76731_a(f3); ++ int i = MathHelper.func_76128_c(par1Entity.field_70165_t); ++ int j = MathHelper.func_76128_c(par1Entity.field_70163_u); ++ int k = MathHelper.func_76128_c(par1Entity.field_70161_v); + int l = ForgeHooksClient.getSkyBlendColour(this, i, j, k); float f4 = (float)(l >> 16 & 255) / 255.0F; float f5 = (float)(l >> 8 & 255) / 255.0F; float f6 = (float)(l & 255) / 255.0F; -@@ -1615,6 +1696,12 @@ + f4 *= f2; + f5 *= f2; + f6 *= f2; +- float f7 = this.func_72867_j(p_72833_2_); ++ float f7 = this.func_72867_j(par2); + float f8; + float f9; + +@@ -1487,7 +1568,7 @@ + f6 = f6 * f9 + f8 * (1.0F - f9); + } + +- f8 = this.func_72819_i(p_72833_2_); ++ f8 = this.func_72819_i(par2); + + if (f8 > 0.0F) + { +@@ -1500,7 +1581,7 @@ + + if (this.field_73016_r > 0) + { +- f9 = (float)this.field_73016_r - p_72833_2_; ++ f9 = (float)this.field_73016_r - par2; + + if (f9 > 1.0F) + { +@@ -1541,7 +1622,13 @@ @SideOnly(Side.CLIENT) - public Vec3 getCloudColour(float par1) + public Vec3 func_72824_f(float p_72824_1_) { -+ return provider.drawClouds(par1); +- float f1 = this.func_72826_c(p_72824_1_); ++ return field_73011_w.drawClouds(p_72824_1_); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawCloudsBody(float par1) + { - float f1 = this.getCelestialAngle(par1); - float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; ++ float f1 = this.func_72826_c(par1); + float f2 = MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1679,6 +1766,8 @@ - public int getTopSolidOrLiquidBlock(int par1, int par2) - { - Chunk chunk = this.getChunkFromBlockCoords(par1, par2); -+ int x = par1; -+ int z = par2; - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; + if (f2 < 0.0F) +@@ -1557,7 +1644,7 @@ + float f3 = (float)(this.field_73001_c >> 16 & 255L) / 255.0F; + float f4 = (float)(this.field_73001_c >> 8 & 255L) / 255.0F; + float f5 = (float)(this.field_73001_c & 255L) / 255.0F; +- float f6 = this.func_72867_j(p_72824_1_); ++ float f6 = this.func_72867_j(par1); + float f7; + float f8; -@@ -1686,7 +1775,7 @@ +@@ -1573,7 +1660,7 @@ + f3 *= f2 * 0.9F + 0.1F; + f4 *= f2 * 0.9F + 0.1F; + f5 *= f2 * 0.85F + 0.15F; +- f7 = this.func_72819_i(p_72824_1_); ++ f7 = this.func_72819_i(par1); + + if (f7 > 0.0F) { - Block block = chunk.getBlock(par1, k, par2); +@@ -1602,6 +1689,8 @@ + public int func_72825_h(int p_72825_1_, int p_72825_2_) + { + Chunk chunk = this.func_72938_d(p_72825_1_, p_72825_2_); ++ int x = p_72825_1_; ++ int z = p_72825_2_; + int k = chunk.func_76625_h() + 15; + p_72825_1_ &= 15; -- if (block.getMaterial().blocksMovement() && block.getMaterial() != Material.leaves) -+ if (block.getMaterial().blocksMovement() && block.getMaterial() != Material.leaves && !block.isFoliage(this, x, k, z)) +@@ -1609,7 +1698,7 @@ + { + Block block = chunk.func_150810_a(p_72825_1_, k, p_72825_2_); + +- if (block.func_149688_o().func_76230_c() && block.func_149688_o() != Material.field_151584_j) ++ if (block.func_149688_o().func_76230_c() && block.func_149688_o() != Material.field_151584_j && !block.isFoliage(this, x, k, z)) { return k + 1; } -@@ -1699,6 +1788,12 @@ +@@ -1621,7 +1710,13 @@ @SideOnly(Side.CLIENT) - public float getStarBrightness(float par1) + public float func_72880_h(float p_72880_1_) { -+ return provider.getStarBrightness(par1); +- float f1 = this.func_72826_c(p_72880_1_); ++ return field_73011_w.getStarBrightness(p_72880_1_); + } + + @SideOnly(Side.CLIENT) + public float getStarBrightnessBody(float par1) + { - float f1 = this.getCelestialAngle(par1); - float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); ++ float f1 = this.func_72826_c(par1); + float f2 = 1.0F - (MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); -@@ -1755,7 +1850,15 @@ - entity.addEntityCrashInfo(crashreportcategory); + if (f2 < 0.0F) +@@ -1675,7 +1770,15 @@ + entity.func_85029_a(crashreportcategory); } - throw new ReportedException(crashreport); + if (ForgeModContainer.removeErroringEntities) + { -+ FMLLog.severe(crashreport.getCompleteReport()); -+ removeEntity(entity); ++ FMLLog.severe(crashreport.func_71502_e()); ++ func_72900_e(entity); + } + else + { @@ -281,17 +365,17 @@ + } } - if (entity.isDead) -@@ -1817,7 +1920,16 @@ - crashreport = CrashReport.makeCrashReport(throwable1, "Ticking entity"); - crashreportcategory = crashreport.makeCategory("Entity being ticked"); - entity.addEntityCrashInfo(crashreportcategory); + if (entity.field_70128_L) +@@ -1737,7 +1840,16 @@ + crashreport = CrashReport.func_85055_a(throwable1, "Ticking entity"); + crashreportcategory = crashreport.func_85058_a("Entity being ticked"); + entity.func_85029_a(crashreportcategory); - throw new ReportedException(crashreport); + + if (ForgeModContainer.removeErroringEntities) + { -+ FMLLog.severe(crashreport.getCompleteReport()); -+ removeEntity(entity); ++ FMLLog.severe(crashreport.func_71502_e()); ++ func_72900_e(entity); + } + else + { @@ -300,16 +384,16 @@ } } -@@ -1860,7 +1972,16 @@ - crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity"); - crashreportcategory = crashreport.makeCategory("Block entity being ticked"); +@@ -1780,7 +1892,16 @@ + crashreport = CrashReport.func_85055_a(throwable, "Ticking block entity"); + crashreportcategory = crashreport.func_85058_a("Block entity being ticked"); tileentity.func_145828_a(crashreportcategory); - throw new ReportedException(crashreport); + if (ForgeModContainer.removeErroringTileEntities) + { -+ FMLLog.severe(crashreport.getCompleteReport()); -+ tileentity.invalidate(); -+ setBlockToAir(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); ++ FMLLog.severe(crashreport.func_71502_e()); ++ tileentity.func_145843_s(); ++ func_147468_f(tileentity.field_145851_c, tileentity.field_145848_d, tileentity.field_145849_e); + } + else + { @@ -318,16 +402,16 @@ } } -@@ -1874,7 +1995,7 @@ +@@ -1794,7 +1915,7 @@ if (chunk != null) { -- chunk.removeTileEntity(tileentity.xCoord & 15, tileentity.yCoord, tileentity.zCoord & 15); -+ chunk.removeInvalidTileEntity(tileentity.xCoord & 15, tileentity.yCoord, tileentity.zCoord & 15); +- chunk.func_150805_f(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); ++ chunk.removeInvalidTileEntity(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); } } } -@@ -1882,6 +2003,10 @@ +@@ -1802,6 +1923,10 @@ if (!this.field_147483_b.isEmpty()) { @@ -335,73 +419,73 @@ + { + ((TileEntity)tile).onChunkUnload(); + } - this.loadedTileEntityList.removeAll(this.field_147483_b); + this.field_147482_g.removeAll(this.field_147483_b); this.field_147483_b.clear(); } -@@ -1902,18 +2027,18 @@ +@@ -1822,18 +1947,18 @@ { - this.loadedTileEntityList.add(tileentity1); + this.field_147482_g.add(tileentity1); } - + } + else + { - if (this.chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4)) + if (this.func_72916_c(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4)) { - Chunk chunk1 = this.getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4); + Chunk chunk1 = this.func_72964_e(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4); if (chunk1 != null) { -- chunk1.func_150812_a(tileentity1.xCoord & 15, tileentity1.yCoord, tileentity1.zCoord & 15, tileentity1); -+ chunk1.removeInvalidTileEntity(tileentity1.xCoord & 15, tileentity1.yCoord, tileentity1.zCoord & 15); +- chunk1.func_150812_a(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15, tileentity1); ++ chunk1.removeInvalidTileEntity(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15); } } - -- this.markBlockForUpdate(tileentity1.xCoord, tileentity1.yCoord, tileentity1.zCoord); +- this.func_147471_g(tileentity1.field_145851_c, tileentity1.field_145848_d, tileentity1.field_145849_e); } } -@@ -1926,14 +2051,11 @@ +@@ -1846,14 +1971,11 @@ public void func_147448_a(Collection p_147448_1_) { - if (this.field_147481_N) -+ List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; ++ List dest = field_147481_N ? field_147484_a : field_147482_g; + for(TileEntity entity : (Collection)p_147448_1_) { -- this.addedTileEntityList.addAll(p_147448_1_); +- this.field_147484_a.addAll(p_147448_1_); + if(entity.canUpdate()) dest.add(entity); } - else - { -- this.loadedTileEntityList.addAll(p_147448_1_); +- this.field_147482_g.addAll(p_147448_1_); - } } - // JAVADOC METHOD $$ func_72870_g -@@ -1947,10 +2069,19 @@ + public void func_72870_g(Entity p_72870_1_) +@@ -1865,10 +1987,19 @@ { - int i = MathHelper.floor_double(par1Entity.posX); - int j = MathHelper.floor_double(par1Entity.posZ); + int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t); + int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v); - byte b0 = 32; + boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(i >> 4, j >> 4)); + byte b0 = isForced ? (byte)0 : 32; -+ boolean canUpdate = !par2 || this.checkChunksExist(i - b0, 0, j - b0, i + b0, 0, j + b0); ++ boolean canUpdate = !p_72866_2_ || this.func_72904_c(i - b0, 0, j - b0, i + b0, 0, j + b0); -- if (!par2 || this.checkChunksExist(i - b0, 0, j - b0, i + b0, 0, j + b0)) +- if (!p_72866_2_ || this.func_72904_c(i - b0, 0, j - b0, i + b0, 0, j + b0)) + if (!canUpdate) { -+ EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(par1Entity); ++ EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(p_72866_1_); + MinecraftForge.EVENT_BUS.post(event); + canUpdate = event.canUpdate; + } + + if (canUpdate) + { - par1Entity.lastTickPosX = par1Entity.posX; - par1Entity.lastTickPosY = par1Entity.posY; - par1Entity.lastTickPosZ = par1Entity.posZ; -@@ -2172,6 +2303,10 @@ + p_72866_1_.field_70142_S = p_72866_1_.field_70165_t; + p_72866_1_.field_70137_T = p_72866_1_.field_70163_u; + p_72866_1_.field_70136_U = p_72866_1_.field_70161_v; +@@ -2086,6 +2217,10 @@ { return true; } @@ -412,12 +496,12 @@ } } } -@@ -2465,13 +2600,15 @@ +@@ -2370,13 +2505,15 @@ - public void setTileEntity(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) + public void func_147455_a(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) { -- if (p_147455_4_ != null && !p_147455_4_.isInvalid()) -+ if (p_147455_4_ == null || p_147455_4_.isInvalid()) +- if (p_147455_4_ != null && !p_147455_4_.func_145837_r()) ++ if (p_147455_4_ == null || p_147455_4_.func_145837_r()) { + return; + } @@ -426,17 +510,17 @@ + { if (this.field_147481_N) { -- p_147455_4_.xCoord = p_147455_1_; -- p_147455_4_.yCoord = p_147455_2_; -- p_147455_4_.zCoord = p_147455_3_; - Iterator iterator = this.addedTileEntityList.iterator(); +- p_147455_4_.field_145851_c = p_147455_1_; +- p_147455_4_.field_145848_d = p_147455_2_; +- p_147455_4_.field_145849_e = p_147455_3_; + Iterator iterator = this.field_147484_a.iterator(); while (iterator.hasNext()) -@@ -2490,40 +2627,22 @@ +@@ -2395,40 +2532,22 @@ else { - this.loadedTileEntityList.add(p_147455_4_); -- Chunk chunk = this.getChunkFromChunkCoords(p_147455_1_ >> 4, p_147455_3_ >> 4); + this.field_147482_g.add(p_147455_4_); +- Chunk chunk = this.func_72964_e(p_147455_1_ >> 4, p_147455_3_ >> 4); - - if (chunk != null) - { @@ -444,275 +528,320 @@ - } } } -+ Chunk chunk = this.getChunkFromChunkCoords(p_147455_1_ >> 4, p_147455_3_ >> 4); ++ Chunk chunk = this.func_72964_e(p_147455_1_ >> 4, p_147455_3_ >> 4); + if (chunk != null) + { + chunk.func_150812_a(p_147455_1_ & 15, p_147455_2_, p_147455_3_ & 15, p_147455_4_); + } + //notify tile changes -+ func_147453_f(p_147455_1_, p_147455_2_, p_147455_3_, getBlock(p_147455_1_, p_147455_2_, p_147455_3_)); ++ func_147453_f(p_147455_1_, p_147455_2_, p_147455_3_, func_147439_a(p_147455_1_, p_147455_2_, p_147455_3_)); } - public void removeTileEntity(int p_147475_1_, int p_147475_2_, int p_147475_3_) + public void func_147475_p(int p_147475_1_, int p_147475_2_, int p_147475_3_) { -- TileEntity tileentity = this.getTileEntity(p_147475_1_, p_147475_2_, p_147475_3_); +- TileEntity tileentity = this.func_147438_o(p_147475_1_, p_147475_2_, p_147475_3_); - - if (tileentity != null && this.field_147481_N) - { -- tileentity.invalidate(); -- this.addedTileEntityList.remove(tileentity); +- tileentity.func_145843_s(); +- this.field_147484_a.remove(tileentity); - } - else - { - if (tileentity != null) - { -- this.addedTileEntityList.remove(tileentity); -- this.loadedTileEntityList.remove(tileentity); +- this.field_147484_a.remove(tileentity); +- this.field_147482_g.remove(tileentity); - } - -- Chunk chunk = this.getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); +- Chunk chunk = this.func_72964_e(p_147475_1_ >> 4, p_147475_3_ >> 4); - - if (chunk != null) - { -- chunk.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); +- chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); - } - } -+ Chunk chunk = getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); -+ if (chunk != null) chunk.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); -+ func_147453_f(p_147475_1_, p_147475_2_, p_147475_3_, getBlock(p_147475_1_, p_147475_2_, p_147475_3_)); ++ Chunk chunk = func_72964_e(p_147475_1_ >> 4, p_147475_3_ >> 4); ++ if (chunk != null) chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); ++ func_147453_f(p_147475_1_, p_147475_2_, p_147475_3_, func_147439_a(p_147475_1_, p_147475_2_, p_147475_3_)); } public void func_147457_a(TileEntity p_147457_1_) -@@ -2541,8 +2660,7 @@ - public static boolean doesBlockHaveSolidTopSurface(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) +@@ -2445,8 +2564,7 @@ + public static boolean func_147466_a(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) { - Block block = p_147466_0_.getBlock(p_147466_1_, p_147466_2_, p_147466_3_); -- int l = p_147466_0_.getBlockMetadata(p_147466_1_, p_147466_2_, p_147466_3_); -- return block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockSlab ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false)))); + Block block = p_147466_0_.func_147439_a(p_147466_1_, p_147466_2_, p_147466_3_); +- int l = p_147466_0_.func_72805_g(p_147466_1_, p_147466_2_, p_147466_3_); +- return block.func_149688_o().func_76218_k() && block.func_149686_d() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockSlab ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false)))); + return block.isSideSolid(p_147466_0_, p_147466_1_, p_147466_2_, p_147466_3_, ForgeDirection.UP); } - // JAVADOC METHOD $$ func_147445_c -@@ -2555,7 +2673,7 @@ - if (chunk != null && !chunk.isEmpty()) + public boolean func_147445_c(int p_147445_1_, int p_147445_2_, int p_147445_3_, boolean p_147445_4_) +@@ -2458,7 +2576,7 @@ + if (chunk != null && !chunk.func_76621_g()) { - Block block = this.getBlock(p_147445_1_, p_147445_2_, p_147445_3_); -- return block.getMaterial().isOpaque() && block.renderAsNormalBlock(); + Block block = this.func_147439_a(p_147445_1_, p_147445_2_, p_147445_3_); +- return block.func_149688_o().func_76218_k() && block.func_149686_d(); + return block.isNormalCube(this, p_147445_1_, p_147445_2_, p_147445_3_); } else { -@@ -2582,8 +2700,7 @@ - // JAVADOC METHOD $$ func_72891_a - public void setAllowedSpawnTypes(boolean par1, boolean par2) +@@ -2483,8 +2601,7 @@ + + public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) { -- this.spawnHostileMobs = par1; -- this.spawnPeacefulMobs = par2; -+ provider.setAllowedSpawnTypes(par1, par2); +- this.field_72985_G = p_72891_1_; +- this.field_72992_H = p_72891_2_; ++ field_73011_w.setAllowedSpawnTypes(p_72891_1_, p_72891_2_); } - // JAVADOC METHOD $$ func_72835_b -@@ -2595,6 +2712,11 @@ - // JAVADOC METHOD $$ func_72947_a - private void calculateInitialWeather() + public void func_72835_b() +@@ -2494,6 +2611,11 @@ + + private void func_72947_a() { -+ provider.calculateInitialWeather(); ++ field_73011_w.calculateInitialWeather(); + } + + public void calculateInitialWeatherBody() + { - if (this.worldInfo.isRaining()) + if (this.field_72986_A.func_76059_o()) { - this.rainingStrength = 1.0F; -@@ -2609,6 +2731,11 @@ - // JAVADOC METHOD $$ func_72979_l - protected void updateWeather() + this.field_73004_o = 1.0F; +@@ -2507,6 +2629,11 @@ + + protected void func_72979_l() { -+ provider.updateWeather(); ++ field_73011_w.updateWeather(); + } + + public void updateWeatherBody() + { - if (!this.provider.hasNoSky) + if (!this.field_73011_w.field_76576_e) { - if (!this.isRemote) -@@ -2693,6 +2820,7 @@ + if (!this.field_72995_K) +@@ -2591,6 +2718,7 @@ { - this.activeChunkSet.clear(); - this.theProfiler.startSection("buildList"); -+ this.activeChunkSet.addAll(getPersistentChunks().keySet()); + this.field_72993_I.clear(); + this.field_72984_F.func_76320_a("buildList"); ++ this.field_72993_I.addAll(getPersistentChunks().keySet()); int i; EntityPlayer entityplayer; int j; -@@ -2787,6 +2915,11 @@ - // JAVADOC METHOD $$ func_72834_c - public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) +@@ -2682,44 +2810,49 @@ + + public boolean func_72834_c(int p_72834_1_, int p_72834_2_, int p_72834_3_, boolean p_72834_4_) { -+ return provider.canBlockFreeze(par1, par2, par3, par4); +- BiomeGenBase biomegenbase = this.func_72807_a(p_72834_1_, p_72834_3_); +- float f = biomegenbase.func_150564_a(p_72834_1_, p_72834_2_, p_72834_3_); ++ return field_73011_w.canBlockFreeze(p_72834_1_, p_72834_2_, p_72834_3_, p_72834_4_); + } -+ + + public boolean canBlockFreezeBody(int par1, int par2, int par3, boolean par4) + { - BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); - float f = biomegenbase.getFloatTemperature(par1, par2, par3); ++ BiomeGenBase biomegenbase = this.func_72807_a(par1, par3); ++ float f = biomegenbase.func_150564_a(par1, par2, par3); ++ + if (f > 0.15F) + { + return false; + } + else + { +- if (p_72834_2_ >= 0 && p_72834_2_ < 256 && this.func_72972_b(EnumSkyBlock.Block, p_72834_1_, p_72834_2_, p_72834_3_) < 10) ++ if (par2 >= 0 && par2 < 256 && this.func_72972_b(EnumSkyBlock.Block, par1, par2, par3) < 10) + { +- Block block = this.func_147439_a(p_72834_1_, p_72834_2_, p_72834_3_); ++ Block block = this.func_147439_a(par1, par2, par3); -@@ -2842,6 +2975,11 @@ +- if ((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && this.func_72805_g(p_72834_1_, p_72834_2_, p_72834_3_) == 0) ++ if ((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && this.func_72805_g(par1, par2, par3) == 0) + { +- if (!p_72834_4_) ++ if (!par4) + { + return true; + } + + boolean flag1 = true; + +- if (flag1 && this.func_147439_a(p_72834_1_ - 1, p_72834_2_, p_72834_3_).func_149688_o() != Material.field_151586_h) ++ if (flag1 && this.func_147439_a(par1 - 1, par2, par3).func_149688_o() != Material.field_151586_h) + { + flag1 = false; + } + +- if (flag1 && this.func_147439_a(p_72834_1_ + 1, p_72834_2_, p_72834_3_).func_149688_o() != Material.field_151586_h) ++ if (flag1 && this.func_147439_a(par1 + 1, par2, par3).func_149688_o() != Material.field_151586_h) + { + flag1 = false; + } + +- if (flag1 && this.func_147439_a(p_72834_1_, p_72834_2_, p_72834_3_ - 1).func_149688_o() != Material.field_151586_h) ++ if (flag1 && this.func_147439_a(par1, par2, par3 - 1).func_149688_o() != Material.field_151586_h) + { + flag1 = false; + } + +- if (flag1 && this.func_147439_a(p_72834_1_, p_72834_2_, p_72834_3_ + 1).func_149688_o() != Material.field_151586_h) ++ if (flag1 && this.func_147439_a(par1, par2, par3 + 1).func_149688_o() != Material.field_151586_h) + { + flag1 = false; + } +@@ -2737,6 +2870,11 @@ public boolean func_147478_e(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) { -+ return provider.canSnowAt(p_147478_1_, p_147478_2_, p_147478_3_, p_147478_4_); ++ return field_73011_w.canSnowAt(p_147478_1_, p_147478_2_, p_147478_3_, p_147478_4_); + } + + public boolean canSnowAtBody(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) + { - BiomeGenBase biomegenbase = this.getBiomeGenForCoords(p_147478_1_, p_147478_3_); - float f = biomegenbase.getFloatTemperature(p_147478_1_, p_147478_2_, p_147478_3_); + BiomeGenBase biomegenbase = this.func_72807_a(p_147478_1_, p_147478_3_); + float f = biomegenbase.func_150564_a(p_147478_1_, p_147478_2_, p_147478_3_); -@@ -2891,10 +3029,11 @@ +@@ -2786,10 +2924,11 @@ else { - Block block = this.getBlock(par1, par2, par3); -- int l = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : block.getLightValue(); -- int i1 = block.getLightOpacity(); -+ int blockLight = block.getLightValue(this, par1, par2, par3); -+ int l = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : blockLight; -+ int i1 = block.getLightOpacity(this, par1, par2, par3); + Block block = this.func_147439_a(p_98179_1_, p_98179_2_, p_98179_3_); +- int l = p_98179_4_ == EnumSkyBlock.Sky ? 0 : block.func_149750_m(); +- int i1 = block.func_149717_k(); ++ int blockLight = block.getLightValue(this, p_98179_1_, p_98179_2_, p_98179_3_); ++ int l = p_98179_4_ == EnumSkyBlock.Sky ? 0 : blockLight; ++ int i1 = block.getLightOpacity(this, p_98179_1_, p_98179_2_, p_98179_3_); -- if (i1 >= 15 && block.getLightValue() > 0) +- if (i1 >= 15 && block.func_149750_m() > 0) + if (i1 >= 15 && blockLight > 0) { i1 = 1; } -@@ -2994,7 +3133,7 @@ - int j4 = i2 + Facing.offsetsXForSide[i4]; - int k4 = j2 + Facing.offsetsYForSide[i4]; - int l4 = k2 + Facing.offsetsZForSide[i4]; -- int i5 = Math.max(1, this.getBlock(j4, k4, l4).getLightOpacity()); -+ int i5 = Math.max(1, this.getBlock(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); - i3 = this.getSavedLightValue(p_147463_1_, j4, k4, l4); +@@ -2889,7 +3028,7 @@ + int j4 = i2 + Facing.field_71586_b[i4]; + int k4 = j2 + Facing.field_71587_c[i4]; + int l4 = k2 + Facing.field_71585_d[i4]; +- int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).func_149717_k()); ++ int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); + i3 = this.func_72972_b(p_147463_1_, j4, k4, l4); - if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length) -@@ -3094,10 +3233,10 @@ - public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) + if (i3 == l2 - i5 && i1 < this.field_72994_J.length) +@@ -2987,10 +3126,10 @@ + public List func_94576_a(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) { ArrayList arraylist = new ArrayList(); -- int i = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); +- int i = MathHelper.func_76128_c((p_94576_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_94576_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_94576_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_94576_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_94576_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_94576_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_94576_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_94576_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); for (int i1 = i; i1 <= j; ++i1) { -@@ -3121,10 +3260,10 @@ +@@ -3013,10 +3152,10 @@ - public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) + public List func_82733_a(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_) { -- int i = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -- int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -- int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D); +- int i = MathHelper.func_76128_c((p_82733_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_82733_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_82733_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_82733_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_82733_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_82733_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_82733_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_82733_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); ArrayList arraylist = new ArrayList(); for (int i1 = i; i1 <= j; ++i1) -@@ -3206,11 +3345,14 @@ - // JAVADOC METHOD $$ func_72868_a - public void addLoadedEntities(List par1List) +@@ -3093,11 +3232,14 @@ + + public void func_72868_a(List p_72868_1_) { -- this.loadedEntityList.addAll(par1List); +- this.field_72996_f.addAll(p_72868_1_); - - for (int i = 0; i < par1List.size(); ++i) + for (int i = 0; i < p_72868_1_.size(); ++i) { -- this.onEntityAdded((Entity)par1List.get(i)); -+ Entity entity = (Entity)par1List.get(i); +- this.func_72923_a((Entity)p_72868_1_.get(i)); ++ Entity entity = (Entity)p_72868_1_.get(i); + if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) + { -+ loadedEntityList.add(entity); -+ this.onEntityAdded(entity); ++ field_72996_f.add(entity); ++ this.func_72923_a(entity); + } } } -@@ -3225,7 +3367,7 @@ +@@ -3110,7 +3252,7 @@ { - Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); - AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.getCollisionBoundingBoxFromPool(this, p_147472_2_, p_147472_3_, p_147472_4_); -- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil ? true : block1.getMaterial().isReplaceable() && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); -+ return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); + Block block1 = this.func_147439_a(p_147472_2_, p_147472_3_, p_147472_4_); + AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.func_149668_a(this, p_147472_2_, p_147472_3_, p_147472_4_); +- return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.field_150467_bQ ? true : block1.func_149688_o().func_76222_j() && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); ++ return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.field_150467_bQ ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); } - public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) -@@ -3334,7 +3476,8 @@ - // JAVADOC METHOD $$ func_72878_l - public int getIndirectPowerLevelTo(int par1, int par2, int par3, int par4) + public PathEntity func_72865_a(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) +@@ -3215,7 +3357,8 @@ + + public int func_72878_l(int p_72878_1_, int p_72878_2_, int p_72878_3_, int p_72878_4_) { -- return this.getBlock(par1, par2, par3).isNormalCube() ? this.getBlockPowerInput(par1, par2, par3) : this.getBlock(par1, par2, par3).isProvidingWeakPower(this, par1, par2, par3, par4); -+ Block block = this.getBlock(par1, par2, par3); -+ return block.shouldCheckWeakPower(this, par1, par2, par3, par4) ? this.getBlockPowerInput(par1, par2, par3) : block.isProvidingWeakPower(this, par1, par2, par3, par4); +- return this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_).func_149721_r() ? this.func_94577_B(p_72878_1_, p_72878_2_, p_72878_3_) : this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_).func_149709_b(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); ++ Block block = this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_); ++ return block.shouldCheckWeakPower(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_) ? this.func_94577_B(p_72878_1_, p_72878_2_, p_72878_3_) : block.func_149709_b(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); } - // JAVADOC METHOD $$ func_72864_z -@@ -3474,7 +3617,7 @@ - // JAVADOC METHOD $$ func_72905_C - public long getSeed() + public boolean func_72864_z(int p_72864_1_, int p_72864_2_, int p_72864_3_) +@@ -3346,7 +3489,7 @@ + + public long func_72905_C() { -- return this.worldInfo.getSeed(); -+ return provider.getSeed(); +- return this.field_72986_A.func_76063_b(); ++ return field_73011_w.getSeed(); } - public long getTotalWorldTime() -@@ -3484,24 +3627,24 @@ + public long func_82737_E() +@@ -3356,22 +3499,22 @@ - public long getWorldTime() + public long func_72820_D() { -- return this.worldInfo.getWorldTime(); -+ return provider.getWorldTime(); +- return this.field_72986_A.func_76073_f(); ++ return field_73011_w.getWorldTime(); } - // JAVADOC METHOD $$ func_72877_b - public void setWorldTime(long par1) + public void func_72877_b(long p_72877_1_) { -- this.worldInfo.setWorldTime(par1); -+ provider.setWorldTime(par1); +- this.field_72986_A.func_76068_b(p_72877_1_); ++ field_73011_w.setWorldTime(p_72877_1_); } - // JAVADOC METHOD $$ func_72861_E - public ChunkCoordinates getSpawnPoint() + public ChunkCoordinates func_72861_E() { -- return new ChunkCoordinates(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ()); -+ return provider.getSpawnPoint(); +- return new ChunkCoordinates(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e()); ++ return field_73011_w.getSpawnPoint(); } - public void setSpawnLocation(int par1, int par2, int par3) + public void func_72950_A(int p_72950_1_, int p_72950_2_, int p_72950_3_) { -- this.worldInfo.setSpawnPosition(par1, par2, par3); -+ provider.setSpawnPoint(par1, par2, par3); +- this.field_72986_A.func_76081_a(p_72950_1_, p_72950_2_, p_72950_3_); ++ field_73011_w.setSpawnPoint(p_72950_1_, p_72950_2_, p_72950_3_); } - // JAVADOC METHOD $$ func_72897_h -@@ -3522,13 +3665,21 @@ + @SideOnly(Side.CLIENT) +@@ -3391,12 +3534,20 @@ - if (!this.loadedEntityList.contains(par1Entity)) + if (!this.field_72996_f.contains(p_72897_1_)) { -- this.loadedEntityList.add(par1Entity); -+ if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(par1Entity, this))) +- this.field_72996_f.add(p_72897_1_); ++ if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(p_72897_1_, this))) + { -+ this.loadedEntityList.add(par1Entity); ++ this.field_72996_f.add(p_72897_1_); + } } } - // JAVADOC METHOD $$ func_72962_a - public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) + public boolean func_72962_a(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) { -+ return provider.canMineBlock(par1EntityPlayer, par2, par3, par4); ++ return field_73011_w.canMineBlock(p_72962_1_, p_72962_2_, p_72962_3_, p_72962_4_); + } + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) @@ -720,82 +849,81 @@ return true; } -@@ -3631,8 +3782,7 @@ - // JAVADOC METHOD $$ func_72958_C - public boolean isBlockHighHumidity(int par1, int par2, int par3) +@@ -3486,8 +3637,7 @@ + + public boolean func_72958_C(int p_72958_1_, int p_72958_2_, int p_72958_3_) { -- BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); -- return biomegenbase.isHighHumidity(); -+ return provider.isBlockHighHumidity(par1, par2, par3); +- BiomeGenBase biomegenbase = this.func_72807_a(p_72958_1_, p_72958_3_); +- return biomegenbase.func_76736_e(); ++ return field_73011_w.isBlockHighHumidity(p_72958_1_, p_72958_2_, p_72958_3_); } - // JAVADOC METHOD $$ func_72823_a -@@ -3692,13 +3842,13 @@ - // JAVADOC METHOD $$ func_72800_K - public int getHeight() + public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) +@@ -3541,12 +3691,12 @@ + + public int func_72800_K() { - return 256; -+ return provider.getHeight(); ++ return field_73011_w.getHeight(); } - // JAVADOC METHOD $$ func_72940_L - public int getActualHeight() + public int func_72940_L() { -- return this.provider.hasNoSky ? 128 : 256; -+ return provider.getActualHeight(); +- return this.field_73011_w.field_76576_e ? 128 : 256; ++ return field_73011_w.getActualHeight(); } - // JAVADOC METHOD $$ func_72843_D -@@ -3726,7 +3876,7 @@ + public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) +@@ -3570,7 +3720,7 @@ @SideOnly(Side.CLIENT) - public double getHorizon() + public double func_72919_O() { -- return this.worldInfo.getTerrainType().getHorizon(this); -+ return provider.getHorizon(); +- return this.field_72986_A.func_76067_t().getHorizon(this); ++ return field_73011_w.getHorizon(); } - // JAVADOC METHOD $$ func_72914_a -@@ -3800,25 +3950,24 @@ + public CrashReportCategory func_72914_a(CrashReport p_72914_1_) +@@ -3640,25 +3790,24 @@ public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_) { - for (int l = 0; l < 4; ++l) + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { -- int i1 = p_147453_1_ + Direction.offsetX[l]; -- int j1 = p_147453_3_ + Direction.offsetZ[l]; -- Block block1 = this.getBlock(i1, p_147453_2_, j1); +- int i1 = p_147453_1_ + Direction.field_71583_a[l]; +- int j1 = p_147453_3_ + Direction.field_71581_b[l]; +- Block block1 = this.func_147439_a(i1, p_147453_2_, j1); + int i1 = p_147453_1_ + dir.offsetX; + int y = p_147453_2_ + dir.offsetY; + int j1 = p_147453_3_ + dir.offsetZ; -+ Block block1 = this.getBlock(i1, y, j1); ++ Block block1 = this.func_147439_a(i1, y, j1); -- if (Blocks.unpowered_comparator.func_149907_e(block1)) +- if (Blocks.field_150441_bU.func_149907_e(block1)) + block1.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); + if (block1.isNormalCube(this, i1, p_147453_2_, j1)) { -- block1.onNeighborBlockChange(this, i1, p_147453_2_, j1, p_147453_4_); +- block1.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); - } -- else if (block1.isNormalCube()) +- else if (block1.func_149721_r()) - { -- i1 += Direction.offsetX[l]; -- j1 += Direction.offsetZ[l]; -- Block block2 = this.getBlock(i1, p_147453_2_, j1); +- i1 += Direction.field_71583_a[l]; +- j1 += Direction.field_71581_b[l]; +- Block block2 = this.func_147439_a(i1, p_147453_2_, j1); + i1 += dir.offsetX; + y += dir.offsetY; + j1 += dir.offsetZ; -+ Block block2 = this.getBlock(i1, y, j1); ++ Block block2 = this.func_147439_a(i1, y, j1); -- if (Blocks.unpowered_comparator.func_149907_e(block2)) +- if (Blocks.field_150441_bU.func_149907_e(block2)) + if (block2.getWeakChanges(this, i1, y, j1)) { -- block2.onNeighborBlockChange(this, i1, p_147453_2_, j1, p_147453_4_); +- block2.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); + block2.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); } } } -@@ -3859,4 +4008,110 @@ - iworldaccess.onStaticEntitiesChanged(); +@@ -3699,4 +3848,110 @@ + iworldaccess.func_147584_b(); } } + @@ -807,7 +935,7 @@ + */ + public void addTileEntity(TileEntity entity) + { -+ List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; ++ List dest = field_147481_N ? field_147484_a : field_147482_g; + if(entity.canUpdate()) + { + dest.add(entity); @@ -848,12 +976,12 @@ + return _default; + } + -+ Chunk chunk = this.chunkProvider.provideChunk(x >> 4, z >> 4); -+ if (chunk == null || chunk.isEmpty()) ++ Chunk chunk = this.field_73020_y.func_73154_d(x >> 4, z >> 4); ++ if (chunk == null || chunk.func_76621_g()) + { + return _default; + } -+ return getBlock(x, y, z).isSideSolid(this, x, y, z, side); ++ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); + } + + /** @@ -886,7 +1014,7 @@ + return 0; + } + -+ return getChunkFromChunkCoords(x >> 4, z >> 4).func_150808_b(x & 15, y, z & 15); ++ return func_72964_e(x >> 4, z >> 4).func_150808_b(x & 15, y, z & 15); + } + + /** @@ -895,9 +1023,9 @@ + public int countEntities(EnumCreatureType type, boolean forSpawnCount) + { + int count = 0; -+ for (int x = 0; x < loadedEntityList.size(); x++) ++ for (int x = 0; x < field_72996_f.size(); x++) + { -+ if (((Entity)loadedEntityList.get(x)).isCreatureType(type, forSpawnCount)) ++ if (((Entity)field_72996_f.get(x)).isCreatureType(type, forSpawnCount)) + { + count++; + } diff --git a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch index 522b2d3019..f0929b0ad2 100644 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -26,27 +26,26 @@ public abstract class WorldProvider { -@@ -166,14 +174,14 @@ +@@ -149,13 +157,13 @@ - public static WorldProvider getProviderForDimension(int par0) + public static WorldProvider func_76570_a(int p_76570_0_) { -- return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null))); -+ return DimensionManager.createProviderFor(par0); +- return (WorldProvider)(p_76570_0_ == -1 ? new WorldProviderHell() : (p_76570_0_ == 0 ? new WorldProviderSurface() : (p_76570_0_ == 1 ? new WorldProviderEnd() : null))); ++ return DimensionManager.createProviderFor(p_76570_0_); } - // JAVADOC METHOD $$ func_76571_f @SideOnly(Side.CLIENT) - public float getCloudHeight() + public float func_76571_f() { - return 128.0F; -+ return this.terrainType.getCloudHeight(); ++ return this.field_76577_b.getCloudHeight(); } @SideOnly(Side.CLIENT) -@@ -216,4 +224,285 @@ +@@ -193,4 +201,285 @@ + } - // JAVADOC METHOD $$ func_80007_l - public abstract String getDimensionName(); + public abstract String func_80007_l(); + + /*======================================= Forge Start =========================================*/ + private IRenderHandler skyRenderer = null; @@ -61,7 +60,7 @@ + */ + public void setDimension(int dim) + { -+ this.dimensionId = dim; ++ this.field_76574_g = dim; + } + + /** @@ -71,7 +70,7 @@ + */ + public String getSaveFolder() + { -+ return (dimensionId == 0 ? null : "DIM" + dimensionId); ++ return (field_76574_g == 0 ? null : "DIM" + field_76574_g); + } + + /** @@ -163,17 +162,17 @@ + + public ChunkCoordinates getRandomizedSpawnPoint() + { -+ ChunkCoordinates chunkcoordinates = new ChunkCoordinates(this.worldObj.getSpawnPoint()); ++ ChunkCoordinates chunkcoordinates = new ChunkCoordinates(this.field_76579_a.func_72861_E()); + -+ boolean isAdventure = worldObj.getWorldInfo().getGameType() == GameType.ADVENTURE; -+ int spawnFuzz = terrainType.getSpawnFuzz(); ++ boolean isAdventure = field_76579_a.func_72912_H().func_76077_q() == GameType.ADVENTURE; ++ int spawnFuzz = field_76577_b.getSpawnFuzz(); + int spawnFuzzHalf = spawnFuzz / 2; + -+ if (!hasNoSky && !isAdventure) ++ if (!field_76576_e && !isAdventure) + { -+ chunkcoordinates.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; -+ chunkcoordinates.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; -+ chunkcoordinates.posY = this.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); ++ chunkcoordinates.field_71574_a += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf; ++ chunkcoordinates.field_71573_c += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf; ++ chunkcoordinates.field_71572_b = this.field_76579_a.func_72825_h(chunkcoordinates.field_71574_a, chunkcoordinates.field_71573_c); + } + + return chunkcoordinates; @@ -190,7 +189,7 @@ + */ + public boolean shouldMapSpin(String entity, double x, double y, double z) + { -+ return dimensionId < 0; ++ return field_76574_g < 0; + } + + /** @@ -208,92 +207,92 @@ + + public BiomeGenBase getBiomeGenForCoords(int x, int z) + { -+ return worldObj.getBiomeGenForCoordsBody(x, z); ++ return field_76579_a.getBiomeGenForCoordsBody(x, z); + } + + public boolean isDaytime() + { -+ return worldObj.skylightSubtracted < 4; ++ return field_76579_a.field_73008_k < 4; + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) + { -+ return worldObj.getSkyColorBody(cameraEntity, partialTicks); ++ return field_76579_a.getSkyColorBody(cameraEntity, partialTicks); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawClouds(float partialTicks) + { -+ return worldObj.drawCloudsBody(partialTicks); ++ return field_76579_a.drawCloudsBody(partialTicks); + } + + @SideOnly(Side.CLIENT) + public float getStarBrightness(float par1) + { -+ return worldObj.getStarBrightnessBody(par1); ++ return field_76579_a.getStarBrightnessBody(par1); + } + + public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) + { -+ worldObj.spawnHostileMobs = allowHostile; -+ worldObj.spawnPeacefulMobs = allowPeaceful; ++ field_76579_a.field_72985_G = allowHostile; ++ field_76579_a.field_72992_H = allowPeaceful; + } + + public void calculateInitialWeather() + { -+ worldObj.calculateInitialWeatherBody(); ++ field_76579_a.calculateInitialWeatherBody(); + } + + public void updateWeather() + { -+ worldObj.updateWeatherBody(); ++ field_76579_a.updateWeatherBody(); + } + + public boolean canBlockFreeze(int x, int y, int z, boolean byWater) + { -+ return worldObj.canBlockFreezeBody(x, y, z, byWater); ++ return field_76579_a.canBlockFreezeBody(x, y, z, byWater); + } + + public boolean canSnowAt(int x, int y, int z, boolean checkLight) + { -+ return worldObj.canSnowAtBody(x, y, z, checkLight); ++ return field_76579_a.canSnowAtBody(x, y, z, checkLight); + } + + public void setWorldTime(long time) + { -+ worldObj.worldInfo.setWorldTime(time); ++ field_76579_a.field_72986_A.func_76068_b(time); + } + + public long getSeed() + { -+ return worldObj.worldInfo.getSeed(); ++ return field_76579_a.field_72986_A.func_76063_b(); + } + + public long getWorldTime() + { -+ return worldObj.worldInfo.getWorldTime(); ++ return field_76579_a.field_72986_A.func_76073_f(); + } + + public ChunkCoordinates getSpawnPoint() + { -+ WorldInfo info = worldObj.worldInfo; -+ return new ChunkCoordinates(info.getSpawnX(), info.getSpawnY(), info.getSpawnZ()); ++ WorldInfo info = field_76579_a.field_72986_A; ++ return new ChunkCoordinates(info.func_76079_c(), info.func_76075_d(), info.func_76074_e()); + } + + public void setSpawnPoint(int x, int y, int z) + { -+ worldObj.worldInfo.setSpawnPosition(x, y, z); ++ field_76579_a.field_72986_A.func_76081_a(x, y, z); + } + + public boolean canMineBlock(EntityPlayer player, int x, int y, int z) + { -+ return worldObj.canMineBlockBody(player, x, y, z); ++ return field_76579_a.canMineBlockBody(player, x, y, z); + } + + public boolean isBlockHighHumidity(int x, int y, int z) + { -+ return worldObj.getBiomeGenForCoords(x, z).isHighHumidity(); ++ return field_76579_a.func_72807_a(x, z).func_76736_e(); + } + + public int getHeight() @@ -303,20 +302,20 @@ + + public int getActualHeight() + { -+ return hasNoSky ? 128 : 256; ++ return field_76576_e ? 128 : 256; + } + + public double getHorizon() + { -+ return worldObj.worldInfo.getTerrainType().getHorizon(worldObj); ++ return field_76579_a.field_72986_A.func_76067_t().getHorizon(field_76579_a); + } + + public void resetRainAndThunder() + { -+ worldObj.worldInfo.setRainTime(0); -+ worldObj.worldInfo.setRaining(false); -+ worldObj.worldInfo.setThunderTime(0); -+ worldObj.worldInfo.setThundering(false); ++ field_76579_a.field_72986_A.func_76080_g(0); ++ field_76579_a.field_72986_A.func_76084_b(false); ++ field_76579_a.field_72986_A.func_76090_f(0); ++ field_76579_a.field_72986_A.func_76069_a(false); + } + + public boolean canDoLightning(Chunk chunk) diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index 2f52a21b06..66b36ad604 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -28,8 +28,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -83,6 +92,10 @@ - private IntHashMap entityIdMap; +@@ -78,6 +87,10 @@ + private IntHashMap field_73066_T; private static final String __OBFID = "CL_00001437"; + /** Stores the recently processed (lighting) chunks */ @@ -38,58 +38,58 @@ + public WorldServer(MinecraftServer p_i45284_1_, ISaveHandler p_i45284_2_, String p_i45284_3_, int p_i45284_4_, WorldSettings p_i45284_5_, Profiler p_i45284_6_) { - super(p_i45284_2_, p_i45284_3_, p_i45284_5_, WorldProvider.getProviderForDimension(p_i45284_4_), p_i45284_6_); -@@ -115,8 +128,12 @@ - this.mapStorage.setData("scoreboard", scoreboardsavedata); + super(p_i45284_2_, p_i45284_3_, p_i45284_5_, WorldProvider.func_76570_a(p_i45284_4_), p_i45284_6_); +@@ -110,8 +123,12 @@ + this.field_72988_C.func_75745_a("scoreboard", scoreboardsavedata); } -- scoreboardsavedata.func_96499_a(this.worldScoreboard); +- scoreboardsavedata.func_96499_a(this.field_96442_D); + if (!(this instanceof WorldServerMulti)) //Forge: We fix the global mapStorage, which causes us to share scoreboards early. So don't associate the save data with the temporary scoreboard + { -+ scoreboardsavedata.func_96499_a(this.worldScoreboard); ++ scoreboardsavedata.func_96499_a(this.field_96442_D); + } - ((ServerScoreboard)this.worldScoreboard).func_96547_a(scoreboardsavedata); + ((ServerScoreboard)this.field_96442_D).func_96547_a(scoreboardsavedata); + DimensionManager.setWorld(p_i45284_4_, this); } - // JAVADOC METHOD $$ func_72835_b -@@ -176,6 +193,10 @@ - this.villageSiegeObj.tick(); - this.theProfiler.endStartSection("portalForcer"); - this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + public void func_72835_b() +@@ -170,6 +187,10 @@ + this.field_72983_E.func_75528_a(); + this.field_72984_F.func_76318_c("portalForcer"); + this.field_85177_Q.func_85189_a(this.func_82737_E()); + for (Teleporter tele : customTeleporters) + { -+ tele.removeStalePortalLocations(getTotalWorldTime()); ++ tele.func_85189_a(func_82737_E()); + } - this.theProfiler.endSection(); + this.field_72984_F.func_76319_b(); this.func_147488_Z(); } -@@ -184,6 +205,7 @@ - public BiomeGenBase.SpawnListEntry spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) +@@ -177,6 +198,7 @@ + public BiomeGenBase.SpawnListEntry func_73057_a(EnumCreatureType p_73057_1_, int p_73057_2_, int p_73057_3_, int p_73057_4_) { - List list = this.getChunkProvider().getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); -+ list = ForgeEventFactory.getPotentialSpawns(this, par1EnumCreatureType, par2, par3, par4, list); - return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(this.rand, list) : null; + List list = this.func_72863_F().func_73155_a(p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_); ++ list = ForgeEventFactory.getPotentialSpawns(this, p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_, list); + return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.func_76271_a(this.field_73012_v, list) : null; } -@@ -225,10 +247,7 @@ +@@ -217,10 +239,7 @@ - private void resetRainAndThunder() + private void func_73051_P() { -- this.worldInfo.setRainTime(0); -- this.worldInfo.setRaining(false); -- this.worldInfo.setThunderTime(0); -- this.worldInfo.setThundering(false); -+ provider.resetRainAndThunder(); +- this.field_72986_A.func_76080_g(0); +- this.field_72986_A.func_76084_b(false); +- this.field_72986_A.func_76090_f(0); +- this.field_72986_A.func_76069_a(false); ++ field_73011_w.resetRainAndThunder(); } - public boolean areAllPlayersAsleep() -@@ -293,6 +312,14 @@ + public boolean func_73056_e() +@@ -284,6 +303,14 @@ int j = 0; - Iterator iterator = this.activeChunkSet.iterator(); + Iterator iterator = this.field_72993_I.iterator(); -+ doneChunks.retainAll(activeChunkSet); -+ if (doneChunks.size() == activeChunkSet.size()) ++ doneChunks.retainAll(field_72993_I); ++ if (doneChunks.size() == field_72993_I.size()) + { + doneChunks.clear(); + } @@ -99,38 +99,38 @@ while (iterator.hasNext()) { ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator.next(); -@@ -302,14 +329,18 @@ - Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); +@@ -293,14 +320,18 @@ + Chunk chunk = this.func_72964_e(chunkcoordintpair.field_77276_a, chunkcoordintpair.field_77275_b); this.func_147467_a(k, l, chunk); - this.theProfiler.endStartSection("tickChunk"); + this.field_72984_F.func_76318_c("tickChunk"); - chunk.func_150804_b(false); + //Limits and evenly distributes the lighting update time + if (System.nanoTime() - startTime <= 4000000 && doneChunks.add(chunkcoordintpair)) + { + chunk.func_150804_b(false); + } - this.theProfiler.endStartSection("thunder"); + this.field_72984_F.func_76318_c("thunder"); int i1; int j1; int k1; int l1; -- if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) -+ if (provider.canDoLightning(chunk) && this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) +- if (this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) ++ if (field_73011_w.canDoLightning(chunk) && this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - i1 = this.updateLCG >> 2; -@@ -325,7 +356,7 @@ + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + i1 = this.field_73005_l >> 2; +@@ -316,7 +347,7 @@ - this.theProfiler.endStartSection("iceandsnow"); + this.field_72984_F.func_76318_c("iceandsnow"); -- if (this.rand.nextInt(16) == 0) -+ if (provider.canDoRainSnowIce(chunk) && this.rand.nextInt(16) == 0) +- if (this.field_73012_v.nextInt(16) == 0) ++ if (field_73011_w.canDoRainSnowIce(chunk) && this.field_73012_v.nextInt(16) == 0) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - i1 = this.updateLCG >> 2; -@@ -403,6 +434,9 @@ - public void scheduleBlockUpdateWithPriority(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + i1 = this.field_73005_l >> 2; +@@ -392,6 +423,9 @@ + public void func_147454_a(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) { NextTickListEntry nextticklistentry = new NextTickListEntry(p_147454_1_, p_147454_2_, p_147454_3_, p_147454_4_); + //Keeping here as a note for future when it may be restored. @@ -138,17 +138,17 @@ + //byte b0 = isForced ? 0 : 8; byte b0 = 0; - if (this.scheduledUpdatesAreImmediate && p_147454_4_.getMaterial() != Material.air) -@@ -463,7 +497,7 @@ - // JAVADOC METHOD $$ func_72939_s - public void updateEntities() + if (this.field_72999_e && p_147454_4_.func_149688_o() != Material.field_151579_a) +@@ -451,7 +485,7 @@ + + public void func_72939_s() { -- if (this.playerEntities.isEmpty()) -+ if (this.playerEntities.isEmpty() && getPersistentChunks().isEmpty()) +- if (this.field_73010_i.isEmpty()) ++ if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) { - if (this.updateEntityTick++ >= 1200) + if (this.field_80004_Q++ >= 1200) { -@@ -525,6 +559,9 @@ +@@ -511,6 +545,9 @@ { nextticklistentry = (NextTickListEntry)iterator.next(); iterator.remove(); @@ -157,30 +157,30 @@ + //byte b0 = isForced ? 0 : 8; byte b0 = 0; - if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) -@@ -649,13 +686,26 @@ + if (this.func_72904_c(nextticklistentry.field_77183_a - b0, nextticklistentry.field_77181_b - b0, nextticklistentry.field_77182_c - b0, nextticklistentry.field_77183_a + b0, nextticklistentry.field_77181_b + b0, nextticklistentry.field_77182_c + b0)) +@@ -633,13 +670,26 @@ { ArrayList arraylist = new ArrayList(); -- for (int k1 = 0; k1 < this.loadedTileEntityList.size(); ++k1) +- for (int k1 = 0; k1 < this.field_147482_g.size(); ++k1) + for(int x = (p_147486_1_ >> 4); x <= (p_147486_4_ >> 4); x++) { -- TileEntity tileentity = (TileEntity)this.loadedTileEntityList.get(k1); +- TileEntity tileentity = (TileEntity)this.field_147482_g.get(k1); - -- if (tileentity.xCoord >= p_147486_1_ && tileentity.yCoord >= p_147486_2_ && tileentity.zCoord >= p_147486_3_ && tileentity.xCoord < p_147486_4_ && tileentity.yCoord < p_147486_5_ && tileentity.zCoord < p_147486_6_) +- if (tileentity.field_145851_c >= p_147486_1_ && tileentity.field_145848_d >= p_147486_2_ && tileentity.field_145849_e >= p_147486_3_ && tileentity.field_145851_c < p_147486_4_ && tileentity.field_145848_d < p_147486_5_ && tileentity.field_145849_e < p_147486_6_) + for(int z = (p_147486_3_ >> 4); z <= (p_147486_6_ >> 4); z++) { - arraylist.add(tileentity); -+ Chunk chunk = getChunkFromChunkCoords(x, z); ++ Chunk chunk = func_72964_e(x, z); + if (chunk != null) + { -+ for(Object obj : chunk.chunkTileEntityMap.values()) ++ for(Object obj : chunk.field_150816_i.values()) + { + TileEntity entity = (TileEntity)obj; -+ if (!entity.isInvalid()) ++ if (!entity.func_145837_r()) + { -+ if (entity.xCoord >= p_147486_1_ && entity.yCoord >= p_147486_2_ && entity.zCoord >= p_147486_3_ && -+ entity.xCoord <= p_147486_4_ && entity.yCoord <= p_147486_5_ && entity.zCoord <= p_147486_6_) ++ if (entity.field_145851_c >= p_147486_1_ && entity.field_145848_d >= p_147486_2_ && entity.field_145849_e >= p_147486_3_ && ++ entity.field_145851_c <= p_147486_4_ && entity.field_145848_d <= p_147486_5_ && entity.field_145849_e <= p_147486_6_) + { + arraylist.add(entity); + } @@ -190,50 +190,54 @@ } } -@@ -665,6 +715,11 @@ - // JAVADOC METHOD $$ func_72962_a - public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) +@@ -648,9 +698,14 @@ + + public boolean func_72962_a(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) { -+ return super.canMineBlock(par1EntityPlayer, par2, par3, par4); -+ } -+ -+ public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) -+ { - return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer); +- return !this.field_73061_a.func_96290_a(this, p_72962_2_, p_72962_3_, p_72962_4_, p_72962_1_); ++ return super.func_72962_a(p_72962_1_, p_72962_2_, p_72962_3_, p_72962_4_); } -@@ -744,7 +799,7 @@ - // JAVADOC METHOD $$ func_73047_i - protected void createBonusChest() ++ public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) ++ { ++ return !this.field_73061_a.func_96290_a(this, par2, par3, par4, par1EntityPlayer); ++ } ++ + protected void func_72963_a(WorldSettings p_72963_1_) { -- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); -+ WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand)); + if (this.field_73066_T == null) +@@ -725,7 +780,7 @@ + + protected void func_73047_i() + { +- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(field_73069_S, 10); ++ WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, field_73012_v), ChestGenHooks.getCount(BONUS_CHEST, field_73012_v)); for (int i = 0; i < 10; ++i) { -@@ -783,6 +838,7 @@ +@@ -762,6 +817,7 @@ } - this.chunkProvider.saveChunks(par1, par2IProgressUpdate); + this.field_73020_y.func_73151_a(p_73044_1_, p_73044_2_); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Save(this)); } } -@@ -801,6 +857,7 @@ - this.checkSessionLock(); - this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); - this.mapStorage.saveAllData(); -+ this.perWorldStorage.saveAllData(); +@@ -778,6 +834,7 @@ + this.func_72906_B(); + this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_71203_ab().func_72378_q()); + this.field_72988_C.func_75744_a(); ++ this.perWorldStorage.func_75744_a(); } - protected void onEntityAdded(Entity par1Entity) -@@ -1015,6 +1072,11 @@ + protected void func_72923_a(Entity p_72923_1_) +@@ -984,6 +1041,11 @@ } } + public File getChunkSaveLocation() + { -+ return ((AnvilChunkLoader)theChunkProviderServer.currentChunkLoader).chunkSaveLocation; ++ return ((AnvilChunkLoader)field_73059_b.field_73247_e).field_75825_d; + } + static class ServerBlockEventList extends ArrayList diff --git a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch index 9b1d35d301..1248350f0f 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java +++ ../src-work/minecraft/net/minecraft/world/WorldServerMulti.java -@@ -18,5 +18,8 @@ +@@ -17,5 +17,8 @@ + this.field_72986_A = new DerivedWorldInfo(p_i45283_6_.func_72912_H()); } - // JAVADOC METHOD $$ func_73042_a -- protected void saveLevel() throws MinecraftException {} -+ protected void saveLevel() throws MinecraftException +- protected void func_73042_a() throws MinecraftException {} ++ protected void func_73042_a() throws MinecraftException + { -+ this.perWorldStorage.saveAllData(); ++ this.perWorldStorage.func_75744_a(); + } } diff --git a/patches/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch index 2564713912..d52034211b 100644 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldType.java.patch @@ -23,31 +23,31 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@@ -46,6 +54,7 @@ +@@ -35,6 +43,7 @@ - private WorldType(int par1, String par2Str, int par3) + private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) { -+ if (par2Str.length() > 16) throw new IllegalArgumentException("World type names must not be longer then 16: " + par2Str.length()); - this.worldType = par2Str; - this.generatorVersion = par3; - this.canBeCreated = true; -@@ -202,8 +211,92 @@ - return this == FLAT ? random.nextInt(4) != 1 : false; ++ if (p_i1960_2_.length() > 16) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i1960_2_.length()); + this.field_77133_f = p_i1960_2_; + this.field_77134_g = p_i1960_3_; + this.field_77140_h = true; +@@ -183,8 +192,92 @@ + return this == field_77138_c ? random.nextInt(4) != 1 : false; } + /*=================================================== FORGE START ======================================*/ + private static int getNextID() + { -+ for (int x = 0; x < worldTypes.length; x++) ++ for (int x = 0; x < field_77139_a.length; x++) + { -+ if (worldTypes[x] == null) ++ if (field_77139_a[x] == null) + { + return x; + } + } + -+ int oldLen = worldTypes.length; -+ worldTypes = Arrays.copyOf(worldTypes, oldLen + 16); ++ int oldLen = field_77139_a.length; ++ field_77139_a = Arrays.copyOf(field_77139_a, oldLen + 16); + return oldLen; + } + @@ -84,9 +84,9 @@ + @SideOnly(Side.CLIENT) + public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld) + { -+ if (this == FLAT) ++ if (this == field_77138_c) + { -+ instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); ++ instance.func_147108_a(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); + } + } + @@ -96,7 +96,7 @@ + */ + public boolean isCustomizable() + { -+ return this == FLAT; ++ return this == field_77138_c; + } + + @@ -119,7 +119,7 @@ + public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer) + { + GenLayer ret = new GenLayerBiome(200L, parentLayer, this); -+ ret = GenLayerZoom.magnify(1000L, ret, 2); ++ ret = GenLayerZoom.func_75915_a(1000L, ret, 2); + ret = new GenLayerBiomeEdge(1000L, ret); + return ret; + } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index 459a599dd7..4123ee51cd 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -11,207 +11,207 @@ + public class BiomeDecorator { - // JAVADOC FIELD $$ field_76815_a -@@ -136,26 +141,30 @@ + public World field_76815_a; +@@ -105,26 +110,30 @@ - protected void genDecorations(BiomeGenBase p_150513_1_) + protected void func_150513_a(BiomeGenBase p_150513_1_) { -+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); - this.generateOres(); ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); + this.func_76797_b(); int i; int j; int k; -- for (i = 0; i < this.sandPerChunk2; ++i) -+ boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); -+ for (i = 0; doGen && i < this.sandPerChunk2; ++i) +- for (i = 0; i < this.field_76805_H; ++i) ++ boolean doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SAND); ++ for (i = 0; doGen && i < this.field_76805_H; ++i) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.sandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76810_g.func_76484_a(this.field_76815_a, this.field_76813_b, j, this.field_76815_a.func_72825_h(j, k), k); } -- for (i = 0; i < this.clayPerChunk; ++i) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); -+ for (i = 0; doGen && i < this.clayPerChunk; ++i) +- for (i = 0; i < this.field_76806_I; ++i) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, CLAY); ++ for (i = 0; doGen && i < this.field_76806_I; ++i) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.clayGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76809_f.func_76484_a(this.field_76815_a, this.field_76813_b, j, this.field_76815_a.func_72825_h(j, k), k); } -- for (i = 0; i < this.sandPerChunk; ++i) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); -+ for (i = 0; doGen && i < this.sandPerChunk; ++i) +- for (i = 0; i < this.field_76801_G; ++i) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SAND_PASS2); ++ for (i = 0; doGen && i < this.field_76801_G; ++i) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -172,7 +181,8 @@ + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -141,7 +150,8 @@ int l; int i1; - for (j = 0; j < i; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, TREE); + for (j = 0; doGen && j < i; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -186,14 +196,16 @@ + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -155,14 +165,16 @@ } } -- for (j = 0; j < this.bigMushroomsPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM); -+ for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) +- for (j = 0; j < this.field_76807_J; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, BIG_SHROOM); ++ for (j = 0; doGen && j < this.field_76807_J; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76826_u.func_76484_a(this.field_76815_a, this.field_76813_b, k, this.field_76815_a.func_72976_f(k, l), l); } -- for (j = 0; j < this.flowersPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); -+ for (j = 0; doGen && j < this.flowersPerChunk; ++j) +- for (j = 0; j < this.field_76802_A; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, FLOWERS); ++ for (j = 0; doGen && j < this.field_76802_A; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -208,7 +220,8 @@ + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -177,7 +189,8 @@ } } -- for (j = 0; j < this.grassPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); -+ for (j = 0; doGen && j < this.grassPerChunk; ++j) +- for (j = 0; j < this.field_76803_B; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, GRASS); ++ for (j = 0; doGen && j < this.field_76803_B; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -217,7 +230,8 @@ - worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -186,7 +199,8 @@ + worldgenerator.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } -- for (j = 0; j < this.deadBushPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); -+ for (j = 0; doGen && j < this.deadBushPerChunk; ++j) +- for (j = 0; j < this.field_76804_C; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, DEAD_BUSH); ++ for (j = 0; doGen && j < this.field_76804_C; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -225,7 +239,8 @@ - (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -194,7 +208,8 @@ + (new WorldGenDeadBush(Blocks.field_150330_I)).func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } -- for (j = 0; j < this.waterlilyPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); -+ for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) +- for (j = 0; j < this.field_76833_y; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, LILYPAD); ++ for (j = 0; doGen && j < this.field_76833_y; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -238,7 +253,8 @@ - this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -207,7 +222,8 @@ + this.field_76834_x.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } -- for (j = 0; j < this.mushroomsPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); -+ for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) +- for (j = 0; j < this.field_76798_D; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SHROOM); ++ for (j = 0; doGen && j < this.field_76798_D; ++j) { - if (this.randomGenerator.nextInt(4) == 0) + if (this.field_76813_b.nextInt(4) == 0) { -@@ -257,7 +273,7 @@ +@@ -226,7 +242,7 @@ } } -- if (this.randomGenerator.nextInt(4) == 0) -+ if (doGen && this.randomGenerator.nextInt(4) == 0) +- if (this.field_76813_b.nextInt(4) == 0) ++ if (doGen && this.field_76813_b.nextInt(4) == 0) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -265,7 +281,7 @@ - this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -234,7 +250,7 @@ + this.field_76828_s.func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); } -- if (this.randomGenerator.nextInt(8) == 0) -+ if (doGen && this.randomGenerator.nextInt(8) == 0) +- if (this.field_76813_b.nextInt(8) == 0) ++ if (doGen && this.field_76813_b.nextInt(8) == 0) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -273,7 +289,8 @@ - this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -242,7 +258,8 @@ + this.field_76827_t.func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); } -- for (j = 0; j < this.reedsPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); -+ for (j = 0; doGen && j < this.reedsPerChunk; ++j) +- for (j = 0; j < this.field_76799_E; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, REED); ++ for (j = 0; doGen && j < this.field_76799_E; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -281,7 +298,7 @@ - this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -250,7 +267,7 @@ + this.field_76825_v.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } - for (j = 0; j < 10; ++j) + for (j = 0; doGen && j < 10; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -289,7 +306,8 @@ - this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -258,7 +275,8 @@ + this.field_76825_v.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } -- if (this.randomGenerator.nextInt(32) == 0) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN); -+ if (doGen && this.randomGenerator.nextInt(32) == 0) +- if (this.field_76813_b.nextInt(32) == 0) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, PUMPKIN); ++ if (doGen && this.field_76813_b.nextInt(32) == 0) { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -297,7 +315,8 @@ - (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k); + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -266,7 +284,8 @@ + (new WorldGenPumpkin()).func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); } -- for (j = 0; j < this.cactiPerChunk; ++j) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); -+ for (j = 0; doGen && j < this.cactiPerChunk; ++j) +- for (j = 0; j < this.field_76800_F; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, CACTUS); ++ for (j = 0; doGen && j < this.field_76800_F; ++j) { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -@@ -305,7 +324,8 @@ - this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -274,7 +293,8 @@ + this.field_76824_w.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); } -- if (this.generateLakes) -+ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); -+ if (doGen && this.generateLakes) +- if (this.field_76808_K) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, LAKE); ++ if (doGen && this.field_76808_K) { for (j = 0; j < 50; ++j) { -@@ -323,6 +343,8 @@ - (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1); +@@ -292,6 +312,8 @@ + (new WorldGenLiquids(Blocks.field_150356_k)).func_76484_a(this.field_76815_a, this.field_76813_b, k, l, i1); } } + -+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); } - // JAVADOC METHOD $$ func_76795_a -@@ -352,13 +374,23 @@ - // JAVADOC METHOD $$ func_76797_b - protected void generateOres() + protected void func_76795_a(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) +@@ -318,13 +340,23 @@ + + protected void func_76797_b() { -+ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) - this.genStandardOre1(20, this.dirtGen, 0, 256); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL)) - this.genStandardOre1(10, this.gravelGen, 0, 256); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL)) - this.genStandardOre1(20, this.coalGen, 0, 128); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON)) - this.genStandardOre1(20, this.ironGen, 0, 64); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD)) - this.genStandardOre1(2, this.goldGen, 0, 32); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE)) - this.genStandardOre1(8, this.redstoneGen, 0, 16); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND)) - this.genStandardOre1(1, this.diamondGen, 0, 16); -+ if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS)) - this.genStandardOre2(1, this.lapisGen, 16, 16); -+ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); ++ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76823_i, field_76814_c, field_76811_d, DIRT)) + this.func_76795_a(20, this.field_76823_i, 0, 256); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76820_j, field_76814_c, field_76811_d, GRAVEL)) + this.func_76795_a(10, this.field_76820_j, 0, 256); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76821_k, field_76814_c, field_76811_d, COAL)) + this.func_76795_a(20, this.field_76821_k, 0, 128); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76818_l, field_76814_c, field_76811_d, IRON)) + this.func_76795_a(20, this.field_76818_l, 0, 64); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76819_m, field_76814_c, field_76811_d, GOLD)) + this.func_76795_a(2, this.field_76819_m, 0, 32); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76816_n, field_76814_c, field_76811_d, REDSTONE)) + this.func_76795_a(8, this.field_76816_n, 0, 16); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76817_o, field_76814_c, field_76811_d, DIAMOND)) + this.func_76795_a(1, this.field_76817_o, 0, 16); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76831_p, field_76814_c, field_76811_d, LAPIS)) + this.func_76793_b(1, this.field_76831_p, 16, 16); ++ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); } } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 393acb9089..5729330a1d 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -9,60 +9,63 @@ + public abstract class BiomeGenBase { - private static final Logger logger = LogManager.getLogger(); -@@ -155,6 +158,10 @@ + private static final Logger field_150586_aC = LogManager.getLogger(); +@@ -130,6 +133,10 @@ - public BiomeGenBase(int par1) + public BiomeGenBase(int p_i1971_1_) { -+ this(par1, true); ++ this(p_i1971_1_, true); + } + public BiomeGenBase(int par1, boolean register) + { - this.topBlock = Blocks.grass; + this.field_76752_A = Blocks.field_150349_c; this.field_150604_aj = 0; - this.fillerBlock = Blocks.dirt; -@@ -173,6 +180,7 @@ - this.worldGeneratorBigTree = new WorldGenBigTree(false); - this.worldGeneratorSwamp = new WorldGenSwamp(); - this.biomeID = par1; + this.field_76753_B = Blocks.field_150346_d; +@@ -147,8 +154,9 @@ + this.field_76757_N = new WorldGenTrees(false); + this.field_76758_O = new WorldGenBigTree(false); + this.field_76763_Q = new WorldGenSwamp(); +- this.field_76756_M = p_i1971_1_; +- field_76773_a[p_i1971_1_] = this; ++ this.field_76756_M = par1; + if (register) - biomeList[par1] = this; - this.theBiomeDecorator = this.createBiomeDecorator(); - this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); -@@ -188,12 +196,13 @@ - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); - this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); - this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); ++ field_76773_a[par1] = this; + this.field_76760_I = this.func_76729_a(); + this.field_76762_K.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + this.field_76762_K.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); +@@ -163,11 +171,12 @@ + this.field_76761_J.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.field_76755_L.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.field_82914_M.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + this.addDefaultFlowers(); } - // JAVADOC METHOD $$ func_76729_a - public BiomeDecorator createBiomeDecorator() + public BiomeDecorator func_76729_a() { - return new BiomeDecorator(); + return getModdedBiomeDecorator(new BiomeDecorator()); } - // JAVADOC METHOD $$ func_76732_a -@@ -375,7 +384,7 @@ + public BiomeGenBase func_76732_a(float p_76732_1_, float p_76732_2_) +@@ -335,7 +344,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); - double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); -- return ColorizerGrass.getGrassColor(d0, d1); -+ return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1)); + double d0 = (double)MathHelper.func_76131_a(this.func_150564_a(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerGrass.func_77480_a(d0, d1); ++ return getModdedBiomeGrassColor(ColorizerGrass.func_77480_a(d0, d1)); } - // JAVADOC METHOD $$ func_150571_c -@@ -384,7 +393,7 @@ + @SideOnly(Side.CLIENT) +@@ -343,7 +352,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); - double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); -- return ColorizerFoliage.getFoliageColor(d0, d1); -+ return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1)); + double d0 = (double)MathHelper.func_76131_a(this.func_150564_a(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerFoliage.func_77470_a(d0, d1); ++ return getModdedBiomeFoliageColor(ColorizerFoliage.func_77470_a(d0, d1)); } public boolean func_150559_j() -@@ -535,6 +544,88 @@ +@@ -490,6 +499,88 @@ } } @@ -76,7 +79,7 @@ + + public int getWaterColorMultiplier() + { -+ BiomeEvent.GetWaterColor event = new BiomeEvent.GetWaterColor(this, waterColorMultiplier); ++ BiomeEvent.GetWaterColor event = new BiomeEvent.GetWaterColor(this, field_76759_H); + MinecraftForge.EVENT_BUS.post(event); + return event.newColor; + } @@ -116,8 +119,8 @@ + */ + public void addDefaultFlowers() + { -+ this.flowers.add(new FlowerEntry(Blocks.yellow_flower, 0, 20)); -+ this.flowers.add(new FlowerEntry(Blocks.red_flower, 0, 10)); ++ this.flowers.add(new FlowerEntry(Blocks.field_150327_N, 0, 20)); ++ this.flowers.add(new FlowerEntry(Blocks.field_150328_O, 0, 10)); + } + + /** Register a new plant to be planted when bonemeal is used on grass. @@ -133,16 +136,16 @@ + + public void plantFlower(World world, Random rand, int x, int y, int z) + { -+ BiomeGenBase biome = world.getBiomeGenForCoords(x, z); ++ BiomeGenBase biome = world.func_72807_a(x, z); + String flowername = biome.func_150572_a(rand, x, y, z); + -+ FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(rand, flowers); -+ if (flower == null || flower.block == null || !flower.block.canBlockStay(world, x, y, z)) ++ FlowerEntry flower = (FlowerEntry)WeightedRandom.func_76271_a(rand, flowers); ++ if (flower == null || flower.block == null || !flower.block.func_149718_j(world, x, y, z)) + { + return; + } + -+ world.setBlock(x, y, z, flower.block, flower.metadata, 3); ++ world.func_147465_d(x, y, z, flower.block, flower.metadata, 3); + } + + @@ -150,4 +153,4 @@ + static { - plains.createMutation(); + field_76772_c.func_150566_k(); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch index e2ee118170..749a391bbd 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch @@ -10,7 +10,7 @@ import net.minecraft.world.gen.feature.WorldGenAbstractTree; @@ -53,6 +54,15 @@ { - this.theBiomeDecorator.treesPerChunk = -999; + this.field_76760_I.field_76832_z = -999; } + + if (this.field_150632_aF == 1) @@ -18,7 +18,7 @@ + this.flowers.clear(); + for (int x = 0; x < BlockFlower.field_149859_a.length; x++) + { -+ this.addFlower(Blocks.red_flower, x, 10); ++ this.addFlower(Blocks.field_150328_O, x, 10); + } + } } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch index ba97b493c7..b56164747d 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch @@ -9,18 +9,18 @@ public class BiomeGenPlains extends BiomeGenBase @@ -19,6 +20,15 @@ - this.theBiomeDecorator.treesPerChunk = -999; - this.theBiomeDecorator.flowersPerChunk = 4; - this.theBiomeDecorator.grassPerChunk = 10; + this.field_76760_I.field_76832_z = -999; + this.field_76760_I.field_76802_A = 4; + this.field_76760_I.field_76803_B = 10; + this.flowers.clear(); -+ this.addFlower(Blocks.red_flower, 4, 3); -+ this.addFlower(Blocks.red_flower, 5, 3); -+ this.addFlower(Blocks.red_flower, 6, 3); -+ this.addFlower(Blocks.red_flower, 7, 3); -+ this.addFlower(Blocks.red_flower, 0, 20); -+ this.addFlower(Blocks.red_flower, 3, 20); -+ this.addFlower(Blocks.red_flower, 8, 20); -+ this.addFlower(Blocks.yellow_flower, 0, 30); ++ this.addFlower(Blocks.field_150328_O, 4, 3); ++ this.addFlower(Blocks.field_150328_O, 5, 3); ++ this.addFlower(Blocks.field_150328_O, 6, 3); ++ this.addFlower(Blocks.field_150328_O, 7, 3); ++ this.addFlower(Blocks.field_150328_O, 0, 20); ++ this.addFlower(Blocks.field_150328_O, 3, 20); ++ this.addFlower(Blocks.field_150328_O, 8, 20); ++ this.addFlower(Blocks.field_150327_N, 0, 30); } public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch index 508ffe182c..435c3a7115 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java @@ -30,6 +30,8 @@ - this.theBiomeDecorator.grassPerChunk = 5; - this.waterColorMultiplier = 14745518; - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + this.field_76760_I.field_76803_B = 5; + this.field_76759_H = 14745518; + this.field_76761_J.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + this.flowers.clear(); -+ this.addFlower(Blocks.red_mushroom_block, 0, 10); ++ this.addFlower(Blocks.field_150419_aX, 0, 10); } public WorldGenAbstractTree func_150567_a(Random p_150567_1_) diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch index bfce4e895d..474f786a27 100644 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch @@ -18,35 +18,35 @@ public class WorldChunkManager { -+ public static ArrayList allowedBiomes = new ArrayList(Arrays.asList(forest, plains, taiga, taigaHills, forestHills, jungle, jungleHills)); - private GenLayer genBiomes; - // JAVADOC FIELD $$ field_76945_e - private GenLayer biomeIndexLayer; -@@ -29,19 +34,14 @@ ++ public static ArrayList allowedBiomes = new ArrayList(Arrays.asList(field_76767_f, field_76772_c, field_76768_g, field_76784_u, field_76785_t, field_76782_w, field_76792_x)); + private GenLayer field_76944_d; + private GenLayer field_76945_e; + private BiomeCache field_76942_f; +@@ -26,19 +31,14 @@ { - this.biomeCache = new BiomeCache(this); - this.biomesToSpawnIn = new ArrayList(); -- this.biomesToSpawnIn.add(BiomeGenBase.forest); -- this.biomesToSpawnIn.add(BiomeGenBase.plains); -- this.biomesToSpawnIn.add(BiomeGenBase.taiga); -- this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); -- this.biomesToSpawnIn.add(BiomeGenBase.forestHills); -- this.biomesToSpawnIn.add(BiomeGenBase.jungle); -- this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); -+ this.biomesToSpawnIn.addAll(allowedBiomes); + this.field_76942_f = new BiomeCache(this); + this.field_76943_g = new ArrayList(); +- this.field_76943_g.add(BiomeGenBase.field_76767_f); +- this.field_76943_g.add(BiomeGenBase.field_76772_c); +- this.field_76943_g.add(BiomeGenBase.field_76768_g); +- this.field_76943_g.add(BiomeGenBase.field_76784_u); +- this.field_76943_g.add(BiomeGenBase.field_76785_t); +- this.field_76943_g.add(BiomeGenBase.field_76782_w); +- this.field_76943_g.add(BiomeGenBase.field_76792_x); ++ this.field_76943_g.addAll(allowedBiomes); } - public WorldChunkManager(long par1, WorldType par3WorldType) + public WorldChunkManager(long p_i1975_1_, WorldType p_i1975_3_) { this(); - GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(par1, par3WorldType); -+ agenlayer = getModdedBiomeGenerators(par3WorldType, par1, agenlayer); - this.genBiomes = agenlayer[0]; - this.biomeIndexLayer = agenlayer[1]; + GenLayer[] agenlayer = GenLayer.func_75901_a(p_i1975_1_, p_i1975_3_); ++ agenlayer = getModdedBiomeGenerators(p_i1975_3_, p_i1975_1_, agenlayer); + this.field_76944_d = agenlayer[0]; + this.field_76945_e = agenlayer[1]; } -@@ -254,4 +254,11 @@ +@@ -242,4 +242,11 @@ { - this.biomeCache.cleanupCache(); + this.field_76942_f.func_76838_a(); } + + public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index cd742611cc..caa4833ac8 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -11,58 +11,58 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -218,7 +222,7 @@ +@@ -194,7 +198,7 @@ { - Block block = this.getBlock(j, l - 1, k); + Block block = this.func_150810_a(j, l - 1, k); -- if (block.getLightOpacity() == 0) +- if (block.func_149717_k() == 0) + if (func_150808_b(j, l - 1, k) == 0) { --l; continue; -@@ -521,7 +525,9 @@ +@@ -493,7 +497,9 @@ public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { -- return this.getBlock(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(); -+ int x = (xPosition << 4) + p_150808_1_; -+ int z = (zPosition << 4) + p_150808_3_; -+ return this.getBlock(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(worldObj, x, p_150808_2_, p_150808_3_); +- return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).func_149717_k(); ++ int x = (field_76635_g << 4) + p_150808_1_; ++ int z = (field_76647_h << 4) + p_150808_3_; ++ return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(field_76637_e, x, p_150808_2_, p_150808_3_); } - // JAVADOC METHOD $$ func_150810_a -@@ -615,14 +621,19 @@ + public Block func_150810_a(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_) +@@ -585,14 +591,19 @@ } extendedblockstorage.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_); -+ extendedblockstorage.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); // Move this above to prevent other mods/tile entites from creating invalid ones for the wrong metadata ++ extendedblockstorage.func_76654_b(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); // Move this above to prevent other mods/tile entites from creating invalid ones for the wrong metadata - if (!this.worldObj.isRemote) + if (!this.field_76637_e.field_72995_K) { - block1.breakBlock(this.worldObj, l1, p_150807_2_, i2, block1, k1); + block1.func_149749_a(this.field_76637_e, l1, p_150807_2_, i2, block1, k1); } - else if (block1 instanceof ITileEntityProvider && block1 != p_150807_4_) + else if (block1.hasTileEntity(k1)) { -- this.worldObj.removeTileEntity(l1, p_150807_2_, i2); +- this.field_76637_e.func_147475_p(l1, p_150807_2_, i2); + TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); -+ if (te != null && te.shouldRefresh(block1, p_150807_4_, k1, p_150807_5_, worldObj, l1, p_150807_2_, i2)) ++ if (te != null && te.shouldRefresh(block1, p_150807_4_, k1, p_150807_5_, field_76637_e, l1, p_150807_2_, i2)) + { -+ this.worldObj.removeTileEntity(l1, p_150807_2_, i2); ++ this.field_76637_e.func_147475_p(l1, p_150807_2_, i2); + } } - if (extendedblockstorage.getBlockByExtId(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) -@@ -631,8 +642,6 @@ + if (extendedblockstorage.func_150819_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) +@@ -601,8 +612,6 @@ } else { -- extendedblockstorage.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); +- extendedblockstorage.func_76654_b(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); - if (flag) { - this.generateSkylightMap(); -@@ -662,34 +671,19 @@ + this.func_76603_b(); +@@ -632,34 +641,19 @@ TileEntity tileentity; @@ -72,13 +72,13 @@ - - if (tileentity != null) - { -- tileentity.updateContainingBlockInfo(); +- tileentity.func_145836_u(); - } - } - - if (!this.worldObj.isRemote) + if (!this.field_76637_e.field_72995_K) { - p_150807_4_.onBlockAdded(this.worldObj, l1, p_150807_2_, i2); + p_150807_4_.func_149726_b(this.field_76637_e, l1, p_150807_2_, i2); } - if (p_150807_4_ instanceof ITileEntityProvider) @@ -88,63 +88,63 @@ - if (tileentity == null) - { -- tileentity = ((ITileEntityProvider)p_150807_4_).createNewTileEntity(this.worldObj, p_150807_5_); -- this.worldObj.setTileEntity(l1, p_150807_2_, i2, tileentity); +- tileentity = ((ITileEntityProvider)p_150807_4_).func_149915_a(this.field_76637_e, p_150807_5_); +- this.field_76637_e.func_147455_a(l1, p_150807_2_, i2, tileentity); - } - if (tileentity != null) { - tileentity.updateContainingBlockInfo(); -+ tileentity.blockMetadata = p_150807_5_; + tileentity.func_145836_u(); ++ tileentity.field_145847_g = p_150807_5_; } } -@@ -721,7 +715,7 @@ - this.isModified = true; - extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4); +@@ -690,7 +684,7 @@ + this.field_76643_l = true; + extendedblockstorage.func_76654_b(p_76589_1_, p_76589_2_ & 15, p_76589_3_, p_76589_4_); -- if (extendedblockstorage.getBlockByExtId(par1, par2 & 15, par3) instanceof ITileEntityProvider) -+ if (extendedblockstorage.getBlockByExtId(par1, par2 & 15, par3).hasTileEntity(par4)) +- if (extendedblockstorage.func_150819_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_) instanceof ITileEntityProvider) ++ if (extendedblockstorage.func_150819_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_).hasTileEntity(p_76589_4_)) { - TileEntity tileentity = this.func_150806_e(par1, par2, par3); + TileEntity tileentity = this.func_150806_e(p_76589_1_, p_76589_2_, p_76589_3_); -@@ -825,6 +819,7 @@ - k = this.entityLists.length - 1; +@@ -790,6 +784,7 @@ + k = this.field_76645_j.length - 1; } -+ MinecraftForge.EVENT_BUS.post(new EntityEvent.EnteringChunk(par1Entity, this.xPosition, this.zPosition, par1Entity.chunkCoordX, par1Entity.chunkCoordZ)); - par1Entity.addedToChunk = true; - par1Entity.chunkCoordX = this.xPosition; - par1Entity.chunkCoordY = k; -@@ -865,28 +860,27 @@ ++ MinecraftForge.EVENT_BUS.post(new EntityEvent.EnteringChunk(p_76612_1_, this.field_76635_g, this.field_76647_h, p_76612_1_.field_70176_ah, p_76612_1_.field_70164_aj)); + p_76612_1_.field_70175_ag = true; + p_76612_1_.field_70176_ah = this.field_76635_g; + p_76612_1_.field_70162_ai = k; +@@ -827,28 +822,27 @@ ChunkPosition chunkposition = new ChunkPosition(p_150806_1_, p_150806_2_, p_150806_3_); - TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); + TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); -+ if (tileentity != null && tileentity.isInvalid()) ++ if (tileentity != null && tileentity.func_145837_r()) + { -+ chunkTileEntityMap.remove(chunkposition); ++ field_150816_i.remove(chunkposition); + tileentity = null; + } + if (tileentity == null) { - Block block = this.getBlock(p_150806_1_, p_150806_2_, p_150806_3_); -+ int meta = this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_); + Block block = this.func_150810_a(p_150806_1_, p_150806_2_, p_150806_3_); ++ int meta = this.func_76628_c(p_150806_1_, p_150806_2_, p_150806_3_); -- if (!block.hasTileEntity()) +- if (!block.func_149716_u()) + if (!block.hasTileEntity(meta)) { return null; } -- tileentity = ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_)); -+ tileentity = block.createTileEntity(worldObj, meta); - this.worldObj.setTileEntity(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, tileentity); +- tileentity = ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, this.func_76628_c(p_150806_1_, p_150806_2_, p_150806_3_)); ++ tileentity = block.createTileEntity(field_76637_e, meta); + this.field_76637_e.func_147455_a(this.field_76635_g * 16 + p_150806_1_, p_150806_2_, this.field_76647_h * 16 + p_150806_3_, tileentity); } -- if (tileentity != null && tileentity.isInvalid()) +- if (tileentity != null && tileentity.func_145837_r()) - { -- this.chunkTileEntityMap.remove(chunkposition); +- this.field_150816_i.remove(chunkposition); - return null; - } - else @@ -154,110 +154,110 @@ + return tileentity; } - public void addTileEntity(TileEntity p_150813_1_) -@@ -898,7 +892,7 @@ + public void func_150813_a(TileEntity p_150813_1_) +@@ -860,7 +854,7 @@ - if (this.isChunkLoaded) + if (this.field_76636_d) { -- this.worldObj.loadedTileEntityList.add(p_150813_1_); -+ this.worldObj.addTileEntity(p_150813_1_); +- this.field_76637_e.field_147482_g.add(p_150813_1_); ++ this.field_76637_e.addTileEntity(p_150813_1_); } } -@@ -910,7 +904,8 @@ - p_150812_4_.yCoord = p_150812_2_; - p_150812_4_.zCoord = this.zPosition * 16 + p_150812_3_; +@@ -872,7 +866,8 @@ + p_150812_4_.field_145848_d = p_150812_2_; + p_150812_4_.field_145849_e = this.field_76647_h * 16 + p_150812_3_; -- if (this.getBlock(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) -+ int metadata = getBlockMetadata(p_150812_1_, p_150812_2_, p_150812_3_); -+ if (this.getBlock(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) +- if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) ++ int metadata = func_76628_c(p_150812_1_, p_150812_2_, p_150812_3_); ++ if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) { - if (this.chunkTileEntityMap.containsKey(chunkposition)) + if (this.field_150816_i.containsKey(chunkposition)) { -@@ -955,6 +950,7 @@ +@@ -916,6 +911,7 @@ - this.worldObj.addLoadedEntities(this.entityLists[i]); + this.field_76637_e.func_72868_a(this.field_76645_j[i]); } + MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(this)); } - // JAVADOC METHOD $$ func_76623_d -@@ -973,6 +969,7 @@ + public void func_76623_d() +@@ -933,6 +929,7 @@ { - this.worldObj.unloadEntities(this.entityLists[i]); + this.field_76637_e.func_72828_b(this.field_76645_j[i]); } + MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this)); } - // JAVADOC METHOD $$ func_76630_e -@@ -984,8 +981,8 @@ - // JAVADOC METHOD $$ func_76588_a - public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) - { -- int i = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); - j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + public void func_76630_e() +@@ -942,8 +939,8 @@ -@@ -1022,8 +1019,8 @@ - // JAVADOC METHOD $$ func_76618_a - public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) + public void func_76588_a(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) { -- int i = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); - j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); +- int i = MathHelper.func_76128_c((p_76588_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_76588_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_76588_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_76588_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); -@@ -1187,6 +1184,15 @@ +@@ -979,8 +976,8 @@ + + public void func_76618_a(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) + { +- int i = MathHelper.func_76128_c((p_76618_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_76618_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_76618_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_76618_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); + +@@ -1139,6 +1136,15 @@ @SideOnly(Side.CLIENT) - public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) + public void func_76607_a(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_) { -+ Iterator iterator = chunkTileEntityMap.values().iterator(); ++ Iterator iterator = field_150816_i.values().iterator(); + while(iterator.hasNext()) + { + TileEntity tileEntity = (TileEntity)iterator.next(); -+ tileEntity.updateContainingBlockInfo(); -+ tileEntity.getBlockMetadata(); -+ tileEntity.getBlockType(); ++ tileEntity.func_145836_u(); ++ tileEntity.func_145832_p(); ++ tileEntity.func_145838_q(); + } + int k = 0; - boolean flag1 = !this.worldObj.provider.hasNoSky; + boolean flag1 = !this.field_76637_e.field_73011_w.field_76576_e; int l; -@@ -1289,13 +1295,27 @@ - this.isLightPopulated = true; - this.isTerrainPopulated = true; - this.generateHeightMap(); -- Iterator iterator = this.chunkTileEntityMap.values().iterator(); +@@ -1241,13 +1247,27 @@ + this.field_150814_l = true; + this.field_76646_k = true; + this.func_76590_a(); +- Iterator iterator = this.field_150816_i.values().iterator(); + List invalidList = new ArrayList(); -+ iterator = this.chunkTileEntityMap.values().iterator(); ++ iterator = this.field_150816_i.values().iterator(); while (iterator.hasNext()) { TileEntity tileentity = (TileEntity)iterator.next(); -+ int x = tileentity.xCoord & 15; -+ int y = tileentity.yCoord; -+ int z = tileentity.zCoord & 15; -+ Block block = tileentity.getBlockType(); -+ if (block != getBlock(x, y, z) || tileentity.blockMetadata != this.getBlockMetadata(x, y, z)) ++ int x = tileentity.field_145851_c & 15; ++ int y = tileentity.field_145848_d; ++ int z = tileentity.field_145849_e & 15; ++ Block block = tileentity.func_145838_q(); ++ if (block != func_150810_a(x, y, z) || tileentity.field_145847_g != this.func_76628_c(x, y, z)) + { + invalidList.add(tileentity); + } - tileentity.updateContainingBlockInfo(); + tileentity.func_145836_u(); } + + for (TileEntity te : invalidList) + { -+ te.invalidate(); ++ te.func_145843_s(); + } } - // JAVADOC METHOD $$ func_76591_a -@@ -1503,4 +1523,48 @@ + public BiomeGenBase func_76591_a(int p_76591_1_, int p_76591_2_, WorldChunkManager p_76591_3_) +@@ -1450,4 +1470,48 @@ return true; } @@ -274,11 +274,11 @@ + public TileEntity getTileEntityUnsafe(int x, int y, int z) + { + ChunkPosition chunkposition = new ChunkPosition(x, y, z); -+ TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); ++ TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); + -+ if (tileentity != null && tileentity.isInvalid()) ++ if (tileentity != null && tileentity.func_145837_r()) + { -+ chunkTileEntityMap.remove(chunkposition); ++ field_150816_i.remove(chunkposition); + tileentity = null; + } + @@ -296,12 +296,12 @@ + public void removeInvalidTileEntity(int x, int y, int z) + { + ChunkPosition position = new ChunkPosition(x, y, z); -+ if (isChunkLoaded) ++ if (field_76636_d) + { -+ TileEntity entity = (TileEntity)chunkTileEntityMap.get(position); -+ if (entity != null && entity.isInvalid()) ++ TileEntity entity = (TileEntity)field_150816_i.get(position); ++ if (entity != null && entity.func_145837_r()) + { -+ chunkTileEntityMap.remove(position); ++ field_150816_i.remove(position); + } + } + } diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch index 08ae6c78da..8ac12773ec 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -9,19 +9,19 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; -@@ -109,6 +111,7 @@ - chunk = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level")); +@@ -106,6 +108,7 @@ + chunk = this.func_75823_a(p_75822_1_, p_75822_4_.func_74775_l("Level")); } -+ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, par4NBTTagCompound)); ++ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, p_75822_4_)); return chunk; } } -@@ -123,6 +126,7 @@ +@@ -120,6 +123,7 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound.setTag("Level", nbttagcompound1); - this.writeChunkToNBT(par2Chunk, par1World, nbttagcompound1); -+ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(par2Chunk, nbttagcompound)); - this.addChunkToPending(par2Chunk.getChunkCoordIntPair(), nbttagcompound); + nbttagcompound.func_74782_a("Level", nbttagcompound1); + this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1); ++ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); + this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound); } catch (Exception exception) diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch index 35b12c60ec..dc00369167 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -1,18 +1,18 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -24,18 +24,12 @@ - File file1 = this.getWorldDirectory(); +@@ -23,18 +23,12 @@ + File file1 = this.func_75765_b(); File file2; -- if (par1WorldProvider instanceof WorldProviderHell) -+ if (par1WorldProvider.getSaveFolder() != null) +- if (p_75763_1_ instanceof WorldProviderHell) ++ if (p_75763_1_.getSaveFolder() != null) { - file2 = new File(file1, "DIM-1"); -+ file2 = new File(file1, par1WorldProvider.getSaveFolder()); ++ file2 = new File(file1, p_75763_1_.getSaveFolder()); file2.mkdirs(); return new AnvilChunkLoader(file2); } -- else if (par1WorldProvider instanceof WorldProviderEnd) +- else if (p_75763_1_ instanceof WorldProviderEnd) - { - file2 = new File(file1, "DIM1"); - file2.mkdirs(); diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index 136939ae4b..eb215a9f3d 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -10,23 +10,23 @@ + public class ChunkProviderEnd implements IChunkProvider { - private Random endRNG; -@@ -44,6 +48,14 @@ - this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); - this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); - this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + private Random field_73204_i; +@@ -43,6 +47,14 @@ + this.field_73199_l = new NoiseGeneratorOctaves(this.field_73204_i, 8); + this.field_73196_a = new NoiseGeneratorOctaves(this.field_73204_i, 10); + this.field_73194_b = new NoiseGeneratorOctaves(this.field_73204_i, 16); + -+ NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5}; -+ noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.endRNG, noiseGens); -+ this.noiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.noiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.noiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.noiseGen4 = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; ++ NoiseGenerator[] noiseGens = {field_73201_j, field_73202_k, field_73199_l, field_73196_a, field_73194_b}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2007_1_, this.field_73204_i, noiseGens); ++ this.field_73201_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73202_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73199_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73196_a = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73194_b = (NoiseGeneratorOctaves)noiseGens[4]; } public void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_) -@@ -116,6 +128,10 @@ +@@ -115,6 +127,10 @@ public void func_147421_b(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_) { @@ -37,31 +37,31 @@ for (int k = 0; k < 16; ++k) { for (int l = 0; l < 16; ++l) -@@ -198,6 +214,10 @@ - // JAVADOC METHOD $$ func_73187_a - private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) +@@ -194,6 +210,10 @@ + + private double[] func_73187_a(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) { -+ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7); ++ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return event.noisefield; + - if (par1ArrayOfDouble == null) + if (p_73187_1_ == null) { - par1ArrayOfDouble = new double[par5 * par6 * par7]; -@@ -341,10 +361,16 @@ - public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; +@@ -335,10 +355,16 @@ + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { - BlockFalling.fallInstantly = true; + BlockFalling.field_149832_M = true; + -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, endWorld, endWorld.rand, par2, par3, false)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); + - int k = par2 * 16; - int l = par3 * 16; - BiomeGenBase biomegenbase = this.endWorld.getBiomeGenForCoords(k + 16, l + 16); - biomegenbase.decorate(this.endWorld, this.endWorld.rand, k, l); + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.field_73200_m.func_72807_a(k + 16, l + 16); + biomegenbase.func_76728_a(this.field_73200_m, this.field_73200_m.field_73012_v, k, l); + -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, endWorld, endWorld.rand, par2, par3, false)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); + - BlockFalling.fallInstantly = false; + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch index 064ad5abe9..73bd211758 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -12,105 +12,105 @@ + public class ChunkProviderGenerate implements IChunkProvider { - // JAVADOC FIELD $$ field_73220_k -@@ -62,6 +68,15 @@ + private Random field_73220_k; +@@ -52,6 +58,15 @@ int[][] field_73219_j = new int[32][32]; private static final String __OBFID = "CL_00000396"; + { -+ caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE); -+ strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD); -+ villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE); -+ mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT); -+ scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); -+ ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); ++ field_73226_t = TerrainGen.getModdedMapGen(field_73226_t, CAVE); ++ field_73225_u = (MapGenStronghold) TerrainGen.getModdedMapGen(field_73225_u, STRONGHOLD); ++ field_73224_v = (MapGenVillage) TerrainGen.getModdedMapGen(field_73224_v, VILLAGE); ++ field_73223_w = (MapGenMineshaft) TerrainGen.getModdedMapGen(field_73223_w, MINESHAFT); ++ field_73233_x = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(field_73233_x, SCATTERED_FEATURE); ++ field_73232_y = TerrainGen.getModdedMapGen(field_73232_y, RAVINE); + } + - public ChunkProviderGenerate(World par1World, long par2, boolean par4) + public ChunkProviderGenerate(World p_i2006_1_, long p_i2006_2_, boolean p_i2006_4_) { - this.worldObj = par1World; -@@ -86,6 +101,16 @@ - this.parabolicField[j + 2 + (k + 2) * 5] = f; + this.field_73230_p = p_i2006_1_; +@@ -76,6 +91,16 @@ + this.field_147433_r[j + 2 + (k + 2) * 5] = f; } } + -+ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, noiseGen6, mobSpawnerNoise}; -+ noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens); ++ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, field_73214_a, field_73212_b, field_73213_c}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2006_1_, this.field_73220_k, noiseGens); + this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; + this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; + this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; + this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6]; ++ this.field_73214_a = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73212_b = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73213_c = (NoiseGeneratorOctaves)noiseGens[6]; } public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) -@@ -167,6 +192,10 @@ +@@ -157,6 +182,10 @@ - public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) + public void func_147422_a(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return; + double d0 = 0.03125D; - this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + this.field_73227_s = this.field_147430_m.func_151599_a(this.field_73227_s, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); -@@ -359,6 +388,8 @@ - this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed()); +@@ -345,6 +374,8 @@ + this.field_73220_k.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.field_73230_p.func_72905_C()); boolean flag = false; -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); + - if (this.mapFeaturesEnabled) + if (this.field_73229_q) { - this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); -@@ -371,7 +402,8 @@ + this.field_73223_w.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_); +@@ -357,7 +388,8 @@ int l1; int i2; -- if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0) -+ if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 -+ && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE)) +- if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && !flag && this.field_73220_k.nextInt(4) == 0) ++ if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && !flag && this.field_73220_k.nextInt(4) == 0 ++ && TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, LAKE)) { - k1 = k + this.rand.nextInt(16) + 8; - l1 = this.rand.nextInt(256); -@@ -379,7 +411,7 @@ - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2); + k1 = k + this.field_73220_k.nextInt(16) + 8; + l1 = this.field_73220_k.nextInt(256); +@@ -365,7 +397,7 @@ + (new WorldGenLakes(Blocks.field_150355_j)).func_76484_a(this.field_73230_p, this.field_73220_k, k1, l1, i2); } -- if (!flag && this.rand.nextInt(8) == 0) -+ if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag && this.rand.nextInt(8) == 0) +- if (!flag && this.field_73220_k.nextInt(8) == 0) ++ if (TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, LAVA) && !flag && this.field_73220_k.nextInt(8) == 0) { - k1 = k + this.rand.nextInt(16) + 8; - l1 = this.rand.nextInt(this.rand.nextInt(248) + 8); -@@ -391,7 +423,8 @@ + k1 = k + this.field_73220_k.nextInt(16) + 8; + l1 = this.field_73220_k.nextInt(this.field_73220_k.nextInt(248) + 8); +@@ -377,7 +409,8 @@ } } - for (k1 = 0; k1 < 8; ++k1) -+ boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON); ++ boolean doGen = TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, DUNGEON); + for (k1 = 0; doGen && k1 < 8; ++k1) { - l1 = k + this.rand.nextInt(16) + 8; - i2 = this.rand.nextInt(256); -@@ -404,7 +437,8 @@ + l1 = k + this.field_73220_k.nextInt(16) + 8; + i2 = this.field_73220_k.nextInt(256); +@@ -390,7 +423,8 @@ k += 8; l += 8; - for (k1 = 0; k1 < 16; ++k1) -+ doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ICE); ++ doGen = TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, ICE); + for (k1 = 0; doGen && k1 < 16; ++k1) { for (l1 = 0; l1 < 16; ++l1) { -@@ -422,6 +456,8 @@ +@@ -408,6 +442,8 @@ } } -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); + - BlockFalling.fallInstantly = false; + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch index 9cf8fcb013..d25b8edb52 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -14,37 +14,37 @@ + public class ChunkProviderHell implements IChunkProvider { - private Random hellRNG; -@@ -51,6 +59,11 @@ - double[] noiseData5; + private Random field_73181_i; +@@ -45,6 +53,11 @@ + double[] field_73180_h; private static final String __OBFID = "CL_00000392"; + { -+ genNetherBridge = (MapGenNetherBridge) TerrainGen.getModdedMapGen(genNetherBridge, NETHER_BRIDGE); -+ netherCaveGenerator = TerrainGen.getModdedMapGen(netherCaveGenerator, NETHER_CAVE); ++ field_73172_c = (MapGenNetherBridge) TerrainGen.getModdedMapGen(field_73172_c, NETHER_BRIDGE); ++ field_73182_t = TerrainGen.getModdedMapGen(field_73182_t, NETHER_CAVE); + } + - public ChunkProviderHell(World par1World, long par2) + public ChunkProviderHell(World p_i2005_1_, long p_i2005_2_) { - this.worldObj = par1World; -@@ -62,6 +75,16 @@ - this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); - this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); - this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.field_73175_o = p_i2005_1_; +@@ -56,6 +69,16 @@ + this.field_73174_n = new NoiseGeneratorOctaves(this.field_73181_i, 4); + this.field_73173_a = new NoiseGeneratorOctaves(this.field_73181_i, 10); + this.field_73171_b = new NoiseGeneratorOctaves(this.field_73181_i, 16); + -+ NoiseGenerator[] noiseGens = {netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7}; -+ noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.hellRNG, noiseGens); -+ this.netherNoiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.netherNoiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.netherNoiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.slowsandGravelNoiseGen = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.netherrackExculsivityNoiseGen = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.netherNoiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.netherNoiseGen7 = (NoiseGeneratorOctaves)noiseGens[6]; ++ NoiseGenerator[] noiseGens = {field_73178_j, field_73179_k, field_73176_l, field_73177_m, field_73174_n, field_73173_a, field_73171_b}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2005_1_, this.field_73181_i, noiseGens); ++ this.field_73178_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73179_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73176_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73177_m = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73174_n = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73173_a = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73171_b = (NoiseGeneratorOctaves)noiseGens[6]; } public void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_) -@@ -140,6 +163,10 @@ +@@ -134,6 +157,10 @@ public void func_147418_b(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_) { @@ -54,107 +54,107 @@ + byte b0 = 64; double d0 = 0.03125D; - this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); -@@ -262,6 +289,10 @@ - // JAVADOC METHOD $$ func_73164_a - private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) + this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); +@@ -253,6 +280,10 @@ + + private double[] func_73164_a(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) { -+ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7); ++ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return event.noisefield; + - if (par1ArrayOfDouble == null) + if (p_73164_1_ == null) { - par1ArrayOfDouble = new double[par5 * par6 * par7]; -@@ -410,6 +441,9 @@ - public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; +@@ -399,6 +430,9 @@ + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { - BlockFalling.fallInstantly = true; + BlockFalling.field_149832_M = true; + -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, hellRNG, par2, par3, false)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); + - int k = par2 * 16; - int l = par3 * 16; - this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, par2, par3); -@@ -418,7 +452,8 @@ + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + this.field_73172_c.func_75051_a(this.field_73175_o, this.field_73181_i, p_73153_2_, p_73153_3_); +@@ -407,7 +441,8 @@ int k1; int l1; - for (i1 = 0; i1 < 8; ++i1) -+ boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, hellRNG, par2, par3, false, NETHER_LAVA); ++ boolean doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, NETHER_LAVA); + for (i1 = 0; doGen && i1 < 8; ++i1) { - j1 = k + this.hellRNG.nextInt(16) + 8; - k1 = this.hellRNG.nextInt(120) + 4; -@@ -429,7 +464,8 @@ - i1 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(120) + 4; +@@ -418,7 +453,8 @@ + i1 = this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; int i2; - for (j1 = 0; j1 < i1; ++j1) -+ doGen = TerrainGen.populate(par1IChunkProvider, worldObj, hellRNG, par2, par3, false, FIRE); ++ doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, FIRE); + for (j1 = 0; doGen && j1 < i1; ++j1) { - k1 = k + this.hellRNG.nextInt(16) + 8; - l1 = this.hellRNG.nextInt(120) + 4; -@@ -438,8 +474,9 @@ + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(120) + 4; +@@ -427,8 +463,9 @@ } - i1 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); + i1 = this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); - - for (j1 = 0; j1 < i1; ++j1) + -+ doGen = TerrainGen.populate(par1IChunkProvider, worldObj, hellRNG, par2, par3, false, GLOWSTONE); ++ doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, GLOWSTONE); + for (j1 = 0; doGen && j1 < i1; ++j1) { - k1 = k + this.hellRNG.nextInt(16) + 8; - l1 = this.hellRNG.nextInt(120) + 4; -@@ -447,7 +484,7 @@ - (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, k1, l1, i2); + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(120) + 4; +@@ -436,7 +473,7 @@ + (new WorldGenGlowStone1()).func_76484_a(this.field_73175_o, this.field_73181_i, k1, l1, i2); } - for (j1 = 0; j1 < 10; ++j1) + for (j1 = 0; doGen && j1 < 10; ++j1) { - k1 = k + this.hellRNG.nextInt(16) + 8; - l1 = this.hellRNG.nextInt(128); -@@ -455,7 +492,10 @@ - (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, k1, l1, i2); + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(128); +@@ -444,7 +481,10 @@ + (new WorldGenGlowStone2()).func_76484_a(this.field_73175_o, this.field_73181_i, k1, l1, i2); } -- if (this.hellRNG.nextInt(1) == 0) -+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, hellRNG, k, l)); +- if (this.field_73181_i.nextInt(1) == 0) ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(field_73175_o, field_73181_i, k, l)); + -+ doGen = TerrainGen.decorate(worldObj, hellRNG, k, l, SHROOM); -+ if (doGen && this.hellRNG.nextInt(1) == 0) ++ doGen = TerrainGen.decorate(field_73175_o, field_73181_i, k, l, SHROOM); ++ if (doGen && this.field_73181_i.nextInt(1) == 0) { - j1 = k + this.hellRNG.nextInt(16) + 8; - k1 = this.hellRNG.nextInt(128); -@@ -463,7 +503,7 @@ - (new WorldGenFlowers(Blocks.brown_mushroom)).generate(this.worldObj, this.hellRNG, j1, k1, l1); + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(128); +@@ -452,7 +492,7 @@ + (new WorldGenFlowers(Blocks.field_150338_P)).func_76484_a(this.field_73175_o, this.field_73181_i, j1, k1, l1); } -- if (this.hellRNG.nextInt(1) == 0) -+ if (doGen && this.hellRNG.nextInt(1) == 0) +- if (this.field_73181_i.nextInt(1) == 0) ++ if (doGen && this.field_73181_i.nextInt(1) == 0) { - j1 = k + this.hellRNG.nextInt(16) + 8; - k1 = this.hellRNG.nextInt(128); -@@ -474,7 +514,8 @@ - WorldGenMinable worldgenminable = new WorldGenMinable(Blocks.quartz_ore, 13, Blocks.netherrack); + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(128); +@@ -463,7 +503,8 @@ + WorldGenMinable worldgenminable = new WorldGenMinable(Blocks.field_150449_bY, 13, Blocks.field_150424_aL); int j2; - for (k1 = 0; k1 < 16; ++k1) -+ doGen = TerrainGen.generateOre(worldObj, hellRNG, worldgenminable, k, l, QUARTZ); ++ doGen = TerrainGen.generateOre(field_73175_o, field_73181_i, worldgenminable, k, l, QUARTZ); + for (k1 = 0; doGen && k1 < 16; ++k1) { - l1 = k + this.hellRNG.nextInt(16); - i2 = this.hellRNG.nextInt(108) + 10; -@@ -490,6 +531,9 @@ - (new WorldGenHellLava(Blocks.flowing_lava, true)).generate(this.worldObj, this.hellRNG, l1, i2, j2); + l1 = k + this.field_73181_i.nextInt(16); + i2 = this.field_73181_i.nextInt(108) + 10; +@@ -479,6 +520,9 @@ + (new WorldGenHellLava(Blocks.field_150356_k, true)).func_76484_a(this.field_73175_o, this.field_73181_i, l1, i2, j2); } -+ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, hellRNG, k, l)); -+ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, hellRNG, par2, par3, false)); ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(field_73175_o, field_73181_i, k, l)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); + - BlockFalling.fallInstantly = false; + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index e66166ce9e..413d8cf486 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -9,48 +9,48 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -59,7 +61,7 @@ - // JAVADOC METHOD $$ func_73241_b - public void unloadChunksIfNotNearSpawn(int par1, int par2) +@@ -55,7 +57,7 @@ + + public void func_73241_b(int p_73241_1_, int p_73241_2_) { -- if (this.worldObj.provider.canRespawnHere()) -+ if (this.worldObj.provider.canRespawnHere() && DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) +- if (this.field_73251_h.field_73011_w.func_76567_e()) ++ if (this.field_73251_h.field_73011_w.func_76567_e() && DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.field_76574_g)) { - ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint(); - int k = par1 * 16 + 8 - chunkcoordinates.posX; -@@ -98,7 +100,11 @@ + ChunkCoordinates chunkcoordinates = this.field_73251_h.func_72861_E(); + int k = p_73241_1_ * 16 + 8 - chunkcoordinates.field_71574_a; +@@ -92,7 +94,11 @@ if (chunk == null) { -- chunk = this.safeLoadChunk(par1, par2); -+ chunk = ForgeChunkManager.fetchDormantChunk(k, this.worldObj); +- chunk = this.func_73239_e(p_73158_1_, p_73158_2_); ++ chunk = ForgeChunkManager.fetchDormantChunk(k, this.field_73251_h); + if (chunk == null) + { -+ chunk = this.safeLoadChunk(par1, par2); ++ chunk = this.func_73239_e(p_73158_1_, p_73158_2_); + } if (chunk == null) { -@@ -272,6 +278,11 @@ +@@ -258,6 +264,11 @@ { - if (!this.worldObj.levelSaving) + if (!this.field_73251_h.field_73058_d) { -+ for (ChunkCoordIntPair forced : this.worldObj.getPersistentChunks().keySet()) ++ for (ChunkCoordIntPair forced : this.field_73251_h.getPersistentChunks().keySet()) + { -+ this.chunksToUnload.remove(ChunkCoordIntPair.chunkXZ2Int(forced.chunkXPos, forced.chunkZPos)); ++ this.field_73248_b.remove(ChunkCoordIntPair.func_77272_a(forced.field_77276_a, forced.field_77275_b)); + } + for (int i = 0; i < 100; ++i) { - if (!this.chunksToUnload.isEmpty()) -@@ -284,6 +295,11 @@ - this.chunksToUnload.remove(olong); - this.loadedChunkHashMap.remove(olong.longValue()); - this.loadedChunks.remove(chunk); -+ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk); -+ if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)){ -+ DimensionManager.unloadWorld(this.worldObj.provider.dimensionId); -+ return currentChunkProvider.unloadQueuedChunks(); + if (!this.field_73248_b.isEmpty()) +@@ -270,6 +281,11 @@ + this.field_73248_b.remove(olong); + this.field_73244_f.func_76159_d(olong.longValue()); + this.field_73245_g.remove(chunk); ++ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.func_77272_a(chunk.field_76635_g, chunk.field_76647_h), chunk); ++ if(field_73245_g.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.field_73251_h).size() == 0 && !DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.field_76574_g)){ ++ DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.field_76574_g); ++ return field_73246_d.func_73156_b(); + } } } diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch index 7929c6a92c..4f1f59fb21 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -12,7 +12,7 @@ { Block block = p_151541_5_[j3]; -- if (block == Blocks.flowing_water || block == Blocks.water) +- if (block == Blocks.field_150358_i || block == Blocks.field_150355_j) + if (isOceanBlock(p_151541_5_, j3, k2, i3, l2, p_151541_3_, p_151541_4_)) { flag3 = true; @@ -21,25 +21,25 @@ { Block block1 = p_151541_5_[k3]; -- if (block1 == Blocks.grass) +- if (block1 == Blocks.field_150349_c) + if (isTopBlock(p_151541_5_, k3, k2, l3, j3, p_151541_3_, p_151541_4_)) { flag1 = true; } - -- if (block1 == Blocks.stone || block1 == Blocks.dirt || block1 == Blocks.grass) +- if (block1 == Blocks.field_150348_b || block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) - { - if (l3 < 10) - { -- p_151541_5_[k3] = Blocks.lava; +- p_151541_5_[k3] = Blocks.field_150353_l; - } - else - { - p_151541_5_[k3] = null; - -- if (flag1 && p_151541_5_[k3 - 1] == Blocks.dirt) +- if (flag1 && p_151541_5_[k3 - 1] == Blocks.field_150346_d) - { -- p_151541_5_[k3 - 1] = this.worldObj.getBiomeGenForCoords(k2 + p_151541_3_ * 16, j3 + p_151541_4_ * 16).topBlock; +- p_151541_5_[k3 - 1] = this.field_75039_c.func_72807_a(k2 + p_151541_3_ * 16, j3 + p_151541_4_ * 16).field_76752_A; - } - } - } @@ -54,15 +54,15 @@ + + protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { -+ return data[index] == Blocks.flowing_water || data[index] == Blocks.water; ++ return data[index] == Blocks.field_150358_i || data[index] == Blocks.field_150355_j; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(BiomeGenBase biome) + { -+ if (biome == BiomeGenBase.mushroomIsland) return true; -+ if (biome == BiomeGenBase.beach) return true; -+ if (biome == BiomeGenBase.desert) return true; ++ if (biome == BiomeGenBase.field_76789_p) return true; ++ if (biome == BiomeGenBase.field_76787_r) return true; ++ if (biome == BiomeGenBase.field_76769_d) return true; + return false; + } + @@ -70,8 +70,8 @@ + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { -+ BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); -+ return (isExceptionBiome(biome) ? data[index] == Blocks.grass : data[index] == biome.topBlock); ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ return (isExceptionBiome(biome) ? data[index] == Blocks.field_150349_c : data[index] == biome.field_76752_A); + } + + /** @@ -91,16 +91,16 @@ + */ + protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { -+ BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); -+ Block top = (isExceptionBiome(biome) ? Blocks.grass : biome.topBlock); -+ Block filler = (isExceptionBiome(biome) ? Blocks.dirt : biome.fillerBlock); ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ Block top = (isExceptionBiome(biome) ? Blocks.field_150349_c : biome.field_76752_A); ++ Block filler = (isExceptionBiome(biome) ? Blocks.field_150346_d : biome.field_76753_B); + Block block = data[index]; + -+ if (block == Blocks.stone || block == filler || block == top) ++ if (block == Blocks.field_150348_b || block == filler || block == top) + { + if (y < 10) + { -+ data[index] = Blocks.lava; ++ data[index] = Blocks.field_150353_l; + } + else + { diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch index 56f630b282..95e70ae455 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -12,7 +12,7 @@ { Block block = p_151540_5_[j3]; -- if (block == Blocks.flowing_water || block == Blocks.water) +- if (block == Blocks.field_150358_i || block == Blocks.field_150355_j) + if (isOceanBlock(p_151540_5_, j3, k2, i3, l2, p_151540_3_, p_151540_4_)) { flag2 = true; @@ -21,25 +21,25 @@ { Block block1 = p_151540_5_[k3]; -- if (block1 == Blocks.grass) +- if (block1 == Blocks.field_150349_c) + if (isTopBlock(p_151540_5_, k3, k2, l3, j3, p_151540_3_, p_151540_4_)) { flag = true; } -- if (block1 == Blocks.stone || block1 == Blocks.dirt || block1 == Blocks.grass) +- if (block1 == Blocks.field_150348_b || block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) - { - if (l3 < 10) - { -- p_151540_5_[k3] = Blocks.flowing_lava; +- p_151540_5_[k3] = Blocks.field_150356_k; - } - else - { - p_151540_5_[k3] = null; - -- if (flag && p_151540_5_[k3 - 1] == Blocks.dirt) +- if (flag && p_151540_5_[k3 - 1] == Blocks.field_150346_d) - { -- p_151540_5_[k3 - 1] = this.worldObj.getBiomeGenForCoords(k2 + p_151540_3_ * 16, j3 + p_151540_4_ * 16).topBlock; +- p_151540_5_[k3 - 1] = this.field_75039_c.func_72807_a(k2 + p_151540_3_ * 16, j3 + p_151540_4_ * 16).field_76752_A; - } - } - } @@ -54,15 +54,15 @@ + + protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { -+ return data[index] == Blocks.water || data[index] == Blocks.flowing_water; ++ return data[index] == Blocks.field_150355_j || data[index] == Blocks.field_150358_i; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(BiomeGenBase biome) + { -+ if (biome == BiomeGenBase.mushroomIsland) return true; -+ if (biome == BiomeGenBase.beach) return true; -+ if (biome == BiomeGenBase.desert) return true; ++ if (biome == BiomeGenBase.field_76789_p) return true; ++ if (biome == BiomeGenBase.field_76787_r) return true; ++ if (biome == BiomeGenBase.field_76769_d) return true; + return false; + } + @@ -70,8 +70,8 @@ + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { -+ BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); -+ return (isExceptionBiome(biome) ? data[index] == Blocks.grass : data[index] == biome.topBlock); ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ return (isExceptionBiome(biome) ? data[index] == Blocks.field_150349_c : data[index] == biome.field_76752_A); + } + + /** @@ -91,16 +91,16 @@ + */ + protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { -+ BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); -+ Block top = (isExceptionBiome(biome) ? Blocks.grass : biome.topBlock); -+ Block filler = (isExceptionBiome(biome) ? Blocks.dirt : biome.fillerBlock); ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ Block top = (isExceptionBiome(biome) ? Blocks.field_150349_c : biome.field_76752_A); ++ Block filler = (isExceptionBiome(biome) ? Blocks.field_150346_d : biome.field_76753_B); + Block block = data[index]; + -+ if (block == Blocks.stone || block == filler || block == top) ++ if (block == Blocks.field_150348_b || block == filler || block == top) + { + if (y < 10) + { -+ data[index] = Blocks.flowing_lava; ++ data[index] = Blocks.field_150356_k; + } + else + { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch index 32eb0f656b..a95f248686 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -7,7 +7,7 @@ + + protected boolean isReplaceable(World world, int x, int y, int z) + { -+ Block block = world.getBlock(x, y, z); ++ Block block = world.func_147439_a(x, y, z); + return block.isAir(world, x, y, z) || block.isLeaves(world, x, y, z) || block.isWood(world, x, y, z) || func_150523_a(block); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch index f38b32355d..8774e797b2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -1,29 +1,29 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java -@@ -57,7 +57,7 @@ +@@ -56,7 +56,7 @@ { - Block block = par1World.getBlock(k1, j1, l1); + Block block = p_76484_1_.func_147439_a(k1, j1, l1); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(par1World, k1, j1, l1) && !block.isLeaves(par1World, k1, j1, l1)) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_76484_1_, k1, j1, l1) && !block.isLeaves(p_76484_1_, k1, j1, l1)) { flag = false; } -@@ -184,7 +184,7 @@ +@@ -183,7 +183,7 @@ j2 = 0; } -- if ((j2 != 0 || par4 >= par4 + i1 - 1) && !par1World.getBlock(l2, k1, i2).func_149730_j()) -+ if ((j2 != 0 || par4 >= par4 + i1 - 1) && par1World.getBlock(l2, k1, i2).canBeReplacedByLeaves(par1World, l2, k1, i2)) +- if ((j2 != 0 || p_76484_4_ >= p_76484_4_ + i1 - 1) && !p_76484_1_.func_147439_a(l2, k1, i2).func_149730_j()) ++ if ((j2 != 0 || p_76484_4_ >= p_76484_4_ + i1 - 1) && p_76484_1_.func_147439_a(l2, k1, i2).canBeReplacedByLeaves(p_76484_1_, l2, k1, i2)) { - this.setBlockAndNotifyAdequately(par1World, l2, k1, i2, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), j2); + this.func_150516_a(p_76484_1_, l2, k1, i2, Block.func_149729_e(Block.func_149682_b(Blocks.field_150420_aW) + l), j2); } -@@ -196,7 +196,7 @@ +@@ -195,7 +195,7 @@ { - Block block2 = par1World.getBlock(par3, par4 + k1, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k1, p_76484_5_); - if (!block2.func_149730_j()) -+ if (block2.canBeReplacedByLeaves(par1World, par3, par4 + k1, par5)) ++ if (block2.canBeReplacedByLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + k1, par5, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), 10); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Block.func_149729_e(Block.func_149682_b(Blocks.field_150420_aW) + l), 10); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch index c67dab2d8d..9b8c327987 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -13,30 +13,30 @@ public class WorldGenBigTree extends WorldGenAbstractTree { -@@ -150,7 +152,7 @@ +@@ -142,7 +144,7 @@ aint1[b2] = aint[b2] + j1; - Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); + Block block1 = this.field_76506_c.func_147439_a(aint1[0], aint1[1], aint1[2]); -- if (block1.getMaterial() != Material.air && block1.getMaterial() != Material.leaves) -+ if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) +- if (block1.func_149688_o() != Material.field_151579_a && block1.func_149688_o() != Material.field_151584_j) ++ if (!block1.isAir(field_76506_c, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(field_76506_c, aint1[0], aint1[1], aint1[2])) { ++j1; } -@@ -389,7 +391,7 @@ - aint3[b3] = MathHelper.floor_double((double)par1ArrayOfInteger[b3] + (double)i * d1); - Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); +@@ -374,7 +376,7 @@ + aint3[b3] = MathHelper.func_76128_c((double)p_76496_1_[b3] + (double)i * d1); + Block block = this.field_76506_c.func_147439_a(aint3[0], aint3[1], aint3[2]); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) ++ if (!this.isReplaceable(field_76506_c, aint3[0], aint3[1], aint3[2])) { break; } -@@ -406,7 +408,8 @@ - int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; - Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); +@@ -390,7 +392,8 @@ + int[] aint1 = new int[] {this.field_76503_d[0], this.field_76503_d[1] + this.field_76504_e - 1, this.field_76503_d[2]}; + Block block = this.field_76506_c.func_147439_a(this.field_76503_d[0], this.field_76503_d[1] - 1, this.field_76503_d[2]); -- if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland) -+ boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling); +- if (block != Blocks.field_150346_d && block != Blocks.field_150349_c && block != Blocks.field_150458_ak) ++ boolean isSoil = block.canSustainPlant(field_76506_c, field_76503_d[0], field_76503_d[1] - 1, field_76503_d[2], ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); + if (!isSoil) { return false; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch index 6ebb1406b5..7858d6046e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -15,55 +15,55 @@ { @@ -48,7 +50,7 @@ { - Block block = par1World.getBlock(j1, i1, k1); + Block block = p_76484_1_.func_147439_a(j1, i1, k1); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(par1World, j1, i1, k1)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) { flag = false; } @@ -69,12 +71,13 @@ { - Block block2 = par1World.getBlock(par3, par4 - 1, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block2 == Blocks.grass || block2 == Blocks.dirt) && par4 < 256 - l - 1) -+ boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -- this.func_150515_a(par1World, par3 + 1, par4 - 1, par5, Blocks.dirt); -- this.func_150515_a(par1World, par3 + 1, par4 - 1, par5 + 1, Blocks.dirt); -- this.func_150515_a(par1World, par3, par4 - 1, par5 + 1, Blocks.dirt); -+ onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); -+ onPlantGrow(par1World, par3 + 1, par4 - 1, par5, par3, par4, par5); -+ onPlantGrow(par1World, par3 + 1, par4 - 1, par5 + 1, par3, par4, par5); -+ onPlantGrow(par1World, par3, par4 - 1, par5 + 1, par3, par4, par5); - int j3 = par2Random.nextInt(4); - j1 = l - par2Random.nextInt(4); - k1 = 2 - par2Random.nextInt(3); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.field_150346_d); ++ onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4); + k1 = 2 - p_76484_2_.nextInt(3); @@ -97,7 +100,7 @@ - Block block1 = par1World.getBlock(k3, k2, l1); + Block block1 = p_76484_1_.func_147439_a(k3, k2, l1); -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(par1World, k3, k2, l1) || block1.isLeaves(par1World, k3, k2, l1)) +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) { - this.setBlockAndNotifyAdequately(par1World, k3, k2, l1, Blocks.log2, 1); - this.setBlockAndNotifyAdequately(par1World, k3 + 1, k2, l1, Blocks.log2, 1); + this.func_150516_a(p_76484_1_, k3, k2, l1, Blocks.field_150363_s, 1); + this.func_150516_a(p_76484_1_, k3 + 1, k2, l1, Blocks.field_150363_s, 1); @@ -203,9 +206,15 @@ { - Block block = p_150526_1_.getBlock(p_150526_2_, p_150526_3_, p_150526_4_); + Block block = p_150526_1_.func_147439_a(p_150526_2_, p_150526_3_, p_150526_4_); -- if (block.getMaterial() == Material.air) +- if (block.func_149688_o() == Material.field_151579_a) + if (block.isAir(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_)) { - this.setBlockAndNotifyAdequately(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.leaves2, 1); + this.func_150516_a(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.field_150361_u, 1); } } + + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { -+ world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch index 40ca9d22c7..012f19063e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -4,17 +4,17 @@ { Block block; -- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) + do { -+ block = par1World.getBlock(par3, par4, par5); -+ if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } - --par4; + --p_76484_4_; - } -+ } while (par4 > 0); ++ } while (p_76484_4_ > 0); for (int l = 0; l < 4; ++l) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch index b6da9f9fa8..27ac8306a4 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -13,23 +13,23 @@ @@ -123,12 +126,11 @@ if (k2 == 1) { - par1World.setBlock(i2, par4, j2, Blocks.chest, 0, 2); -- WeightedRandomChestContent[] aweightedrandomchestcontent = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}); - TileEntityChest tileentitychest = (TileEntityChest)par1World.getTileEntity(i2, par4, j2); + p_76484_1_.func_147465_d(i2, p_76484_4_, j2, Blocks.field_150486_ae, 0, 2); +- WeightedRandomChestContent[] aweightedrandomchestcontent = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_76484_2_)}); + TileEntityChest tileentitychest = (TileEntityChest)p_76484_1_.func_147438_o(i2, p_76484_4_, j2); if (tileentitychest != null) { -- WeightedRandomChestContent.generateChestContents(par2Random, aweightedrandomchestcontent, tileentitychest, 8); -+ WeightedRandomChestContent.generateChestContents(par2Random, ChestGenHooks.getItems(DUNGEON_CHEST, par2Random), tileentitychest, ChestGenHooks.getCount(DUNGEON_CHEST, par2Random)); +- WeightedRandomChestContent.func_76293_a(p_76484_2_, aweightedrandomchestcontent, tileentitychest, 8); ++ WeightedRandomChestContent.func_76293_a(p_76484_2_, ChestGenHooks.getItems(DUNGEON_CHEST, p_76484_2_), tileentitychest, ChestGenHooks.getCount(DUNGEON_CHEST, p_76484_2_)); } break label101; -@@ -168,7 +170,6 @@ - // JAVADOC METHOD $$ func_76543_b - private String pickMobSpawner(Random par1Random) +@@ -167,7 +169,6 @@ + + private String func_76543_b(Random p_76543_1_) { -- int i = par1Random.nextInt(4); +- int i = p_76543_1_.nextInt(4); - return i == 0 ? "Skeleton" : (i == 1 ? "Zombie" : (i == 2 ? "Zombie" : (i == 3 ? "Spider" : ""))); -+ return DungeonHooks.getRandomDungeonMob(par1Random); ++ return DungeonHooks.getRandomDungeonMob(p_76543_1_); } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch index 795f0b52ab..ac5d841a49 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch @@ -14,41 +14,41 @@ { @@ -55,7 +57,7 @@ { - Block block = par1World.getBlock(j1, i1, k1); + Block block = p_76484_1_.func_147439_a(j1, i1, k1); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(par1World, j1, i1, k1)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) { flag = false; } @@ -76,9 +78,10 @@ { - Block block2 = par1World.getBlock(par3, par4 - 1, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block2 == Blocks.grass || block2 == Blocks.dirt || block2 == Blocks.farmland) && par4 < 256 - l - 1) -+ boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d || block2 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block2.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); int k2; - for (k2 = par4 - 3 + l; k2 <= par4 + l; ++k2) + for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) @@ -98,7 +101,7 @@ { - Block block1 = par1World.getBlock(l2, k2, i2); + Block block1 = p_76484_1_.func_147439_a(l2, k2, i2); -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(par1World, l2, k2, i2) || block1.isLeaves(par1World, l2, k2, i2)) +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, l2, k2, i2) || block1.isLeaves(p_76484_1_, l2, k2, i2)) { - this.setBlockAndNotifyAdequately(par1World, l2, k2, i2, Blocks.leaves, 2); + this.func_150516_a(p_76484_1_, l2, k2, i2, Blocks.field_150362_t, 2); } @@ -111,7 +114,7 @@ { - Block block3 = par1World.getBlock(par3, par4 + k2, par5); + Block block3 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); -- if (block3.getMaterial() == Material.air || block3.getMaterial() == Material.leaves) -+ if (block3.isAir(par1World, par3, par4 + k2, par5) || block3.isLeaves(par1World, par3, par4 + k2, par5)) +- if (block3.func_149688_o() == Material.field_151579_a || block3.func_149688_o() == Material.field_151584_j) ++ if (block3.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block3.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + k2, par5, Blocks.log, 2); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r, 2); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch index 59ed900214..14eb8efa06 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -12,27 +12,27 @@ public abstract class WorldGenHugeTrees extends WorldGenAbstractTree { -@@ -66,7 +68,7 @@ +@@ -63,7 +65,7 @@ { - Block block = p_150536_1_.getBlock(j1, i1, k1); + Block block = p_150536_1_.func_147439_a(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(p_150536_1_, j1, i1, k1)) { flag = false; } -@@ -91,12 +93,13 @@ +@@ -88,12 +90,13 @@ { - Block block = p_150532_1_.getBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_); + Block block = p_150532_1_.func_147439_a(p_150532_3_, p_150532_4_ - 1, p_150532_5_); -- if ((block == Blocks.grass || block == Blocks.dirt) && p_150532_4_ >= 2) -+ boolean isSoil = block.canSustainPlant(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_150532_4_ >= 2) ++ boolean isSoil = block.canSustainPlant(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); + if (isSoil && p_150532_4_ >= 2) { -- p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); -- p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); -- p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); -- p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.field_150346_d, 0, 2); + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); @@ -40,25 +40,25 @@ return true; } else -@@ -128,7 +131,7 @@ +@@ -125,7 +128,7 @@ { - Block block = p_150535_1_.getBlock(j1, p_150535_3_, l1); + Block block = p_150535_1_.func_147439_a(j1, p_150535_3_, l1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) + if (block.isAir(p_150535_1_, j1, p_150535_3_, l1) || block.isLeaves(p_150535_1_, j1, p_150535_3_, l1)) { - this.setBlockAndNotifyAdequately(p_150535_1_, j1, p_150535_3_, l1, Blocks.leaves, this.leavesMetadata); + this.func_150516_a(p_150535_1_, j1, p_150535_3_, l1, Blocks.field_150362_t, this.field_76521_c); } -@@ -153,7 +156,7 @@ +@@ -150,7 +153,7 @@ { - Block block = p_150534_1_.getBlock(j1, p_150534_3_, l1); + Block block = p_150534_1_.func_147439_a(j1, p_150534_3_, l1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) + if (block.isAir(p_150534_1_, j1, p_150534_3_, l1) || block.isLeaves(p_150534_1_, j1, p_150534_3_, l1)) { - this.setBlockAndNotifyAdequately(p_150534_1_, j1, p_150534_3_, l1, Blocks.leaves, this.leavesMetadata); + this.func_150516_a(p_150534_1_, j1, p_150534_3_, l1, Blocks.field_150362_t, this.field_76521_c); } -@@ -161,4 +164,10 @@ +@@ -158,4 +161,10 @@ } } } @@ -66,6 +66,6 @@ + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { -+ world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch index 4366cbe334..603c443acc 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -2,37 +2,37 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -56,7 +56,7 @@ { - Block block = par1World.getBlock(par3, par4 + l2, par5); + Block block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + l2, p_76484_5_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3, par4 + l2, par5) || block.isLeaves(par1World, par3, par4 + l2, par5)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + l2, par5, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); @@ -78,7 +78,7 @@ { - block = par1World.getBlock(par3 + 1, par4 + l2, par5); + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3 + 1, par4 + l2, par5) || block.isLeaves(par1World, par3 + 1, par4 + l2, par5)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + l2, par5, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); @@ -98,7 +98,7 @@ - block = par1World.getBlock(par3 + 1, par4 + l2, par5 + 1); + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3 + 1, par4 + l2, par5 + 1) || block.isLeaves(par1World, par3 + 1, par4 + l2, par5 + 1)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1)) { - this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); @@ -118,7 +118,7 @@ - block = par1World.getBlock(par3, par4 + l2, par5 + 1); + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3, par4 + l2, par5 + 1) || block.isLeaves(par1World, par3, par4 + l2, par5 + 1)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch index d3b08688df..40006b97b0 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -15,50 +15,50 @@ { @@ -34,7 +36,7 @@ { - Block block = par1World.getBlock(par3, par4 + i1, par5); + Block block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i1, p_76484_5_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3, par4 + i1, par5) || block.isLeaves(par1World, par3, par4 + i1, par5)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + i1, par5, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); } @@ -43,21 +45,21 @@ { - block = par1World.getBlock(par3 + 1, par4 + i1, par5); + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3 + 1, par4 + i1, par5) || block.isLeaves(par1World, par3 + 1, par4 + i1, par5)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + i1, par5, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); } - block = par1World.getBlock(par3 + 1, par4 + i1, par5 + 1); + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3 + 1, par4 + i1, par5 + 1) || block.isLeaves(par1World, par3 + 1, par4 + i1, par5 + 1)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1)) { - this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); } - block = par1World.getBlock(par3, par4 + i1, par5 + 1); + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3, par4 + i1, par5 + 1) || block.isLeaves(par1World, par3, par4 + i1, par5 + 1)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); } @@ -132,13 +134,13 @@ { - Block block = p_150540_1_.getBlock(p_150540_2_, l, p_150540_4_); + Block block = p_150540_1_.func_147439_a(p_150540_2_, l, p_150540_4_); -- if (block == Blocks.grass || block == Blocks.dirt) -+ if (block.canSustainPlant(p_150540_1_, p_150540_2_, l, p_150540_4_, ForgeDirection.UP, (BlockSapling)Blocks.sapling)) +- if (block == Blocks.field_150349_c || block == Blocks.field_150346_d) ++ if (block.canSustainPlant(p_150540_1_, p_150540_2_, l, p_150540_4_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g)) { - this.setBlockAndNotifyAdequately(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.dirt, 2); + this.func_150516_a(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.field_150346_d, 2); break; } -- if (block.getMaterial() != Material.air && l < p_150540_3_) +- if (block.func_149688_o() != Material.field_151579_a && l < p_150540_3_) + if (block.isAir(p_150540_1_, p_150540_2_, l, p_150540_4_) && l < p_150540_3_) { break; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch index 7b55967694..bac3c9bf88 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java -@@ -13,6 +13,7 @@ - private int numberOfBlocks; +@@ -12,6 +12,7 @@ + private int field_76541_b; private Block field_150518_c; private static final String __OBFID = "CL_00000426"; + private int mineableBlockMeta; public WorldGenMinable(Block p_i45459_1_, int p_i45459_2_) { -@@ -26,6 +27,12 @@ +@@ -25,6 +26,12 @@ this.field_150518_c = p_i45460_3_; } @@ -18,18 +18,18 @@ + this.mineableBlockMeta = meta; + } + - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + public boolean func_76484_a(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { - float f = par2Random.nextFloat() * (float)Math.PI; -@@ -67,9 +74,9 @@ + float f = p_76484_2_.nextFloat() * (float)Math.PI; +@@ -66,9 +73,9 @@ { double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); -- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlock(k2, l2, i3) == this.field_150518_c) -+ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlock(k2, l2, i3).isReplaceableOreGen(par1World, k2, l2, i3, field_150518_c)) +- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && p_76484_1_.func_147439_a(k2, l2, i3) == this.field_150518_c) ++ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && p_76484_1_.func_147439_a(k2, l2, i3).isReplaceableOreGen(p_76484_1_, k2, l2, i3, field_150518_c)) { -- par1World.setBlock(k2, l2, i3, this.field_150519_a, 0, 2); -+ par1World.setBlock(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); +- p_76484_1_.func_147465_d(k2, l2, i3, this.field_150519_a, 0, 2); ++ p_76484_1_.func_147465_d(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); } } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch index 05671baae2..34615fe111 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -15,50 +15,50 @@ { @@ -48,7 +50,7 @@ { - Block block = par1World.getBlock(j1, i1, k1); + Block block = p_76484_1_.func_147439_a(j1, i1, k1); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(par1World, j1, i1, k1)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) { flag = false; } @@ -69,9 +71,10 @@ { - Block block3 = par1World.getBlock(par3, par4 - 1, par5); + Block block3 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block3 == Blocks.grass || block3 == Blocks.dirt) && par4 < 256 - l - 1) -+ boolean isSoil = block3.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block3 == Blocks.field_150349_c || block3 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block3.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block3.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); - int j3 = par2Random.nextInt(4); - j1 = l - par2Random.nextInt(4) - 1; - k1 = 3 - par2Random.nextInt(3); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block3.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4) - 1; + k1 = 3 - p_76484_2_.nextInt(3); @@ -94,7 +97,7 @@ - Block block1 = par1World.getBlock(k3, k2, l1); + Block block1 = p_76484_1_.func_147439_a(k3, k2, l1); -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(par1World, k3, k2, l1) || block1.isLeaves(par1World, k3, k2, l1)) +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) { - this.setBlockAndNotifyAdequately(par1World, k3, k2, l1, Blocks.log2, 0); + this.func_150516_a(p_76484_1_, k3, k2, l1, Blocks.field_150363_s, 0); i2 = k2; @@ -146,7 +149,7 @@ - l1 += Direction.offsetZ[j2]; - Block block2 = par1World.getBlock(k3, i3, l1); + l1 += Direction.field_71581_b[j2]; + Block block2 = p_76484_1_.func_147439_a(k3, i3, l1); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ if (block2.isAir(par1World, k3, i3, l1) || block2.isLeaves(par1World, k3, i3, l1)) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, k3, i3, l1) || block2.isLeaves(p_76484_1_, k3, i3, l1)) { - this.setBlockAndNotifyAdequately(par1World, k3, i3, l1, Blocks.log2, 0); + this.func_150516_a(p_76484_1_, k3, i3, l1, Blocks.field_150363_s, 0); i2 = i3; @@ -197,7 +200,7 @@ { - Block block = p_150525_1_.getBlock(p_150525_2_, p_150525_3_, p_150525_4_); + Block block = p_150525_1_.func_147439_a(p_150525_2_, p_150525_3_, p_150525_4_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) + if (block.isAir(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_) || block.isLeaves(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_)) { - this.setBlockAndNotifyAdequately(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.leaves2, 0); + this.func_150516_a(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.field_150361_u, 0); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch index 58fe84a23e..40c5b9eacf 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -4,26 +4,26 @@ { Block block; -- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) + do { -+ block = par1World.getBlock(par3, par4, par5); -+ if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } - --par4; + --p_76484_4_; - } -+ } while (par4 > 0); ++ } while (p_76484_4_ > 0); - Block block1 = par1World.getBlock(par3, par4, par5); + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); @@ -48,7 +53,7 @@ { - int j2 = i2 - par5; + int j2 = i2 - p_76484_5_; -- if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && !par1World.getBlock(k1, l, i2).func_149730_j()) -+ if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && par1World.getBlock(k1, l, i2).canBeReplacedByLeaves(par1World, k1, l, i2)) +- if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_76484_2_.nextInt(2) != 0) && !p_76484_1_.func_147439_a(k1, l, i2).func_149730_j()) ++ if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_76484_2_.nextInt(2) != 0) && p_76484_1_.func_147439_a(k1, l, i2).canBeReplacedByLeaves(p_76484_1_, k1, l, i2)) { - this.setBlockAndNotifyAdequately(par1World, k1, l, i2, Blocks.leaves, this.field_150528_a); + this.func_150516_a(p_76484_1_, k1, l, i2, Blocks.field_150362_t, this.field_150528_a); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch index f7ee53579d..a388bba2ad 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -14,80 +14,80 @@ { @@ -53,7 +55,7 @@ { - Block block = par1World.getBlock(j1, i1, k1); + Block block = p_76484_1_.func_147439_a(j1, i1, k1); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!(block.isAir(par1World, j1, i1, k1) || block.isLeaves(par1World, j1, i1, k1))) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!(block.isAir(p_76484_1_, j1, i1, k1) || block.isLeaves(p_76484_1_, j1, i1, k1))) { - if (block != Blocks.water && block != Blocks.flowing_water) + if (block != Blocks.field_150355_j && block != Blocks.field_150358_i) { @@ -81,9 +83,10 @@ { - Block block1 = par1World.getBlock(par3, par4 - 1, par5); + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt) && par4 < 256 - l - 1) -+ boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block1.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); int l1; int l2; int k2; @@ -101,7 +104,7 @@ { - int j2 = i2 - par5; + int j2 = i2 - p_76484_5_; -- if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && !par1World.getBlock(l2, k2, i2).func_149730_j()) -+ if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && par1World.getBlock(l2, k2, i2).canBeReplacedByLeaves(par1World, l2, k2, i2)) +- if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) && !p_76484_1_.func_147439_a(l2, k2, i2).func_149730_j()) ++ if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) && p_76484_1_.func_147439_a(l2, k2, i2).canBeReplacedByLeaves(p_76484_1_, l2, k2, i2)) { - this.func_150515_a(par1World, l2, k2, i2, Blocks.leaves); + this.func_150515_a(p_76484_1_, l2, k2, i2, Blocks.field_150362_t); } @@ -113,7 +116,7 @@ { - Block block2 = par1World.getBlock(par3, par4 + k2, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water) -+ if (block2.isAir(par1World, par3, par4 + k2, par5) || block2.isLeaves(par1World, par3, par4 + k2, par5) || block2 == Blocks.flowing_water || block2 == Blocks.water) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) { - this.func_150515_a(par1World, par3, par4 + k2, par5, Blocks.log); + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r); } @@ -128,24 +131,24 @@ { - for (l1 = par5 - k1; l1 <= par5 + k1; ++l1) + for (l1 = p_76484_5_ - k1; l1 <= p_76484_5_ + k1; ++l1) { -- if (par1World.getBlock(l2, k2, l1).getMaterial() == Material.leaves) -+ if (par1World.getBlock(l2, k2, l1).isLeaves(par1World, l2, k2, l1)) +- if (p_76484_1_.func_147439_a(l2, k2, l1).func_149688_o() == Material.field_151584_j) ++ if (p_76484_1_.func_147439_a(l2, k2, l1).isLeaves(p_76484_1_, l2, k2, l1)) { -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 - 1, k2, l1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 - 1, k2, l1).isAir(par1World, l2 - 1, k2, l1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 - 1, k2, l1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 - 1, k2, l1).isAir(p_76484_1_, l2 - 1, k2, l1)) { - this.generateVines(par1World, l2 - 1, k2, l1, 8); + this.func_76536_b(p_76484_1_, l2 - 1, k2, l1, 8); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 + 1, k2, l1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 + 1, k2, l1).isAir(par1World, l2 + 1, k2, l1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 + 1, k2, l1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 + 1, k2, l1).isAir(p_76484_1_, l2 + 1, k2, l1)) { - this.generateVines(par1World, l2 + 1, k2, l1, 2); + this.func_76536_b(p_76484_1_, l2 + 1, k2, l1, 2); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 - 1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 - 1).isAir(par1World, l2, k2, l1 - 1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 - 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 - 1).isAir(p_76484_1_, l2, k2, l1 - 1)) { - this.generateVines(par1World, l2, k2, l1 - 1, 1); + this.func_76536_b(p_76484_1_, l2, k2, l1 - 1, 1); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 + 1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 + 1).isAir(par1World, l2, k2, l1 + 1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 + 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 + 1).isAir(p_76484_1_, l2, k2, l1 + 1)) { - this.generateVines(par1World, l2, k2, l1 + 1, 4); + this.func_76536_b(p_76484_1_, l2, k2, l1 + 1, 4); } -@@ -178,7 +181,7 @@ +@@ -177,7 +180,7 @@ { - --par3; + --p_76536_3_; -- if (par1World.getBlock(par2, par3, par4).getMaterial() != Material.air || i1 <= 0) -+ if (!(par1World.getBlock(par2, par3, par4).isAir(par1World, par2, par3, par4)) || i1 <= 0) +- if (p_76536_1_.func_147439_a(p_76536_2_, p_76536_3_, p_76536_4_).func_149688_o() != Material.field_151579_a || i1 <= 0) ++ if (!(p_76536_1_.func_147439_a(p_76536_2_, p_76536_3_, p_76536_4_).isAir(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_)) || i1 <= 0) { return; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch index 4af8526ab5..df6c980133 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -14,41 +14,41 @@ { @@ -50,7 +52,7 @@ { - Block block = par1World.getBlock(i2, l1, j2); + Block block = p_76484_1_.func_147439_a(i2, l1, j2); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(par1World, i2, l1, j2)) ++ if (!this.isReplaceable(p_76484_1_, i2, l1, j2)) { flag = false; } @@ -71,9 +73,10 @@ { - Block block1 = par1World.getBlock(par3, par4 - 1, par5); + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt) && par4 < 256 - l - 1) -+ boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block1.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); i3 = 0; - for (i2 = par4 + l; i2 >= par4 + i1; --i2) + for (i2 = p_76484_4_ + l; i2 >= p_76484_4_ + i1; --i2) @@ -86,7 +89,7 @@ { - int l2 = k2 - par5; + int l2 = k2 - p_76484_5_; -- if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && !par1World.getBlock(j2, i2, k2).func_149730_j()) -+ if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && par1World.getBlock(j2, i2, k2).canBeReplacedByLeaves(par1World, j2, i2, k2)) +- if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && !p_76484_1_.func_147439_a(j2, i2, k2).func_149730_j()) ++ if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && p_76484_1_.func_147439_a(j2, i2, k2).canBeReplacedByLeaves(p_76484_1_, j2, i2, k2)) { - this.setBlockAndNotifyAdequately(par1World, j2, i2, k2, Blocks.leaves, 1); + this.func_150516_a(p_76484_1_, j2, i2, k2, Blocks.field_150362_t, 1); } @@ -107,7 +110,7 @@ { - Block block2 = par1World.getBlock(par3, par4 + i2, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i2, p_76484_5_); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ if (block2.isAir(par1World, par3, par4 + i2, par5) || block2.isLeaves(par1World, par3, par4 + i2, par5)) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + i2, par5, Blocks.log, 1); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_, Blocks.field_150364_r, 1); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch index e6eec534ab..ae8da1c844 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -14,41 +14,41 @@ { @@ -49,7 +51,7 @@ { - Block block = par1World.getBlock(i2, l1, j2); + Block block = p_76484_1_.func_147439_a(i2, l1, j2); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(par1World, i2, l1, j2) && !block.isLeaves(par1World, i2, l1, j2)) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_76484_1_, i2, l1, j2) && !block.isLeaves(p_76484_1_, i2, l1, j2)) { flag = false; } @@ -70,9 +72,10 @@ { - Block block1 = par1World.getBlock(par3, par4 - 1, par5); + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && par4 < 256 - l - 1) -+ boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block1.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); - l3 = par2Random.nextInt(2); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + l3 = p_76484_2_.nextInt(2); i2 = 1; byte b0 = 0; @@ -91,7 +94,7 @@ { - int k3 = j3 - par5; + int k3 = j3 - p_76484_5_; -- if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && !par1World.getBlock(l2, k2, j3).func_149730_j()) -+ if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && par1World.getBlock(l2, k2, j3).canBeReplacedByLeaves(par1World, l2, k2, j3)) +- if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && !p_76484_1_.func_147439_a(l2, k2, j3).func_149730_j()) ++ if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && p_76484_1_.func_147439_a(l2, k2, j3).canBeReplacedByLeaves(p_76484_1_, l2, k2, j3)) { - this.setBlockAndNotifyAdequately(par1World, l2, k2, j3, Blocks.leaves, 1); + this.func_150516_a(p_76484_1_, l2, k2, j3, Blocks.field_150362_t, 1); } @@ -121,7 +124,7 @@ { - Block block2 = par1World.getBlock(par3, par4 + k2, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ if (block2.isAir(par1World, par3, par4 + k2, par5) || block2.isLeaves(par1World, par3, par4 + k2, par5)) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + k2, par5, Blocks.log, 1); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r, 1); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch index 551e829ff3..18be24a731 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -4,17 +4,17 @@ { Block block; -- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) + do { -+ block = par1World.getBlock(par3, par4, par5); -+ if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } - --par4; + --p_76484_4_; - } -+ } while (par4 > 0); ++ } while (p_76484_4_ > 0); for (int l = 0; l < 128; ++l) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch index 790185adc5..cac2fd7336 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -13,82 +13,82 @@ public class WorldGenTrees extends WorldGenAbstractTree { -@@ -66,7 +68,7 @@ +@@ -62,7 +64,7 @@ { - block = par1World.getBlock(j1, i1, k1); + block = p_76484_1_.func_147439_a(j1, i1, k1); - if (!this.func_150523_a(block)) -+ if (!this.isReplaceable(par1World, j1, i1, k1)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) { flag = false; } -@@ -87,9 +89,10 @@ +@@ -83,9 +85,10 @@ { - Block block2 = par1World.getBlock(par3, par4 - 1, par5); + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); -- if ((block2 == Blocks.grass || block2 == Blocks.dirt || block2 == Blocks.farmland) && par4 < 256 - l - 1) -+ boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); -+ if (isSoil && par4 < 256 - l - 1) +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d || block2 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) { -- this.func_150515_a(par1World, par3, par4 - 1, par5, Blocks.dirt); -+ block2.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); b0 = 3; byte b1 = 0; int l1; -@@ -114,7 +117,7 @@ +@@ -110,7 +113,7 @@ { - Block block1 = par1World.getBlock(i2, k1, k2); + Block block1 = p_76484_1_.func_147439_a(i2, k1, k2); -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(par1World, i2, k1, k2) || block1.isLeaves(par1World, i2, k1, k2)) +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, i2, k1, k2) || block1.isLeaves(p_76484_1_, i2, k1, k2)) { - this.setBlockAndNotifyAdequately(par1World, i2, k1, k2, Blocks.leaves, this.metaLeaves); + this.func_150516_a(p_76484_1_, i2, k1, k2, Blocks.field_150362_t, this.field_76530_d); } -@@ -127,7 +130,7 @@ +@@ -123,7 +126,7 @@ { - block = par1World.getBlock(par3, par4 + k1, par5); + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k1, p_76484_5_); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(par1World, par3, par4 + k1, par5) || block.isLeaves(par1World, par3, par4 + k1, par5)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) { - this.setBlockAndNotifyAdequately(par1World, par3, par4 + k1, par5, Blocks.log, this.metaWood); + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Blocks.field_150364_r, this.field_76532_c); -@@ -167,24 +170,24 @@ +@@ -163,24 +166,24 @@ { - for (j2 = par5 - l1; j2 <= par5 + l1; ++j2) + for (j2 = p_76484_5_ - l1; j2 <= p_76484_5_ + l1; ++j2) { -- if (par1World.getBlock(i2, k1, j2).getMaterial() == Material.leaves) -+ if (par1World.getBlock(i2, k1, j2).isLeaves(par1World, i2, k1, j2)) +- if (p_76484_1_.func_147439_a(i2, k1, j2).func_149688_o() == Material.field_151584_j) ++ if (p_76484_1_.func_147439_a(i2, k1, j2).isLeaves(p_76484_1_, i2, k1, j2)) { -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 - 1, k1, j2).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 - 1, k1, j2).isAir(par1World, i2 - 1, k1, j2)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 - 1, k1, j2).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 - 1, k1, j2).isAir(p_76484_1_, i2 - 1, k1, j2)) { - this.growVines(par1World, i2 - 1, k1, j2, 8); + this.func_76529_b(p_76484_1_, i2 - 1, k1, j2, 8); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 + 1, k1, j2).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 + 1, k1, j2).isAir(par1World, i2 + 1, k1, j2)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 + 1, k1, j2).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 + 1, k1, j2).isAir(p_76484_1_, i2 + 1, k1, j2)) { - this.growVines(par1World, i2 + 1, k1, j2, 2); + this.func_76529_b(p_76484_1_, i2 + 1, k1, j2, 2); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 - 1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 - 1).isAir(par1World, i2, k1, j2 - 1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 - 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 - 1).isAir(p_76484_1_, i2, k1, j2 - 1)) { - this.growVines(par1World, i2, k1, j2 - 1, 1); + this.func_76529_b(p_76484_1_, i2, k1, j2 - 1, 1); } -- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 + 1).getMaterial() == Material.air) -+ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 + 1).isAir(par1World, i2, k1, j2 + 1)) +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 + 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 + 1).isAir(p_76484_1_, i2, k1, j2 + 1)) { - this.growVines(par1World, i2, k1, j2 + 1, 4); + this.func_76529_b(p_76484_1_, i2, k1, j2 + 1, 4); } -@@ -233,7 +236,7 @@ +@@ -228,7 +231,7 @@ { - --par3; + --p_76529_3_; -- if (par1World.getBlock(par2, par3, par4).getMaterial() != Material.air || i1 <= 0) -+ if (par1World.getBlock(par2, par3, par4).isAir(par1World, par2, par3, par4) || i1 <= 0) +- if (p_76529_1_.func_147439_a(p_76529_2_, p_76529_3_, p_76529_4_).func_149688_o() != Material.field_151579_a || i1 <= 0) ++ if (p_76529_1_.func_147439_a(p_76529_2_, p_76529_3_, p_76529_4_).isAir(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_) || i1 <= 0) { return; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch index 83b5cf37e4..1e5182e1a7 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -1,18 +1,18 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java -@@ -26,10 +26,12 @@ +@@ -24,10 +24,12 @@ { Block block; -- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 1) +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 1) + do { -- --par4; +- --p_76484_4_; - } -+ block = par1World.getBlock(par3, par4, par5); -+ if (!block.isAir(par1World, par3, par4, par5) && !block.isLeaves(par1World, par3, par4, par5)) break; -+ par4--; -+ } while (par4 > 1); ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) && !block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_)) break; ++ p_76484_4_--; ++ } while (p_76484_4_ > 1); - if (par4 < 1) + if (p_76484_4_ < 1) { diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch index a660dcef7b..766d2e87cb 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -9,30 +9,30 @@ + public abstract class GenLayer { - // JAVADOC FIELD $$ field_75907_b -@@ -53,17 +56,12 @@ + private long field_75907_b; +@@ -48,17 +51,12 @@ { b0 = 4; } -+ b0 = getModdedBiomeSize(par2WorldType, b0); ++ b0 = getModdedBiomeSize(p_75901_2_, b0); - GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer3, 0); + GenLayer genlayer = GenLayerZoom.func_75915_a(1000L, genlayer3, 0); GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer); -- Object object = new GenLayerBiome(200L, genlayer3, par2WorldType); -+ Object object = par2WorldType.getBiomeLayer(par0, genlayer3); +- Object object = new GenLayerBiome(200L, genlayer3, p_75901_2_); ++ Object object = p_75901_2_.getBiomeLayer(p_75901_0_, genlayer3); - if (!flag) - { -- GenLayer genlayer2 = GenLayerZoom.magnify(1000L, (GenLayer)object, 2); +- GenLayer genlayer2 = GenLayerZoom.func_75915_a(1000L, (GenLayer)object, 2); - object = new GenLayerBiomeEdge(1000L, genlayer2); - } - - GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + GenLayer genlayer1 = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1); - genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); -@@ -217,4 +215,11 @@ + genlayer = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); +@@ -204,4 +202,11 @@ { - return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.func_151619_a(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); } + + public static byte getModdedBiomeSize(WorldType worldType, byte original) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch index 9e2e14b4ae..443b20d838 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch @@ -10,53 +10,53 @@ public class ComponentScatteredFeaturePieces { private static final String __OBFID = "CL_00000473"; -@@ -277,9 +280,12 @@ - this.placeBlockAtCurrentPosition(par1World, Blocks.redstone_wire, 0, 4, -3, 1, par3StructureBoundingBox); - this.placeBlockAtCurrentPosition(par1World, Blocks.mossy_cobblestone, 0, 3, -3, 1, par3StructureBoundingBox); +@@ -270,9 +273,12 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150488_af, 0, 4, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150341_Y, 0, 3, -3, 1, p_74875_3_); + ChestGenHooks dispenser = ChestGenHooks.getInfo(PYRAMID_JUNGLE_DISPENSER); + ChestGenHooks chest = ChestGenHooks.getInfo(PYRAMID_JUNGLE_CHEST); + if (!this.field_74945_j) { -- this.field_74945_j = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); -+ this.field_74945_j = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, dispenser.getItems(par2Random), dispenser.getCount(par2Random)); +- this.field_74945_j = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, field_74944_m, 2); ++ this.field_74945_j = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); } - this.placeBlockAtCurrentPosition(par1World, Blocks.vine, 15, 3, -2, 2, par3StructureBoundingBox); -@@ -296,7 +302,7 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150395_bd, 15, 3, -2, 2, p_74875_3_); +@@ -289,7 +295,7 @@ if (!this.field_74946_k) { -- this.field_74946_k = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); -+ this.field_74946_k = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, dispenser.getItems(par2Random), dispenser.getCount(par2Random)); +- this.field_74946_k = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, field_74944_m, 2); ++ this.field_74946_k = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); } - this.placeBlockAtCurrentPosition(par1World, Blocks.vine, 15, 8, -1, 3, par3StructureBoundingBox); -@@ -304,7 +310,7 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150395_bd, 15, 8, -1, 3, p_74875_3_); +@@ -297,7 +303,7 @@ if (!this.field_74947_h) { -- this.field_74947_h = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); -+ this.field_74947_h = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, chest.getItems(par2Random), chest.getCount(par2Random)); +- this.field_74947_h = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_92080_a(field_74943_l, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74947_h = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); } - this.placeBlockAtCurrentPosition(par1World, Blocks.mossy_cobblestone, 0, 9, -3, 2, par3StructureBoundingBox); -@@ -337,7 +343,7 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150341_Y, 0, 9, -3, 2, p_74875_3_); +@@ -330,7 +336,7 @@ if (!this.field_74948_i) { -- this.field_74948_i = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); -+ this.field_74948_i = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 9, -3, 10, chest.getItems(par2Random), chest.getCount(par2Random)); +- this.field_74948_i = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_92080_a(field_74943_l, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74948_i = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); } return true; -@@ -697,7 +703,7 @@ +@@ -685,7 +691,7 @@ { - int i1 = Direction.offsetX[l] * 2; - int j1 = Direction.offsetZ[l] * 2; -- this.field_74940_h[l] = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 10 + i1, -11, 10 + j1, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); -+ this.field_74940_h[l] = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 10 + i1, -11, 10 + j1, ChestGenHooks.getItems(PYRAMID_DESERT_CHEST, par2Random), ChestGenHooks.getCount(PYRAMID_DESERT_CHEST, par2Random)); + int i1 = Direction.field_71583_a[l] * 2; + int j1 = Direction.field_71581_b[l] * 2; +- this.field_74940_h[l] = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + i1, -11, 10 + j1, WeightedRandomChestContent.func_92080_a(field_74941_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74940_h[l] = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + i1, -11, 10 + j1, ChestGenHooks.getItems(PYRAMID_DESERT_CHEST, p_74875_2_), ChestGenHooks.getCount(PYRAMID_DESERT_CHEST, p_74875_2_)); } } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch index 477112a866..943c9e5d83 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -8,12 +8,12 @@ public class MapGenStronghold extends MapGenStructure { -@@ -35,11 +36,18 @@ +@@ -34,11 +35,18 @@ { BiomeGenBase biomegenbase = abiomegenbase[j]; -- if (biomegenbase != null && biomegenbase.rootHeight > 0.0F) -+ if (biomegenbase != null && biomegenbase.rootHeight > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) +- if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F) ++ if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) { this.field_151546_e.add(biomegenbase); } @@ -27,4 +27,4 @@ + } } - public MapGenStronghold(Map par1Map) + public MapGenStronghold(Map p_i2068_1_) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch index de906f0ef9..a363382192 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java -@@ -243,12 +243,12 @@ +@@ -239,12 +239,12 @@ { if (this.field_143029_e == null) { -- this.field_143029_e = (MapGenStructureData)par1World.loadItemData(MapGenStructureData.class, this.func_143025_a()); -+ this.field_143029_e = (MapGenStructureData)par1World.perWorldStorage.loadData(MapGenStructureData.class, this.func_143025_a()); +- this.field_143029_e = (MapGenStructureData)p_143027_1_.func_72943_a(MapGenStructureData.class, this.func_143025_a()); ++ this.field_143029_e = (MapGenStructureData)p_143027_1_.perWorldStorage.func_75742_a(MapGenStructureData.class, this.func_143025_a()); if (this.field_143029_e == null) { this.field_143029_e = new MapGenStructureData(this.func_143025_a()); -- par1World.setItemData(this.func_143025_a(), this.field_143029_e); -+ par1World.perWorldStorage.setData(this.func_143025_a(), this.field_143029_e); +- p_143027_1_.func_72823_a(this.func_143025_a(), this.field_143029_e); ++ p_143027_1_.perWorldStorage.func_75745_a(this.func_143025_a(), this.field_143029_e); } else { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch index 7304acc0fe..5ecfdf6229 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java -@@ -36,6 +36,10 @@ +@@ -34,6 +34,10 @@ public NBTTagCompound func_143010_b() { @@ -9,5 +9,5 @@ + throw new RuntimeException("StructureComponent \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); + } NBTTagCompound nbttagcompound = new NBTTagCompound(); - nbttagcompound.setString("id", MapGenStructureIO.func_143036_a(this)); - nbttagcompound.setTag("BB", this.boundingBox.func_151535_h()); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143036_a(this)); + nbttagcompound.func_74782_a("BB", this.field_74887_e.func_151535_h()); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch index 53e4cedac0..c30f7191ac 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch @@ -9,22 +9,22 @@ + public class StructureMineshaftPieces { - // JAVADOC FIELD $$ field_78818_a -@@ -664,14 +667,15 @@ - this.func_151552_a(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, k - 1, Blocks.torch, 0); - this.func_151552_a(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, k + 1, Blocks.torch, 0); + public static final WeightedRandomChestContent[] field_78818_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 10), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151137_ax, 0, 4, 9, 5), new WeightedRandomChestContent(Items.field_151100_aR, 4, 4, 9, 5), new WeightedRandomChestContent(Items.field_151045_i, 0, 1, 2, 3), new WeightedRandomChestContent(Items.field_151044_h, 0, 3, 8, 10), new WeightedRandomChestContent(Items.field_151025_P, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151035_b, 0, 1, 1, 1), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150448_aq), 0, 4, 8, 1), new WeightedRandomChestContent(Items.field_151081_bc, 0, 2, 4, 10), new WeightedRandomChestContent(Items.field_151080_bb, 0, 2, 4, 10), new WeightedRandomChestContent(Items.field_151141_av, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151138_bX, 0, 1, 1, 1)}; +@@ -654,14 +657,15 @@ + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k - 1, Blocks.field_150478_aa, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k + 1, Blocks.field_150478_aa, 0); + ChestGenHooks info = ChestGenHooks.getInfo(MINESHAFT_CORRIDOR); - if (par2Random.nextInt(100) == 0) + if (p_74875_2_.nextInt(100) == 0) { -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 2, 0, k - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.mineshaftChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 2, 0, k - 1, info.getItems(par2Random), info.getCount(par2Random)); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.field_78818_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } - if (par2Random.nextInt(100) == 0) + if (p_74875_2_.nextInt(100) == 0) { -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 0, 0, k + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.mineshaftChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 0, 0, k + 1, info.getItems(par2Random), info.getCount(par2Random)); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.field_78818_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } - if (this.hasSpiders && !this.spawnerPlaced) + if (this.field_74956_b && !this.field_74957_c) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch index d46f810900..b21aa36e81 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java -@@ -65,6 +65,10 @@ +@@ -62,6 +62,10 @@ - public NBTTagCompound func_143021_a(int par1, int par2) + public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) { + if (MapGenStructureIO.func_143033_a(this) == null) // This is just a more friendly error instead of the 'Null String' below + { + throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); + } NBTTagCompound nbttagcompound = new NBTTagCompound(); - nbttagcompound.setString("id", MapGenStructureIO.func_143033_a(this)); - nbttagcompound.setInteger("ChunkX", par1); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); + nbttagcompound.func_74768_a("ChunkX", p_143021_1_); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch index c0ac80a776..c8e4a48861 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch @@ -9,39 +9,39 @@ + public class StructureStrongholdPieces { - private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) -@@ -573,12 +576,14 @@ - this.placeBlockAtCurrentPosition(par1World, Blocks.torch, 0, b1, 8, b2 + 1, par3StructureBoundingBox); + private static final StructureStrongholdPieces.PieceWeight[] field_75205_b = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) +@@ -562,12 +565,14 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150478_aa, 0, b1, 8, b2 + 1, p_74875_3_); } -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_92080_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); + ChestGenHooks info = ChestGenHooks.getInfo(STRONGHOLD_LIBRARY); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, info.getItems(par2Random), info.getCount(par2Random)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + - if (this.isLargeRoom) + if (this.field_75008_c) { - this.placeBlockAtCurrentPosition(par1World, Blocks.air, 0, 12, 9, 1, par3StructureBoundingBox); -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, info.getItems(par2Random), info.getCount(par2Random)); + this.func_151550_a(p_74875_1_, Blocks.field_150350_a, 0, 12, 9, 1, p_74875_3_); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_92080_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } return true; -@@ -806,7 +811,7 @@ - if (par3StructureBoundingBox.isVecInside(j, i, k)) +@@ -788,7 +793,7 @@ + if (p_74875_3_.func_78890_b(j, i, k)) { - this.hasMadeChest = true; -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 2 + par2Random.nextInt(2)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, ChestGenHooks.getItems(STRONGHOLD_CORRIDOR, par2Random), ChestGenHooks.getCount(STRONGHOLD_CORRIDOR, par2Random)); + this.field_75002_c = true; +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_92080_a(field_75003_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(2)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, ChestGenHooks.getItems(STRONGHOLD_CORRIDOR, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CORRIDOR, p_74875_2_)); } } -@@ -960,7 +965,7 @@ - this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 1, 3, par3StructureBoundingBox); - this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 2, 3, par3StructureBoundingBox); - this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 3, 3, par3StructureBoundingBox); -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 1 + par2Random.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, ChestGenHooks.getItems(STRONGHOLD_CROSSING, par2Random), ChestGenHooks.getCount(STRONGHOLD_CROSSING, par2Random)); +@@ -938,7 +943,7 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 3, 3, p_74875_3_); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_92080_a(field_75014_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, ChestGenHooks.getItems(STRONGHOLD_CROSSING, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CROSSING, p_74875_2_)); } return true; diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch index a4f6c3efba..60ea211e55 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -20,23 +20,23 @@ public class StructureVillagePieces { -@@ -351,6 +355,7 @@ - private int villagersSpawned; +@@ -346,6 +350,7 @@ + private int field_74896_a; private boolean field_143014_b; private static final String __OBFID = "CL_00000531"; + private StructureVillagePieces.Start startPiece; public Village() {} -@@ -361,6 +366,7 @@ - if (par1ComponentVillageStartPiece != null) +@@ -356,6 +361,7 @@ + if (p_i2107_1_ != null) { - this.field_143014_b = par1ComponentVillageStartPiece.inDesert; -+ startPiece = par1ComponentVillageStartPiece; + this.field_143014_b = p_i2107_1_.field_74927_b; ++ startPiece = p_i2107_1_; } } -@@ -479,6 +485,9 @@ +@@ -469,6 +475,9 @@ protected Block func_151558_b(Block p_151558_1_, int p_151558_2_) { @@ -45,8 +45,8 @@ + if (event.getResult() == Result.DENY) return event.replacement; if (this.field_143014_b) { - if (p_151558_1_ == Blocks.log || p_151558_1_ == Blocks.log2) -@@ -517,6 +526,9 @@ + if (p_151558_1_ == Blocks.field_150364_r || p_151558_1_ == Blocks.field_150363_s) +@@ -507,6 +516,9 @@ protected int func_151557_c(Block p_151557_1_, int p_151557_2_) { @@ -55,17 +55,17 @@ + if (event.getResult() == Result.DENY) return event.replacement; if (this.field_143014_b) { - if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2) -@@ -1288,7 +1300,7 @@ - if (par3StructureBoundingBox.isVecInside(j, i, k)) + if (p_151557_1_ == Blocks.field_150364_r || p_151557_1_ == Blocks.field_150363_s) +@@ -1265,7 +1277,7 @@ + if (p_74875_3_.func_78890_b(j, i, k)) { - this.hasMadeChest = true; -- this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 5, 1, 5, villageBlacksmithChestContents, 3 + par2Random.nextInt(6)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 5, 1, 5, ChestGenHooks.getItems(VILLAGE_BLACKSMITH, par2Random), ChestGenHooks.getCount(VILLAGE_BLACKSMITH, par2Random)); + this.field_74917_c = true; +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, field_74918_a, 3 + p_74875_2_.nextInt(6)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, ChestGenHooks.getItems(VILLAGE_BLACKSMITH, p_74875_2_), ChestGenHooks.getCount(VILLAGE_BLACKSMITH, p_74875_2_)); } } -@@ -1333,6 +1345,7 @@ +@@ -1306,6 +1318,7 @@ public List field_74932_i = new ArrayList(); public List field_74930_j = new ArrayList(); private static final String __OBFID = "CL_00000527"; @@ -73,11 +73,11 @@ public Start() {} -@@ -1344,6 +1357,7 @@ - this.terrainType = par7; - BiomeGenBase biomegenbase = par1WorldChunkManager.getBiomeGenAt(par4, par5); - this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; +@@ -1317,6 +1330,7 @@ + this.field_74928_c = p_i2104_7_; + BiomeGenBase biomegenbase = p_i2104_1_.func_76935_a(p_i2104_4_, p_i2104_5_); + this.field_74927_b = biomegenbase == BiomeGenBase.field_76769_d || biomegenbase == BiomeGenBase.field_76786_s; + this.biome = biomegenbase; } - public WorldChunkManager getWorldChunkManager() + public WorldChunkManager func_74925_d() diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index 692eece4b5..99d11668d7 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/world/storage/MapData.java +++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java -@@ -162,7 +162,7 @@ - par8 += par8 < 0.0D ? -8.0D : 8.0D; - b2 = (byte)((int)(par8 * 16.0D / 360.0D)); +@@ -156,7 +156,7 @@ + p_82567_8_ += p_82567_8_ < 0.0D ? -8.0D : 8.0D; + b2 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); -- if (this.dimension < 0) -+ if (par2World.provider.shouldMapSpin(par3Str, par4, par6, par8)) +- if (this.field_76200_c < 0) ++ if (p_82567_2_.field_73011_w.shouldMapSpin(p_82567_3_, p_82567_4_, p_82567_6_, p_82567_8_)) { - int k = (int)(par2World.getWorldInfo().getWorldTime() / 10L); + int k = (int)(p_82567_2_.func_72912_H().func_76073_f() / 10L); b2 = (byte)(k * k * 34187121 + k * 121 >> 15 & 15);