diff --git a/build.gradle b/build.gradle index db62cdfb5..fc806e733 100644 --- a/build.gradle +++ b/build.gradle @@ -47,11 +47,11 @@ minecraft { projects { forge { rootDir "." - patchDir "patches.mcp/minecraft" + patchDir "patches/minecraft" patchAfter "clean" genPatchesFrom "clean" - genMcpPatches = true - applyMcpPatches = true + genMcpPatches = false + applyMcpPatches = false with common } } diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 5b4a8fa04..c7da6fc34 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,18 +1,18 @@ --- ../src-base/minecraft/net/minecraft/block/Block.java +++ ../src-work/minecraft/net/minecraft/block/Block.java -@@ -38,8 +38,9 @@ +@@ -46,8 +46,9 @@ public class Block { private static final ResourceLocation field_176230_a = new ResourceLocation("air"); - public static final RegistryNamespacedDefaultedByKey field_149771_c = new RegistryNamespacedDefaultedByKey(field_176230_a); - public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap(); -+ public static final RegistryNamespacedDefaultedByKey field_149771_c = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry(); ++ public static final RegistryNamespacedDefaultedByKey field_149771_c = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry(); + @Deprecated //Modders: DO NOT use this! Use GameRegistry + public static final ObjectIntIdentityMap field_176229_d = net.minecraftforge.fml.common.registry.GameData.getBlockStateIDMap(); + public static final AxisAlignedBB field_185505_j = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + public static final AxisAlignedBB field_185506_k = null; private CreativeTabs field_149772_a; - public static final Block.SoundType field_149769_e = new Block.SoundType("stone", 1.0F, 1.0F); - public static final Block.SoundType field_149766_f = new Block.SoundType("wood", 1.0F, 1.0F); -@@ -119,6 +120,9 @@ +@@ -70,6 +71,9 @@ private IBlockState field_176228_M; private String field_149770_b; @@ -22,7 +22,7 @@ public static int func_149682_b(Block p_149682_0_) { return field_149771_c.func_148757_b(p_149682_0_); -@@ -132,7 +136,8 @@ +@@ -83,7 +87,8 @@ public static Block func_149729_e(int p_149729_0_) { @@ -32,16 +32,16 @@ } public static IBlockState func_176220_d(int p_176220_0_) -@@ -303,7 +308,7 @@ +@@ -268,7 +273,7 @@ - public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_) + public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_) { - return false; -+ return func_149688_o().func_76222_j(); ++ return p_176200_1_.func_180495_p(p_176200_2_).func_185904_a().func_76222_j(); } public Block func_149711_c(float p_149711_1_) -@@ -340,9 +345,10 @@ +@@ -305,9 +310,10 @@ return this.field_149789_z; } @@ -52,33 +52,33 @@ + return hasTileEntity(func_176223_P()); } - 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_) -@@ -359,13 +365,13 @@ - public int func_176207_c(IBlockAccess p_176207_1_, BlockPos p_176207_2_) + public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_) +@@ -346,13 +352,13 @@ + @SideOnly(Side.CLIENT) + public int func_185484_c(IBlockState p_185484_1_, IBlockAccess p_185484_2_, BlockPos p_185484_3_) { - Block block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c(); -- int i = p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m()); -+ int i = p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_)); +- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d()); ++ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_)); - if (i == 0 && block instanceof BlockSlab) + if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab) { - p_176207_2_ = p_176207_2_.func_177977_b(); - block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c(); -- return p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m()); -+ return p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_)); + p_185484_3_ = p_185484_3_.func_177977_b(); + p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_); +- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d()); ++ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_)); } else { -@@ -376,7 +382,7 @@ - @SideOnly(Side.CLIENT) - public boolean func_176225_a(IBlockAccess p_176225_1_, BlockPos p_176225_2_, EnumFacing p_176225_3_) - { -- return p_176225_3_ == EnumFacing.DOWN && this.field_149760_C > 0.0D ? true : (p_176225_3_ == EnumFacing.UP && this.field_149756_F < 1.0D ? true : (p_176225_3_ == EnumFacing.NORTH && this.field_149754_D > 0.0D ? true : (p_176225_3_ == EnumFacing.SOUTH && this.field_149757_G < 1.0D ? true : (p_176225_3_ == EnumFacing.WEST && this.field_149759_B > 0.0D ? true : (p_176225_3_ == EnumFacing.EAST && this.field_149755_E < 1.0D ? true : !p_176225_1_.func_180495_p(p_176225_2_).func_177230_c().func_149662_c()))))); -+ return p_176225_3_ == EnumFacing.DOWN && this.field_149760_C > 0.0D ? true : (p_176225_3_ == EnumFacing.UP && this.field_149756_F < 1.0D ? true : (p_176225_3_ == EnumFacing.NORTH && this.field_149754_D > 0.0D ? true : (p_176225_3_ == EnumFacing.SOUTH && this.field_149757_G < 1.0D ? true : (p_176225_3_ == EnumFacing.WEST && this.field_149759_B > 0.0D ? true : (p_176225_3_ == EnumFacing.EAST && this.field_149755_E < 1.0D ? true : !p_176225_1_.func_180495_p(p_176225_2_).func_177230_c().doesSideBlockRendering(p_176225_1_, p_176225_2_, p_176225_3_)))))); +@@ -415,7 +421,7 @@ + } + } + +- return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).func_185914_p(); ++ return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).doesSideBlockRendering(p_176225_2_, p_176225_3_.func_177972_a(p_176225_4_), p_176225_4_.func_176734_d()); } - public boolean func_176212_b(IBlockAccess p_176212_1_, BlockPos p_176212_2_, EnumFacing p_176212_3_) -@@ -453,6 +459,10 @@ + @SideOnly(Side.CLIENT) +@@ -472,6 +478,10 @@ public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) { @@ -89,17 +89,17 @@ } public int func_149745_a(Random p_149745_1_) -@@ -467,8 +477,7 @@ +@@ -486,8 +496,7 @@ - public float func_180647_a(EntityPlayer p_180647_1_, World p_180647_2_, BlockPos p_180647_3_) + public float func_180647_a(IBlockState p_180647_1_, EntityPlayer p_180647_2_, World p_180647_3_, BlockPos p_180647_4_) { -- float f = this.func_176195_g(p_180647_2_, p_180647_3_); -- return f < 0.0F ? 0.0F : (!p_180647_1_.func_146099_a(this) ? p_180647_1_.func_180471_a(this) / f / 100.0F : p_180647_1_.func_180471_a(this) / f / 30.0F); -+ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_2_.func_180495_p(p_180647_3_), p_180647_1_, p_180647_2_, p_180647_3_); +- float f = p_180647_1_.func_185887_b(p_180647_3_, p_180647_4_); +- return f < 0.0F ? 0.0F : (!p_180647_2_.func_184823_b(p_180647_1_) ? p_180647_2_.func_184813_a(p_180647_1_) / f / 100.0F : p_180647_2_.func_184813_a(p_180647_1_) / f / 30.0F); ++ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_); } public final void func_176226_b(World p_176226_1_, BlockPos p_176226_2_, IBlockState p_176226_3_, int p_176226_4_) -@@ -478,20 +487,16 @@ +@@ -497,20 +506,16 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { @@ -125,7 +125,7 @@ } } } -@@ -499,8 +504,13 @@ +@@ -518,8 +523,13 @@ public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) { @@ -140,7 +140,7 @@ float f = 0.5F; double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -@@ -687,7 +697,7 @@ +@@ -588,7 +598,7 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { @@ -148,15 +148,15 @@ + return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_); } - public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumFacing p_180639_5_, float p_180639_6_, float p_180639_7_, float p_180639_8_) -@@ -799,25 +809,35 @@ - p_180657_2_.func_71029_a(StatList.field_75934_C[func_149682_b(this)]); + public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumHand p_180639_5_, ItemStack p_180639_6_, EnumFacing p_180639_7_, float p_180639_8_, float p_180639_9_, float p_180639_10_) +@@ -638,25 +648,35 @@ + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); p_180657_2_.func_71020_j(0.025F); -- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_)) -+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_)) +- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) ++ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) { -+ java.util.ArrayList items = new java.util.ArrayList(); ++ java.util.List items = new java.util.ArrayList(); ItemStack itemstack = this.func_180643_i(p_180657_4_); if (itemstack != null) @@ -165,7 +165,7 @@ + items.add(itemstack); } + -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_); ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_); + for (ItemStack stack : items) + { + func_180635_a(p_180657_1_, p_180657_3_, stack); @@ -174,7 +174,7 @@ else { + harvesters.set(p_180657_2_); - int i = EnchantmentHelper.func_77517_e(p_180657_2_); + int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_); this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); + harvesters.set(null); } @@ -183,12 +183,20 @@ + @Deprecated //Forge: State sensitive version protected boolean func_149700_E() { -- return this.func_149686_d() && !this.field_149758_A; -+ return this.func_149686_d() && !this.hasTileEntity(silk_check_state.get()); +- return this.func_176223_P().func_185917_h() && !this.field_149758_A; ++ return this.func_176223_P().func_185917_h() && !this.hasTileEntity(silk_check_state.get()); } protected ItemStack func_180643_i(IBlockState p_180643_1_) -@@ -1010,6 +1030,1147 @@ +@@ -747,6 +767,7 @@ + p_176216_2_.field_70181_x = 0.0D; + } + ++ @Deprecated // Forge: Use more sensitive version below: getPickBlock + public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) + { + return new ItemStack(Item.func_150898_a(this), 1, this.func_180651_a(p_185473_3_)); +@@ -844,6 +865,1166 @@ return "Block{" + field_149771_c.func_177774_c(this) + "}"; } @@ -200,42 +208,45 @@ + /** + * Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15 + * ++ * @param state Block state + * @param world The current world + * @param pos Block position in world + * @return The light value + */ -+ public int getLightValue(IBlockAccess world, BlockPos pos) ++ public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ Block block = world.func_180495_p(pos).func_177230_c(); -+ if (block != this) ++ IBlockState other = world.func_180495_p(pos); ++ if (other.func_177230_c() != this) + { -+ return block.getLightValue(world, pos); ++ return other.getLightValue(world, pos); + } -+ return func_149750_m(); ++ return state.func_185906_d(); + } + + /** + * Checks if a player or entity can use this block to 'climb' like a ladder. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param entity The entity trying to use the ladder, CAN be null. + * @return True if the block should act like a ladder + */ -+ public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; } ++ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; } + + /** + * Return true if the block is a normal, solid cube. This + * determines indirect power state, entity ejection from blocks, and a few + * others. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return True if the block is a full cube + */ -+ public boolean isNormalCube(IBlockAccess world, BlockPos pos) ++ public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return func_149688_o().func_76218_k() && func_149686_d() && !func_149744_f(); ++ return state.func_185904_a().func_76218_k() && state.func_185917_h() && !state.func_185897_m(); + } + + /** @@ -249,26 +260,30 @@ + * @param side The side to check + * @return True if the block is opaque on the specified side. + */ -+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face) ++ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) + { -+ return func_149662_c(); ++ return state.func_185914_p(); + } + + /** + * Checks if the block is a solid face on the given side, used by placement logic. + * ++ * @param base_state The base state, getActualState should be called first + * @param world The current world + * @param pos Block position in world + * @param side The side to check + * @return True if the block is solid on the specified side. + */ -+ public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) ++ public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ IBlockState state = this.func_176221_a(world.func_180495_p(pos), world, pos); ++ if (base_state.func_185896_q()) // Short circuit to vanilla function if its true ++ return true; ++ ++ IBlockState state = this.func_176221_a(base_state, world, pos); + + if (this instanceof BlockSlab) + { -+ return func_149730_j() ++ return base_state.func_185913_b() + || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP ) + || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.BOTTOM && side == EnumFacing.DOWN); + } @@ -308,7 +323,7 @@ + { + return true; + } -+ return isNormalCube(world, pos); ++ return isNormalCube(state, world, pos); + } + + /** @@ -330,13 +345,14 @@ + * useful for creating pure logic-blocks that will be invisible + * to the player and otherwise interact as air would. + * ++ * @param sata The current state + * @param world The current world + * @param pos Block position in world + * @return True if the block considered air + */ -+ public boolean isAir(IBlockAccess world, BlockPos pos) ++ public boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return func_149688_o() == Material.field_151579_a; ++ return state.func_185904_a() == Material.field_151579_a; + } + + /** @@ -362,6 +378,7 @@ + * Note: When used in multiplayer, this is called on both client and + * server sides! + * ++ * @param state The current state. + * @param world The current world + * @param player The player damaging the block, may be null + * @param pos Block position in world @@ -369,9 +386,10 @@ + * Can be useful to delay the destruction of tile entities till after harvestBlock + * @return True if the block is actually destroyed. + */ -+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) ++ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { -+ return world.func_175698_g(pos); ++ this.func_176208_a(world, pos, state, player); ++ return world.func_180501_a(pos, net.minecraft.init.Blocks.field_150350_a.func_176223_P(), world.field_72995_K ? 11 : 3); + } + + /** @@ -535,23 +553,15 @@ + * Determines if a specified mob type can spawn on this block, returning false will + * prevent any mob from spawning on the block. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param type The Mob Category Type + * @return True to allow a mob of the specified category to spawn, false to prevent it. + */ -+ public boolean canCreatureSpawn(IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) ++ public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) + { -+ IBlockState state = world.func_180495_p(pos); -+ if (this instanceof BlockSlab) -+ { -+ return (func_149730_j() || state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP); -+ } -+ else if (this instanceof BlockStairs) -+ { -+ return state.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP; -+ } -+ return isSideSolid(world, pos, EnumFacing.UP); ++ return isSideSolid(state, world, pos, EnumFacing.UP); + } + + /** @@ -559,12 +569,13 @@ + * players to sleep in it, though the block has to specifically + * perform the sleeping functionality in it's activated event. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param player The player or camera entity, null in some cases. + * @return True to treat this as a bed + */ -+ public boolean isBed(IBlockAccess world, BlockPos pos, Entity player) ++ public boolean isBed(IBlockState state, IBlockAccess world, BlockPos pos, Entity player) + { + return this == net.minecraft.init.Blocks.field_150324_C; + } @@ -573,12 +584,13 @@ + * Returns the position that the player is moved to upon + * waking up, or respawning at the bed. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param player The player or camera entity, null in some cases. + * @return The spawn position + */ -+ public BlockPos getBedSpawnPosition(IBlockAccess world, BlockPos pos, EntityPlayer player) ++ public BlockPos getBedSpawnPosition(IBlockState state, IBlockAccess world, BlockPos pos, EntityPlayer player) + { + if (world instanceof World) + return BlockBed.func_176468_a((World)world, pos, 0); @@ -608,13 +620,14 @@ + * Returns the direction of the block. Same values that + * are returned by BlockDirectional + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return Bed direction + */ -+ public EnumFacing getBedDirection(IBlockAccess world, BlockPos pos) ++ public EnumFacing getBedDirection(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return (EnumFacing)func_176221_a(world.func_180495_p(pos), world, pos).func_177229_b(BlockDirectional.field_176387_N); ++ return (EnumFacing)func_176221_a(state, world, pos).func_177229_b(BlockHorizontal.field_185512_D); + } + + /** @@ -632,19 +645,20 @@ + /** + * Called when a leaf should start its decay process. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + */ -+ public void beginLeavesDecay(World world, BlockPos pos){} ++ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos){} + + /** + * Determines if this block can prevent leaves connected to it from decaying. -+ * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return true if the presence this block can prevent leaves from decaying. + */ -+ public boolean canSustainLeaves(IBlockAccess world, BlockPos pos) ++ public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) + { + return false; + } @@ -652,25 +666,27 @@ + /** + * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return true if this block is considered leaves. + */ -+ public boolean isLeaves(IBlockAccess world, BlockPos pos) ++ public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return func_149688_o() == Material.field_151584_j; ++ return state.func_185904_a() == Material.field_151584_j; + } + + /** + * Used during tree growth to determine if newly generated leaves can replace this block. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return true if this block can be replaced by growing leaves. + */ -+ public boolean canBeReplacedByLeaves(IBlockAccess world, BlockPos pos) ++ public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return !func_149730_j(); ++ return !state.func_185913_b(); + } + + /** @@ -687,15 +703,16 @@ + /** + * Determines if the current block is replaceable by Ore veins during world generation. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param target The generic target block the gen is looking for, Standards define stone + * for overworld generation, and neatherack for the nether. + * @return True to allow this block to be replaced by a ore + */ -+ public boolean isReplaceableOreGen(World world, BlockPos pos, com.google.common.base.Predicate target) ++ public boolean isReplaceableOreGen(IBlockState state, IBlockAccess world, BlockPos pos, com.google.common.base.Predicate target) + { -+ return target.apply(world.func_180495_p(pos)); ++ return target.apply(state); + } + + /** @@ -731,27 +748,29 @@ + * Determine if this block can make a redstone connection on the side provided, + * Useful to control which sides are inputs and outputs for redstone wires. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param side The side that is trying to make the connection, CAN BE NULL + * @return True to make the connection + */ -+ public boolean canConnectRedstone(IBlockAccess world, BlockPos pos, EnumFacing side) ++ public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ return func_149744_f() && side != null; ++ return state.func_185897_m() && side != null; + } + + /** + * Determines if a torch can be placed on the top surface of this block. + * Useful for creating your own block that torches can be on, such as fences. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return True to allow the torch to be placed + */ -+ public boolean canPlaceTorchOnTop(IBlockAccess world, BlockPos pos) ++ public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ if (isSideSolid(world, pos, EnumFacing.UP)) ++ if (state.isSideSolid(world, pos, EnumFacing.UP)) + { + return true; + } @@ -780,22 +799,9 @@ + * @param target The full target the player is looking at + * @return A ItemStack to add to the player's inventory, Null if nothing should be added. + */ -+ public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) ++ public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) + { -+ return getPickBlock(target, world, pos); -+ } -+ @Deprecated -+ public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos) -+ { -+ Item item = func_180665_b(world, pos); -+ -+ if (item == null) -+ { -+ return null; -+ } -+ -+ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this; -+ return new ItemStack(item, 1, block.func_176222_j(world, pos)); ++ return func_185473_a(world, pos, state); + } + + /** @@ -821,7 +827,7 @@ + * @param numberOfParticles that vanilla would have spawned. + * @return True to prevent vanilla landing particles form spawning. + */ -+ public boolean addLandingEffects(net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) ++ public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) + { + return false; + } @@ -832,13 +838,14 @@ + * control over the particles. Useful when you have entirely different + * texture sheets for different sides/locations in the world. + * ++ * @param state The current state + * @param world The current world + * @param target The target the player is looking at {x/y/z/side/sub} + * @param effectRenderer A reference to the current effect renderer. + * @return True to prevent vanilla digging particles form spawning. + */ + @SideOnly(Side.CLIENT) -+ public boolean addHitEffects(World worldObj, MovingObjectPosition target, net.minecraft.client.particle.EffectRenderer effectRenderer) ++ public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, net.minecraft.client.particle.EffectRenderer effectRenderer) + { + return false; + } @@ -871,15 +878,15 @@ + * Plains check if its grass or dirt + * Water check if its still water + * ++ * @param state The Current state + * @param world The current world + * @param pos Block position in world + * @param direction The direction relative to the given position the plant wants to be, typically its UP + * @param plantable The plant that wants to check + * @return True to allow the plant to be planted/stay. + */ -+ public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) ++ public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) + { -+ IBlockState state = world.func_180495_p(pos); + IBlockState plant = plantable.getPlant(world, pos.func_177972_a(direction)); + net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.func_177972_a(direction)); + @@ -893,7 +900,7 @@ + return true; + } + -+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this)) ++ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_185514_i(state)) + { + return true; + } @@ -903,15 +910,15 @@ + case Desert: return this == net.minecraft.init.Blocks.field_150354_m || this == net.minecraft.init.Blocks.field_150405_ch || this == net.minecraft.init.Blocks.field_150406_ce || this == net.minecraft.init.Blocks.field_150346_d; + case Nether: return this == net.minecraft.init.Blocks.field_150425_aM; + case Crop: return this == net.minecraft.init.Blocks.field_150458_ak; -+ case Cave: return isSideSolid(world, pos, EnumFacing.UP); ++ case Cave: return state.isSideSolid(world, pos, EnumFacing.UP); + case Plains: return this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150458_ak; -+ case Water: return func_149688_o() == Material.field_151586_h && ((Integer)state.func_177229_b(BlockLiquid.field_176367_b)) == 0; ++ case Water: return state.func_185904_a() == Material.field_151586_h && state.func_177229_b(BlockLiquid.field_176367_b) == 0; + case Beach: + boolean isBeach = this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150354_m; -+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_177230_c().func_149688_o() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177976_e()).func_177230_c().func_149688_o() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177978_c()).func_177230_c().func_149688_o() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177968_d()).func_177230_c().func_149688_o() == Material.field_151586_h); ++ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177968_d()).func_185904_a() == Material.field_151586_h); + return isBeach && hasWater; + } + @@ -927,11 +934,12 @@ + * + * Note: This happens DURING the generation, the generation may not be complete when this is called. + * ++ * @param state The current state + * @param world Current world + * @param pos Block position in world + * @param source Source plant's position in world + */ -+ public void onPlantGrow(World world, BlockPos pos, BlockPos source) ++ public void onPlantGrow(IBlockState state, World world, BlockPos pos, BlockPos source) + { + if (this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150458_ak) + { @@ -966,27 +974,43 @@ + * Recommended that you have your tile entity call relight after being placed if you + * rely on it for light info. + * ++ * @param state The Block state + * @param world The current world + * @param pos Block position in world + * @return The amount of light to block, 0 for air, 255 for fully opaque. + */ -+ public int getLightOpacity(IBlockAccess world, BlockPos pos) ++ public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return func_149717_k(); ++ return state.func_185891_c(); + } + + /** + * Determines if this block is can be destroyed by the specified entities normal behavior. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @return True to allow the ender dragon to destroy this block + */ -+ public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity) ++ public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) + { + if (entity instanceof net.minecraft.entity.boss.EntityDragon) + { -+ return this != net.minecraft.init.Blocks.field_180401_cv && this != net.minecraft.init.Blocks.field_150343_Z && this != net.minecraft.init.Blocks.field_150377_bs && this != net.minecraft.init.Blocks.field_150357_h && this != net.minecraft.init.Blocks.field_150483_bI; ++ return this != net.minecraft.init.Blocks.field_180401_cv && ++ this != net.minecraft.init.Blocks.field_150343_Z && ++ this != net.minecraft.init.Blocks.field_150377_bs && ++ this != net.minecraft.init.Blocks.field_150357_h && ++ this != net.minecraft.init.Blocks.field_150384_bq && ++ this != net.minecraft.init.Blocks.field_150378_br && ++ this != net.minecraft.init.Blocks.field_150483_bI && ++ this != net.minecraft.init.Blocks.field_185776_dc && ++ this != net.minecraft.init.Blocks.field_185777_dd && ++ this != net.minecraft.init.Blocks.field_150411_aY && ++ this != net.minecraft.init.Blocks.field_185775_db; ++ } ++ else if (entity instanceof net.minecraft.entity.boss.EntityWither) ++ { ++ return net.minecraft.entity.boss.EntityWither.func_181033_a(this); + } + + return true; @@ -1019,7 +1043,7 @@ + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("facing") || prop.func_177701_a().equals("rotation")) + { @@ -1040,10 +1064,11 @@ + public EnumFacing[] getValidRotations(World world, BlockPos pos) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("facing") && prop.func_177699_b() == EnumFacing.class) + { ++ @SuppressWarnings("unchecked") + java.util.Collection values = ((java.util.Collection)prop.func_177700_c()); + return values.toArray(new EnumFacing[values.size()]); + } @@ -1070,10 +1095,11 @@ + * @param color The color to change to + * @return If the recoloring was successful + */ ++ @SuppressWarnings({ "unchecked", "rawtypes" }) + public boolean recolorBlock(World world, BlockPos pos, EnumFacing side, net.minecraft.item.EnumDyeColor color) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("color") && prop.func_177699_b() == net.minecraft.item.EnumDyeColor.class) + { @@ -1091,12 +1117,13 @@ + /** + * Gathers how much experience this block drops when broken. + * ++ * @param state The current state + * @param world The world + * @param pos Block position + * @param fortune + * @return Amount of XP from breaking this block. + */ -+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune) ++ public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) + { + return 0; + } @@ -1116,9 +1143,9 @@ + * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side + * @return Whether Block#isProvidingWeakPower should be called when determining indirect power + */ -+ public boolean shouldCheckWeakPower(IBlockAccess world, BlockPos pos, EnumFacing side) ++ public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ return func_149721_r(); ++ return state.func_185915_l(); + } + + /** @@ -1220,7 +1247,7 @@ + /** + * Called when the entity is inside this block, may be used to determined if the entity can breathing, + * display material overlays, or if the entity can swim inside a block. -+ * ++ * + * @param world that is being tested. + * @param blockpos position thats being tested. + * @param iblockstate state at world/blockpos @@ -1230,15 +1257,15 @@ + * @param testingHead when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment. + * @return null for default behavior, true if the entity is within the material, false if it was not. + */ -+ public Boolean isEntityInsideMaterial(World world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) ++ public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) + { + return null; + } -+ ++ + /** + * Called when boats or fishing hooks are inside the block to check if they are inside + * the material requested. -+ * ++ * + * @param world world that is being tested. + * @param pos block thats being tested. + * @param boundingBox box to test, generally the bounds of an entity that are besting tested. @@ -1254,7 +1281,7 @@ + * Queries if this block should render in a given layer. + * ISmartBlockModel can use MinecraftForgeClient.getRenderLayer to alter their model based on layer + */ -+ public boolean canRenderInLayer(EnumWorldBlockLayer layer) ++ public boolean canRenderInLayer(BlockRenderLayer layer) + { + return func_180664_k() == layer; + } diff --git a/patches/minecraft/net/minecraft/block/BlockBanner.java.patch b/patches/minecraft/net/minecraft/block/BlockBanner.java.patch index 4aa9b6d55..f2e82e73e 100644 --- a/patches/minecraft/net/minecraft/block/BlockBanner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBanner.java.patch @@ -1,21 +1,13 @@ --- ../src-base/minecraft/net/minecraft/block/BlockBanner.java +++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java -@@ -85,22 +85,7 @@ +@@ -104,14 +104,7 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -- TileEntity tileentity = p_180653_1_.func_175625_s(p_180653_2_); +- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_, p_180653_3_); - -- if (tileentity instanceof TileEntityBanner) +- if (itemstack != null) { -- ItemStack itemstack = new ItemStack(Items.field_179564_cE, 1, ((TileEntityBanner)tileentity).func_175115_b()); -- NBTTagCompound nbttagcompound = new NBTTagCompound(); -- tileentity.func_145841_b(nbttagcompound); -- nbttagcompound.func_82580_o("x"); -- nbttagcompound.func_82580_o("y"); -- nbttagcompound.func_82580_o("z"); -- nbttagcompound.func_82580_o("id"); -- itemstack.func_77983_a("BlockEntityTag", nbttagcompound); - func_180635_a(p_180653_1_, p_180653_2_, itemstack); - } - else @@ -23,7 +15,7 @@ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); } } -@@ -133,6 +118,28 @@ +@@ -138,6 +131,28 @@ } } @@ -51,4 +43,4 @@ + public static class BlockBannerHanging extends BlockBanner { - public BlockBannerHanging() + protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D); diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch index c8c22a6eb..1bd0b0e43 100644 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBush.java.patch @@ -1,40 +1,40 @@ --- ../src-base/minecraft/net/minecraft/block/BlockBush.java +++ ../src-work/minecraft/net/minecraft/block/BlockBush.java -@@ -13,7 +13,7 @@ +@@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class BlockBush extends Block +public class BlockBush extends Block implements net.minecraftforge.common.IPlantable { - protected BlockBush() - { -@@ -36,7 +36,7 @@ + protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D); + +@@ -37,7 +37,8 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c()); -+ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); +- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b())); ++ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); ++ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); } - protected boolean func_149854_a(Block p_149854_1_) -@@ -66,7 +66,10 @@ + protected boolean func_185514_i(IBlockState p_185514_1_) +@@ -67,6 +68,11 @@ public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); -+ BlockPos down = p_180671_2_.func_177977_b(); -+ Block soil = p_180671_1_.func_180495_p(down).func_177230_c(); -+ if (p_180671_3_.func_177230_c() != this) return this.func_149854_a(soil); //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. -+ return soil.canSustainPlant(p_180671_1_, down, net.minecraft.util.EnumFacing.UP, this); ++ if (p_180671_3_.func_177230_c() == this) //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. ++ { ++ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); ++ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); ++ } + return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); } - public AxisAlignedBB func_180640_a(World p_180640_1_, BlockPos p_180640_2_, IBlockState p_180640_3_) -@@ -89,4 +92,33 @@ - { - return EnumWorldBlockLayer.CUTOUT; +@@ -90,6 +96,35 @@ + return false; } -+ + + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { @@ -63,4 +63,7 @@ + if (state.func_177230_c() != this) return func_176223_P(); + return state; + } - } ++ + @SideOnly(Side.CLIENT) + public BlockRenderLayer func_180664_k() + { diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch index 58cd17706..984b01117 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockButton.java.patch @@ -1,12 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockButton.java +++ ../src-work/minecraft/net/minecraft/block/BlockButton.java -@@ -74,8 +74,7 @@ - +@@ -89,7 +89,7 @@ protected static boolean func_181088_a(World p_181088_0_, BlockPos p_181088_1_, EnumFacing p_181088_2_) { -- BlockPos blockpos = p_181088_1_.func_177972_a(p_181088_2_); -- return p_181088_2_ == EnumFacing.DOWN ? World.func_175683_a(p_181088_0_, blockpos) : p_181088_0_.func_180495_p(blockpos).func_177230_c().func_149721_r(); -+ return p_181088_2_ == EnumFacing.DOWN && World.func_175683_a(p_181088_0_, p_181088_1_.func_177977_b()) ? true : p_181088_0_.isSideSolid(p_181088_1_.func_177972_a(p_181088_2_), p_181088_2_.func_176734_d()); + BlockPos blockpos = p_181088_1_.func_177972_a(p_181088_2_); +- return p_181088_2_ == EnumFacing.DOWN ? p_181088_0_.func_180495_p(blockpos).func_185896_q() : p_181088_0_.func_180495_p(blockpos).func_185915_l(); ++ return p_181088_0_.func_180495_p(blockpos).isSideSolid(p_181088_0_, blockpos, p_181088_2_.func_176734_d()); } public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index 17dfb0356..7d568610d 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -8,21 +8,22 @@ +public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable { public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15); - -@@ -109,7 +109,7 @@ + protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D); +@@ -110,8 +110,8 @@ + } } - Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c(); -- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m; -+ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this); +- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c(); +- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d(); ++ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()); ++ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_, EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d(); } public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_) -@@ -137,4 +137,16 @@ - { - return new BlockState(this, new IProperty[] {field_176587_a}); +@@ -135,6 +135,18 @@ + return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue(); } -+ + + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { @@ -34,4 +35,7 @@ + { + return func_176223_P(); + } - } ++ + protected BlockStateContainer func_180661_e() + { + return new BlockStateContainer(this, new IProperty[] {field_176587_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch index 90f209e19..08fcab897 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockChest.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockChest.java +++ ../src-work/minecraft/net/minecraft/block/BlockChest.java -@@ -527,7 +527,7 @@ +@@ -506,7 +506,7 @@ private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_) { -- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r(); -+ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false); +- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l(); ++ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).isSideSolid(p_176456_1_, p_176456_2_, EnumFacing.DOWN); } private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index 5ecbf9a68..bbdb460ba 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java +++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java -@@ -137,7 +137,14 @@ +@@ -131,7 +131,14 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { @@ -16,7 +16,7 @@ int j = 1; if (i >= 2) -@@ -147,8 +154,9 @@ +@@ -141,8 +148,9 @@ for (int k = 0; k < j; ++k) { @@ -26,4 +26,4 @@ + return dropped; } - @SideOnly(Side.CLIENT) + public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index ed9298153..55eadae08 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockCrops.java +++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java -@@ -81,11 +81,11 @@ +@@ -116,11 +116,11 @@ float f1 = 0.0F; IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); - if (iblockstate.func_177230_c() == Blocks.field_150458_ak) -+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) ++ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) { f1 = 1.0F; @@ -14,45 +14,20 @@ { f1 = 3.0F; } -@@ -126,7 +126,7 @@ +@@ -161,7 +161,8 @@ public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); -+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); +- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); ++ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); ++ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); } protected Item func_149866_i() -@@ -142,24 +142,6 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0); -- -- if (!p_180653_1_.field_72995_K) -- { -- int i = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue(); -- -- if (i >= 7) -- { -- int j = 3 + p_180653_5_; -- -- for (int k = 0; k < j; ++k) -- { -- if (p_180653_1_.field_73012_v.nextInt(15) <= i) -- { -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0)); -- } -- } -- } -- } +@@ -174,11 +175,33 @@ + return Items.field_151015_O; } - public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) -@@ -202,4 +184,26 @@ - { - return new BlockState(this, new IProperty[] {field_176488_a}); - } -+ + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { @@ -74,4 +49,13 @@ + } + return ret; + } - } ++ + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) + { + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0); + +- if (!p_180653_1_.field_72995_K) ++ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this. + { + int i = this.func_185527_x(p_180653_3_); + diff --git a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch index a350513b4..5ef70af15 100644 --- a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch @@ -1,26 +1,25 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java +++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java -@@ -14,7 +14,7 @@ - import net.minecraft.util.BlockPos; +@@ -16,7 +16,7 @@ + import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class BlockDeadBush extends BlockBush +public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable { - protected BlockDeadBush() - { -@@ -45,14 +45,15 @@ + protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) +@@ -57,7 +57,7 @@ + + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { -- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) +- if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) ++ if (false && !p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) // Forge: Noop { -- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0)); -- } -- else -- { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); + func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0)); +@@ -67,4 +67,11 @@ + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); } } + @@ -28,6 +27,6 @@ + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I))); ++ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index de31efb01..51d575be8 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java -@@ -154,7 +154,7 @@ +@@ -107,7 +107,7 @@ { if (this.field_149764_J == Material.field_151573_f) { @@ -9,12 +9,12 @@ } else { -@@ -272,7 +272,7 @@ +@@ -219,7 +219,7 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); -+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); +- return p_176196_2_.func_177956_o() >= 255 ? false : p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); ++ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); } - public int func_149656_h() + public EnumPushReaction func_149656_h(IBlockState p_149656_1_) diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch index 2218435af..1a92f21a6 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch @@ -9,7 +9,7 @@ { public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class); public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class); -@@ -90,6 +90,8 @@ +@@ -88,6 +88,8 @@ Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c()); Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this); @@ -18,7 +18,7 @@ if (block == this) { p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2); -@@ -98,17 +100,13 @@ +@@ -96,17 +98,13 @@ if (block1 == this) { p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3); @@ -37,24 +37,24 @@ if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER) { return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this; -@@ -158,7 +156,6 @@ +@@ -149,7 +147,6 @@ - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { -- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_)) +- if (p_180657_1_.field_72995_K || p_180657_6_ == null || p_180657_6_.func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_)) { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); } -@@ -221,8 +218,6 @@ +@@ -212,8 +209,6 @@ else { - p_176489_4_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); + p_176489_4_.func_71029_a(StatList.func_188055_a(this)); - int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a(); - func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i)); return true; } } -@@ -293,6 +288,32 @@ +@@ -284,6 +279,33 @@ return Block.EnumOffsetType.XZ; } @@ -65,6 +65,7 @@ + EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a); + return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS); + } ++ + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { @@ -74,11 +75,11 @@ + if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a())); + return ret; + } ++ + @Override -+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) ++ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames. -+ IBlockState state = world.func_180495_p(pos); + if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this) + world.func_175698_g(pos.func_177984_a()); + return world.func_175698_g(pos); diff --git a/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch b/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch new file mode 100644 index 000000000..2eb9dd2a2 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java +@@ -48,7 +48,7 @@ + + private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_) + { +- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0) ++ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0) + { + int i = 32; + +@@ -61,7 +61,7 @@ + p_180683_1_.func_175698_g(p_180683_2_); + BlockPos blockpos; + +- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) ++ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) + { + ; + } diff --git a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch index 811cb1a2c..60dba8b04 100644 --- a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch @@ -1,10 +1,20 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFalling.java +++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java -@@ -86,6 +86,7 @@ +@@ -44,7 +44,7 @@ - public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_) + private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_) { -+ if (p_180685_0_.func_175623_d(p_180685_1_)) return true; - Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c(); - Material material = block.field_149764_J; - return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i; +- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0) ++ if (p_176503_1_.func_175623_d(p_176503_2_) && func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0) + { + int i = 32; + +@@ -62,7 +62,7 @@ + p_176503_1_.func_175698_g(p_176503_2_); + BlockPos blockpos; + +- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) ++ for (blockpos = p_176503_2_.func_177977_b(); p_176503_1_.func_175623_d(blockpos) && func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) + { + ; + } diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch index 7547658d3..6332eeec8 100644 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java +++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java -@@ -89,7 +89,7 @@ +@@ -87,7 +87,7 @@ private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_) { Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c(); - return block instanceof BlockCrops || block instanceof BlockStem; -+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block); ++ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block); } private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index 05ab962bc..62f2ba905 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -1,34 +1,23 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFire.java +++ ../src-work/minecraft/net/minecraft/block/BlockFire.java -@@ -41,18 +41,24 @@ - int j = p_176221_3_.func_177956_o(); - int k = p_176221_3_.func_177952_p(); +@@ -37,7 +37,15 @@ -- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b())) -+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP)) - { - boolean flag = (i + j + k & 1) == 1; - boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1; - int l = 0; + public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) + { +- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P(); ++ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP)) ++ { ++ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)) ++ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST)) ++ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)) ++ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST)) ++ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN)); ++ } ++ return this.func_176223_P(); + } -- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a())) -+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN)) - { - l = flag ? 1 : 2; - } - -- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag)); -+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))) -+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST ))) -+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))) -+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST ))) -+ .func_177226_a(field_176542_R, Integer.valueOf(l)) -+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1)) -+ .func_177226_a(field_176544_M, Boolean.valueOf(flag)); - } - else - { -@@ -108,6 +114,7 @@ + protected BlockFire() +@@ -90,6 +98,7 @@ public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { @@ -36,7 +25,7 @@ this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_)); this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_)); } -@@ -147,13 +154,8 @@ +@@ -129,13 +138,8 @@ } Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); @@ -48,10 +37,19 @@ - flag = true; - } - - if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_)) - { - p_180650_1_.func_175698_g(p_180650_2_); -@@ -182,7 +184,7 @@ + int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue(); + + if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F) +@@ -156,7 +160,7 @@ + { + if (!this.func_176533_e(p_180650_1_, p_180650_2_)) + { +- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3) ++ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3) + { + p_180650_1_.func_175698_g(p_180650_2_); + } +@@ -164,7 +168,7 @@ return; } @@ -60,7 +58,7 @@ { p_180650_1_.func_175698_g(p_180650_2_); return; -@@ -197,12 +199,12 @@ +@@ -179,12 +183,12 @@ j = -50; } @@ -79,7 +77,7 @@ for (int k = -1; k <= 1; ++k) { -@@ -261,22 +263,30 @@ +@@ -243,45 +247,53 @@ return false; } @@ -104,14 +102,44 @@ + this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP); + } -+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face) +- if (p_176536_4_.nextInt(p_176536_3_) < i) ++ private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face) + { -+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face); ++ int i = worldIn.func_180495_p(pos).func_177230_c().getFlammability(worldIn, pos, face); + - if (p_176536_4_.nextInt(p_176536_3_) < i) ++ if (random.nextInt(chance) < i) { - IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_); -@@ -308,7 +318,7 @@ +- IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_); ++ IBlockState iblockstate = worldIn.func_180495_p(pos); + +- if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) ++ if (random.nextInt(age + 10) < 5 && !worldIn.func_175727_C(pos)) + { +- int j = p_176536_5_ + p_176536_4_.nextInt(5) / 4; ++ int j = age + random.nextInt(5) / 4; + + if (j > 15) + { + j = 15; + } + +- p_176536_1_.func_180501_a(p_176536_2_, this.func_176223_P().func_177226_a(field_176543_a, Integer.valueOf(j)), 3); ++ worldIn.func_180501_a(pos, this.func_176223_P().func_177226_a(field_176543_a, Integer.valueOf(j)), 3); + } + else + { +- p_176536_1_.func_175698_g(p_176536_2_); ++ worldIn.func_175698_g(pos); + } + + if (iblockstate.func_177230_c() == Blocks.field_150335_W) + { +- Blocks.field_150335_W.func_176206_d(p_176536_1_, p_176536_2_, iblockstate.func_177226_a(BlockTNT.field_176246_a, Boolean.valueOf(true))); ++ Blocks.field_150335_W.func_176206_d(worldIn, pos, iblockstate.func_177226_a(BlockTNT.field_176246_a, Boolean.valueOf(true))); + } + } + } +@@ -290,7 +302,7 @@ { for (EnumFacing enumfacing : EnumFacing.values()) { @@ -120,7 +148,7 @@ { return true; } -@@ -329,7 +339,7 @@ +@@ -311,7 +323,7 @@ for (EnumFacing enumfacing : EnumFacing.values()) { @@ -129,7 +157,7 @@ } return i; -@@ -341,9 +351,10 @@ +@@ -323,9 +335,10 @@ return false; } @@ -141,57 +169,57 @@ } public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) -@@ -382,9 +393,9 @@ - p_180655_1_.func_72980_b((double)((float)p_180655_2_.func_177958_n() + 0.5F), (double)((float)p_180655_2_.func_177956_o() + 0.5F), (double)((float)p_180655_2_.func_177952_p() + 0.5F), "fire.fire", 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false); +@@ -364,9 +377,9 @@ + p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false); } -- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b())) -+ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP)) +- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b())) ++ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP)) { -- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST)) { for (int j = 0; j < 2; ++j) { -@@ -395,7 +406,7 @@ +@@ -377,7 +390,7 @@ } } -- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST)) { for (int k = 0; k < 2; ++k) { -@@ -406,7 +417,7 @@ +@@ -388,7 +401,7 @@ } } -- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH)) { for (int l = 0; l < 2; ++l) { -@@ -417,7 +428,7 @@ +@@ -399,7 +412,7 @@ } } -- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH)) { for (int i1 = 0; i1 < 2; ++i1) { -@@ -428,7 +439,7 @@ +@@ -410,7 +423,7 @@ } } -- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN)) { for (int j1 = 0; j1 < 2; ++j1) { -@@ -476,4 +487,19 @@ +@@ -458,4 +471,19 @@ { - return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M}); + return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R}); } + + /*================================= Forge Start ======================================*/ diff --git a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch index 24229b07b..cf36d9316 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java +++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java -@@ -169,13 +169,6 @@ +@@ -148,13 +148,6 @@ public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) { @@ -14,8 +14,8 @@ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); } -@@ -395,6 +388,31 @@ - return EnumWorldBlockLayer.CUTOUT; +@@ -374,6 +367,31 @@ + return BlockRenderLayer.CUTOUT; } + @@ -30,15 +30,15 @@ + return ret; + } + @Override -+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) ++ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops -+ return super.removedByPlayer(world, pos, player, willHarvest); ++ return super.removedByPlayer(state, world, pos, player, willHarvest); + } + @Override -+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) ++ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack tool) + { -+ super.func_180657_a(world, player, pos, state, te); ++ super.func_180657_a(world, player, pos, state, te, tool); + world.func_175698_g(pos); + } + /*===========================FORGE END==========================================*/ diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch index 7f957e591..d56f0539b 100644 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -1,24 +1,24 @@ --- ../src-base/minecraft/net/minecraft/block/BlockGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java -@@ -58,7 +58,7 @@ +@@ -38,7 +38,7 @@ { if (!p_180650_1_.field_72995_K) { -- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2) -+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) +- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2) ++ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) { p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P()); } -@@ -72,7 +72,7 @@ - Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c(); - IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos); +@@ -58,7 +58,7 @@ + IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a()); + IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos); -- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2) -+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) +- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2) ++ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2) { p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P()); } -@@ -110,7 +110,7 @@ +@@ -96,7 +96,7 @@ { if (j >= i / 16) { diff --git a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch index cfc4d531f..c4f0ba396 100644 --- a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java -@@ -79,6 +79,20 @@ - return new BlockState(this, new IProperty[] {field_176380_a}); +@@ -221,6 +221,20 @@ + return new BlockStateContainer(this, new IProperty[] {field_176380_a}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : (java.util.Set>)state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("variant")) + { diff --git a/patches/minecraft/net/minecraft/block/BlockIce.java.patch b/patches/minecraft/net/minecraft/block/BlockIce.java.patch index b2ff04fe6..e7570c693 100644 --- a/patches/minecraft/net/minecraft/block/BlockIce.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockIce.java.patch @@ -1,35 +1,34 @@ --- ../src-base/minecraft/net/minecraft/block/BlockIce.java +++ ../src-work/minecraft/net/minecraft/block/BlockIce.java -@@ -38,14 +38,17 @@ - p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +@@ -40,14 +40,19 @@ + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); p_180657_2_.func_71020_j(0.025F); -- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_)) -+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_)) +- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) ++ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) { + java.util.List items = new java.util.ArrayList(); ItemStack itemstack = this.func_180643_i(p_180657_4_); -- if (itemstack != null) -- { + if (itemstack != null) + { - func_180635_a(p_180657_1_, p_180657_3_, itemstack); -- } -+ if (itemstack != null) items.add(itemstack); -+ -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_); ++ items.add(itemstack); + } + ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_); + for (ItemStack is : items) + func_180635_a(p_180657_1_, p_180657_3_, is); } else { -@@ -56,7 +59,9 @@ +@@ -58,7 +63,9 @@ } - int i = EnchantmentHelper.func_77517_e(p_180657_2_); + int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_); + harvesters.set(p_180657_2_); this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); + harvesters.set(null); - Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o(); + Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a(); if (material.func_76230_c() || material.func_76224_d()) diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index 84fa2d3db..4251c5bd5 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -1,30 +1,30 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLadder.java +++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java -@@ -78,7 +78,10 @@ +@@ -61,7 +61,10 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r())); -+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) || -+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) || -+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) || -+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true); +- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_185915_l() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_185915_l() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_185915_l() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_185915_l())); ++ return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).isSideSolid(p_176196_1_, p_176196_2_.func_177976_e(), EnumFacing.EAST) || ++ p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).isSideSolid(p_176196_1_, p_176196_2_.func_177974_f(), EnumFacing.WEST) || ++ p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).isSideSolid(p_176196_1_, p_176196_2_.func_177978_c(), EnumFacing.SOUTH) || ++ p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).isSideSolid(p_176196_1_, p_176196_2_.func_177968_d(), EnumFacing.NORTH); } public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) -@@ -116,7 +119,7 @@ +@@ -99,7 +102,7 @@ protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_) { -- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r(); -+ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true); +- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_185915_l(); ++ return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).isSideSolid(p_176381_1_, p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_); } public IBlockState func_176203_a(int p_176203_1_) -@@ -146,4 +149,6 @@ +@@ -139,4 +142,6 @@ { - return new BlockState(this, new IProperty[] {field_176382_a}); + return new BlockStateContainer(this, new IProperty[] {field_176382_a}); } + -+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } ++ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } } diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index 4dcb42a4d..201fd6013 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -1,39 +1,39 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java +++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java -@@ -18,7 +18,7 @@ +@@ -17,7 +17,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; --public abstract class BlockLeaves extends BlockLeavesBase -+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable +-public abstract class BlockLeaves extends Block ++public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable { public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable"); public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay"); -@@ -75,9 +75,9 @@ +@@ -53,9 +53,9 @@ BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1); IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); -- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue()) -+ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos)) +- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos)) { - p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4); -+ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos); ++ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos); } } } -@@ -117,9 +117,9 @@ - { - Block block = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)).func_177230_c(); +@@ -96,9 +96,9 @@ + IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)); + Block block = iblockstate.func_177230_c(); - if (block != Blocks.field_150364_r && block != Blocks.field_150363_s) -+ if (!block.canSustainLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) ++ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) { -- if (block.func_149688_o() == Material.field_151584_j) -+ if (block.isLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) +- if (iblockstate.func_185904_a() == Material.field_151584_j) ++ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) { this.field_150128_a[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; } -@@ -226,40 +226,7 @@ +@@ -205,40 +205,7 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { @@ -75,18 +75,16 @@ } protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) -@@ -296,4 +263,48 @@ - } +@@ -274,6 +241,49 @@ public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_); -+ + + @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } -+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; } ++ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; } + + @Override -+ public void beginLeavesDecay(World world, BlockPos pos) ++ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos) + { -+ IBlockState state = world.func_180495_p(pos); + if (!(Boolean)state.func_177229_b(field_176236_b)) + { + world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4); @@ -123,4 +121,7 @@ + return ret; + } + - } ++ + @SideOnly(Side.CLIENT) + public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_) + { diff --git a/patches/minecraft/net/minecraft/block/BlockLever.java.patch b/patches/minecraft/net/minecraft/block/BlockLever.java.patch index 7bee93321..b3e399cd0 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLever.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLever.java +++ ../src-work/minecraft/net/minecraft/block/BlockLever.java -@@ -237,6 +237,12 @@ - return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b}); +@@ -295,6 +295,12 @@ + return new BlockStateContainer(this, new IProperty[] {field_176360_a, field_176359_b}); } + diff --git a/patches/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch index a6247c0c2..626833921 100644 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLog.java.patch @@ -1,22 +1,22 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLog.java +++ ../src-work/minecraft/net/minecraft/block/BlockLog.java -@@ -33,9 +33,9 @@ +@@ -34,9 +34,9 @@ { IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); -- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue()) -+ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos)) +- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos)) { - p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4); -+ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos); ++ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos); } } } -@@ -46,6 +46,9 @@ - return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k())); +@@ -69,6 +69,9 @@ + } } -+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } ++ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } + @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } + public static enum EnumAxis implements IStringSerializable diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index 89062cf38..49d79f3fc 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java +++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java -@@ -37,10 +37,14 @@ +@@ -39,10 +39,14 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); @@ -9,11 +9,11 @@ } + @Override -+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { + return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); + } + - public boolean func_149662_c() + public boolean func_149662_c(IBlockState p_149662_1_) { return false; diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch index c78e7fc1d..ff671be04 100644 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java -@@ -71,7 +71,7 @@ +@@ -78,7 +78,7 @@ if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256) { IBlockState iblockstate = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); -- return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate.func_177230_c())); -+ return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this)); +- return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate)); ++ return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this)); } else { diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch index c7bd1a280..f97644492 100644 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch @@ -4,17 +4,17 @@ { if (!p_180650_1_.field_72995_K) { -- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2) -+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) +- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2) ++ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) { p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT)); } @@ -53,7 +53,7 @@ IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos); - Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c(); + IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a()); -- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2) -+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) +- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2) ++ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) { p_180650_1_.func_175656_a(blockpos, this.func_176223_P()); } diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch index 959b41a0b..3424c6cd8 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java +++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java -@@ -38,7 +38,7 @@ +@@ -42,7 +42,7 @@ public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); +- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); + return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); } public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_) -@@ -54,9 +54,11 @@ +@@ -58,9 +58,11 @@ super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); } @@ -22,11 +22,10 @@ { int i = 1; -@@ -107,4 +109,24 @@ - { - return new BlockState(this, new IProperty[] {field_176486_a}); +@@ -106,6 +108,26 @@ + return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue(); } -+ + + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { @@ -46,4 +45,7 @@ + + return ret; + } - } ++ + protected BlockStateContainer func_180661_e() + { + return new BlockStateContainer(this, new IProperty[] {field_176486_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch index 9cfc32668..7efe335af 100644 --- a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch @@ -1,24 +1,22 @@ --- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java +++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java -@@ -99,14 +99,15 @@ +@@ -98,7 +98,7 @@ - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { -- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) +- if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) ++ if (false && !p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) //Forge: Noop this { -- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4)); -- } -- else -- { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); + func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4)); +@@ -108,4 +108,10 @@ + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); } } + + @Override + public List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.func_180495_p(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4))); ++ return java.util.Arrays.asList(new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4)); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockNote.java.patch b/patches/minecraft/net/minecraft/block/BlockNote.java.patch index 6899eb877..d3ec274fc 100644 --- a/patches/minecraft/net/minecraft/block/BlockNote.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNote.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockNote.java +++ ../src-work/minecraft/net/minecraft/block/BlockNote.java -@@ -58,7 +58,9 @@ +@@ -64,7 +64,9 @@ if (tileentity instanceof TileEntityNote) { TileEntityNote tileentitynote = (TileEntityNote)tileentity; @@ -8,9 +8,9 @@ tileentitynote.func_145877_a(); + if (old == tileentitynote.field_145879_a) return false; tileentitynote.func_175108_a(p_180639_1_, p_180639_2_); - p_180639_4_.func_71029_a(StatList.field_181735_S); + p_180639_4_.func_71029_a(StatList.field_188087_U); } -@@ -98,6 +100,10 @@ +@@ -104,6 +106,10 @@ public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_) { @@ -19,5 +19,5 @@ + p_180648_4_ = e.instrument.ordinal(); + p_180648_5_ = e.getVanillaNoteId(); float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D); - p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f); + p_180648_1_.func_184133_a((EntityPlayer)null, p_180648_2_, this.func_185576_e(p_180648_4_), SoundCategory.BLOCKS, 3.0F, f); p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]); diff --git a/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch index c81ddd561..c056b175b 100644 --- a/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch @@ -1,21 +1,28 @@ --- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java +++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java -@@ -142,11 +142,17 @@ - if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) +@@ -14,6 +14,7 @@ + import net.minecraft.stats.StatList; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.util.math.BlockPos; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; +@@ -103,11 +104,16 @@ + if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) { - p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); - func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a())); } else { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); } } + + @Override + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.func_180495_p(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a()))); ++ return java.util.Arrays.asList(new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a())); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch index a08f33dec..15b1046bc 100644 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOre.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockOre.java -@@ -58,34 +58,40 @@ +@@ -59,34 +59,39 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); @@ -8,9 +8,8 @@ - if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) + } + @Override -+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.func_180495_p(pos); + Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); + if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this)) { @@ -48,4 +47,4 @@ + return 0; } - public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_) + public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch index bf26e9faf..0d9d74407 100644 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPane.java +++ ../src-work/minecraft/net/minecraft/block/BlockPane.java -@@ -38,7 +38,10 @@ +@@ -105,7 +105,10 @@ public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) { @@ -12,30 +12,15 @@ } public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) -@@ -64,10 +67,10 @@ - - public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_) +@@ -182,4 +185,11 @@ { -- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c()); -- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c()); -- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c()); -- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c()); -+ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH); -+ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH); -+ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST); -+ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST); - - if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) - { -@@ -186,4 +189,11 @@ - { - return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N}); + return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N}); } + + public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) + { + BlockPos off = pos.func_177972_a(dir); -+ Block block = world.func_180495_p(off).func_177230_c(); -+ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d()); ++ IBlockState state = world.func_180495_p(off); ++ return func_150098_a(state.func_177230_c()) || state.isSideSolid(world, off, dir.func_176734_d()); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index db2e7cfae..d3d13188c 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -1,31 +1,31 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java -@@ -189,7 +189,7 @@ +@@ -235,7 +235,7 @@ } } -- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) -+ if (!flag1 && !block.isAir(p_180648_1_, blockpos) && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) +- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) ++ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_180648_1_, blockpos) && func_185646_a(iblockstate, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) { this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false); } -@@ -333,7 +333,7 @@ +@@ -320,7 +320,7 @@ return false; } -- return !(p_180696_0_ instanceof ITileEntityProvider); -+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_))); +- return !block.func_149716_u(); ++ return !block.hasTileEntity(p_185646_0_); } else { -@@ -371,7 +371,9 @@ +@@ -366,7 +366,9 @@ { - BlockPos blockpos = (BlockPos)list1.get(j); - Block block = p_176319_1_.func_180495_p(blockpos).func_177230_c(); -- block.func_176226_b(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), 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.func_180653_a(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), chance, 0); - p_176319_1_.func_175698_g(blockpos); - --i; - ablock[i] = block; + BlockPos blockpos1 = (BlockPos)list2.get(j); + IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1); +- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0); ++ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. ++ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f; ++ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0); + p_176319_1_.func_175698_g(blockpos1); + --k; + aiblockstate[k] = iblockstate; diff --git a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch index 3ba28b443..9cbc42a5d 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch @@ -1,32 +1,31 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java +++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java -@@ -109,16 +109,7 @@ +@@ -110,7 +110,7 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - if (!p_180653_1_.field_72995_K) -- { -- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_); -- -- if (tileentitypiston != null) -- { -- IBlockState iblockstate = tileentitypiston.func_174927_b(); -- iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0); -- } -- } ++ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out + { + TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_); + +@@ -120,6 +120,7 @@ + iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0); + } + } + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); } - public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_) -@@ -282,4 +273,16 @@ + public RayTraceResult func_180636_a(IBlockState p_180636_1_, World p_180636_2_, BlockPos p_180636_3_, Vec3d p_180636_4_, Vec3d p_180636_5_) +@@ -190,4 +191,16 @@ { - return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b}); + return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b}); } + + @Override + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { -+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos); ++ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos); + if (tileentitypiston != null) + { + IBlockState pushed = tileentitypiston.func_174927_b(); diff --git a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch b/patches/minecraft/net/minecraft/block/BlockPotato.java.patch index f507e3336..1e3926361 100644 --- a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPotato.java.patch @@ -1,24 +1,24 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPotato.java +++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java -@@ -22,13 +22,14 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) +@@ -27,7 +27,7 @@ { super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -- + - if (!p_180653_1_.field_72995_K) -- { -- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0) -- { -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI)); -- } -- } ++ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops + { + if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0) + { +@@ -40,4 +40,13 @@ + { + return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()]; } ++ + @Override -+ public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) ++ public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = super.getDrops(world, pos, state, fortune); -+ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random(); -+ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0) ++ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0) + ret.add(new ItemStack(Items.field_151170_bI)); + return ret; + } diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch index 256bace07..1d4332d11 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 -@@ -115,7 +115,7 @@ +@@ -117,7 +117,7 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()); -+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()); +- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q(); ++ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_, EnumFacing.UP); } - public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) + public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch b/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch index b78be41ea..5bc96aff1 100644 --- a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java +++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java -@@ -90,6 +90,26 @@ - return new BlockState(this, new IProperty[] {field_176335_a}); +@@ -113,6 +113,26 @@ + return new BlockStateContainer(this, new IProperty[] {field_176335_a}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("variant") && prop.func_177699_b() == EnumType.class) + { diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 9f7a36165..13fe90005 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java -@@ -31,7 +31,7 @@ +@@ -32,7 +32,7 @@ public static boolean func_176563_d(IBlockState p_176563_0_) { Block block = p_176563_0_.func_177230_c(); @@ -9,7 +9,46 @@ } protected BlockRailBase(boolean p_i45389_1_) -@@ -175,6 +175,81 @@ +@@ -65,7 +65,7 @@ + + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) + { +- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q(); ++ return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_, EnumFacing.UP); + } + + public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_) +@@ -88,24 +88,24 @@ + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_176204_3_.func_177229_b(this.func_176560_l()); + boolean flag = false; + +- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177977_b()).func_185896_q()) ++ if (!p_176204_1_.func_180495_p(p_176204_2_.func_177977_b()).isSideSolid(p_176204_1_, p_176204_2_.func_177977_b(), EnumFacing.UP)) + { + flag = true; + } + +- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_176204_1_.func_180495_p(p_176204_2_.func_177974_f()).func_185896_q()) ++ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_176204_1_.func_180495_p(p_176204_2_.func_177974_f()).isSideSolid(p_176204_1_, p_176204_2_.func_177974_f(), EnumFacing.UP)) + { + flag = true; + } +- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_176204_1_.func_180495_p(p_176204_2_.func_177976_e()).func_185896_q()) ++ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_176204_1_.func_180495_p(p_176204_2_.func_177976_e()).isSideSolid(p_176204_1_, p_176204_2_.func_177976_e(), EnumFacing.UP)) + { + flag = true; + } +- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177978_c()).func_185896_q()) ++ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177978_c()).isSideSolid(p_176204_1_, p_176204_2_.func_177978_c(), EnumFacing.UP)) + { + flag = true; + } +- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177968_d()).func_185896_q()) ++ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177968_d()).isSideSolid(p_176204_1_, p_176204_2_.func_177968_d(), EnumFacing.UP)) + { + flag = true; + } +@@ -160,6 +160,81 @@ public abstract IProperty func_176560_l(); @@ -75,7 +114,7 @@ + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { + IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) ++ for (IProperty prop : state.func_177228_b().keySet()) + { + if (prop.func_177701_a().equals("shape")) + { @@ -91,7 +130,7 @@ public static enum EnumRailDirection implements IStringSerializable { NORTH_SOUTH(0, "north_south"), -@@ -245,6 +320,7 @@ +@@ -230,6 +305,7 @@ private IBlockState field_180366_e; private final boolean field_150656_f; private final List field_150657_g = Lists.newArrayList(); @@ -99,17 +138,17 @@ public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_) { -@@ -253,7 +329,8 @@ +@@ -238,7 +314,8 @@ this.field_180366_e = p_i45739_4_; this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c(); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l()); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(this.field_180365_d.func_176560_l()); - this.field_150656_f = this.field_180365_d.field_150053_a; + this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_); -+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_); ++ this.canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_); this.func_180360_a(blockrailbase$enumraildirection); } -@@ -439,7 +516,7 @@ +@@ -429,7 +506,7 @@ } } @@ -118,7 +157,7 @@ { if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) { -@@ -452,7 +529,7 @@ +@@ -442,7 +519,7 @@ } } @@ -127,7 +166,7 @@ { if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a())) { -@@ -595,7 +672,7 @@ +@@ -585,7 +662,7 @@ } } @@ -136,7 +175,7 @@ { if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) { -@@ -608,7 +685,7 @@ +@@ -598,7 +675,7 @@ } } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch index 1ad9b4abf..84a6de664 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java -@@ -295,6 +295,21 @@ - return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE); +@@ -310,6 +310,21 @@ + return this.func_176223_P().func_177226_a(field_185512_D, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE); } + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch index fe20ed8f6..f9a873048 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java -@@ -198,6 +198,8 @@ +@@ -204,6 +204,8 @@ { - EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_176387_N); + EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D); BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d()); + if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d())).isCanceled()) + return; diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index daefa904e..7762d1ea3 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java -@@ -91,12 +91,16 @@ +@@ -92,12 +92,16 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); @@ -8,9 +8,9 @@ - if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) + @Override -+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this)) ++ if (this.func_180660_a(state, RANDOM, fortune) != Item.func_150898_a(this)) { - int i = 1 + p_180653_1_.field_73012_v.nextInt(5); - this.func_180637_b(p_180653_1_, p_180653_2_, i); diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index 69aa76b4d..e824763bc 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,59 +1,65 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -58,10 +58,10 @@ +@@ -97,15 +97,15 @@ BlockPos blockpos = p_176341_2_.func_177972_a(p_176341_3_); - Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c(); + IBlockState iblockstate = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)); -- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b())))) -+ if (!canRestoneConnect(p_176341_1_, blockpos, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos.func_177977_b(), null))) +- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b())))) ++ if (!canConnectTo(p_176341_1_.func_180495_p(blockpos), p_176341_3_, p_176341_1_, blockpos) && (iblockstate.func_185915_l() || !func_176340_e(p_176341_1_, blockpos.func_177977_b()))) { - Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c(); -- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; -+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; - } - else - { -@@ -359,35 +359,24 @@ - Block block = iblockstate.func_177230_c(); - boolean flag = block.func_149721_r(); - boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r(); -- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b()))); -+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos.func_177977_b(), null))); + IBlockState iblockstate1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()); + + if (!iblockstate1.func_185915_l()) + { +- boolean flag = p_176341_1_.func_180495_p(blockpos).func_185896_q() || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN; ++ boolean flag = p_176341_1_.func_180495_p(blockpos).isSideSolid(p_176341_1_, blockpos, EnumFacing.UP) || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN; + +- if (flag && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a()))) ++ if (flag && func_176340_e(p_176341_1_, blockpos.func_177984_a())) + { + if (iblockstate.func_185898_k()) + { +@@ -406,35 +406,30 @@ + IBlockState iblockstate = p_176339_1_.func_180495_p(blockpos); + boolean flag = iblockstate.func_185915_l(); + boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_185915_l(); +- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (iblockstate.func_177230_c() == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b()))); ++ return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (canConnectTo(iblockstate, p_176339_3_, p_176339_1_, p_176339_2_) ? true : (iblockstate.func_177230_c() == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b()))); } -- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_) -+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side) + protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_) { - return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_)); -- } -- ++ return canConnectTo(p_176340_0_.func_180495_p(p_176340_1_), null, p_176340_0_, p_176340_1_); + } + - protected static boolean func_176346_d(IBlockState p_176346_0_) -- { ++ protected static boolean canConnectTo(IBlockState blockState, EnumFacing side, IBlockAccess world, BlockPos pos) + { - return func_176343_a(p_176346_0_, (EnumFacing)null); - } -- ++ Block block = blockState.func_177230_c(); + - protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_) - { - Block block = p_176343_0_.func_177230_c(); - -- if (block == Blocks.field_150488_af) -+ IBlockState state = world.func_180495_p(pos); -+ if (state.func_177230_c() == Blocks.field_150488_af) + if (block == Blocks.field_150488_af) { return true; } -- else if (Blocks.field_150413_aR.func_149907_e(block)) -+ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c())) +- else if (Blocks.field_150413_aR.func_185547_C(p_176343_0_)) ++ else if (Blocks.field_150413_aR.func_185547_C(blockState)) { -- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N); +- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_185512_D); - return enumfacing == p_176343_1_ || enumfacing.func_176734_d() == p_176343_1_; -+ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N); -+ return direction == side || direction.func_176734_d() == side; ++ EnumFacing enumfacing = (EnumFacing)blockState.func_177229_b(BlockRedstoneRepeater.field_185512_D); ++ return enumfacing == side || enumfacing.func_176734_d() == side; } else { -- return block.func_149744_f() && p_176343_1_ != null; -+ return state.func_177230_c().canConnectRedstone(world, pos, side); +- return p_176343_0_.func_185897_m() && p_176343_1_ != null; ++ return blockState.func_177230_c().canConnectRedstone(blockState, world, pos, side); } } diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index 95f05667f..3fccec1b8 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockReed.java +++ ../src-work/minecraft/net/minecraft/block/BlockReed.java -@@ -18,7 +18,7 @@ +@@ -19,7 +19,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -8,20 +8,22 @@ +public class BlockReed extends Block implements net.minecraftforge.common.IPlantable { public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15); + protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D); +@@ -69,7 +69,9 @@ -@@ -65,6 +65,7 @@ public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { - Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c(); -+ if (block.canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true; +- Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c(); ++ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); ++ Block block = state.func_177230_c(); ++ if (block.canSustainPlant(state, p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true; if (block == this) { -@@ -164,4 +165,15 @@ - { - return new BlockState(this, new IProperty[] {field_176355_a}); +@@ -162,6 +164,17 @@ + return ((Integer)p_176201_1_.func_177229_b(field_176355_a)).intValue(); } -+ + + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) + { @@ -32,4 +34,7 @@ + { + return this.func_176223_P(); + } - } ++ + protected BlockStateContainer func_180661_e() + { + return new BlockStateContainer(this, new IProperty[] {field_176355_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch b/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch index bd3714927..d4e280aaf 100644 --- a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java +++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java -@@ -18,4 +18,18 @@ - { +@@ -28,6 +28,21 @@ super(p_i46385_1_, p_i46385_2_); } -+ -+ public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis) + ++ @Override ++ public boolean rotateBlock(net.minecraft.world.World world, BlockPos pos, EnumFacing axis) + { + net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); + for (net.minecraft.block.properties.IProperty prop : state.func_177228_b().keySet()) @@ -18,4 +18,7 @@ + } + return false; + } - } ++ + public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) + { + switch (p_185499_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index 1bef67eb0..752aa85b6 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSapling.java +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java -@@ -71,6 +71,7 @@ +@@ -77,6 +77,7 @@ public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_) { diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index 3ec9807b9..a7327502a 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSkull.java +++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java -@@ -121,10 +121,6 @@ - return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_); +@@ -116,10 +116,6 @@ + return new ItemStack(Items.field_151144_bL, 1, i); } - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) @@ -11,7 +11,7 @@ public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) { if (p_176208_4_.field_71075_bZ.field_75098_d) -@@ -132,13 +128,18 @@ +@@ -127,22 +123,27 @@ p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true)); p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4); } @@ -25,22 +25,25 @@ - if (!p_180663_1_.field_72995_K) + super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); + } -+ public java.util.List getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune) ++ public java.util.List getDrops(IBlockAccess worldIn, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = new java.util.ArrayList(); { - if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue()) +- if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue()) ++ if (!((Boolean)state.func_177229_b(field_176417_b)).booleanValue()) { -@@ -147,7 +148,7 @@ +- TileEntity tileentity = p_180663_1_.func_175625_s(p_180663_2_); ++ TileEntity tileentity = worldIn.func_175625_s(pos); + if (tileentity instanceof TileEntitySkull) { TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; -- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_)); +- ItemStack itemstack = this.func_185473_a(p_180663_1_, p_180663_2_, p_180663_3_); + ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a()); if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) { -@@ -157,12 +158,11 @@ +@@ -152,12 +153,11 @@ itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound); } diff --git a/patches/minecraft/net/minecraft/block/BlockSlab.java.patch b/patches/minecraft/net/minecraft/block/BlockSlab.java.patch index 56f1865a1..0acded708 100644 --- a/patches/minecraft/net/minecraft/block/BlockSlab.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSlab.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSlab.java +++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java -@@ -91,6 +91,17 @@ +@@ -50,6 +50,17 @@ return this.func_176552_j(); } + @Override -+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ if ( func_149662_c() ) ++ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) ++ { ++ if ( state.func_185914_p() ) + return true; -+ ++ + // face is on the block being rendered, not this block. + EnumBlockHalf side = world.func_180495_p(pos).func_177229_b(field_176554_a); + return (side == EnumBlockHalf.TOP && face == EnumFacing.DOWN) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.UP); @@ -18,21 +18,19 @@ public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) { IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM); -@@ -118,15 +129,8 @@ +@@ -77,13 +88,14 @@ { return false; } - else -- { -- BlockPos blockpos = p_176225_2_.func_177972_a(p_176225_3_.func_176734_d()); -- IBlockState iblockstate = p_176225_1_.func_180495_p(p_176225_2_); -- IBlockState iblockstate1 = p_176225_1_.func_180495_p(blockpos); -- boolean flag = func_150003_a(iblockstate.func_177230_c()) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP; -- boolean flag1 = func_150003_a(iblockstate1.func_177230_c()) && iblockstate1.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP; -- return flag1 ? (p_176225_3_ == EnumFacing.DOWN ? true : (p_176225_3_ == EnumFacing.UP && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_) ? true : !func_150003_a(iblockstate.func_177230_c()) || !flag)) : (p_176225_3_ == EnumFacing.UP ? true : (p_176225_3_ == EnumFacing.DOWN && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_) ? true : !func_150003_a(iblockstate.func_177230_c()) || flag)); -- } -+ // additional logic breaks doesSideBlockRendering and is no longer useful. -+ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_); ++ else if (false) // Forge: Additional logic breaks doesSideBlockRendering and is no longer useful. + { + IBlockState iblockstate = p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)); + boolean flag = func_185675_i(iblockstate) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP; + boolean flag1 = func_185675_i(p_176225_1_) && p_176225_1_.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP; + return flag1 ? (p_176225_4_ == EnumFacing.DOWN ? true : (p_176225_4_ == EnumFacing.UP && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_) ? true : !func_185675_i(iblockstate) || !flag)) : (p_176225_4_ == EnumFacing.UP ? true : (p_176225_4_ == EnumFacing.DOWN && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_) ? true : !func_185675_i(iblockstate) || flag)); + } ++ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_); } @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index cc8659d20..956143674 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSnow.java +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java -@@ -79,7 +79,7 @@ +@@ -73,7 +73,7 @@ { IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); Block block = iblockstate.func_177230_c(); -- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 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_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 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 ? (iblockstate.func_185904_a() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : iblockstate.func_185914_p() && iblockstate.func_185904_a().func_76230_c())) : false; ++ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (iblockstate.func_177230_c().isLeaves(iblockstate, p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : iblockstate.func_185914_p() && iblockstate.func_185904_a().func_76230_c())) : false; } public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_) -@@ -91,7 +91,6 @@ +@@ -85,7 +85,6 @@ { if (!this.func_176196_c(p_176314_1_, p_176314_2_)) { @@ -17,18 +17,18 @@ p_176314_1_.func_175698_g(p_176314_2_); return false; } -@@ -103,9 +102,8 @@ +@@ -97,9 +96,8 @@ - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { - func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0)); -+ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); ++ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); p_180657_1_.func_175698_g(p_180657_3_); -- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- p_180657_2_.func_71029_a(StatList.func_188055_a(this)); } public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) -@@ -115,14 +113,13 @@ +@@ -109,14 +107,13 @@ public int func_149745_a(Random p_149745_1_) { @@ -44,10 +44,12 @@ p_180650_1_.func_175698_g(p_180650_2_); } } -@@ -152,4 +149,6 @@ - { - return new BlockState(this, new IProperty[] {field_176315_a}); +@@ -150,6 +147,8 @@ + return ((Integer)p_176201_1_.func_177229_b(field_176315_a)).intValue() - 1; } -+ + + @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; } - } ++ + protected BlockStateContainer func_180661_e() + { + return new BlockStateContainer(this, new IProperty[] {field_176315_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockStairs.java.patch b/patches/minecraft/net/minecraft/block/BlockStairs.java.patch index dccaada1d..3f8377511 100644 --- a/patches/minecraft/net/minecraft/block/BlockStairs.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStairs.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockStairs.java +++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java -@@ -68,6 +68,19 @@ - return false; +@@ -443,6 +443,19 @@ + return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M}); } + @Override -+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ if ( func_149662_c() ) ++ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) ++ { ++ if ( state.func_185914_p() ) + return true; -+ ++ + // face is on the block being rendered, not this block. + IBlockState iblockstate = world.func_180495_p(pos); + EnumHalf half = iblockstate.func_177229_b(field_176308_b); @@ -17,6 +17,6 @@ + return side == face.func_176734_d() || (half == EnumHalf.TOP && face == EnumFacing.DOWN) || (half == EnumHalf.BOTTOM && face == EnumFacing.UP); + } + - public boolean func_149686_d() + public static enum EnumHalf implements IStringSerializable { - return false; + TOP("top"), diff --git a/patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch new file mode 100644 index 000000000..f6973261e --- /dev/null +++ b/patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockStaticLiquid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockStaticLiquid.java +@@ -52,7 +52,7 @@ + { + blockpos = blockpos.func_177982_a(p_180650_4_.nextInt(3) - 1, 1, p_180650_4_.nextInt(3) - 1); + +- if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256 && !p_180650_1_.func_175667_e(blockpos)) ++ if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < p_180650_1_.func_72800_K() && !p_180650_1_.func_175667_e(blockpos)) + { + return; + } diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 90fd806ba..2b37ff3d3 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -1,15 +1,19 @@ --- ../src-base/minecraft/net/minecraft/block/BlockStem.java +++ ../src-work/minecraft/net/minecraft/block/BlockStem.java -@@ -94,7 +94,7 @@ +@@ -89,9 +89,10 @@ + } + p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_)); - Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); +- Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); ++ IBlockState soil = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()); ++ Block block = soil.func_177230_c(); - if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) -+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) ++ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(soil, p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) { p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P()); } -@@ -148,24 +148,29 @@ +@@ -109,24 +110,29 @@ public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index e9629da02..37298ca35 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -8,17 +8,17 @@ +public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable { public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class); - -@@ -43,7 +43,7 @@ + protected static final AxisAlignedBB field_185522_c = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); +@@ -41,7 +41,7 @@ public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); +- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); + return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); } - public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_) -@@ -53,7 +53,7 @@ + public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_) +@@ -51,7 +51,7 @@ public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) { @@ -27,21 +27,16 @@ } public int func_149679_a(int p_149679_1_, Random p_149679_2_) -@@ -63,13 +63,7 @@ +@@ -61,7 +61,7 @@ - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { -- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) +- if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) ++ if (false && !p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) // Forge: Noop Taken care of by IShearable { -- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a())); -- } -- else -- { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); - } - } -@@ -204,4 +198,22 @@ + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); + func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a())); +@@ -181,4 +181,22 @@ } } } diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch index ec723e30d..2b6f02aa2 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -1,15 +1,24 @@ --- ../src-base/minecraft/net/minecraft/block/BlockTorch.java +++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java -@@ -63,7 +63,7 @@ +@@ -79,14 +79,14 @@ + + private boolean func_176594_d(World p_176594_1_, BlockPos p_176594_2_) + { +- if (p_176594_1_.func_180495_p(p_176594_2_).func_185896_q()) ++ IBlockState state = p_176594_1_.func_180495_p(p_176594_2_); ++ if (state.isSideSolid(p_176594_1_, p_176594_2_, EnumFacing.UP)) + { + return true; + } else { - Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c(); +- Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c(); - return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn; -+ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_); ++ return state.func_177230_c().canPlaceTorchOnTop(state, p_176594_1_, p_176594_2_); } } -@@ -84,7 +84,7 @@ +@@ -107,7 +107,7 @@ { BlockPos blockpos = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d()); boolean flag = p_176595_3_.func_176740_k().func_176722_c(); @@ -18,7 +27,7 @@ } public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) -@@ -97,7 +97,7 @@ +@@ -120,7 +120,7 @@ { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { @@ -27,7 +36,7 @@ { return this.func_176223_P().func_177226_a(field_176596_a, enumfacing); } -@@ -130,7 +130,7 @@ +@@ -153,7 +153,7 @@ EnumFacing enumfacing1 = enumfacing.func_176734_d(); boolean flag = false; diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch index 0eb19ae31..92f977591 100644 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -1,43 +1,21 @@ --- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java -@@ -25,6 +25,8 @@ - - public class BlockTrapDoor extends Block - { -+ /** Set this to allow trapdoors to remain free-floating */ -+ public static boolean disableValidation = false; - public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open"); - public static final PropertyEnum field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class); -@@ -140,9 +142,10 @@ - { - if (!p_176204_1_.field_72995_K) - { -+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a); - BlockPos blockpos = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d()); - -- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c())) -+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c()) || p_176204_1_.isSideSolid(blockpos, direction, true))) - { - p_176204_1_.func_175698_g(p_176204_2_); - this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0); -@@ -186,7 +189,10 @@ - - public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_) - { -- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c()); -+ if (disableValidation) return true; -+ EnumFacing dir = p_176198_3_.func_176734_d(); -+ p_176198_2_ = p_176198_2_.func_177972_a(dir); -+ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true)); +@@ -241,6 +241,18 @@ + return new BlockStateContainer(this, new IProperty[] {field_176284_a, field_176283_b, field_176285_M}); } - protected static EnumFacing func_176281_b(int p_176281_0_) -@@ -223,6 +229,7 @@ - - private static boolean func_150119_a(Block p_150119_0_) ++ @Override ++ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) ++ { ++ if (state.func_177229_b(field_176283_b)) ++ { ++ IBlockState down = world.func_180495_p(pos.func_177977_b()); ++ if (down.func_177230_c() == net.minecraft.init.Blocks.field_150468_ap) ++ return down.func_177229_b(BlockLadder.field_176382_a) == state.func_177229_b(field_176284_a); ++ } ++ return false; ++ } ++ + public static enum DoorHalf implements IStringSerializable { -+ if (disableValidation) return true; - 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; - } - + TOP("top"), diff --git a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch index 6a6ba2054..6850b831b 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch @@ -1,28 +1,28 @@ --- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java +++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java -@@ -58,14 +58,14 @@ +@@ -77,14 +77,14 @@ public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_) { -- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r(); -+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true); +- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_185915_l(); ++ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).isSideSolid(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_); } public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { -- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r()) -+ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true)) +- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_185915_l()) ++ if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).isSideSolid(p_176196_1_, p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())) { return true; } -@@ -99,7 +99,7 @@ +@@ -118,7 +118,7 @@ { EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a); -- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r()) -+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true)) +- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_185915_l()) ++ if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).isSideSolid(p_176204_1_, p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing)) { this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0); p_176204_1_.func_175698_g(p_176204_2_); diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index e64d0dd18..f4f42e06c 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockVine.java +++ ../src-work/minecraft/net/minecraft/block/BlockVine.java -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -9,26 +9,21 @@ { public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up"); public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north"); -@@ -387,13 +387,7 @@ +@@ -342,7 +342,7 @@ - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_) { -- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) +- if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) ++ if (false && !p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) // Forge: Noop, Covered by IShearable { -- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0)); -- } -- else -- { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); - } - } -@@ -474,4 +468,14 @@ + p_180657_2_.func_71029_a(StatList.func_188055_a(this)); + func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0)); +@@ -457,4 +457,14 @@ return i; } + /*************************FORGE START***********************************/ -+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; } ++ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; } + @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } + @Override + public java.util.List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) diff --git a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch index 9b66c108c..7d8c10310 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch +++ b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch @@ -1,29 +1,29 @@ --- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java +++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java -@@ -78,7 +78,7 @@ - { - Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c(); +@@ -80,7 +80,7 @@ + IBlockState iblockstate = this.field_177261_a.func_180495_p(p_177251_1_); + Block block = iblockstate.func_177230_c(); -- if (block.func_149688_o() == Material.field_151579_a) -+ if (block.isAir(field_177261_a, p_177251_1_)) +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, p_177251_1_)) { return true; } -@@ -109,7 +109,7 @@ - BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i); - block = this.field_177261_a.func_180495_p(blockpos).func_177230_c(); +@@ -112,7 +112,7 @@ + iblockstate = this.field_177261_a.func_180495_p(blockpos); + block = iblockstate.func_177230_c(); -- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) -+ if (block.isAir(field_177261_a, blockpos)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) +- if (iblockstate.func_185904_a() == Material.field_151579_a || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos) || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) { break; } -@@ -156,7 +156,7 @@ +@@ -159,7 +159,7 @@ - block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c(); + iblockstate = this.field_177261_a.func_180495_p(blockpos1); -- if (block.func_149688_o() == Material.field_151579_a) -+ if (block.isAir(field_177261_a, blockpos1)) +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos1)) { return true; } diff --git a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch b/patches/minecraft/net/minecraft/block/state/BlockState.java.patch deleted file mode 100644 index 8d775ed11..000000000 --- a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockState.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java -@@ -38,6 +38,16 @@ - - public BlockState(Block p_i45663_1_, IProperty... p_i45663_2_) - { -+ this(p_i45663_1_, p_i45663_2_, null); -+ } -+ -+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) -+ { -+ return new StateImplementation(block, properties); -+ } -+ -+ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap, com.google.common.base.Optional> unlistedProperties) -+ { - this.field_177627_c = p_i45663_1_; - Arrays.sort(p_i45663_2_, new Comparator() - { -@@ -53,7 +63,7 @@ - for (List list1 : Cartesian.func_179321_a(this.func_177620_e())) - { - Map map1 = MapPopulator.func_179400_b(this.field_177624_d, list1); -- BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1)); -+ BlockState.StateImplementation blockstate$stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map1), unlistedProperties); - map.put(map1, blockstate$stateimplementation); - list.add(blockstate$stateimplementation); - } -@@ -132,6 +142,13 @@ - } - } - -+ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) -+ { -+ this.field_177239_a = blockIn; -+ this.field_177237_b = propertiesIn; -+ this.field_177238_c = propertyValueTable; -+ } -+ - public , V extends T> IBlockState func_177226_a(IProperty p_177226_1_, V p_177226_2_) - { - if (!this.field_177237_b.containsKey(p_177226_1_)) -@@ -199,5 +216,10 @@ - map.put(p_177236_1_, p_177236_2_); - return map; - } -+ -+ public ImmutableTable getPropertyValueTable() -+ { -+ return field_177238_c; -+ } - } - } diff --git a/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch b/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch index a8c502863..e6d4fff7f 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch +++ b/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java +++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java -@@ -67,4 +67,9 @@ +@@ -71,4 +71,9 @@ return stringbuilder.toString(); } -+ -+ public com.google.common.collect.ImmutableTable getPropertyValueTable() ++ ++ public com.google.common.collect.ImmutableTable, Comparable, IBlockState> getPropertyValueTable() + { + return null; + } diff --git a/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch b/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch new file mode 100644 index 000000000..8b119b7e2 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/block/state/BlockStateContainer.java ++++ ../src-work/minecraft/net/minecraft/block/state/BlockStateContainer.java +@@ -55,12 +55,22 @@ + + public BlockStateContainer(Block p_i45663_1_, IProperty... p_i45663_2_) + { +- this.field_177627_c = p_i45663_1_; ++ this(p_i45663_1_, p_i45663_2_, null); ++ } ++ ++ protected StateImplementation createState(Block block, ImmutableMap, Comparable> properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) ++ { ++ return new StateImplementation(block, properties); ++ } ++ ++ protected BlockStateContainer(Block blockIn, IProperty[] properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) ++ { ++ this.field_177627_c = blockIn; + Map < String, IProperty> map = Maps. < String, IProperty> newHashMap(); + +- for (IProperty iproperty : p_i45663_2_) ++ for (IProperty iproperty : properties) + { +- func_185919_a(p_i45663_1_, iproperty); ++ func_185919_a(blockIn, iproperty); + map.put(iproperty.func_177701_a(), iproperty); + } + +@@ -71,7 +81,7 @@ + for (List < Comparable> list : Cartesian.func_179321_a(this.func_177620_e())) + { + Map < IProperty, Comparable> map1 = MapPopulator. < IProperty, Comparable> func_179400_b(this.field_177624_d.values(), list); +- BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = new BlockStateContainer.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1)); ++ BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties); + map2.put(map1, blockstatecontainer$stateimplementation); + list1.add(blockstatecontainer$stateimplementation); + } +@@ -163,6 +173,13 @@ + this.field_177237_b = p_i45660_2_; + } + ++ protected StateImplementation(Block blockIn, ImmutableMap, Comparable> propertiesIn, ImmutableTable, Comparable, IBlockState> propertyValueTable) ++ { ++ this.field_177239_a = blockIn; ++ this.field_177237_b = propertiesIn; ++ this.field_177238_c = propertyValueTable; ++ } ++ + public Collection < IProperty> func_177227_a() + { + return Collections. < IProperty> unmodifiableCollection(this.field_177237_b.keySet()); +@@ -414,5 +431,34 @@ + { + return this.field_177239_a.func_185481_k(this); + } ++ ++ //Forge Start ++ public ImmutableTable, Comparable, IBlockState> getPropertyValueTable() ++ { ++ return field_177238_c; ++ } ++ ++ @Override ++ public int getLightOpacity(IBlockAccess world, BlockPos pos) ++ { ++ return this.field_177239_a.getLightOpacity(this, world, pos); ++ } ++ ++ @Override ++ public int getLightValue(IBlockAccess world, BlockPos pos) ++ { ++ return this.field_177239_a.getLightValue(this, world, pos); ++ } ++ ++ public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) ++ { ++ return this.field_177239_a.isSideSolid(this, world, pos, side); ++ } ++ ++ @Override ++ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side) ++ { ++ return this.field_177239_a.doesSideBlockRendering(this, world, pos, side); ++ } + } + } diff --git a/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch b/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch new file mode 100644 index 000000000..e90318ea8 --- /dev/null +++ b/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/block/state/IBlockProperties.java ++++ ../src-work/minecraft/net/minecraft/block/state/IBlockProperties.java +@@ -25,9 +25,13 @@ + + boolean func_185913_b(); + ++ @Deprecated //Forge location aware version below + int func_185891_c(); ++ int getLightOpacity(IBlockAccess world, BlockPos pos); + ++ @Deprecated //Forge location aware version below + int func_185906_d(); ++ int getLightValue(IBlockAccess world, BlockPos pos); + + @SideOnly(Side.CLIENT) + boolean func_185895_e(); +@@ -88,5 +92,10 @@ + + RayTraceResult func_185910_a(World p_185910_1_, BlockPos p_185910_2_, Vec3d p_185910_3_, Vec3d p_185910_4_); + ++ @Deprecated // Forge: Use isSideSolid(IBlockAccess, BlockPos, EnumFacing.UP) instead + boolean func_185896_q(); ++ ++ //Forge added functions ++ boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side); ++ boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side); + } diff --git a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch b/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch index 2d8b6e47e..176c16474 100644 --- a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch @@ -9,10 +9,10 @@ + if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering + { Tessellator tessellator = Tessellator.func_178181_a(); - WorldRenderer worldrenderer = tessellator.func_178180_c(); + VertexBuffer vertexbuffer = tessellator.func_178180_c(); this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k); @@ -174,6 +178,12 @@ - GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215); this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215); + } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 30d858ec0..8a29254d6 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/client/Minecraft.java +++ ../src-work/minecraft/net/minecraft/client/Minecraft.java -@@ -301,7 +301,6 @@ - this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService(); +@@ -318,7 +318,6 @@ + this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService(); this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a; field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a()); - field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")"); this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a; this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1; this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1; -@@ -415,10 +414,10 @@ +@@ -432,10 +431,10 @@ this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an); this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab); this.field_110451_am.func_110542_a(this.field_135017_as); @@ -18,10 +18,10 @@ this.field_110451_am.func_110542_a(this.field_71446_o); - this.func_180510_a(this.field_71446_o); + net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.field_71446_o); - this.func_175595_al(); this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az); - this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves")); -@@ -453,6 +452,8 @@ + this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U); + this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y); +@@ -469,6 +468,8 @@ } }); this.field_71417_B = new MouseHelper(); @@ -30,13 +30,13 @@ this.func_71361_d("Pre startup"); GlStateManager.func_179098_w(); GlStateManager.func_179103_j(7425); -@@ -466,17 +467,21 @@ +@@ -482,19 +483,23 @@ GlStateManager.func_179096_D(); GlStateManager.func_179128_n(5888); this.func_71361_d("Startup"); - this.field_147128_au = new TextureMap("textures"); + bar.step("Loading Texture Map"); -+ this.field_147128_au = new TextureMap("textures",true); ++ this.field_147128_au = new TextureMap("textures", true); this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I); this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au); this.field_71446_o.func_110577_a(TextureMap.field_110575_b); @@ -44,16 +44,18 @@ + bar.step("Loading Model Manager"); this.field_175617_aL = new ModelManager(this.field_147128_au); this.field_110451_am.func_110542_a(this.field_175617_aL); + this.field_184127_aH = BlockColors.func_186723_a(); + this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH); + bar.step("Loading Item Renderer"); - this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL); + this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI); this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X); this.field_175620_Y = new ItemRenderer(this); this.field_110451_am.func_110542_a(this.field_175621_X); + bar.step("Loading Entity Renderer"); this.field_71460_t = new EntityRenderer(this, this.field_110451_am); this.field_110451_am.func_110542_a(this.field_71460_t); - this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_71474_y); -@@ -486,22 +491,25 @@ + this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH); +@@ -504,23 +509,26 @@ this.field_71458_u = new GuiAchievement(this); GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d); this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o); @@ -77,12 +79,13 @@ + net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay); this.field_152354_ay = null; this.field_71461_s = new LoadingScreenRenderer(this); + this.field_184132_p = new DebugRenderer(this); + net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete(); if (this.field_71474_y.field_74353_u && !this.field_71431_Q) { this.func_71352_k(); -@@ -681,21 +689,23 @@ +@@ -692,21 +700,23 @@ File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); Bootstrap.func_179870_a(p_71377_1_.func_71502_e()); @@ -109,7 +112,7 @@ } public boolean func_152349_b() -@@ -883,11 +893,6 @@ +@@ -899,11 +909,6 @@ public void func_147108_a(GuiScreen p_147108_1_) { @@ -121,8 +124,8 @@ if (p_147108_1_ == null && this.field_71441_e == null) { p_147108_1_ = new GuiMainMenu(); -@@ -897,6 +902,17 @@ - p_147108_1_ = new GuiGameOver(); +@@ -913,6 +918,17 @@ + p_147108_1_ = new GuiGameOver((ITextComponent)null); } + GuiScreen old = this.field_71462_r; @@ -136,10 +139,10 @@ + old.func_146281_b(); + } + - if (p_147108_1_ instanceof GuiMainMenu) + if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) { this.field_71474_y.field_74330_P = false; -@@ -1030,9 +1046,11 @@ +@@ -1051,9 +1067,11 @@ if (!this.field_71454_w) { @@ -151,47 +154,28 @@ } this.field_71424_I.func_76319_b(); -@@ -1377,7 +1395,7 @@ +@@ -1393,9 +1411,9 @@ + { + BlockPos blockpos = this.field_71476_x.func_178782_a(); - if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) +- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) ++ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) { - this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b); + this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x); - this.field_71439_g.func_71038_i(); + this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND); } } -@@ -1463,15 +1481,19 @@ +@@ -1429,7 +1447,7 @@ case BLOCK: BlockPos blockpos = this.field_71476_x.func_178782_a(); -- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a) +- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) + if (!this.field_71441_e.func_175623_d(blockpos)) { - int i = itemstack != null ? itemstack.field_77994_a : 0; - -+ -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f).isCanceled(); -+ if (result) { //Forge: Kept separate to simplify patch - if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f)) - { - flag = false; - this.field_71439_g.func_71038_i(); - } -+ } - - if (itemstack == null) - { -@@ -1494,7 +1516,8 @@ - { - ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g(); - -- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, field_71441_e, null, null, null).isCanceled(); -+ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) - { - this.field_71460_t.field_78516_c.func_78445_c(); - } -@@ -1598,6 +1621,8 @@ + this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b); + break; +@@ -1623,6 +1641,8 @@ --this.field_71467_ac; } @@ -200,40 +184,40 @@ this.field_71424_I.func_76320_a("gui"); if (!this.field_71445_n) -@@ -1690,6 +1715,8 @@ - - while (Mouse.next()) - { -+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; -+ - int i = Mouse.getEventButton(); - KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState()); - -@@ -1745,6 +1772,7 @@ - this.field_71462_r.func_146274_d(); - } +@@ -1734,6 +1754,7 @@ + this.field_71457_ai = 0; + this.field_71441_e.func_72897_h(this.field_71439_g); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput(); } - if (this.field_71429_W > 0) -@@ -1923,6 +1951,7 @@ - } - } - } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput(); - } - - for (int l = 0; l < 9; ++l) -@@ -2119,12 +2148,15 @@ + this.field_71424_I.func_76318_c("gameRenderer"); +@@ -1821,6 +1842,7 @@ this.field_71453_ak.func_74428_b(); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick(); -+ this.field_71424_I.func_76319_b(); this.field_71423_H = func_71386_F(); } +@@ -1926,6 +1948,7 @@ + this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s(); + } + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput(); + } + } + +@@ -2166,6 +2189,8 @@ + { + while (Mouse.next()) + { ++ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; ++ + int i = Mouse.getEventButton(); + KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState()); + +@@ -2231,6 +2256,7 @@ public void func_71371_a(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_) { @@ -241,7 +225,7 @@ this.func_71403_a((WorldClient)null); System.gc(); ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false); -@@ -2160,6 +2192,12 @@ +@@ -2273,6 +2299,12 @@ while (!this.field_71437_Z.func_71200_ad()) { @@ -254,24 +238,24 @@ String s = this.field_71437_Z.func_71195_b_(); if (s != null) -@@ -2185,8 +2223,14 @@ +@@ -2298,8 +2330,14 @@ SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a(); NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress); networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); -- networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); -- networkmanager.func_179290_a(new C00PacketLoginStart(this.func_110432_I().func_148256_e())); -+ networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); +- networkmanager.func_179290_a(new C00Handshake(107, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); +- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e())); ++ networkmanager.func_179290_a(new C00Handshake(107, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); + com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e(); + if (!this.func_110432_I().hasCachedProperties()) + { + gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. + this.func_110432_I().setProperties(gameProfile.getProperties()); + } -+ networkmanager.func_179290_a(new C00PacketLoginStart(gameProfile)); ++ networkmanager.func_179290_a(new CPacketLoginStart(gameProfile)); this.field_71453_ak = networkmanager; } -@@ -2197,6 +2241,8 @@ +@@ -2310,6 +2348,8 @@ public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_) { @@ -280,10 +264,10 @@ if (p_71353_1_ == null) { NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); -@@ -2210,6 +2256,18 @@ +@@ -2322,6 +2362,18 @@ + if (this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) { this.field_71437_Z.func_71263_m(); - this.field_71437_Z.func_175592_a(); + if (field_71461_s != null) + { + this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal")); @@ -299,7 +283,7 @@ } this.field_71437_Z = null; -@@ -2232,6 +2290,7 @@ +@@ -2345,6 +2397,7 @@ this.field_71456_v.func_181029_i(); this.func_71351_a((ServerData)null); this.field_71455_al = false; @@ -307,77 +291,72 @@ } this.field_147127_av.func_147690_c(); -@@ -2336,126 +2395,10 @@ - if (this.field_71476_x != null) +@@ -2461,159 +2514,8 @@ + { + if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) { - boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; -- int i = 0; -- boolean flag1 = false; +- boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; - TileEntity tileentity = null; -- Item item; +- ItemStack itemstack; - -- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) +- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) - { - BlockPos blockpos = this.field_71476_x.func_178782_a(); -- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c(); +- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos); +- Block block = iblockstate.func_177230_c(); - -- if (block.func_149688_o() == Material.field_151579_a) +- if (iblockstate.func_185904_a() == Material.field_151579_a) - { - return; - } - -- item = block.func_180665_b(this.field_71441_e, blockpos); +- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate); - -- if (item == null) +- if (itemstack == null) - { - return; - } - -- if (flag && GuiScreen.func_146271_m()) +- if (flag && GuiScreen.func_146271_m() && block.func_149716_u()) - { - tileentity = this.field_71441_e.func_175625_s(blockpos); - } -- -- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block; -- i = block1.func_176222_j(this.field_71441_e, blockpos); -- flag1 = item.func_77614_k(); - } - else - { -- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag) +- if (this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !flag) - { - return; - } - - if (this.field_71476_x.field_72308_g instanceof EntityPainting) - { -- item = Items.field_151159_an; +- itemstack = new ItemStack(Items.field_151159_an); - } - else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) - { -- item = Items.field_151058_ca; +- itemstack = new ItemStack(Items.field_151058_ca); - } - else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) - { - EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g; -- ItemStack itemstack = entityitemframe.func_82335_i(); +- ItemStack itemstack1 = entityitemframe.func_82335_i(); - -- if (itemstack == null) +- if (itemstack1 == null) - { -- item = Items.field_151160_bD; +- itemstack = new ItemStack(Items.field_151160_bD); - } - else - { -- item = itemstack.func_77973_b(); -- i = itemstack.func_77960_j(); -- flag1 = true; +- itemstack = ItemStack.func_77944_b(itemstack1); - } - } - else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) - { - EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g; +- Item item; - -- switch (entityminecart.func_180456_s()) +- switch (entityminecart.func_184264_v()) - { - case FURNACE: - item = Items.field_151109_aJ; @@ -397,53 +376,91 @@ - default: - item = Items.field_151143_au; - } +- +- itemstack = new ItemStack(item); - } - else if (this.field_71476_x.field_72308_g instanceof EntityBoat) - { -- item = Items.field_151124_az; +- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j()); - } - else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand) - { -- item = Items.field_179565_cj; +- itemstack = new ItemStack(Items.field_179565_cj); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) +- { +- itemstack = new ItemStack(Items.field_185158_cP); - } - else - { -- item = Items.field_151063_bx; -- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g); -- flag1 = true; +- String s = EntityList.func_75621_b(this.field_71476_x.field_72308_g); - -- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i))) +- if (!EntityList.field_75627_a.containsKey(s)) - { - return; - } +- +- itemstack = new ItemStack(Items.field_151063_bx); +- ItemMonsterPlacer.func_185078_a(itemstack, s); - } - } - - InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by; - -- if (tileentity == null) +- if (itemstack.func_77973_b() == null) - { -- inventoryplayer.func_146030_a(item, i, flag1, flag); +- String s1 = ""; +- +- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) +- { +- s1 = ((ResourceLocation)Block.field_149771_c.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c())).toString(); +- } +- else if (this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) +- { +- s1 = EntityList.func_75621_b(this.field_71476_x.field_72308_g); +- } +- +- field_147123_G.warn("Picking on: [{}] {} gave null item", new Object[] {this.field_71476_x.field_72313_a, s1}); - } - else - { -- ItemStack itemstack1 = this.func_181036_a(item, i, tileentity); -- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1); -- } +- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by; - -+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return; +- if (tileentity != null) +- { +- this.func_184119_a(itemstack, tileentity); +- } +- +- int i = inventoryplayer.func_184429_b(itemstack); +- +- if (flag) +- { +- inventoryplayer.func_184434_a(itemstack); +- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c); +- } +- else if (i != -1) +- { +- if (InventoryPlayer.func_184435_e(i)) +- { +- inventoryplayer.field_70461_c = i; +- } +- else +- { +- this.field_71442_b.func_187100_a(i); +- } +- } +- } ++ net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e); + // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions - if (flag) - { - int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c; -@@ -2756,18 +2699,8 @@ + } + } + +@@ -2909,18 +2811,8 @@ public static int func_71369_N() { - 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)((ByteBuffer)null)); -- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); +- GlStateManager.func_187419_a(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null); +- int j = GlStateManager.func_187411_c(32868, 0, 4096); - - if (j != 0) - { @@ -457,15 +474,3 @@ } public boolean func_70002_Q() -@@ -2924,9 +2857,9 @@ - { - this.func_147108_a(new GuiYesNo(new GuiYesNoCallback() - { -- public void func_73878_a(boolean p_73878_1_, int p_73878_2_) -+ public void func_73878_a(boolean result, int id) - { -- if (p_73878_1_) -+ if (result) - { - Minecraft.this.func_152346_Z().func_152930_t(); - } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index 90c31e791..c5d7b20ef 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java +++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java -@@ -69,6 +69,7 @@ +@@ -76,6 +76,7 @@ { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); @@ -8,34 +8,34 @@ } catch (SoundSystemException soundsystemexception) { -@@ -80,6 +81,7 @@ - { +@@ -100,6 +101,7 @@ + this.func_148613_b(); this.func_148608_i(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this)); } private synchronized void func_148608_i() -@@ -316,6 +318,9 @@ +@@ -350,6 +352,9 @@ } else { + p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_); + if (p_148611_1_ == null) return; + - SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b()); - - if (soundeventaccessorcomposite == null) -@@ -357,10 +362,12 @@ - if (soundpoolentry.func_148648_d()) + if (!this.field_188777_o.isEmpty()) + { + for (ISoundEventListener isoundeventlistener : this.field_188777_o) +@@ -400,10 +405,12 @@ + if (sound.func_188723_h()) { - this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); + this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, p_148611_1_, s)); } else { - this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); + this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, p_148611_1_, s)); } - field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.func_148652_a(), soundeventaccessorcomposite.func_148729_c(), s}); + field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {sound.func_188719_a(), resourcelocation1, s}); diff --git a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch b/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch index 840d193e0..74fca0297 100644 --- a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java +++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java -@@ -128,6 +128,6 @@ +@@ -148,6 +148,6 @@ f *= 1.0F - f1 * 0.15F; } diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index 8182064b7..df0c1af3d 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java -@@ -345,6 +345,15 @@ +@@ -400,6 +400,15 @@ this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_); } @@ -16,7 +16,7 @@ protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) { if (this.field_70145_X) -@@ -357,30 +366,34 @@ +@@ -412,30 +421,34 @@ double d0 = p_145771_1_ - (double)blockpos.func_177958_n(); double d1 = p_145771_5_ - (double)blockpos.func_177952_p(); @@ -56,16 +56,18 @@ { d2 = 1.0D - d1; i = 5; -@@ -448,6 +461,12 @@ +@@ -515,7 +528,13 @@ - public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_) + public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_85030_1_, p_85030_2_, p_85030_3_); -+ if (event.isCanceled() || event.name == null) return; -+ p_85030_1_ = event.name; -+ p_85030_2_ = event.newVolume; -+ p_85030_3_ = event.newPitch; +- this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false); ++ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_); ++ if (event.isCanceled() || event.getSound() == null) return; ++ p_184185_1_ = event.getSound(); ++ p_184185_2_ = event.getVolume(); ++ p_184185_3_ = event.getPitch(); + - this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false); ++ this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, event.getCategory(), p_184185_2_, p_184185_3_, false); } + public boolean func_70613_aW() diff --git a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch b/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch index 1e1f1185d..284b9d37a 100644 --- a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch @@ -17,25 +17,25 @@ } private void func_111272_d() -@@ -105,7 +106,7 @@ +@@ -106,7 +107,7 @@ try { -- bufferedimage = TextureUtil.func_177053_a(Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g).func_110527_b()); -+ bufferedimage = TextureUtil.func_177053_a(getResourceInputStream(this.field_111273_g)); +- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g); ++ iresource = getResource(this.field_111273_g); + bufferedimage = TextureUtil.func_177053_a(iresource.func_110527_b()); } catch (IOException ioexception) - { -@@ -165,7 +166,7 @@ +@@ -171,7 +172,7 @@ try { -- inputstream = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")).func_110527_b(); -+ inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); - inputstream.read(this.field_78287_e); +- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")); ++ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin")); + iresource.func_110527_b().read(this.field_78287_e); } catch (IOException ioexception) -@@ -196,7 +197,7 @@ +@@ -202,7 +203,7 @@ int i = p_78266_1_ % 16 * 8; int j = p_78266_1_ / 16 * 8; int k = p_78266_2_ ? 1 : 0; @@ -43,8 +43,8 @@ + bindTexture(this.field_111273_g); int l = this.field_78286_d[p_78266_1_]; float f = (float)l - 0.01F; - GL11.glBegin(GL11.GL_TRIANGLE_STRIP); -@@ -224,7 +225,7 @@ + GlStateManager.func_187447_r(5); +@@ -230,7 +231,7 @@ private void func_78257_a(int p_78257_1_) { @@ -53,7 +53,7 @@ } protected float func_78277_a(char p_78277_1_, boolean p_78277_2_) -@@ -271,7 +272,7 @@ +@@ -279,7 +280,7 @@ public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_) { @@ -62,7 +62,7 @@ this.func_78265_b(); int i; -@@ -341,7 +342,7 @@ +@@ -349,7 +350,7 @@ int j1 = this.field_78285_g[i1]; this.field_78304_r = j1; @@ -71,7 +71,7 @@ } else if (i1 == 16) { -@@ -370,7 +371,7 @@ +@@ -378,7 +379,7 @@ this.field_78299_w = false; this.field_78300_v = false; this.field_78301_u = false; @@ -80,7 +80,7 @@ } ++i; -@@ -398,7 +399,7 @@ +@@ -406,7 +407,7 @@ c0 = c1; } @@ -89,7 +89,7 @@ boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_; if (flag) -@@ -436,7 +437,16 @@ +@@ -444,7 +445,16 @@ ++f; } @@ -106,7 +106,7 @@ if (this.field_78299_w) { Tessellator tessellator = Tessellator.func_178181_a(); -@@ -509,7 +519,7 @@ +@@ -517,7 +527,7 @@ this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F; this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F; this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F; @@ -115,19 +115,7 @@ this.field_78295_j = p_180455_2_; this.field_78296_k = p_180455_3_; this.func_78255_a(p_180455_1_, p_180455_5_); -@@ -588,11 +598,6 @@ - int j = this.field_78287_e[p_78263_1_] >>> 4; - int k = this.field_78287_e[p_78263_1_] & 15; - -- if (k > 7) -- { -- k = 15; -- j = 0; -- } - - ++k; - return (k - j) / 2 + 1; -@@ -846,6 +851,26 @@ +@@ -848,6 +858,26 @@ return this.field_78294_m; } @@ -146,11 +134,11 @@ + field_78298_i.func_110577_a(location); + } + -+ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException ++ protected IResource getResource(ResourceLocation location) throws IOException + { -+ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location).func_110527_b(); ++ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location); + } + public int func_175064_b(char p_175064_1_) { - return this.field_78285_g["0123456789abcdef".indexOf(p_175064_1_)]; + int i = "0123456789abcdef".indexOf(p_175064_1_); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch index b212709d6..4d2f4ad58 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java -@@ -21,6 +21,7 @@ +@@ -22,6 +22,7 @@ public boolean field_146124_l; public boolean field_146125_m; protected boolean field_146123_n; @@ -8,7 +8,7 @@ public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) { -@@ -74,6 +75,11 @@ +@@ -75,6 +76,11 @@ this.func_146119_b(p_146112_1_, p_146112_2_, p_146112_3_); int j = 14737632; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch index 799a580d0..afbde6baf 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch @@ -1,39 +1,10 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java -@@ -215,13 +215,14 @@ - this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1); - } +@@ -250,6 +250,7 @@ -- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); -+ this.field_146415_a.func_146191_b(net.minecraft.util.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_) - { - if (p_146405_1_.length() >= 1) - { -+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); - BlockPos blockpos = null; - - if (this.field_146297_k.field_71476_x != null && this.field_146297_k.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) -@@ -281,6 +282,12 @@ - this.field_146417_i = false; - this.field_146412_t.clear(); - -+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; -+ if (complete != null) -+ { -+ p_146406_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_146406_1_, String.class); -+ } + public BlockPos func_186839_b() + { + - for (String s : p_146406_1_) - { - if (s.length() > 0) -@@ -291,6 +298,7 @@ + BlockPos blockpos = null; - String s1 = this.field_146415_a.func_146179_b().substring(this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false)); - String s2 = StringUtils.getCommonPrefix(p_146406_1_); -+ s2 = net.minecraft.util.EnumChatFormatting.func_110646_a(s2); - - if (s2.length() > 0 && !s1.equalsIgnoreCase(s2)) - { + if (this.field_186853_g.field_71476_x != null && this.field_186853_g.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index 4f9d297f4..5261e6fa9 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -6,10 +6,10 @@ + WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress(); + - WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.func_77142_a(this.field_146342_r); - WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); + WorldSettings worldsettings = new WorldSettings(i, WorldSettings.GameType.func_77142_a(this.field_146342_r), this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); worldsettings.func_82750_a(this.field_146334_a); -@@ -312,14 +314,7 @@ + +@@ -311,14 +313,7 @@ } else if (p_146284_1_.field_146127_k == 8) { @@ -25,7 +25,7 @@ } } } -@@ -371,7 +366,7 @@ +@@ -370,7 +365,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; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch new file mode 100644 index 000000000..fea4f6066 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java +@@ -360,7 +360,8 @@ + + BlockPos blockpos = raytraceresult.func_178782_a(); + +- if (!this.field_73839_d.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149716_u() || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) ++ net.minecraft.block.state.IBlockState state = this.field_73839_d.field_71441_e.func_180495_p(blockpos); ++ if (!state.func_177230_c().hasTileEntity(state) || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) + { + return; + } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch new file mode 100644 index 000000000..67dff1d65 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java +@@ -242,7 +242,7 @@ + + if (this.field_186784_e.func_71359_d().func_90033_f(this.field_186786_g.func_75786_a())) + { +- this.field_186784_e.func_71371_a(this.field_186786_g.func_75786_a(), this.field_186786_g.func_75788_b(), (WorldSettings)null); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(field_186785_f, this.field_186786_g); + } + } + diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 76e92d827..08c531721 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java -@@ -223,7 +223,8 @@ +@@ -216,7 +216,8 @@ { this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, p_73969_1_, I18n.func_135052_a("menu.singleplayer", new Object[0]))); this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135052_a("menu.multiplayer", new Object[0]))); @@ -10,7 +10,7 @@ } private void func_73972_b(int p_73972_1_, int p_73972_2_) -@@ -271,6 +272,11 @@ +@@ -264,6 +265,11 @@ this.field_146297_k.func_71400_g(); } @@ -22,8 +22,8 @@ if (p_146284_1_.field_146127_k == 11) { this.field_146297_k.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a); -@@ -516,7 +522,16 @@ - s = s + " Demo"; +@@ -512,7 +518,16 @@ + s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d()); } - this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch index 0841e6d3c..689452fc8 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java -@@ -176,6 +176,9 @@ +@@ -190,6 +190,9 @@ long l = j - k; - List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)}); + List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.func_187416_u(7936)}), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938)}); + list.add(""); + list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false)); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index 1a343c6f6..329f40f34 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java -@@ -143,7 +143,8 @@ +@@ -141,7 +141,8 @@ } } @@ -10,7 +10,7 @@ } protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) -@@ -153,6 +154,11 @@ +@@ -151,6 +152,11 @@ protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) { @@ -22,7 +22,7 @@ if (!p_146283_1_.isEmpty()) { GlStateManager.func_179101_C(); -@@ -163,7 +169,7 @@ +@@ -161,7 +167,7 @@ for (String s : p_146283_1_) { @@ -31,7 +31,7 @@ if (j > i) { -@@ -208,7 +214,7 @@ +@@ -206,7 +212,7 @@ for (int k1 = 0; k1 < p_146283_1_.size(); ++k1) { String s1 = (String)p_146283_1_.get(k1); @@ -40,7 +40,7 @@ if (k1 == 0) { -@@ -436,6 +442,7 @@ +@@ -421,6 +427,7 @@ { this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_); } @@ -48,7 +48,7 @@ this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_); } -@@ -450,9 +457,15 @@ +@@ -435,9 +442,15 @@ if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_)) { @@ -64,7 +64,7 @@ } } } -@@ -482,8 +495,12 @@ +@@ -467,8 +480,12 @@ this.field_146289_q = p_146280_1_.field_71466_p; this.field_146294_l = p_146280_2_; this.field_146295_m = p_146280_3_; @@ -77,7 +77,7 @@ } public void func_183500_a(int p_183500_1_, int p_183500_2_) -@@ -502,7 +519,9 @@ +@@ -487,7 +504,9 @@ { while (Mouse.next()) { @@ -87,7 +87,7 @@ } } -@@ -510,7 +529,9 @@ +@@ -495,7 +514,9 @@ { while (Keyboard.next()) { @@ -97,7 +97,7 @@ } } } -@@ -570,6 +591,7 @@ +@@ -557,6 +578,7 @@ public void func_146276_q_() { this.func_146270_b(0); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch deleted file mode 100644 index d1ee63656..000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java -@@ -186,7 +186,7 @@ - - if (this.field_146297_k.func_71359_d().func_90033_f(s)) - { -- this.field_146297_k.func_71371_a(s, s1, (WorldSettings)null); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); - } - } - } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index d4b2b22e5..fa8d3be0e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch @@ -3,15 +3,15 @@ @@ -181,15 +181,8 @@ GlStateManager.func_179106_n(); Tessellator tessellator = Tessellator.func_178181_a(); - WorldRenderer worldrenderer = tessellator.func_178180_c(); + VertexBuffer vertexbuffer = tessellator.func_178180_c(); - this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - float f = 32.0F; -- worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); -- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- vertexbuffer.func_181668_a(7, DefaultVertexFormats.field_181709_i); +- vertexbuffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- vertexbuffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- vertexbuffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- vertexbuffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); - tessellator.func_78381_a(); + // Forge: background rendering moved into separate method. + this.drawContainerBackground(tessellator); @@ -25,15 +25,15 @@ + + protected void drawContainerBackground(Tessellator tessellator) + { -+ WorldRenderer worldrenderer = tessellator.func_178180_c(); ++ VertexBuffer buffer = tessellator.func_178180_c(); + this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; -+ worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); -+ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ buffer.func_181668_a(7, DefaultVertexFormats.field_181709_i); ++ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); + tessellator.func_78381_a(); + } } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch index be5f0a5aa..90631f9ae 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch @@ -5,6 +5,6 @@ } + s3 = FontRenderer.func_78282_e(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping. - ChatComponentText chatcomponenttext2 = new ChatComponentText(s3); - chatcomponenttext2.func_150255_a(ichatcomponent1.func_150256_b().func_150232_l()); - list1.add(j + 1, chatcomponenttext2); + TextComponentString textcomponentstring2 = new TextComponentString(s3); + textcomponentstring2.func_150255_a(itextcomponent1.func_150256_b().func_150232_l()); + list1.add(j + 1, textcomponentstring2); diff --git a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch b/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch index a79cd9dd2..e3f9b78ed 100644 --- a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java +++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java @@ -82,7 +82,7 @@ - boolean flag1 = this.field_148301_e.field_82821_f < 47; + boolean flag1 = this.field_148301_e.field_82821_f < 107; boolean flag2 = flag || flag1; this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_180790_2_ + 32 + 3, p_180790_3_ + 1, 16777215); - List list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_180790_4_ - 32 - 2); 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 5512b3cdc..bba2f8a70 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -13,10 +13,10 @@ this.field_146562_a = p_i45026_1_; @@ -57,6 +61,14 @@ int j = 141; - this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_76004_f.field_75993_a * 24 - i / 2 - 12); - this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_76004_f.field_75991_b * 24 - j / 2); + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_187982_f.field_75993_a * 24 - i / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_187982_f.field_75991_b * 24 - j / 2); + minecraftAchievements.clear(); -+ for (Achievement achievement : AchievementList.field_76007_e) ++ for (Achievement achievement : AchievementList.field_187981_e) + { + if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement)) + { @@ -27,7 +27,7 @@ public void func_73866_w_() @@ -64,6 +76,7 @@ - this.field_146297_k.func_147114_u().func_147297_a(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.field_146297_k.func_147114_u().func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.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, net.minecraftforge.common.AchievementPage.getTitle(currentPage))); @@ -66,12 +66,11 @@ GlStateManager.func_179143_c(515); this.field_146297_k.func_110434_K().func_110577_a(field_146561_C); -- for (int j5 = 0; j5 < AchievementList.field_76007_e.size(); ++j5) +- for (int j5 = 0; j5 < AchievementList.field_187981_e.size(); ++j5) + java.util.List achievementList = (currentPage == -1 ? minecraftAchievements : net.minecraftforge.common.AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (int j5 = 0; j5 < achievementList.size(); ++j5) { -- Achievement achievement1 = (Achievement)AchievementList.field_76007_e.get(j5); -+ Achievement achievement1 = achievementList.get(j5); + Achievement achievement1 = (Achievement)AchievementList.field_187981_e.get(j5); - if (achievement1.field_75992_c != null) + if (achievement1.field_75992_c != null && achievementList.contains(achievement1.field_75992_c)) @@ -82,10 +81,10 @@ GlStateManager.func_179091_B(); GlStateManager.func_179142_g(); -- for (int i6 = 0; i6 < AchievementList.field_76007_e.size(); ++i6) +- for (int i6 = 0; i6 < AchievementList.field_187981_e.size(); ++i6) + for (int i6 = 0; i6 < achievementList.size(); ++i6) { -- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(i6); +- Achievement achievement2 = (Achievement)AchievementList.field_187981_e.get(i6); + Achievement achievement2 = achievementList.get(i6); int l6 = achievement2.field_75993_a * 24 - i; int j7 = achievement2.field_75991_b * 24 - j; @@ -114,4 +113,4 @@ + GlStateManager.func_179140_f(); //Forge: Make sure Lighting is disabled. Fixes MC-33065 GlStateManager.func_179089_o(); this.field_146296_j.func_180450_b(achievement2.field_75990_d, l6 + 3, j7 + 3); - GlStateManager.func_179112_b(770, 771); + GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch deleted file mode 100644 index f2890750d..000000000 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java -+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java -@@ -5,6 +5,8 @@ - import java.util.Collections; - import java.util.Comparator; - import java.util.List; -+ -+import net.minecraft.block.Block; - import net.minecraft.client.Minecraft; - import net.minecraft.client.audio.PositionedSoundRecord; - import net.minecraft.client.gui.GuiButton; -@@ -443,17 +445,18 @@ - for (StatCrafting statcrafting : StatList.field_75939_e) - { - boolean flag = false; -- int i = Item.func_150891_b(statcrafting.func_150959_a()); -+ int i = Block.func_149682_b(Block.func_149634_a(statcrafting.func_150959_a())); -+ int itemId = Item.func_150891_b(statcrafting.func_150959_a()); - - if (GuiStats.this.field_146546_t.func_77444_a(statcrafting) > 0) - { - flag = true; - } -- else if (StatList.field_75929_E[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[i]) > 0) -+ else if (StatList.field_75929_E[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[itemId]) > 0) - { - flag = true; - } -- else if (StatList.field_75928_D[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[i]) > 0) -+ else if (StatList.field_75928_D[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[itemId]) > 0) - { - flag = true; - } -@@ -468,8 +471,15 @@ - { - public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) - { -- int j = Item.func_150891_b(p_compare_1_.func_150959_a()); -- int k = Item.func_150891_b(p_compare_2_.func_150959_a()); -+ int j; -+ int k; -+ if (StatsBlock.this.field_148217_o == 2) { -+ j = Block.func_149682_b(Block.func_149634_a(p_compare_1_.func_150959_a())); -+ k = Block.func_149682_b(Block.func_149634_a(p_compare_2_.func_150959_a())); -+ } else { -+ j = Item.func_150891_b(p_compare_1_.func_150959_a()); -+ k = Item.func_150891_b(p_compare_2_.func_150959_a()); -+ } - StatBase statbase = null; - StatBase statbase1 = null; - -@@ -748,7 +758,7 @@ - super(p_i45510_2_, GuiStats.this.field_146294_l, GuiStats.this.field_146295_m, 32, GuiStats.this.field_146295_m - 64, GuiStats.this.field_146289_q.field_78288_b * 4); - this.func_148130_a(false); - -- for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.field_75627_a.values()) -+ for (EntityList.EntityEggInfo entitylist$entityegginfo : com.google.common.collect.Iterables.concat(EntityList.field_75627_a.values(), net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().values())) - { - if (GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e) > 0) - { -@@ -784,7 +794,7 @@ - protected void func_180791_a(int p_180791_1_, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_) - { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(p_180791_1_); -- String s = I18n.func_135052_a("entity." + EntityList.func_75617_a(entitylist$entityegginfo.field_75613_a) + ".name", new Object[0]); -+ String s = I18n.func_135052_a("entity." + entitylist$entityegginfo.name + ".name", new Object[0]); - int i = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d); - int j = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e); - String s1 = I18n.func_135052_a("stat.entityKills", new Object[] {Integer.valueOf(i), s}); 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 2e03fc6d3..1b2794a76 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java -@@ -175,8 +175,11 @@ +@@ -176,8 +176,11 @@ GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F); this.field_73735_i = 200.0F; this.field_146296_j.field_77023_b = 200.0F; @@ -13,9 +13,9 @@ this.field_73735_i = 0.0F; this.field_146296_j.field_77023_b = 0.0F; } -@@ -239,13 +242,12 @@ +@@ -240,13 +243,12 @@ - if (itemstack == null) + if (itemstack == null && p_146977_1_.func_111238_b()) { - String s1 = p_146977_1_.func_178171_c(); + TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite(); @@ -30,7 +30,7 @@ this.func_175175_a(i, j, textureatlassprite, 16, 16); GlStateManager.func_179145_e(); flag1 = true; -@@ -326,6 +328,7 @@ +@@ -327,6 +329,7 @@ int j = this.field_147003_i; int k = this.field_147009_r; boolean flag1 = p_73864_1_ < j || p_73864_2_ < k || p_73864_1_ >= j + this.field_146999_f || p_73864_2_ >= k + this.field_147000_g; @@ -38,7 +38,7 @@ int l = -1; if (slot != null) -@@ -463,10 +466,12 @@ +@@ -464,10 +467,12 @@ protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_) { @@ -51,7 +51,7 @@ int k = -1; if (slot != null) -@@ -685,4 +690,16 @@ +@@ -686,4 +691,16 @@ this.field_146297_k.field_71439_g.func_71053_j(); } } 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 671aff30b..a4786eeeb 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -48,6 +48,8 @@ +@@ -49,6 +49,8 @@ private Slot field_147064_C; private boolean field_147057_D; private CreativeCrafting field_147059_E; @@ -9,16 +9,7 @@ public GuiContainerCreative(EntityPlayer p_i1088_1_) { -@@ -175,7 +177,7 @@ - return; - } - -- 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) - { -@@ -259,6 +261,13 @@ +@@ -258,6 +260,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); @@ -32,7 +23,7 @@ } else { -@@ -280,7 +289,7 @@ +@@ -279,7 +288,7 @@ protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException { @@ -41,7 +32,7 @@ { if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D)) { -@@ -318,6 +327,14 @@ +@@ -317,6 +326,14 @@ GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; guicontainercreative$containercreative.field_148330_a.clear(); @@ -56,7 +47,7 @@ for (Item item : Item.field_150901_e) { if (item != null && item.func_77640_w() != null) -@@ -325,7 +342,13 @@ +@@ -324,7 +341,13 @@ item.func_150895_a(item, (CreativeTabs)null, guicontainercreative$containercreative.field_148330_a); } } @@ -66,11 +57,11 @@ + //split from above for custom search tabs + private void updateFilteredItems(GuiContainerCreative.ContainerCreative guicontainercreative$containercreative) + { -+ if (CreativeTabs.field_78032_a[field_147058_w] == CreativeTabs.field_78027_g) // FORGE: Only add enchanted books to the regular search - for (Enchantment enchantment : Enchantment.field_77331_b) ++ if (CreativeTabs.field_78032_a[field_147058_w] == CreativeTabs.field_78027_g) // FORGE: Only add enchanted books to the regular search + for (Enchantment enchantment : Enchantment.field_185264_b) { if (enchantment != null && enchantment.field_77351_y != null) -@@ -333,7 +356,6 @@ +@@ -332,7 +355,6 @@ Items.field_151134_bR.func_92113_a(enchantment, guicontainercreative$containercreative.field_148330_a); } } @@ -78,7 +69,7 @@ Iterator iterator = guicontainercreative$containercreative.field_148330_a.iterator(); String s1 = this.field_147062_A.func_146179_b().toLowerCase(); -@@ -365,7 +387,7 @@ +@@ -364,7 +386,7 @@ { CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; @@ -87,7 +78,7 @@ { GlStateManager.func_179084_k(); this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752); -@@ -400,7 +422,7 @@ +@@ -399,7 +421,7 @@ for (CreativeTabs creativetabs : CreativeTabs.field_78032_a) { @@ -96,7 +87,7 @@ { this.func_147050_b(creativetabs); return; -@@ -413,11 +435,13 @@ +@@ -412,11 +434,13 @@ private boolean func_147055_p() { @@ -110,7 +101,7 @@ int i = field_147058_w; field_147058_w = p_147050_1_.func_78021_a(); GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; -@@ -483,12 +507,14 @@ +@@ -487,12 +511,14 @@ if (this.field_147062_A != null) { @@ -126,7 +117,7 @@ this.func_147053_i(); } else -@@ -558,20 +584,43 @@ +@@ -562,20 +588,43 @@ } super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); @@ -171,7 +162,7 @@ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.func_179140_f(); } -@@ -633,16 +682,35 @@ +@@ -637,16 +686,35 @@ RenderHelper.func_74520_c(); CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; @@ -208,7 +199,7 @@ 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(); -@@ -657,6 +725,14 @@ +@@ -661,6 +729,14 @@ this.func_73729_b(i, j + (int)((float)(k - j - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); } @@ -223,7 +214,7 @@ this.func_147051_a(creativetabs); if (creativetabs == CreativeTabs.field_78036_m) -@@ -667,6 +743,14 @@ +@@ -671,6 +747,14 @@ protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { @@ -238,7 +229,7 @@ int i = p_147049_1_.func_78020_k(); int j = 28 * i; int k = 0; -@@ -763,6 +847,8 @@ +@@ -767,6 +851,8 @@ } GlStateManager.func_179140_f(); @@ -247,7 +238,7 @@ this.func_73729_b(l, i1, j, k, 28, j1); this.field_73735_i = 100.0F; this.field_146296_j.field_77023_b = 100.0F; -@@ -789,6 +875,15 @@ +@@ -793,6 +879,15 @@ { this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); } diff --git a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch index d91355e16..387c49616 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -13,6 +13,6 @@ } + @SideOnly(Side.CLIENT) - public void func_178780_a(WorldRenderer p_178780_1_, float p_178780_2_) + public void func_178780_a(VertexBuffer p_178780_1_, float p_178780_2_) { 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 77e0a42cb..4962d8769 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java +++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java -@@ -10,7 +10,6 @@ +@@ -9,7 +9,6 @@ + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; - import org.lwjgl.opengl.GL11; -@SideOnly(Side.CLIENT) public class ModelRenderer { public float field_78801_a; -@@ -109,6 +108,7 @@ +@@ -108,6 +107,7 @@ this.field_78798_e = p_78793_3_; } @@ -16,7 +16,7 @@ public void func_78785_a(float p_78785_1_) { if (!this.field_78807_k) -@@ -190,6 +190,7 @@ +@@ -189,6 +189,7 @@ } } @@ -24,7 +24,7 @@ public void func_78791_b(float p_78791_1_) { if (!this.field_78807_k) -@@ -225,6 +226,7 @@ +@@ -224,6 +225,7 @@ } } @@ -32,7 +32,7 @@ public void func_78794_c(float p_78794_1_) { if (!this.field_78807_k) -@@ -266,6 +268,7 @@ +@@ -265,6 +267,7 @@ } } diff --git a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch index dbe66e303..307bb90b3 100644 --- a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -3,11 +3,11 @@ @@ -1,10 +1,7 @@ package net.minecraft.client.model; - import net.minecraft.util.Vec3; + import net.minecraft.util.math.Vec3d; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -@SideOnly(Side.CLIENT) public class PositionTextureVertex { - public Vec3 field_78243_a; + public Vec3d 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 ea7d9cd31..860a67a8b 100644 --- a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch @@ -1,13 +1,18 @@ --- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java +++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java -@@ -4,10 +4,7 @@ - import net.minecraft.client.renderer.WorldRenderer; - import net.minecraft.client.renderer.vertex.DefaultVertexFormats; - import net.minecraft.util.Vec3; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; +@@ -7,7 +7,6 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; -@SideOnly(Side.CLIENT) public class TexturedQuad { public PositionTextureVertex[] field_78239_a; +@@ -43,6 +42,7 @@ + this.field_78239_a = apositiontexturevertex; + } + ++ @SideOnly(Side.CLIENT) + public void func_178765_a(VertexBuffer p_178765_1_, float p_178765_2_) + { + Vec3d vec3d = this.field_78239_a[1].field_78243_a.func_72444_a(this.field_78239_a[0].field_78243_a); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index feb70661e..97d95aea6 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java -@@ -55,6 +55,7 @@ +@@ -52,6 +52,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); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch index fbd519d25..0d82da59b 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch @@ -4,8 +4,8 @@ inetaddress = InetAddress.getByName(p_146367_1_); GuiConnecting.this.field_146371_g = NetworkManager.func_181124_a(inetaddress, p_146367_2_, GuiConnecting.this.field_146297_k.field_71474_y.func_181148_f()); GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i)); -- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN)); -+ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true)); - GuiConnecting.this.field_146371_g.func_179290_a(new C00PacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e())); +- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(107, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN)); ++ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(107, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true)); + GuiConnecting.this.field_146371_g.func_179290_a(new CPacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e())); } catch (UnknownHostException unknownhostexception) diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 891b51bc7..8cc02cf1a 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -1,87 +1,93 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java -@@ -111,6 +111,12 @@ +@@ -121,6 +121,12 @@ } } -+ 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_178888_1_, field_78776_a.field_71439_g)) ++ ItemStack stack = field_78776_a.field_71439_g.func_184614_ca(); ++ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_187103_1_, field_78776_a.field_71439_g)) + { + return false; + } + - if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_70694_bm() != null && this.field_78776_a.field_71439_g.func_70694_bm().func_77973_b() instanceof ItemSword) + if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_184614_ca() != null && this.field_78776_a.field_71439_g.func_184614_ca().func_77973_b() instanceof ItemSword) { return false; -@@ -128,13 +134,7 @@ +@@ -142,14 +148,7 @@ else { - world.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate)); -- boolean flag = world.func_175698_g(p_178888_1_); + world.func_175718_b(2001, p_187103_1_, Block.func_176210_f(iblockstate)); +- block.func_176208_a(world, p_187103_1_, iblockstate, this.field_78776_a.field_71439_g); +- boolean flag = world.func_180501_a(p_187103_1_, Blocks.field_150350_a.func_176223_P(), 11); - if (flag) - { -- block1.func_176206_d(world, p_178888_1_, iblockstate); +- block.func_176206_d(world, p_187103_1_, iblockstate); - } - this.field_178895_c = new BlockPos(this.field_178895_c.func_177958_n(), -1, this.field_178895_c.func_177952_p()); if (!this.field_78779_k.func_77145_d()) -@@ -152,6 +152,12 @@ +@@ -160,13 +159,20 @@ + { + itemstack1.func_179548_a(world, iblockstate, p_187103_1_, this.field_78776_a.field_71439_g); + +- if (itemstack1.field_77994_a == 0) ++ if (itemstack1.field_77994_a <= 0) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_78776_a.field_71439_g, itemstack1, EnumHand.MAIN_HAND); + this.field_78776_a.field_71439_g.func_184611_a(EnumHand.MAIN_HAND, (ItemStack)null); + } } } -+ boolean flag = block1.removedByPlayer(world, p_178888_1_, field_78776_a.field_71439_g, false); ++ boolean flag = block.removedByPlayer(iblockstate, world, p_187103_1_, field_78776_a.field_71439_g, false); + + if (flag) + { -+ block1.func_176206_d(world, p_178888_1_, iblockstate); ++ block.func_176206_d(world, p_187103_1_, iblockstate); + } return flag; } } -@@ -356,11 +362,19 @@ +@@ -373,11 +379,15 @@ { if (this.field_78779_k != WorldSettings.GameType.SPECTATOR) { ++ net.minecraft.item.Item item = p_187099_3_ == null ? null : p_187099_3_.func_77973_b(); ++ EnumActionResult ret = item == null ? EnumActionResult.PASS : item.onItemUseFirst(p_187099_3_, p_187099_1_, p_187099_2_, p_187099_4_, p_187099_5_, f, f1, f2, p_187099_7_); ++ if (ret != EnumActionResult.PASS) return ret; + -+ if (p_178890_3_ != null && -+ p_178890_3_.func_77973_b() != null && -+ p_178890_3_.func_77973_b().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) -+ { -+ return true; -+ } -+ - IBlockState iblockstate = p_178890_2_.func_180495_p(p_178890_4_); + IBlockState iblockstate = p_187099_2_.func_180495_p(p_187099_4_); -- if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null) && iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2)) -+ if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null || p_178890_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_))) +- if ((!p_187099_1_.func_70093_af() || p_187099_1_.func_184614_ca() == null && p_187099_1_.func_184592_cb() == null) && iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_4_, iblockstate, p_187099_1_, p_187099_7_, p_187099_3_, p_187099_5_, f, f1, f2)) ++ if ((!p_187099_1_.func_70093_af() || (p_187099_1_.func_184614_ca() == null || item.doesSneakBypassUse(p_187099_3_, p_187099_2_, p_187099_4_, p_187099_1_)) && p_187099_1_.func_184592_cb() == null)) { - flag = true; -+ flag = iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2); ++ flag = iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_4_, iblockstate, p_187099_1_, p_187099_7_, p_187099_3_, p_187099_5_, f, f1, f2); } - if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock) -@@ -393,7 +407,9 @@ + if (!flag && p_187099_3_ != null && p_187099_3_.func_77973_b() instanceof ItemBlock) +@@ -418,7 +428,9 @@ } else { -- return p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2); -+ if (!p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false; -+ if (p_178890_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_); -+ return true; +- return p_187099_3_.func_179546_a(p_187099_1_, p_187099_2_, p_187099_4_, p_187099_7_, p_187099_5_, f, f1, f2); ++ EnumActionResult ret = p_187099_3_.func_179546_a(p_187099_1_, p_187099_2_, p_187099_4_, p_187099_7_, p_187099_5_, f, f1, f2); ++ if (p_187099_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187099_1_, p_187099_3_, p_187099_7_); ++ return ret; } } else -@@ -420,9 +436,10 @@ - { - p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack; - -- if (itemstack.field_77994_a == 0) -+ if (itemstack.field_77994_a <= 0) +@@ -453,9 +465,10 @@ { - p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_78769_1_, itemstack); + p_187101_1_.func_184611_a(p_187101_4_, itemstack); + +- if (itemstack.field_77994_a == 0) ++ if (itemstack.field_77994_a <= 0) + { + p_187101_1_.func_184611_a(p_187101_4_, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187101_1_, itemstack, p_187101_4_); + } } - 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 0996e6ecd..e15a04d45 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java -@@ -52,12 +52,13 @@ - super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true); +@@ -63,12 +63,13 @@ + this.field_184157_a = Sets.newHashSet(); this.field_73035_a = p_i45063_1_; this.func_72912_H().func_176144_a(p_i45063_4_); - this.func_175652_B(new BlockPos(8, 64, 8)); diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch index 445652888..5d54f059f 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java -@@ -104,7 +104,10 @@ +@@ -106,7 +106,10 @@ { this.field_175091_e = p_147390_1_.func_179730_a(); this.field_147393_d.func_150723_a(EnumConnectionState.PLAY); @@ -11,4 +11,4 @@ + net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc); } - public void func_147231_a(IChatComponent p_147231_1_) + public void func_147231_a(ITextComponent p_147231_1_) diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 4fa630f5f..54911d838 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java -@@ -246,7 +246,7 @@ +@@ -267,7 +267,7 @@ { PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f); this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this); @@ -9,11 +9,11 @@ this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g(); this.field_147299_f.func_71403_a(this.field_147300_g); this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f(); -@@ -750,14 +750,16 @@ - public void func_147251_a(S02PacketChat p_147251_1_) +@@ -785,14 +785,16 @@ + public void func_147251_a(SPacketChat p_147251_1_) { PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f); -+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c()); ++ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c()); + if (message == null) return; if (p_147251_1_.func_179841_c() == 2) @@ -28,7 +28,7 @@ } } -@@ -808,6 +810,11 @@ +@@ -848,6 +850,11 @@ float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F; float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F; EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e); @@ -37,10 +37,10 @@ + net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", p_147281_1_.func_149025_e(), d0, d1, d2); + return; + } - entitylivingbase.field_70118_ct = p_147281_1_.func_149023_f(); - entitylivingbase.field_70117_cu = p_147281_1_.func_149034_g(); - entitylivingbase.field_70116_cv = p_147281_1_.func_149029_h(); -@@ -1133,6 +1140,10 @@ + EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2); + entitylivingbase.field_70761_aq = entitylivingbase.field_70759_as = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F; + Entity[] aentity = entitylivingbase.func_70021_al(); +@@ -1179,6 +1186,10 @@ { tileentity.func_145839_a(p_147273_1_.func_148857_g()); } @@ -48,15 +48,15 @@ + { + tileentity.onDataPacket(field_147302_e, p_147273_1_); + } - } - } -@@ -1341,7 +1352,7 @@ + if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) + { +@@ -1378,7 +1389,7 @@ if (entity instanceof EntityLivingBase) { -- PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f()); -+ PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e() & 0xff, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f()); - potioneffect.func_100012_b(p_147260_1_.func_149429_c()); - ((EntityLivingBase)entity).func_70690_d(potioneffect); - } +- Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e()); ++ Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e() & 0xFF); + + if (potion != null) + { diff --git a/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch b/patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch similarity index 59% rename from patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch rename to patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch index d7aad9ec1..0168e2cc5 100644 --- a/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch +++ b/patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch @@ -1,10 +1,10 @@ ---- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java -+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java +--- ../src-base/minecraft/net/minecraft/client/network/ServerPinger.java ++++ ../src-work/minecraft/net/minecraft/client/network/ServerPinger.java @@ -150,6 +150,7 @@ p_147224_1_.func_147407_a((String)null); } + net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(p_147224_1_, serverstatusresponse); this.field_175092_e = Minecraft.func_71386_F(); - networkmanager.func_179290_a(new C01PacketPing(this.field_175092_e)); + networkmanager.func_179290_a(new CPacketPing(this.field_175092_e)); this.field_147403_d = true; diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index 08e6f7261..17332afbd 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -1,31 +1,41 @@ --- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java -@@ -133,6 +133,7 @@ +@@ -3,6 +3,9 @@ + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.google.common.collect.Queues; ++ ++import akka.actor.FSM.State; ++ + import java.util.ArrayDeque; + import java.util.Iterator; + import java.util.List; +@@ -143,6 +146,7 @@ public void func_78873_a(EntityFX p_78873_1_) { + if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. - int i = p_78873_1_.func_70537_b(); - int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1; + this.field_187241_h.add(p_78873_1_); + } -@@ -351,7 +352,7 @@ +@@ -376,7 +380,7 @@ public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) { -- if (p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a) -+ if (!p_180533_2_.func_177230_c().isAir(field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this)) +- if (p_180533_2_.func_185904_a() != Material.field_151579_a) ++ if (p_180533_2_.func_177230_c().isAir(p_180533_2_, field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this)) { - p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_); + p_180533_2_ = p_180533_2_.func_185899_b(this.field_78878_a, p_180533_1_); int i = 4; -@@ -457,4 +458,13 @@ +@@ -460,4 +464,13 @@ return "" + i; } + -+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target) ++ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.math.RayTraceResult target) + { -+ Block block = field_78878_a.func_180495_p(pos).func_177230_c(); -+ if (block != null && !block.addHitEffects(field_78878_a, target, this)) ++ IBlockState state = field_78878_a.func_180495_p(pos); ++ if (state != null && !state.func_177230_c().addHitEffects(state, field_78878_a, target, this)) + { + func_180532_a(pos, target.field_178784_b); + } diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch deleted file mode 100644 index 39f2cb169..000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java -@@ -533,8 +533,19 @@ - @SideOnly(Side.CLIENT) - public static enum EnumNeighborInfo - { -- DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), -- UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), -+ // -- Forge Patch to Fix Top/Bottom Lighting Interpolation -- -+ // Forge PR - https://github.com/MinecraftForge/MinecraftForge/pull/1892 -+ // Mojang Bug - https://bugs.mojang.com/browse/MC-80148 -+ DOWN( new EnumFacing[]{ EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH }, 0.5F, true, -+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.SOUTH }, -+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.SOUTH } ), -+ UP( new EnumFacing[]{ EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH }, 1.0F, true, -+ new Orientation[]{ Orientation.EAST, Orientation.SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.SOUTH }, -+ new Orientation[]{ Orientation.EAST, Orientation.NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.WEST, Orientation.NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.WEST, Orientation.SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.SOUTH } ), - NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}), - SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}), - WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}), diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch index af6ec831d..6ff9d53b7 100644 --- a/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java +++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java -@@ -309,5 +309,6 @@ +@@ -307,5 +307,6 @@ return new ModelResourceLocation(s + "_double_slab", s1); } }); diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch index 72ea50b40..3b5e95d38 100644 --- a/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch @@ -1,49 +1,31 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java -@@ -24,7 +24,7 @@ - { - private BlockModelShapes field_175028_a; - private final GameSettings field_175026_b; -- private final BlockModelRenderer field_175027_c = new BlockModelRenderer(); -+ private final BlockModelRenderer field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(); - private final ChestRenderer field_175024_d = new ChestRenderer(); - private final BlockFluidRenderer field_175025_e = new BlockFluidRenderer(); - -@@ -48,6 +48,24 @@ - { - p_175020_1_ = block.func_176221_a(p_175020_1_, p_175020_4_, p_175020_2_); - IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_); -+ -+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) -+ { -+ IBlockState extendedState = block.getExtendedState(p_175020_1_, p_175020_4_, p_175020_2_); -+ for ( net.minecraft.util.EnumWorldBlockLayer layer : net.minecraft.util.EnumWorldBlockLayer.values() ) -+ { -+ if ( block.canRenderInLayer( layer ) ) -+ { -+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer); -+ -+ IBakedModel targetLayer = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); -+ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, p_175020_3_)).func_177645_b(); -+ this.field_175027_c.func_178259_a(p_175020_4_, damageModel, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c()); -+ } -+ } -+ return; -+ } -+ - IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, p_175020_3_)).func_177645_b(); - this.field_175027_c.func_178259_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c()); - } -@@ -128,6 +146,12 @@ - ibakedmodel = ((WeightedBakedModel)ibakedmodel).func_177564_a(MathHelper.func_180186_a(p_175022_3_)); - } - -+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) -+ { -+ IBlockState extendedState = block.getExtendedState(p_175022_1_, p_175022_2_, p_175022_3_); -+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); -+ } -+ - return ibakedmodel; +@@ -29,7 +29,7 @@ + public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) + { + this.field_175028_a = p_i46577_1_; +- this.field_175027_c = new BlockModelRenderer(p_i46577_2_); ++ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(p_i46577_2_); + this.field_175025_e = new BlockFluidRenderer(p_i46577_2_); } +@@ -44,7 +44,7 @@ + { + p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_); + IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_); +- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b(); ++ IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, p_175020_3_, p_175020_1_, p_175020_4_, p_175020_2_); + this.field_175027_c.func_178267_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true); + } + } +@@ -76,7 +76,9 @@ + switch (enumblockrendertype) + { + case MODEL: +- return this.field_175027_c.func_178267_a(p_175018_3_, this.func_184389_a(p_175018_1_), p_175018_1_, p_175018_2_, p_175018_4_, true); ++ IBakedModel model = this.func_184389_a(p_175018_1_); ++ p_175018_1_ = p_175018_1_.func_177230_c().getExtendedState(p_175018_1_, p_175018_3_, p_175018_2_); ++ return this.field_175027_c.func_178267_a(p_175018_3_, model, p_175018_1_, p_175018_2_, p_175018_4_, true); + case ENTITYBLOCK_ANIMATED: + return false; + case LIQUID: diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 6bc47e6d1..6559dc960 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java -@@ -200,6 +200,7 @@ +@@ -207,6 +207,7 @@ { this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); } @@ -8,25 +8,25 @@ } } -@@ -419,7 +420,7 @@ +@@ -398,7 +399,7 @@ if (d3 < d2 || d2 == 0.0D) { -- if (entity1 == entity.field_70154_o) -+ if (entity1 == entity.field_70154_o && !entity.canRiderInteract()) +- if (entity1.func_184208_bv() == entity.func_184208_bv()) ++ if (entity1.func_184208_bv() == entity.func_184208_bv() && !entity.canRiderInteract()) { if (d2 == 0.0D) { -@@ -512,7 +513,7 @@ +@@ -491,7 +492,7 @@ f = f * 60.0F / 70.0F; } - return f; -+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, block, p_78481_1_, f); ++ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, p_78481_1_, f); } } -@@ -576,14 +577,8 @@ +@@ -555,14 +556,8 @@ { BlockPos blockpos = new BlockPos(entity); IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos); @@ -35,14 +35,14 @@ - if (block == Blocks.field_150324_C) - { -- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b(); +- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b(); - GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F); - } - GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); } -@@ -650,17 +645,20 @@ +@@ -629,17 +624,20 @@ if (!this.field_78531_r.field_71474_y.field_74325_U) { @@ -61,8 +61,8 @@ - { - GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); - } -+ Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); -+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, block, p_78467_1_, yaw, pitch, roll); ++ IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); ++ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, p_78467_1_, yaw, pitch, roll); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + GlStateManager.func_179114_b(event.roll, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b(event.pitch, 1.0F, 0.0F, 0.0F); @@ -70,7 +70,15 @@ } GlStateManager.func_179109_b(0.0F, -f, 0.0F); -@@ -1103,7 +1101,7 @@ +@@ -757,6 +755,7 @@ + + boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn(); + ++ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_78476_1_, p_78476_2_)) + if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a()) + { + this.func_180436_i(); +@@ -1092,7 +1091,7 @@ try { @@ -79,7 +87,7 @@ } catch (Throwable throwable) { -@@ -1164,7 +1162,7 @@ +@@ -1187,7 +1186,7 @@ if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR) { @@ -88,7 +96,7 @@ } else { -@@ -1314,7 +1312,9 @@ +@@ -1312,7 +1311,9 @@ GlStateManager.func_179094_E(); RenderHelper.func_74519_b(); this.field_78531_r.field_71424_I.func_76318_c("entities"); @@ -97,40 +105,34 @@ + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); RenderHelper.func_74518_a(); this.func_175072_h(); - GlStateManager.func_179128_n(5888); -@@ -1326,6 +1326,7 @@ - EntityPlayer entityplayer = (EntityPlayer)entity; - GlStateManager.func_179118_c(); - this.field_78531_r.field_71424_I.func_76318_c("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_)) - renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); - GlStateManager.func_179141_d(); - } -@@ -1339,6 +1340,7 @@ - EntityPlayer entityplayer1 = (EntityPlayer)entity; + } +@@ -1325,6 +1326,7 @@ + EntityPlayer entityplayer = (EntityPlayer)entity; GlStateManager.func_179118_c(); this.field_78531_r.field_71424_I.func_76318_c("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, field_78531_r.field_71476_x, 0, entityplayer1.func_70694_bm(), p_175068_2_)) - renderglobal.func_72731_b(entityplayer1, this.field_78531_r.field_71476_x, 0, p_175068_2_); ++ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, p_175068_2_)) + renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); GlStateManager.func_179141_d(); } -@@ -1380,6 +1382,15 @@ +@@ -1366,6 +1368,17 @@ GlStateManager.func_179103_j(7425); this.field_78531_r.field_71424_I.func_76318_c("translucent"); - renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); + renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); + if (!this.field_175078_W) //Only render if render pass 0 happens as well. + { + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); + renderglobal.func_180446_a(entity, icamera, p_175068_2_); ++ // restore blending function changed by RenderGlobal.preRenderDamagedBlocks ++ GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); + RenderHelper.func_74518_a(); + } GlStateManager.func_179103_j(7424); GlStateManager.func_179132_a(true); GlStateManager.func_179089_o(); -@@ -1392,8 +1403,12 @@ +@@ -1378,6 +1391,9 @@ this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); } @@ -139,11 +141,8 @@ + this.field_78531_r.field_71424_I.func_76318_c("hand"); -+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_)) if (this.field_175074_C) - { - GlStateManager.func_179086_m(256); -@@ -1505,6 +1520,13 @@ +@@ -1490,6 +1506,13 @@ protected void func_78474_d(float p_78474_1_) { @@ -157,11 +156,11 @@ float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); if (f > 0.0F) -@@ -1830,6 +1852,13 @@ +@@ -1820,6 +1843,13 @@ this.field_175081_S = f7; } -+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); ++ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + + this.field_175080_Q = event.red; @@ -171,22 +170,22 @@ GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); } -@@ -1848,6 +1877,10 @@ +@@ -1830,7 +1860,9 @@ + GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F); GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); - -+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F); -+ if (hook >= 0) -+ GlStateManager.func_179095_a(hook); + IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); +- ++ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, p_78468_2_, 0.1F); ++ if (hook >= 0) GlStateManager.func_179095_a(hook); + else - if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q)) + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) { float f1 = 5.0F; -@@ -1925,6 +1958,7 @@ +@@ -1915,6 +1947,7 @@ GlStateManager.func_179102_b(f * 0.05F); GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); } -+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f); ++ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, p_78468_2_, p_78468_1_, f); } GlStateManager.func_179142_g(); diff --git a/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch index 8bdca504f..faade1145 100644 --- a/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch @@ -1,28 +1,28 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java -@@ -27,7 +27,12 @@ +@@ -28,7 +28,12 @@ protected void func_175378_g() { - if (!this.field_146297_k.field_71439_g.func_70651_bq().isEmpty()) + boolean hasVisibleEffect = false; + for(PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) { -+ Potion potion = Potion.field_76425_a[potioneffect.func_76456_a()]; ++ Potion potion = potioneffect.func_188419_a(); + if(potion.shouldRender(potioneffect)) { hasVisibleEffect = true; break; } + } + if (!this.field_146297_k.field_71439_g.func_70651_bq().isEmpty() && hasVisibleEffect) { this.field_147003_i = 160 + (this.field_146294_l - this.field_146999_f - 200) / 2; this.field_147045_u = true; -@@ -70,6 +75,7 @@ - for (PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) +@@ -71,6 +76,7 @@ + for (PotionEffect potioneffect : Ordering.natural().sortedCopy(collection)) { - Potion potion = Potion.field_76425_a[potioneffect.func_76456_a()]; + Potion potion = potioneffect.func_188419_a(); + if(!potion.shouldRender(potioneffect)) continue; GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); this.field_146297_k.func_110434_K().func_110577_a(field_147001_a); this.func_73729_b(i, j, 0, 166, 140, 32); -@@ -80,6 +86,8 @@ +@@ -81,6 +87,8 @@ this.func_73729_b(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); } diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch index 09c4a9878..1b7646b17 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch @@ -1,14 +1,13 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java -@@ -50,6 +50,11 @@ - } - } +@@ -32,7 +32,9 @@ -+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartItemModel) -+ { -+ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(p_178089_1_); -+ } -+ - if (ibakedmodel == null) - { - ibakedmodel = this.field_178090_d.func_174951_a(); + public TextureAtlasSprite func_178087_a(Item p_178087_1_, int p_178087_2_) + { +- return this.func_178089_a(new ItemStack(p_178087_1_, 1, p_178087_2_)).func_177554_e(); ++ ItemStack stack = new ItemStack(p_178087_1_, 1, p_178087_2_); ++ IBakedModel model = this.func_178089_a(stack); ++ return model.func_188617_f().handleItemState(model, stack, null, null).func_177554_e(); + } + + public IBakedModel func_178089_a(ItemStack p_178089_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 9e4e3ebcd..0bbb0a806 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java -@@ -313,7 +313,7 @@ - - if (this.field_78453_b != null) - { -- if (this.field_78453_b.func_77973_b() == Items.field_151098_aY) -+ if (this.field_78453_b.func_77973_b() instanceof net.minecraft.item.ItemMap) - { - this.func_178097_a(abstractclientplayer, f2, f, f1); +@@ -360,7 +360,7 @@ + this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside); } -@@ -365,6 +365,7 @@ + } +- else if (p_187457_6_.func_77973_b() == Items.field_151098_aY) ++ else if (p_187457_6_.func_77973_b() instanceof net.minecraft.item.ItemMap) + { + if (flag && this.field_187468_e == null) + { +@@ -444,6 +444,7 @@ if (this.field_78455_a.field_71439_g.func_70094_T()) { IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g)); @@ -17,7 +17,7 @@ EntityPlayer entityplayer = this.field_78455_a.field_71439_g; for (int i = 0; i < 8; ++i) -@@ -378,11 +379,13 @@ +@@ -457,11 +458,13 @@ if (iblockstate1.func_177230_c().func_176214_u()) { iblockstate = iblockstate1; @@ -25,13 +25,13 @@ } } - if (iblockstate.func_177230_c().func_149645_b() != -1) + if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) { + if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) this.func_178108_a(p_78447_1_, this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate)); } } -@@ -391,11 +394,13 @@ +@@ -470,11 +473,13 @@ { if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) { @@ -45,16 +45,14 @@ this.func_78442_d(p_78447_1_); } } -@@ -512,6 +517,12 @@ +@@ -596,8 +601,8 @@ + else { - if (!this.field_78453_b.func_179549_c(itemstack)) - { -+ if (!this.field_78453_b.func_77973_b().shouldCauseReequipAnimation(this.field_78453_b, itemstack, field_78450_g != entityplayer.field_71071_by.field_70461_c)) -+ { -+ this.field_78453_b = itemstack; -+ this.field_78450_g = entityplayer.field_71071_by.field_70461_c; -+ return; -+ } - flag = true; - } + float f = entityplayersp.func_184825_o(1.0F); +- this.field_187469_f += MathHelper.func_76131_a((Objects.equal(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); +- this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equal(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); ++ this.field_187469_f += MathHelper.func_76131_a((net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); ++ this.field_187471_h += MathHelper.func_76131_a((float)(net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); } + + if (this.field_187469_f < 0.1F) diff --git a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index 98273ca48..41709861e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java -@@ -83,6 +83,10 @@ +@@ -92,6 +92,10 @@ public static int field_176089_P; public static int field_148826_e; @@ -11,7 +11,7 @@ public static void func_77474_a() { ContextCapabilities contextcapabilities = GLContext.getCapabilities(); -@@ -843,6 +847,12 @@ +@@ -852,6 +856,12 @@ { GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); } diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index cee9639e6..b71bd566d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java +++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java -@@ -525,8 +525,10 @@ +@@ -547,8 +547,10 @@ public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) { @@ -11,7 +11,7 @@ --this.field_72740_G; } else -@@ -537,9 +539,12 @@ +@@ -559,9 +561,12 @@ this.field_72769_h.field_72984_F.func_76320_a("prepare"); TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_); this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_); @@ -24,7 +24,7 @@ Entity entity = this.field_72777_q.func_175606_aa(); double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_; double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_; -@@ -551,11 +556,15 @@ +@@ -573,11 +578,15 @@ this.field_72777_q.field_71460_t.func_180436_i(); this.field_72769_h.field_72984_F.func_76318_c("global"); List list = this.field_72769_h.func_72910_y(); @@ -40,39 +40,31 @@ ++this.field_72749_I; if (entity1.func_145770_h(d0, d1, d2)) -@@ -577,6 +586,7 @@ - for (int j = 0; j < list.size(); ++j) +@@ -599,6 +608,7 @@ { - Entity entity3 = (Entity)list.get(j); -+ if (!entity3.shouldRenderInPass(pass)) continue; - boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn(); - boolean flag1 = entity3.func_145770_h(d0, d1, d2) && (entity3.field_70158_ak || p_180446_2_.func_78546_a(entity3.func_174813_aQ()) || entity3.field_70153_n == this.field_72777_q.field_71439_g) && entity3 instanceof EntityPlayer; + for (Entity entity2 : classinheritancemultimap) + { ++ if(!entity2.shouldRenderInPass(pass)) continue; + boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g); -@@ -626,6 +636,7 @@ - } - - entity2 = (Entity)iterator.next(); -+ if (!entity2.shouldRenderInPass(pass)) continue; - flag2 = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.field_70153_n == this.field_72777_q.field_71439_g; - - if (!flag2) -@@ -654,6 +665,7 @@ + if (flag) +@@ -672,6 +682,7 @@ this.field_72769_h.field_72984_F.func_76318_c("blockentities"); RenderHelper.func_74519_b(); + TileEntityRendererDispatcher.field_147556_a.preDrawBatch(); for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R) { - List list1 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b(); -@@ -662,6 +674,7 @@ + List list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b(); +@@ -680,6 +691,7 @@ { - for (TileEntity tileentity2 : list1) + for (TileEntity tileentity2 : list3) { + if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity2.getRenderBoundingBox())) continue; TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1); } } -@@ -671,9 +684,11 @@ +@@ -689,9 +701,11 @@ { for (TileEntity tileentity : this.field_181024_n) { @@ -84,7 +76,7 @@ this.func_180443_s(); -@@ -700,7 +715,7 @@ +@@ -718,7 +732,7 @@ Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); @@ -93,7 +85,7 @@ { TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e()); } -@@ -1161,6 +1176,12 @@ +@@ -1210,6 +1224,13 @@ public void func_174976_a(float p_174976_1_, int p_174976_2_) { @@ -103,10 +95,11 @@ + renderer.render(p_174976_1_, field_72769_h, field_72777_q); + return; + } - if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1) ++ + if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1) { this.func_180448_r(); -@@ -1378,6 +1399,12 @@ +@@ -1427,6 +1448,12 @@ public void func_180447_b(float p_180447_1_, int p_180447_2_) { @@ -119,7 +112,7 @@ if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { if (this.field_72777_q.field_71474_y.func_181147_e() == 2) -@@ -1793,8 +1820,11 @@ +@@ -1854,8 +1881,11 @@ double d4 = (double)blockpos.func_177956_o() - d1; double d5 = (double)blockpos.func_177952_p() - d2; Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); @@ -132,21 +125,3 @@ { if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) { -@@ -1949,13 +1979,16 @@ - if (p_174961_1_ != null) - { - ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_); -+ ResourceLocation resource = null; - - if (itemrecord != null) - { - this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i()); -+ resource = itemrecord.getRecordResource(p_174961_1_); - } - -- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p()); -+ if (resource == null) resource = new ResourceLocation(p_174961_1_); -+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p()); - this.field_147593_P.put(p_174961_2_, positionedsoundrecord); - this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord); - } diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch new file mode 100644 index 000000000..fefb800f5 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch @@ -0,0 +1,97 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderItem.java +@@ -71,7 +71,7 @@ + public RenderItem(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_) + { + this.field_175057_n = p_i46552_1_; +- this.field_175059_m = new ItemModelMesher(p_i46552_2_); ++ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46552_2_); + this.func_175041_b(); + this.field_184395_f = p_i46552_3_; + } +@@ -223,7 +223,7 @@ + k = k | -16777216; + } + +- this.func_175033_a(p_175032_1_, bakedquad, k); ++ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_175032_1_, bakedquad, k); + } + } + +@@ -245,17 +245,7 @@ + public IBakedModel func_184393_a(ItemStack p_184393_1_, World p_184393_2_, EntityLivingBase p_184393_3_) + { + IBakedModel ibakedmodel = this.field_175059_m.func_178089_a(p_184393_1_); +- Item item = p_184393_1_.func_77973_b(); +- +- if (item != null && item.func_185040_i()) +- { +- ResourceLocation resourcelocation = ibakedmodel.func_188617_f().func_188021_a(p_184393_1_, p_184393_2_, p_184393_3_); +- return resourcelocation == null ? ibakedmodel : this.field_175059_m.func_178083_a().func_174953_a(new ModelResourceLocation(resourcelocation, "inventory")); +- } +- else +- { +- return ibakedmodel; +- } ++ return ibakedmodel.func_188617_f().handleItemState(ibakedmodel, p_184393_1_, p_184393_2_, p_184393_3_); + } + + public void func_184392_a(ItemStack p_184392_1_, EntityLivingBase p_184392_2_, ItemCameraTransforms.TransformType p_184392_3_, boolean p_184392_4_) +@@ -279,14 +269,9 @@ + GlStateManager.func_179147_l(); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.func_179094_E(); +- ItemCameraTransforms itemcameratransforms = p_184394_2_.func_177552_f(); +- ItemCameraTransforms.func_188034_a(itemcameratransforms.func_181688_b(p_184394_3_), p_184394_4_); ++ // TODO: check if negative scale is a thing ++ p_184394_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_184394_2_, p_184394_3_, p_184394_4_); + +- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_184394_3_))) +- { +- GlStateManager.func_187407_a(GlStateManager.CullFace.FRONT); +- } +- + this.func_180454_a(p_184394_1_, p_184394_2_); + GlStateManager.func_187407_a(GlStateManager.CullFace.BACK); + GlStateManager.func_179121_F(); +@@ -319,7 +304,7 @@ + GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + this.func_180452_a(p_184390_2_, p_184390_3_, p_184390_4_.func_177556_c()); +- p_184390_4_.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI); ++ p_184390_4_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_184390_4_, ItemCameraTransforms.TransformType.GUI, false); + this.func_180454_a(p_184390_1_, p_184390_4_); + GlStateManager.func_179118_c(); + GlStateManager.func_179101_C(); +@@ -426,10 +411,11 @@ + GlStateManager.func_179126_j(); + } + +- if (p_180453_2_.func_77951_h()) ++ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_)) + { +- int j = (int)Math.round(13.0D - (double)p_180453_2_.func_77952_i() * 13.0D / (double)p_180453_2_.func_77958_k()); +- int i = (int)Math.round(255.0D - (double)p_180453_2_.func_77952_i() * 255.0D / (double)p_180453_2_.func_77958_k()); ++ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_); ++ int j = (int)Math.round(13.0D - health * 13.0D); ++ int i = (int)Math.round(255.0D - health * 255.0D); + GlStateManager.func_179140_f(); + GlStateManager.func_179097_i(); + GlStateManager.func_179090_x(); +@@ -440,7 +426,7 @@ + this.func_181565_a(vertexbuffer, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255); + this.func_181565_a(vertexbuffer, p_180453_3_ + 2, p_180453_4_ + 13, 12, 1, (255 - i) / 4, 64, 0, 255); + this.func_181565_a(vertexbuffer, p_180453_3_ + 2, p_180453_4_ + 13, j, 1, 255 - i, i, 0, 255); +- GlStateManager.func_179147_l(); ++ //GlStateManager.enableBlend(); // Forge: Disable Blend because it screws with a lot of things down the line. + GlStateManager.func_179141_d(); + GlStateManager.func_179098_w(); + GlStateManager.func_179145_e(); +@@ -1053,6 +1039,7 @@ + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.LOAD.func_185110_a(), "structure_block"); + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.CORNER.func_185110_a(), "structure_block"); + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.DATA.func_185110_a(), "structure_block"); ++ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m); + } + + public void func_110549_a(IResourceManager p_110549_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/VertexBuffer.java.patch similarity index 78% rename from patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch rename to patches/minecraft/net/minecraft/client/renderer/VertexBuffer.java.patch index bd74c5c47..8f240c8a4 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/VertexBuffer.java.patch @@ -1,6 +1,6 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java -@@ -506,15 +506,15 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/VertexBuffer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/VertexBuffer.java +@@ -510,15 +510,15 @@ break; case USHORT: case SHORT: @@ -22,20 +22,13 @@ } this.func_181667_k(); -@@ -578,6 +578,16 @@ +@@ -609,4 +609,9 @@ + return this.field_179018_e; } } - -+ public void checkAndGrow() -+ { -+ this.func_181670_b(field_179011_q.func_177338_f()/* / 4 * 4 */); -+ } + + public boolean isColorDisabled() + { + return field_78939_q; + } -+ - @SideOnly(Side.CLIENT) - public class State - { + } diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch index 3102b6d98..8b9356ee9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch @@ -1,63 +1,54 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java +++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java -@@ -23,32 +23,9 @@ +@@ -28,26 +28,8 @@ + int l = vertexformatelement.func_177369_e(); + bytebuffer.position(vertexformat.func_181720_d(j)); - for (int j = 0; j < list.size(); ++j) - { -+ // moved to VertexFormatElement.preDraw - VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.func_177375_c(); -- int k = vertexformatelement.func_177367_b().func_177397_c(); -- int l = vertexformatelement.func_177369_e(); -- bytebuffer.position(vertexformat.func_181720_d(j)); -- - switch (vertexformatelement$enumusage) - { - case POSITION: -- GL11.glVertexPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); +- GlStateManager.func_187427_b(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32884); - break; - case UV: - OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l); -- GL11.glTexCoordPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); +- GlStateManager.func_187404_a(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32888); - OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); - break; - case COLOR: -- GL11.glColorPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); +- GlStateManager.func_187400_c(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32886); - break; - case NORMAL: -- GL11.glNormalPointer(k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); +- GlStateManager.func_187446_a(k, i, bytebuffer); +- GlStateManager.func_187410_q(32885); - } ++ // moved to VertexFormatElement.preDraw + vertexformatelement.func_177375_c().preDraw(vertexformat, j, i, bytebuffer); } - GL11.glDrawArrays(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h()); -@@ -57,26 +34,8 @@ - for (int j1 = list.size(); i1 < j1; ++i1) - { - VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c(); -- int k1 = vertexformatelement1.func_177369_e(); -- + GlStateManager.func_187439_f(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h()); +@@ -59,23 +41,8 @@ + VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c(); + int k1 = vertexformatelement1.func_177369_e(); + - switch (vertexformatelement$enumusage1) - { - case POSITION: -- GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); +- GlStateManager.func_187429_p(32884); - break; - case UV: - OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k1); -- GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); +- GlStateManager.func_187429_p(32888); - OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); - break; - case COLOR: -- GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); +- GlStateManager.func_187429_p(32886); - GlStateManager.func_179117_G(); - break; - case NORMAL: -- GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); +- GlStateManager.func_187429_p(32885); - } + // moved to VertexFormatElement.postDraw + vertexformatelement1.func_177375_c().postDraw(vertexformat, i1, i, bytebuffer); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch index 656fce0df..8a1013f88 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch @@ -1,13 +1,47 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java -@@ -5,8 +5,9 @@ +@@ -6,15 +6,25 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class BakedQuad +public class BakedQuad implements net.minecraftforge.client.model.pipeline.IVertexProducer { -+ @Override public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer) { net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this); } protected final int[] field_178215_a; protected final int field_178213_b; protected final EnumFacing field_178214_c; + protected final TextureAtlasSprite field_187509_d; + ++ /** ++ * @deprecated Use constructor with the format argument. ++ */ ++ @Deprecated + public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_) + { ++ this(p_i46574_1_, p_i46574_2_, p_i46574_3_, p_i46574_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b); ++ } ++ ++ public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_, net.minecraft.client.renderer.vertex.VertexFormat format) ++ { ++ this.format = format; + this.field_178215_a = p_i46574_1_; + this.field_178213_b = p_i46574_2_; + this.field_178214_c = p_i46574_3_; +@@ -45,4 +55,17 @@ + { + return this.field_178214_c; + } ++ ++ private final net.minecraft.client.renderer.vertex.VertexFormat format; ++ ++ @Override ++ public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer) ++ { ++ net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this); ++ } ++ ++ public net.minecraft.client.renderer.vertex.VertexFormat getFormat() ++ { ++ return format; ++ } + } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch index fb28a524d..438061260 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch @@ -1,82 +1,93 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java -@@ -20,7 +20,12 @@ +@@ -48,14 +48,20 @@ public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) { -- int[] aint = this.func_178405_a(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); + return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.client.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); + } + + public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.client.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) + { -+ int[] aint = this.makeQuadVertexData(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); - EnumFacing enumfacing = func_178410_a(aint); + BlockFaceUV blockfaceuv = p_178414_3_.field_178243_e; if (p_178414_8_) -@@ -33,16 +38,22 @@ + { +- blockfaceuv = this.func_188010_a(p_178414_3_.field_178243_e, p_178414_5_, p_178414_6_); ++ // TODO fix uvlock for custom rotations ++ //blockfaceuv = this.func_188010_a(face.blockFaceUV, facing, modelRotationIn); + } + +- int[] aint = this.func_188012_a(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_9_); ++ int[] aint = this.makeQuadVertexData(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_9_); + EnumFacing enumfacing = func_178410_a(aint); + + if (p_178414_7_ == null) +@@ -63,6 +69,7 @@ this.func_178408_a(aint, enumfacing); } + net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); - return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing); + return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing, p_178414_4_); } - private int[] func_178405_a(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, ModelRotation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_) +@@ -73,11 +80,16 @@ + + private int[] func_188012_a(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, ModelRotation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) { -+ return func_178405_a(p_178405_1_, p_178405_2_, p_178405_3_, p_178405_4_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); ++ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.client.model.ITransformation)p_188012_5_, p_188012_6_, p_188012_7_); + } + -+ private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_) ++ private int[] makeQuadVertexData(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, net.minecraftforge.client.model.ITransformation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) + { int[] aint = new int[28]; for (int i = 0; i < 4; ++i) { -- this.func_178402_a(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); -+ this.fillVertexData(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); +- this.func_188015_a(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_); ++ this.fillVertexData(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_); } return aint; -@@ -88,12 +99,17 @@ +@@ -123,12 +135,17 @@ - private void func_178402_a(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, ModelRotation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_) + private void func_188015_a(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, ModelRotation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) { -- EnumFacing enumfacing = p_178402_7_.func_177523_a(p_178402_3_); -+ func_178402_a(p_178402_1_, p_178402_2_, p_178402_3_, p_178402_4_, p_178402_5_, p_178402_6_, p_178402_7_, p_178402_8_, p_178402_9_, p_178402_10_); +- EnumFacing enumfacing = p_188015_7_.func_177523_a(p_188015_3_); ++ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.client.model.ITransformation)p_188015_7_, p_188015_8_, p_188015_9_); + } + -+ private void fillVertexData(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, net.minecraftforge.client.model.ITransformation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_) ++ private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.client.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) + { -+ EnumFacing enumfacing = p_178402_7_.rotate(p_178402_3_); - int i = p_178402_10_ ? this.func_178413_a(enumfacing) : -1; - EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.func_179027_a(p_178402_3_).func_179025_a(p_178402_2_); - Vector3f vector3f = new Vector3f(p_178402_5_[enumfacedirection$vertexinformation.field_179184_a], p_178402_5_[enumfacedirection$vertexinformation.field_179182_b], p_178402_5_[enumfacedirection$vertexinformation.field_179183_c]); - this.func_178407_a(vector3f, p_178402_8_); -- int j = this.func_178415_a(vector3f, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_); -+ int j = this.rotateVertex(vector3f, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_); - this.func_178404_a(p_178402_1_, j, p_178402_2_, vector3f, i, p_178402_6_, p_178402_4_.field_178243_e); ++ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_); + int i = p_188015_9_ ? this.func_178413_a(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.func_179027_a(p_188015_3_).func_179025_a(p_188015_2_); + Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.field_179184_a], p_188015_5_[enumfacedirection$vertexinformation.field_179182_b], p_188015_5_[enumfacedirection$vertexinformation.field_179183_c]); + this.func_178407_a(vector3f, p_188015_8_); +- int j = this.func_188011_a(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); ++ int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); + this.func_178404_a(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_); } -@@ -154,14 +170,19 @@ +@@ -189,14 +206,19 @@ - public int func_178415_a(Vector3f p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, ModelRotation p_178415_4_, boolean p_178415_5_) + public int func_188011_a(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, ModelRotation p_188011_4_) { -+ return func_178415_a(p_178415_1_, p_178415_2_, p_178415_3_, p_178415_4_, p_178415_5_); ++ return rotateVertex(p_188011_1_, p_188011_2_, p_188011_3_, (net.minecraftforge.client.model.ITransformation)p_188011_4_); + } + -+ public int rotateVertex(Vector3f p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, net.minecraftforge.client.model.ITransformation p_178415_4_, boolean p_178415_5_) ++ public int rotateVertex(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, net.minecraftforge.client.model.ITransformation p_188011_4_) + { - if (p_178415_4_ == ModelRotation.X0_Y0) + if (p_188011_4_ == ModelRotation.X0_Y0) { - return p_178415_3_; + return p_188011_3_; } else { -- this.func_178406_a(p_178415_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_178415_4_.func_177525_a(), new Vector3f(1.0F, 1.0F, 1.0F)); -- return p_178415_4_.func_177520_a(p_178415_2_, p_178415_3_); -+ net.minecraftforge.client.ForgeHooksClient.transform(p_178415_1_, p_178415_4_.getMatrix()); -+ return p_178415_4_.rotate(p_178415_2_, p_178415_3_); +- this.func_178406_a(p_188011_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_188011_4_.func_177525_a(), new Vector3f(1.0F, 1.0F, 1.0F)); +- return p_188011_4_.func_177520_a(p_188011_2_, p_188011_3_); ++ net.minecraftforge.client.ForgeHooksClient.transform(p_188011_1_, p_188011_4_.getMatrix()); ++ return p_188011_4_.rotate(p_188011_2_, p_188011_3_); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch new file mode 100644 index 000000000..af5da1d94 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java +@@ -20,6 +20,7 @@ + + TextureAtlasSprite func_177554_e(); + ++ @Deprecated + ItemCameraTransforms func_177552_f(); + + ItemOverrideList func_188617_f(); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch index 7d8ba1837..91ecaba4d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch @@ -1,18 +1,40 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java -@@ -10,7 +10,11 @@ - import net.minecraftforge.fml.relauncher.Side; +@@ -12,6 +12,9 @@ import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.util.vector.Quaternion; +/* + * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead + */ @SideOnly(Side.CLIENT) -+@Deprecated public class ItemCameraTransforms { - public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms(); -@@ -117,7 +121,7 @@ +@@ -39,6 +42,7 @@ + this(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a); + } + ++ @Deprecated + public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_) + { + this.field_188036_k = p_i46443_1_.field_188036_k; +@@ -51,6 +55,7 @@ + this.field_181700_p = p_i46443_1_.field_181700_p; + } + ++ @Deprecated + public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_) + { + this.field_188036_k = p_i46569_1_; +@@ -103,6 +108,7 @@ + return new Quaternion(f3 * f6 * f8 + f4 * f5 * f7, f4 * f5 * f8 - f3 * f6 * f7, f3 * f5 * f8 + f4 * f6 * f7, f4 * f6 * f8 - f3 * f5 * f7); + } + ++ @Deprecated + public ItemTransformVec3f func_181688_b(ItemCameraTransforms.TransformType p_181688_1_) + { + switch (p_181688_1_) +@@ -169,7 +175,7 @@ } @SideOnly(Side.CLIENT) @@ -20,4 +42,4 @@ + public static enum TransformType implements net.minecraftforge.client.model.IModelPart { NONE, - THIRD_PERSON, + THIRD_PERSON_LEFT_HAND, diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch new file mode 100644 index 000000000..6f23a6d7b --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java +@@ -1,7 +1,10 @@ + package net.minecraft.client.renderer.block.model; + + import com.google.common.collect.Lists; ++ + import java.util.List; ++ ++import net.minecraft.client.Minecraft; + import net.minecraft.entity.EntityLivingBase; + import net.minecraft.item.ItemStack; + import net.minecraft.util.ResourceLocation; +@@ -27,6 +30,7 @@ + } + } + ++ @Deprecated + public ResourceLocation func_188021_a(ItemStack p_188021_1_, World p_188021_2_, EntityLivingBase p_188021_3_) + { + if (!this.field_188023_b.isEmpty()) +@@ -42,4 +46,18 @@ + + return null; + } ++ ++ public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) ++ { ++ net.minecraft.item.Item item = stack.func_77973_b(); ++ if (item != null && item.func_185040_i()) ++ { ++ ResourceLocation location = func_188021_a(stack, world, entity); ++ if (location != null) ++ { ++ return Minecraft.func_71410_x().func_175599_af().func_175037_a().func_178083_a().func_174953_a(new ModelResourceLocation(location, "inventory")); ++ } ++ } ++ return originalModel; ++ } + } diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch similarity index 53% rename from patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch rename to patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch index 3382ee553..58f308341 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch @@ -1,15 +1,15 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelBakery.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelBakery.java -@@ -114,7 +114,7 @@ - } - catch (Exception var6) - { -- field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation); -+ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var6); - } - } - catch (Exception exception) -@@ -294,6 +294,7 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java +@@ -132,7 +132,7 @@ + { + if (!modelblockdefinition.func_188002_b()) + { +- field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation); ++ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var12); + } + } + } +@@ -370,6 +370,7 @@ protected void func_177592_e() { @@ -17,10 +17,10 @@ this.field_177613_u.put(Item.func_150898_a(Blocks.field_150348_b), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); this.field_177613_u.put(Item.func_150898_a(Blocks.field_150346_d), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); this.field_177613_u.put(Item.func_150898_a(Blocks.field_150344_f), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); -@@ -336,6 +337,10 @@ - this.field_177613_u.put(Item.func_150898_a(Blocks.field_180390_bo), Lists.newArrayList(new String[] {"oak_fence_gate"})); +@@ -413,6 +414,10 @@ this.field_177613_u.put(Item.func_150898_a(Blocks.field_180407_aO), Lists.newArrayList(new String[] {"oak_fence"})); this.field_177613_u.put(Items.field_179570_aq, Lists.newArrayList(new String[] {"oak_door"})); + this.field_177613_u.put(Items.field_151124_az, Lists.newArrayList(new String[] {"oak_boat"})); + for (Entry, Set> e : customVariantNames.entrySet()) + { + this.field_177613_u.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); @@ -28,7 +28,7 @@ } protected List func_177596_a(Item p_177596_1_) -@@ -352,7 +357,7 @@ +@@ -429,7 +434,7 @@ protected ResourceLocation func_177583_a(String p_177583_1_) { @@ -37,16 +37,16 @@ return new ResourceLocation(resourcelocation.func_110624_b(), "item/" + resourcelocation.func_110623_a()); } -@@ -395,7 +400,7 @@ +@@ -536,7 +541,7 @@ for (Entry entry : this.field_177615_s.entrySet()) { ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); -- ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation((String)entry.getKey(), "inventory"); -+ ModelResourceLocation modelresourcelocation1 = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); - ModelBlock modelblock1 = (ModelBlock)this.field_177611_h.get(resourcelocation); +- ModelResourceLocation modelresourcelocation = new ModelResourceLocation((String)entry.getKey(), "inventory"); ++ ModelResourceLocation modelresourcelocation = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); + ModelBlock modelblock = (ModelBlock)this.field_177611_h.get(resourcelocation); - if (modelblock1 != null && modelblock1.func_178303_d()) -@@ -453,6 +458,11 @@ + if (modelblock != null && modelblock.func_178303_d()) +@@ -623,6 +628,11 @@ private IBakedModel func_177578_a(ModelBlock p_177578_1_, ModelRotation p_177578_2_, boolean p_177578_3_) { @@ -56,26 +56,26 @@ + protected IBakedModel bakeModel(ModelBlock p_177578_1_, net.minecraftforge.client.model.ITransformation p_177578_2_, boolean p_177578_3_) + { TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c("particle"))); - SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_)).func_177646_a(textureatlassprite); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_, p_177578_1_.func_187967_g())).func_177646_a(textureatlassprite); -@@ -463,13 +473,13 @@ - BlockPartFace blockpartface = (BlockPartFace)blockpart.field_178240_c.get(enumfacing); - TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d))); +@@ -639,13 +649,13 @@ + BlockPartFace blockpartface = (BlockPartFace)blockpart.field_178240_c.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d))); -- if (blockpartface.field_178244_b == null) -+ if (blockpartface.field_178244_b == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix())) - { -- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); -+ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); - } - else - { -- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); -+ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); +- if (blockpartface.field_178244_b == null) ++ if (blockpartface.field_178244_b == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix())) + { +- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); + } + else + { +- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); + } } } - } -@@ -479,9 +489,14 @@ +@@ -656,9 +666,14 @@ private BakedQuad func_177589_a(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) { @@ -91,28 +91,14 @@ private void func_177597_h() { this.func_177574_i(); -@@ -722,4 +737,35 @@ - field_177617_q.field_178317_b = "class generation marker"; +@@ -878,4 +893,18 @@ + field_177606_o.field_178317_b = "generation marker"; field_177616_r.field_178317_b = "block entity marker"; } -+ -+ /*********************************************************** -+ * FML Start -+ ***********************************************************/ -+ private static Map, Set> customVariantNames = Maps.newHashMap(); -+ /** -+ * @deprecated use registerItemVariants -+ */ -+ @Deprecated -+ public static void addVariantName(Item item, String... names) -+ { -+ if (customVariantNames.containsKey(item.delegate)) -+ customVariantNames.get(item.delegate).addAll(Lists.newArrayList(names)); -+ else -+ customVariantNames.put(item.delegate, Sets.newHashSet(names)); -+ } + -+ public static void registerItemVariants(Item item, T... names) ++ private static Map, Set> customVariantNames = Maps.newHashMap(); ++ ++ public static void registerItemVariants(Item item, ResourceLocation... names) + { + if (!customVariantNames.containsKey(item.delegate)) + { @@ -123,7 +109,4 @@ + customVariantNames.get(item.delegate).add(name.toString()); + } + } -+ /*********************************************************** -+ * FML End -+ ***********************************************************/ } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch index 30299b290..aef97997d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java -@@ -29,7 +29,7 @@ +@@ -31,7 +31,7 @@ public static ModelBlockDefinition func_178331_a(Reader p_178331_0_) { @@ -8,22 +8,4 @@ + return net.minecraftforge.client.model.BlockStateLoader.load(p_178331_0_, field_178333_a); } - public ModelBlockDefinition(Collection p_i46221_1_) -@@ -155,11 +155,17 @@ - return this.field_178437_a; - } - -+ @Deprecated - public ModelRotation func_178432_b() - { - return this.field_178435_b; - } - -+ public net.minecraftforge.client.model.IModelState getState() -+ { -+ return this.field_178435_b; -+ } -+ - public boolean func_178433_c() - { - return this.field_178436_c; + public ModelBlockDefinition(Map p_i46572_1_, Multipart p_i46572_2_) diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch new file mode 100644 index 000000000..c64c3804f --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java +@@ -24,9 +24,11 @@ + + public void func_110549_a(IResourceManager p_110549_1_) + { +- ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c); ++ // FIXME: reenable after ModelLoader is fixed ++ ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c); //new net.minecraftforge.client.model.ModelLoader(resourceManager, this.texMap, this.modelProvider); + this.field_174958_a = modelbakery.func_177570_a(); + this.field_174955_d = (IBakedModel)this.field_174958_a.func_82594_a(ModelBakery.field_177604_a); ++ //net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.modelRegistry, modelbakery); + this.field_174957_c.func_178124_c(); + } + diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch similarity index 85% rename from patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch rename to patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch index 893292696..39044dd39 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelRotation.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelRotation.java +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java @@ -10,7 +10,7 @@ import org.lwjgl.util.vector.Vector3f; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch new file mode 100644 index 000000000..51f084a94 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/Variant.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/Variant.java +@@ -32,11 +32,17 @@ + return this.field_188050_a; + } + ++ @Deprecated + public ModelRotation func_188048_b() + { + return this.field_188051_b; + } + ++ public net.minecraftforge.client.model.IModelState getState() ++ { ++ return this.field_188051_b; ++ } ++ + public boolean func_188049_c() + { + return this.field_188052_c; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch index 035810033..c0c691837 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch @@ -4,8 +4,8 @@ } else { -- s = ((IProperty)this.field_178142_a).func_177702_a((Comparable)map.remove(this.field_178142_a)); -+ s = String.format("%s:%s", ((ResourceLocation)Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c())).func_110624_b(), ((IProperty)this.field_178142_a).func_177702_a((Comparable)map.remove(this.field_178142_a))); +- s = this.func_187490_a(this.field_178142_a, map); ++ s = String.format("%s:%s", Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c()).func_110624_b(), this.func_187490_a(this.field_178142_a, map)); } if (this.field_178141_c != null) diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index c7abba832..e256ce39c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java +++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java -@@ -131,7 +131,9 @@ +@@ -133,7 +133,9 @@ return; } @@ -11,7 +11,7 @@ p_178581_4_.func_178543_a(compiledchunk); } finally -@@ -158,7 +160,7 @@ +@@ -160,7 +162,7 @@ lvt_10_1_.func_178606_a(blockpos$mutableblockpos); } @@ -20,27 +20,27 @@ { TileEntity tileentity = iblockaccess.func_175625_s(new BlockPos(blockpos$mutableblockpos)); TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.field_147556_a.func_147547_b(tileentity); -@@ -174,7 +176,9 @@ +@@ -176,7 +178,9 @@ } } -- EnumWorldBlockLayer enumworldblocklayer1 = block.func_180664_k(); -+ for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) { -+ if(!block.canRenderInLayer(enumworldblocklayer1)) continue; -+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1); - int j = enumworldblocklayer1.ordinal(); +- BlockRenderLayer blockrenderlayer1 = block.func_180664_k(); ++ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) { ++ if(!block.canRenderInLayer(blockrenderlayer1)) continue; ++ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1); + int j = blockrenderlayer1.ordinal(); - if (block.func_149645_b() != -1) -@@ -189,6 +193,7 @@ + if (block.func_176223_P().func_185901_i() != EnumBlockRenderType.INVISIBLE) +@@ -191,6 +195,7 @@ - aboolean[j] |= blockrendererdispatcher.func_175018_a(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); + aboolean[j] |= blockrendererdispatcher.func_175018_a(iblockstate, blockpos$mutableblockpos, iblockaccess, vertexbuffer); } + } } - for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) -@@ -385,6 +390,26 @@ - return this.field_178593_n; + for (BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) +@@ -413,6 +418,26 @@ + return this.field_178593_n && this.field_188284_q; } + /* ======================================== FORGE START =====================================*/ diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch index 155cd7b44..93c9d6fd0 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java -@@ -41,7 +41,7 @@ +@@ -44,7 +44,7 @@ boolean flag = p_177077_9_.func_177556_c(); int i = this.func_177078_a(itemstack); float f = 0.25F; @@ -9,44 +9,53 @@ float f2 = p_177077_9_.func_177552_f().func_181688_b(ItemCameraTransforms.TransformType.GROUND).field_178363_d.y; GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); -@@ -110,7 +110,6 @@ +@@ -114,16 +114,13 @@ + GlStateManager.func_179094_E(); + IBakedModel ibakedmodel = this.field_177080_a.func_184393_a(itemstack, p_76986_1_.field_70170_p, (EntityLivingBase)null); + int j = this.func_177077_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_9_, ibakedmodel); +- float f = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.x; +- float f1 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.y; +- float f2 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.z; + boolean flag1 = ibakedmodel.func_177556_c(); - for (int j = 0; j < i; ++j) + if (!flag1) { -- if (ibakedmodel.func_177556_c()) - { - GlStateManager.func_179094_E(); +- float f3 = -0.0F * (float)(j - 1) * 0.5F * f; +- float f4 = -0.0F * (float)(j - 1) * 0.5F * f1; +- float f5 = -0.09375F * (float)(j - 1) * 0.5F * f2; ++ float f3 = -0.0F * (float)(j - 1) * 0.5F; ++ float f4 = -0.0F * (float)(j - 1) * 0.5F; ++ float f5 = -0.09375F * (float)(j - 1) * 0.5F; + GlStateManager.func_179109_b(f3, f4, f5); + } -@@ -119,25 +118,15 @@ - float f = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; - float f1 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; - float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; -- GlStateManager.func_179109_b(f, f1, f2); -+ GlStateManager.func_179109_b(shouldSpreadItems() ? f : 0.0F, shouldSpreadItems() ? f1 : 0.0F, f2); +@@ -144,10 +141,10 @@ + float f7 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f9 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f6 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; +- GlStateManager.func_179109_b(f7, f9, f6); ++ GlStateManager.func_179109_b(shouldSpreadItems() ? f7 : 0, shouldSpreadItems() ? f9 : 0, f6); } -+ if (ibakedmodel.func_177556_c()) - GlStateManager.func_179152_a(0.5F, 0.5F, 0.5F); - ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND); -+ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND); ++ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false); this.field_177080_a.func_180454_a(itemstack, ibakedmodel); GlStateManager.func_179121_F(); } -- else -- { -- GlStateManager.func_179094_E(); +@@ -162,10 +159,10 @@ + GlStateManager.func_179109_b(f8, f10, 0.0F); + } + - ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND); -- this.field_177080_a.func_180454_a(itemstack, ibakedmodel); -- GlStateManager.func_179121_F(); -- float f3 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.x; -- float f4 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.y; -- float f5 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.z; -- GlStateManager.func_179109_b(0.0F * f3, 0.0F * f4, 0.046875F * f5); -- } ++ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false); + this.field_177080_a.func_180454_a(itemstack, ibakedmodel); + GlStateManager.func_179121_F(); +- GlStateManager.func_179109_b(0.0F * f, 0.0F * f1, 0.09375F * f2); ++ GlStateManager.func_179109_b(0.0F, 0.0F, 0.09375F); + } } - GlStateManager.func_179121_F(); -@@ -157,4 +146,25 @@ +@@ -192,4 +189,25 @@ { return TextureMap.field_110575_b; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch deleted file mode 100644 index 253b492fc..000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java -@@ -72,7 +72,7 @@ - public RenderItem(TextureManager p_i46165_1_, ModelManager p_i46165_2_) - { - this.field_175057_n = p_i46165_1_; -- this.field_175059_m = new ItemModelMesher(p_i46165_2_); -+ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46165_2_); - this.func_175041_b(); - } - -@@ -226,7 +226,7 @@ - k = k | -16777216; - } - -- this.func_175033_a(p_175032_1_, bakedquad, k); -+ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_175032_1_, bakedquad, k); - } - } - -@@ -296,6 +296,11 @@ - modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory"); - } - } -+ else -+ { -+ // TODO: maybe switch to the smart player model / normal smart item model? -+ modelresourcelocation = item.getModel(p_175049_1_, entityplayer, entityplayer.func_71052_bv()); -+ } - - if (modelresourcelocation != null) - { -@@ -317,14 +322,9 @@ - GlStateManager.func_179147_l(); - GlStateManager.func_179120_a(770, 771, 1, 0); - GlStateManager.func_179094_E(); -- ItemCameraTransforms itemcameratransforms = p_175040_2_.func_177552_f(); -- itemcameratransforms.func_181689_a(p_175040_3_); -+ // TODO: check if negative scale is a thing -+ p_175040_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_175040_2_, p_175040_3_); - -- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_175040_3_))) -- { -- GlStateManager.func_179107_e(1028); -- } -- - this.func_180454_a(p_175040_1_, p_175040_2_); - GlStateManager.func_179107_e(1029); - GlStateManager.func_179121_F(); -@@ -352,7 +352,7 @@ - GlStateManager.func_179112_b(770, 771); - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - this.func_180452_a(p_175042_2_, p_175042_3_, ibakedmodel.func_177556_c()); -- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI); -+ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GUI); - this.func_180454_a(p_175042_1_, ibakedmodel); - GlStateManager.func_179118_c(); - GlStateManager.func_179101_C(); -@@ -459,10 +459,11 @@ - GlStateManager.func_179126_j(); - } - -- if (p_180453_2_.func_77951_h()) -+ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_)) - { -- int j = (int)Math.round(13.0D - (double)p_180453_2_.func_77952_i() * 13.0D / (double)p_180453_2_.func_77958_k()); -- int i = (int)Math.round(255.0D - (double)p_180453_2_.func_77952_i() * 255.0D / (double)p_180453_2_.func_77958_k()); -+ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_); -+ int j = (int)Math.round(13.0D - health * 13.0D); -+ int i = (int)Math.round(255.0D - health * 255.0D); - GlStateManager.func_179140_f(); - GlStateManager.func_179097_i(); - GlStateManager.func_179090_x(); -@@ -473,7 +474,7 @@ - this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255); - this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 12, 1, (255 - i) / 4, 64, 0, 255); - this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, j, 1, 255 - i, i, 0, 255); -- GlStateManager.func_179147_l(); -+ //GlStateManager.enableBlend(); // Forge: Disable Blend because it screws with a lot of things down the line. - GlStateManager.func_179141_d(); - GlStateManager.func_179098_w(); - GlStateManager.func_179145_e(); -@@ -1038,6 +1039,7 @@ - this.func_175029_a(Blocks.field_150420_aW, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "brown_mushroom_block"); - this.func_175029_a(Blocks.field_150419_aX, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "red_mushroom_block"); - this.func_175031_a(Blocks.field_150380_bt, "dragon_egg"); -+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m); - } - - public void func_110549_a(IResourceManager p_110549_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch similarity index 58% rename from patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch rename to patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch index 04e75b48e..8d2a95086 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch @@ -1,51 +1,51 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java -@@ -38,6 +38,9 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java +@@ -32,6 +32,9 @@ protected List> field_177097_h = Lists.>newArrayList(); - protected boolean field_177098_i = false; + protected boolean field_188323_j = false; + public static float NAME_TAG_RANGE = 64.0f; + public static float NAME_TAG_RANGE_SNEAK = 32.0f; + - public RendererLivingEntity(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_) + public RenderLivingBase(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_) { super(p_i46156_1_); -@@ -83,10 +86,12 @@ +@@ -77,10 +80,12 @@ public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return; ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return; GlStateManager.func_179094_E(); GlStateManager.func_179129_p(); this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_); -- this.field_77045_g.field_78093_q = p_76986_1_.func_70115_ae(); -+ boolean shouldSit = p_76986_1_.func_70115_ae() && (p_76986_1_.field_70154_o != null && p_76986_1_.field_70154_o.shouldRiderSit()); +- this.field_77045_g.field_78093_q = p_76986_1_.func_184218_aH(); ++ boolean shouldSit = p_76986_1_.func_184218_aH() && (p_76986_1_.func_184187_bx() != null && p_76986_1_.func_184187_bx().shouldRiderSit()); + this.field_77045_g.field_78093_q = shouldSit; this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_(); try -@@ -95,7 +100,7 @@ +@@ -89,7 +94,7 @@ float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_); float f2 = f1 - f; -- if (p_76986_1_.func_70115_ae() && p_76986_1_.field_70154_o instanceof EntityLivingBase) -+ if (shouldSit && p_76986_1_.field_70154_o instanceof EntityLivingBase) +- if (p_76986_1_.func_184218_aH() && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) ++ if (shouldSit && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) { - EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.field_70154_o; + EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.func_184187_bx(); f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_); -@@ -191,6 +196,7 @@ - { - super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); - } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_)); +@@ -197,6 +202,7 @@ + GlStateManager.func_179089_o(); + GlStateManager.func_179121_F(); + super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_)); } - protected boolean func_177088_c(T p_177088_1_) -@@ -469,10 +475,11 @@ + public float func_188322_c(T p_188322_1_, float p_188322_2_) +@@ -452,10 +458,11 @@ public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return; ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return; if (this.func_177070_b(p_177067_1_)) { double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h); @@ -54,11 +54,11 @@ if (d0 < (double)(f * f)) { -@@ -518,6 +525,7 @@ - } +@@ -464,6 +471,7 @@ + this.func_188296_a(p_177067_1_, p_177067_2_, p_177067_4_, p_177067_6_, s, d0); } } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_)); } protected boolean func_177070_b(T p_177070_1_) 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 267976b53..9292829e3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,27 +1,28 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java -@@ -192,7 +192,12 @@ +@@ -204,8 +204,13 @@ this.field_178637_m = new RenderPlayer(this); this.field_178636_l.put("default", this.field_178637_m); this.field_178636_l.put("slim", new RenderPlayer(this, true)); + net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o); } -+ + + public Map getSkinMap() { + return (Map) java.util.Collections.unmodifiableMap(field_178636_l); + } - ++ public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) { -@@ -241,9 +246,9 @@ + this.field_78725_b = p_178628_1_; +@@ -253,9 +258,9 @@ IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_)); Block block = iblockstate.func_177230_c(); - if (block == Blocks.field_150324_C) -+ if (block.isBed(p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_)) ++ if (block.isBed(iblockstate, p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_)) { -- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b(); -+ int i = block.getBedDirection(p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b(); +- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b(); ++ int i = block.getBedDirection(iblockstate, p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b(); this.field_78735_i = (float)(i * 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 984365594..f54ab0437 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java -@@ -49,6 +49,7 @@ +@@ -55,6 +55,7 @@ public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { @@ -8,9 +8,9 @@ if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_78734_h == p_76986_1_) { double d0 = p_76986_4_; -@@ -61,6 +62,7 @@ - this.func_177137_d(p_76986_1_); +@@ -69,6 +70,7 @@ super.func_76986_a(p_76986_1_, p_76986_2_, d0, p_76986_6_, p_76986_8_, p_76986_9_); + GlStateManager.func_187440_b(GlStateManager.Profile.PLAYER_SKIN); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_)); } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch index 2bbf64ef4..7d33508e9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -1,47 +1,46 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java -@@ -55,29 +55,28 @@ - T t = this.func_177175_a(p_177182_9_); - t.func_178686_a(this.field_177190_a.func_177087_b()); - t.func_78086_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_4_); -+ t = getArmorModelHook(p_177182_1_, itemstack, p_177182_9_, t); - this.func_177179_a(t, p_177182_9_); - boolean flag = this.func_177180_b(p_177182_9_); -- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag)); -+ this.field_177190_a.func_110776_a(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, null)); +@@ -59,29 +59,27 @@ + T t = this.func_188360_a(p_188361_9_); + t.func_178686_a(this.field_177190_a.func_177087_b()); + t.func_78086_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_4_); ++ t = getArmorModelHook(p_188361_1_, itemstack, p_188361_9_, t); + this.func_188359_a(t, p_188361_9_); + boolean flag = this.func_188363_b(p_188361_9_); +- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag)); ++ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null)); -- switch (itemarmor.func_82812_d()) -- { -- case LEATHER: - int i = itemarmor.func_82814_b(itemstack); -+ { -+ if (i != -1) // Allow this for anything, not only cloth. +- switch (itemarmor.func_82812_d()) +- { +- case LEATHER: + int i = itemarmor.func_82814_b(itemstack); + { - float f = (float)(i >> 16 & 255) / 255.0F; - float f1 = (float)(i >> 8 & 255) / 255.0F; - float f2 = (float)(i & 255) / 255.0F; - GlStateManager.func_179131_c(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e); - t.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); -- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay")); -- case CHAIN: -- case IRON: -- case GOLD: -- case DIAMOND: -+ this.field_177190_a.func_110776_a(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, "overlay")); -+ } -+ { // Non-colored - GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e); - t.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); -- default: ++ if (i != 0xFFFFFF) // Allow this for anything, not only cloth ++ { + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + GlStateManager.func_179131_c(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e); + t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); +- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay")); +- case CHAIN: +- case IRON: +- case GOLD: +- case DIAMOND: ++ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay")); ++ } ++ { // Non-colored + GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e); + t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); +- default: - -- if (!this.field_177193_i && itemstack.func_77948_v()) -+ } -+ // Default -+ if (!this.field_177193_i && itemstack.func_77962_s()) - { - this.func_177183_a(p_177182_1_, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); - } -@@ -135,11 +134,13 @@ +- if (!this.field_177193_i && itemstack.func_77948_v()) ++ } // Default ++ if (!this.field_177193_i && itemstack.func_77962_s()) + { + func_188364_a(this.field_177190_a, p_188361_1_, t, p_188361_2_, p_188361_3_, p_188361_4_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); + } +@@ -140,11 +138,13 @@ GlStateManager.func_179084_k(); } @@ -55,21 +54,21 @@ private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) { String s = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.func_82812_d().func_179242_c(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); -@@ -157,4 +158,49 @@ +@@ -162,4 +162,49 @@ protected abstract void func_177177_a(); - protected abstract void func_177179_a(T p_177179_1_, int p_177179_2_); + protected abstract void func_188359_a(T p_188359_1_, EntityEquipmentSlot p_188359_2_); + + /*=================================== FORGE START =========================================*/ + + /** + * Hook to allow item-sensitive armor model. for LayerBipedArmor. + */ -+ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, int slot, T model) ++ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, EntityEquipmentSlot slot, T model) + { + return model; + } -+ ++ + /** + * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide. + * @@ -79,7 +78,7 @@ + * @param type Subtype, can be null or "overlay" + * @return ResourceLocation pointing at the armor's texture + */ -+ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type) ++ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, EntityEquipmentSlot slot, String type) + { + ItemArmor item = (ItemArmor)stack.func_77973_b(); + String texture = item.func_82812_d().func_179242_c(); @@ -90,7 +89,7 @@ + domain = texture.substring(0, idx); + texture = texture.substring(idx + 1); + } -+ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (func_188363_b(slot) ? 2 : 1), type == null ? "" : String.format("_%s", type)); + + s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); + ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch index e391d61ac..b5b72c195 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java -@@ -49,4 +49,10 @@ +@@ -51,4 +51,10 @@ { p_177194_1_.func_178719_a(false); } + + @Override -+ protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, int slot, ModelBiped model) ++ protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model) + { + return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model); + } 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 1dbb9630a..9f4d33cb8 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 -@@ -58,12 +58,17 @@ +@@ -56,18 +56,24 @@ { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); Arrays.sort((Object[])astitcher$holder); @@ -18,15 +18,14 @@ throw new StitcherException(stitcher$holder, s); } } -@@ -73,6 +78,7 @@ - this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c); - this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d); - } + + this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c); + this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d); + net.minecraftforge.fml.common.ProgressManager.pop(bar); } public List func_94309_g() -@@ -260,7 +266,7 @@ +@@ -238,7 +244,7 @@ public String toString() { 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 7d8895248..5ef4028b9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java -@@ -402,4 +402,30 @@ +@@ -398,4 +398,30 @@ { 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 133b68b97..4a37adc65 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java -@@ -28,6 +28,7 @@ +@@ -26,6 +26,7 @@ @SideOnly(Side.CLIENT) public class TextureMap extends AbstractTexture implements ITickableTextureObject { @@ -8,7 +8,7 @@ private static final Logger field_147635_d = LogManager.getLogger(); public static final ResourceLocation field_174945_f = new ResourceLocation("missingno"); public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png"); -@@ -38,6 +39,7 @@ +@@ -36,6 +37,7 @@ private final IIconCreator field_174946_m; private int field_147636_j; private final TextureAtlasSprite field_94249_f; @@ -16,7 +16,7 @@ public TextureMap(String p_i46099_1_) { -@@ -46,12 +48,23 @@ +@@ -44,12 +46,23 @@ public TextureMap(String p_i46100_1_, IIconCreator p_i46100_2_) { @@ -41,7 +41,7 @@ } private void func_110569_e() -@@ -90,12 +103,28 @@ +@@ -88,12 +101,26 @@ int j = Integer.MAX_VALUE; int k = 1 << this.field_147636_j; @@ -53,67 +53,52 @@ for (Entry entry : this.field_110574_e.entrySet()) { TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue(); - ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.func_94215_i()); - ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); -+ bar.step(resourcelocation1.func_110623_a()); + ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite); ++ bar.step(resourcelocation.func_110623_a()); + IResource iresource = null; + if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) + { -+ if (!textureatlassprite.load(p_110571_1_, resourcelocation)) ++ if (textureatlassprite.load(p_110571_1_, resourcelocation)) + { -+ j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b())); -+ stitcher.func_110934_a(textureatlassprite); ++ continue; + } -+ continue; + } -+ ++ else try { - IResource iresource = p_110571_1_.func_110536_a(resourcelocation1); -@@ -145,12 +174,14 @@ + PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation)); +@@ -103,12 +130,14 @@ } catch (RuntimeException runtimeexception) { -- field_147635_d.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); -+ //logger.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); +- field_147635_d.error((String)("Unable to parse metadata from " + resourcelocation), (Throwable)runtimeexception); ++ //logger.error((String)("Unable to parse metadata from " + resourcelocation), (Throwable)runtimeexception); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation, runtimeexception.getMessage()); continue; } - catch (IOException ioexception1) + catch (IOException ioexception) { -- field_147635_d.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); -+ //logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); +- field_147635_d.error((String)("Using missing texture, unable to load " + resourcelocation), (Throwable)ioexception); ++ //logger.error((String)("Using missing texture, unable to load " + resourcelocation), (Throwable)ioexception); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation); continue; } - -@@ -166,6 +197,7 @@ + finally +@@ -128,6 +157,7 @@ stitcher.func_110934_a(textureatlassprite); } + net.minecraftforge.fml.common.ProgressManager.pop(bar); - int j1 = Math.min(j, k); - int k1 = MathHelper.func_151239_c(j1); + int l = Math.min(j, k); + int i1 = MathHelper.func_151239_c(l); -@@ -175,8 +207,11 @@ - this.field_147636_j = k1; - } - -+ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.field_110574_e.size()); - for (final TextureAtlasSprite textureatlassprite1 : this.field_110574_e.values()) - { -+ if (skipFirst) break; -+ bar.step(textureatlassprite1.func_94215_i()); - try - { - textureatlassprite1.func_147963_d(this.field_147636_j); -@@ -213,9 +248,13 @@ +@@ -139,9 +169,12 @@ this.field_94249_f.func_147963_d(this.field_147636_j); stitcher.func_110934_a(this.field_94249_f); -+ net.minecraftforge.fml.common.ProgressManager.pop(bar); + skipFirst = false; -+ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 3); ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 2); try { @@ -121,7 +106,7 @@ stitcher.func_94305_f(); } catch (StitcherException stitcherexception) -@@ -224,9 +263,11 @@ +@@ -150,11 +183,16 @@ } field_147635_d.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c}); @@ -129,13 +114,18 @@ TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b()); Map map = Maps.newHashMap(this.field_110574_e); -+ bar.step("Uploading GL texture"); - for (TextureAtlasSprite textureatlassprite2 : stitcher.func_94309_g()) ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture mipmap and upload", stitcher.func_94309_g().size()); ++ + for (TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) { - String s = textureatlassprite2.func_94215_i(); -@@ -256,6 +297,13 @@ ++ bar.step(textureatlassprite1.func_94215_i()); + if (textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) + { + String s = textureatlassprite1.func_94215_i(); +@@ -185,6 +223,13 @@ { - textureatlassprite3.func_94217_a(this.field_94249_f); + textureatlassprite2.func_94217_a(this.field_94249_f); } + + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); @@ -146,8 +136,8 @@ + net.minecraftforge.fml.common.ProgressManager.pop(bar); } - private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) -@@ -319,4 +367,37 @@ + private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) +@@ -317,4 +362,37 @@ { return this.field_94249_f; } diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch index a9d758ece..cb9c3dc8e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java -@@ -197,9 +197,11 @@ +@@ -202,9 +202,11 @@ public static void func_180600_a(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) { @@ -12,4 +12,4 @@ + } if (p_180600_1_ >= 0) { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_180600_1_); + GlStateManager.func_187421_b(3553, 33085, p_180600_1_); diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch index d0ec3a7d9..1cd896209 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java -@@ -99,15 +99,18 @@ +@@ -105,15 +105,18 @@ GlStateManager.func_179140_f(); int i = p_82402_1_.func_82333_j(); @@ -21,9 +21,9 @@ this.field_76990_c.field_78724_e.func_110577_a(field_110789_a); GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F); float f = 0.0078125F; -@@ -165,6 +168,7 @@ - textureatlassprite.func_94219_l(); - } +@@ -142,6 +145,7 @@ + RenderHelper.func_74518_a(); + GlStateManager.func_179099_b(); } + } diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch index 22634cf06..3977f21e2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java -@@ -78,6 +78,7 @@ +@@ -98,6 +98,7 @@ { TileEntityRendererDispatcher.field_147556_a.func_147549_a(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); } diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch index 92a84ea6b..d1fbb80f3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java -@@ -102,11 +102,14 @@ +@@ -106,11 +106,14 @@ { if (p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n()) { @@ -9,13 +9,13 @@ int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0); int j = i % 65536; int k = i / 65536; - OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j / 1.0F, (float)k / 1.0F); + OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k); GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + } BlockPos blockpos = p_180546_1_.func_174877_v(); this.func_178469_a(p_180546_1_, (double)blockpos.func_177958_n() - field_147554_b, (double)blockpos.func_177956_o() - field_147555_c, (double)blockpos.func_177952_p() - field_147552_d, p_180546_2_, p_180546_3_); } -@@ -125,6 +128,11 @@ +@@ -129,6 +132,11 @@ { try { @@ -27,7 +27,7 @@ tileentityspecialrenderer.func_180535_a(p_178469_1_, p_178469_2_, p_178469_4_, p_178469_6_, p_178469_8_, p_178469_9_); } catch (Throwable throwable) -@@ -146,4 +154,49 @@ +@@ -155,4 +163,49 @@ { return this.field_147557_n; } diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch index 2dcbbec25..adf45bb4c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch @@ -5,5 +5,5 @@ return false; } + -+ public void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, net.minecraft.client.renderer.WorldRenderer worldRenderer) {} ++ public void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, net.minecraft.client.renderer.VertexBuffer buffer) {} } diff --git a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch index fa5296e39..4d42cf311 100644 --- a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/resources/FallbackResourceManager.java +++ ../src-work/minecraft/net/minecraft/client/resources/FallbackResourceManager.java -@@ -67,6 +67,7 @@ +@@ -68,6 +68,7 @@ throw new FileNotFoundException(p_110536_1_.toString()); } diff --git a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch b/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch index 4bc3d483c..07b5cb779 100644 --- a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch @@ -5,6 +5,6 @@ field_135049_a.func_135022_a(p_110549_1_, list); + net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(field_135049_a.field_135032_a, this.field_135048_c); - StringTranslate.func_135063_a(field_135049_a.field_135032_a); + LanguageMap.func_135063_a(field_135049_a.field_135032_a); } diff --git a/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch b/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch deleted file mode 100644 index d792aea1b..000000000 --- a/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/IBakedModel.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/IBakedModel.java -@@ -23,5 +23,6 @@ - - TextureAtlasSprite func_177554_e(); - -+ @Deprecated - ItemCameraTransforms func_177552_f(); - } diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch deleted file mode 100644 index 9b92db76e..000000000 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelManager.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelManager.java -@@ -24,9 +24,10 @@ - - public void func_110549_a(IResourceManager p_110549_1_) - { -- ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c); -+ ModelBakery modelbakery = new net.minecraftforge.client.model.ModelLoader(p_110549_1_, this.field_174956_b, this.field_174957_c); - this.field_174958_a = modelbakery.func_177570_a(); - this.field_174955_d = (IBakedModel)this.field_174958_a.func_82594_a(ModelBakery.field_177604_a); -+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery); - this.field_174957_c.func_178124_c(); - } - diff --git a/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch b/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch index 7d50686a0..5a85b1f67 100644 --- a/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch +++ b/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/settings/GameSettings.java +++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java -@@ -994,6 +994,7 @@ +@@ -887,6 +887,7 @@ public void func_74303_b() { diff --git a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch index 5c9c777d2..8bcdddcc2 100644 --- a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java +++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java -@@ -119,8 +119,17 @@ +@@ -118,8 +118,17 @@ if (this.field_147619_e) { OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.field_147624_h); @@ -18,7 +18,7 @@ } this.func_147614_f(); -@@ -280,4 +289,36 @@ +@@ -279,4 +288,36 @@ GlStateManager.func_179086_m(i); this.func_147609_e(); } diff --git a/patches/minecraft/net/minecraft/command/CommandBase.java.patch b/patches/minecraft/net/minecraft/command/CommandBase.java.patch index 1cfdfa406..49c1eaedf 100644 --- a/patches/minecraft/net/minecraft/command/CommandBase.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandBase.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/CommandBase.java +++ ../src-work/minecraft/net/minecraft/command/CommandBase.java -@@ -329,7 +329,7 @@ - ichatcomponent.func_150258_a(" "); +@@ -369,7 +369,7 @@ + itextcomponent.func_150258_a(" "); } -- IChatComponent ichatcomponent1 = new ChatComponentText(p_147176_1_[i]); -+ IChatComponent ichatcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(p_147176_1_[i]); // Forge: links for messages +- ITextComponent itextcomponent1 = new TextComponentString(p_147176_1_[i]); ++ ITextComponent itextcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(p_147176_1_[i]); // Forge: links for messages if (p_147176_3_) { diff --git a/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch b/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch index 361b3dc03..f3ca18c30 100644 --- a/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/CommandEnchant.java +++ ../src-work/minecraft/net/minecraft/command/CommandEnchant.java -@@ -93,7 +93,7 @@ +@@ -85,7 +85,7 @@ { - Enchantment enchantment2 = Enchantment.func_180306_c(l); + Enchantment enchantment1 = Enchantment.func_185262_c(k); -- if (!enchantment2.func_77326_a(enchantment1)) -+ if (!enchantment2.func_77326_a(enchantment1) || !enchantment1.func_77326_a(enchantment2)) //Forge BugFix: Let Both enchantments veto being together +- if (!enchantment.func_77326_a(enchantment1)) ++ if (!enchantment.func_77326_a(enchantment1) || !enchantment1.func_77326_a(enchantment)) //Forge BugFix: Let Both enchantments veto being together { - throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.func_77316_c(j), enchantment2.func_77316_c(nbttaglist.func_150305_b(k).func_74765_d("lvl"))}); + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment.func_77316_c(i), enchantment1.func_77316_c(nbttaglist.func_150305_b(j).func_74765_d("lvl"))}); } diff --git a/patches/minecraft/net/minecraft/command/CommandFill.java.patch b/patches/minecraft/net/minecraft/command/CommandFill.java.patch index c9950fe71..38da66d37 100644 --- a/patches/minecraft/net/minecraft/command/CommandFill.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandFill.java.patch @@ -1,28 +1,28 @@ --- ../src-base/minecraft/net/minecraft/command/CommandFill.java +++ ../src-work/minecraft/net/minecraft/command/CommandFill.java -@@ -48,6 +48,7 @@ +@@ -50,6 +50,7 @@ { - i = func_175764_a(p_71515_2_[7], 0, 15); + i = func_175764_a(p_184881_3_[7], 0, 15); } + IBlockState state = block.func_176203_a(i); BlockPos blockpos2 = new BlockPos(Math.min(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.min(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.min(blockpos.func_177952_p(), blockpos1.func_177952_p())); BlockPos blockpos3 = new BlockPos(Math.max(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.max(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.max(blockpos.func_177952_p(), blockpos1.func_177952_p())); -@@ -75,7 +76,7 @@ +@@ -77,7 +78,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (p_71515_2_.length >= 10 && block.func_149716_u()) -+ if (p_71515_2_.length >= 10 && block.hasTileEntity(state)) +- if (p_184881_3_.length >= 10 && block.func_149716_u()) ++ if (p_184881_3_.length >= 10 && block.hasTileEntity(state)) { - String s = func_147178_a(p_71515_1_, p_71515_2_, 9).func_150260_c(); + String s = func_147178_a(p_184881_2_, p_184881_3_, 9).func_150260_c(); -@@ -116,7 +117,7 @@ +@@ -118,7 +119,7 @@ continue; } } -- else if (p_71515_2_[8].equals("replace") && !block.func_149716_u()) -+ else if (p_71515_2_[8].equals("replace") && !block.hasTileEntity(state)) +- else if (p_184881_3_[8].equals("replace") && !block.func_149716_u()) ++ else if (p_184881_3_[8].equals("replace") && !block.hasTileEntity(state)) { - if (p_71515_2_.length > 9) + if (p_184881_3_.length > 9) { diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index ab5182a94..cc1032380 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/command/CommandHandler.java +++ ../src-work/minecraft/net/minecraft/command/CommandHandler.java -@@ -44,6 +44,16 @@ +@@ -46,6 +46,16 @@ } - else if (icommand.func_71519_b(p_71556_1_)) + else if (icommand.func_184882_a(this.func_184879_a(), p_71556_1_)) { + net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, p_71556_1_, astring); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) @@ -16,13 +16,13 @@ + if (i > -1) { - List list = PlayerSelector.func_179656_b(p_71556_1_, astring[i], Entity.class); -@@ -107,7 +117,7 @@ - ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); - chatcomponenttranslation.func_150256_b().func_150238_a(EnumChatFormatting.RED); - p_175786_1_.func_145747_a(chatcomponenttranslation); + List list = EntitySelector.func_179656_b(p_71556_1_, astring[i], Entity.class); +@@ -109,7 +119,7 @@ + TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.exception", new Object[0]); + textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED); + p_175786_1_.func_145747_a(textcomponenttranslation); - field_147175_a.warn("Couldn\'t process command: \'" + p_175786_4_ + "\'"); -+ field_147175_a.warn("Couldn\'t process command: \'" + p_175786_4_ + "\'", var9); // Forge: Log stacktrace of unknown exceptions ++ field_147175_a.warn("Couldn\'t process command: \'" + p_175786_4_ + "\'", var9); } return false; diff --git a/patches/minecraft/net/minecraft/command/PlayerSelector.java.patch b/patches/minecraft/net/minecraft/command/EntitySelector.java.patch similarity index 84% rename from patches/minecraft/net/minecraft/command/PlayerSelector.java.patch rename to patches/minecraft/net/minecraft/command/EntitySelector.java.patch index 1aacfa255..b93a59d9e 100644 --- a/patches/minecraft/net/minecraft/command/PlayerSelector.java.patch +++ b/patches/minecraft/net/minecraft/command/EntitySelector.java.patch @@ -1,8 +1,8 @@ ---- ../src-base/minecraft/net/minecraft/command/PlayerSelector.java -+++ ../src-work/minecraft/net/minecraft/command/PlayerSelector.java +--- ../src-base/minecraft/net/minecraft/command/EntitySelector.java ++++ ../src-work/minecraft/net/minecraft/command/EntitySelector.java @@ -36,9 +36,9 @@ - public class PlayerSelector + public class EntitySelector { - private static final Pattern field_82389_a = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); + private static final Pattern field_82389_a = Pattern.compile("^@([pare])(?:\\[([\\w\\.=,!-]*)\\])?$"); // FORGE: allow . in entity selectors diff --git a/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch b/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch index e5ef73f0b..fcb4ea652 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch +++ b/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/command/server/CommandSetBlock.java +++ ../src-work/minecraft/net/minecraft/command/server/CommandSetBlock.java -@@ -52,6 +52,8 @@ - i = func_175764_a(p_71515_2_[4], 0, 15); +@@ -54,6 +54,8 @@ + i = func_175764_a(p_184881_3_[4], 0, 15); } + IBlockState state = block.func_176203_a(i); + - World world = p_71515_1_.func_130014_f_(); + World world = p_184881_2_.func_130014_f_(); if (!world.func_175667_e(blockpos)) -@@ -63,7 +65,7 @@ +@@ -65,7 +67,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (p_71515_2_.length >= 7 && block.func_149716_u()) -+ if (p_71515_2_.length >= 7 && block.hasTileEntity(state)) +- if (p_184881_3_.length >= 7 && block.func_149716_u()) ++ if (p_184881_3_.length >= 7 && block.hasTileEntity(state)) { - String s = func_147178_a(p_71515_1_, p_71515_2_, 6).func_150260_c(); + String s = func_147178_a(p_184881_2_, p_184881_3_, 6).func_150260_c(); diff --git a/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch b/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch index a9dae5314..4a1533789 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch +++ b/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/server/CommandTestForBlock.java +++ ../src-work/minecraft/net/minecraft/command/server/CommandTestForBlock.java -@@ -70,7 +70,7 @@ +@@ -72,7 +72,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (p_71515_2_.length >= 6 && block.func_149716_u()) -+ if (p_71515_2_.length >= 6 && block.hasTileEntity(block.func_176203_a(i))) +- if (p_184881_3_.length >= 6 && block.func_149716_u()) ++ if (p_184881_3_.length >= 6 && block.hasTileEntity(block.func_176203_a(i))) { - String s = func_147178_a(p_71515_1_, p_71515_2_, 5).func_150260_c(); + String s = func_147178_a(p_184881_2_, p_184881_3_, 5).func_150260_c(); diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index 6af34573d..ab4e3edde 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java -@@ -117,8 +117,11 @@ +@@ -122,8 +122,11 @@ } else { diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index 92f2bc57b..bd1ecc910 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java +++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java -@@ -61,7 +61,7 @@ - - if (field_180311_a[p_i45771_1_] != null) - { -- throw new IllegalArgumentException("Duplicate enchantment id!"); -+ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + field_180311_a[p_i45771_1_].getClass() + " Enchantment ID:" + p_i45771_1_); - } - else - { -@@ -139,7 +139,7 @@ +@@ -118,7 +118,7 @@ public boolean func_92089_a(ItemStack p_92089_1_) { @@ -18,8 +9,8 @@ } public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) -@@ -150,6 +150,45 @@ - { +@@ -134,6 +134,26 @@ + return false; } + /** @@ -33,25 +24,6 @@ + return this.field_77351_y.func_77557_a(stack.func_77973_b()); + } + -+ private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; -+ /** -+ * Add to the list of enchantments applicable by the anvil from a book -+ * -+ * @param enchantment -+ */ -+ public static void addToBookList(Enchantment enchantment) -+ { -+ try -+ { -+ net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, -+ com.google.common.collect.ObjectArrays.concat(field_77331_b, enchantment)); -+ } -+ catch (Exception e) -+ { -+ throw new RuntimeException(e); //Rethrow see what happens -+ } -+ } -+ + /** + * Is this enchantment allowed to be enchanted on books via Enchantment Table + * @return false to disable the vanilla feature @@ -61,6 +33,6 @@ + return true; + } + - static + public static void func_185257_f() { - List list = Lists.newArrayList(); + EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 6f607d4dd..010e0173e 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java -@@ -296,7 +296,7 @@ +@@ -292,7 +292,7 @@ public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) { Item item = p_77514_3_.func_77973_b(); @@ -9,33 +9,31 @@ if (i <= 0) { -@@ -345,7 +345,7 @@ - public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) +@@ -339,7 +339,7 @@ { + List list = Lists.newArrayList(); Item item = p_77513_1_.func_77973_b(); - int i = item.func_77619_b(); + int i = item.getItemEnchantability(p_77513_1_); if (i <= 0) { -@@ -387,7 +387,9 @@ +@@ -380,7 +380,8 @@ - for (EnchantmentData enchantmentdata1 : list) - { -- if (!enchantmentdata1.field_76302_b.func_77326_a(Enchantment.func_180306_c(integer.intValue()))) -+ Enchantment e1 = enchantmentdata1.field_76302_b; -+ Enchantment e2 = Enchantment.func_180306_c(integer.intValue()); -+ if (!e1.func_77326_a(e2) || !e2.func_77326_a(e1)) //Forge BugFix: Let Both enchantments veto being together - { - flag = false; - break; -@@ -421,7 +423,8 @@ - - for (Enchantment enchantment : Enchantment.field_77331_b) + while (iterator.hasNext()) { -- if (enchantment != null && (enchantment.field_77351_y.func_77557_a(item) || flag)) -+ if (enchantment == null) continue; -+ if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || (flag && enchantment.isAllowedOnBooks())) +- if (!p_185282_1_.field_76302_b.func_77326_a(((EnchantmentData)iterator.next()).field_76302_b)) ++ Enchantment e2 = iterator.next().field_76302_b; ++ if (!p_185282_1_.field_76302_b.func_77326_a(e2) || !e2.func_77326_a(p_185282_1_.field_76302_b)) //Forge BugFix: Let Both enchantments veto being together { - for (int i = enchantment.func_77319_d(); i <= enchantment.func_77325_b(); ++i) + iterator.remove(); + } +@@ -395,7 +396,7 @@ + + for (Enchantment enchantment : Enchantment.field_185264_b) + { +- if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.field_77351_y.func_77557_a(item) || flag)) ++ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag || enchantment.isAllowedOnBooks()))) + { + for (int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) { diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index 8d3e677c0..43f7adfdf 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,113 +1,69 @@ --- ../src-base/minecraft/net/minecraft/entity/Entity.java +++ ../src-work/minecraft/net/minecraft/entity/Entity.java -@@ -49,7 +49,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; +@@ -76,7 +76,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; -public abstract class Entity implements ICommandSender +public abstract class Entity implements ICommandSender, net.minecraftforge.common.capabilities.ICapabilitySerializable { + private static final Logger field_184243_a = LogManager.getLogger(); private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); - private static int field_70152_a; -@@ -129,6 +129,15 @@ - protected UUID field_96093_i; - private final CommandResultStats field_174837_as; +@@ -195,8 +195,16 @@ + this.field_70180_af.func_187214_a(field_184242_az, ""); + this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false)); + this.func_70088_a(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); ++ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); + } + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; + public boolean captureDrops = false; + public java.util.ArrayList capturedDrops = new java.util.ArrayList(); -+ -+ @Deprecated //ToDo: Move to Capabilities? -+ protected java.util.HashMap extendedProperties = new java.util.HashMap(); + private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; + public int func_145782_y() { return this.field_145783_c; -@@ -172,6 +181,9 @@ - this.field_70180_af.func_75682_a(2, ""); - this.field_70180_af.func_75682_a(4, Byte.valueOf((byte)0)); - this.func_70088_a(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); -+ for (net.minecraftforge.common.IExtendedEntityProperties props : extendedProperties.values()) props.init(this, p_i1582_1_); -+ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); - } +@@ -1134,12 +1142,12 @@ + BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - protected abstract void func_70088_a(); -@@ -996,12 +1008,12 @@ - IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - Block block = iblockstate.func_177230_c(); - -+ Boolean result = block.isEntityInsideMaterial(this.field_70170_p, blockpos, iblockstate, this, d0, p_70055_1_, true); -+ if (result != null) return result; ++ Boolean result = iblockstate.func_177230_c().isEntityInsideMaterial(this.field_70170_p, blockpos, iblockstate, this, d0, p_70055_1_, true); ++ if (result != null) return result; + - if (block.func_149688_o() == p_70055_1_) - { -- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F; -- float f1 = (float)(blockpos.func_177956_o() + 1) - f; -- boolean flag = d0 < (double)f1; -- return !flag && this instanceof EntityPlayer ? false : flag; -+ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(p_70055_1_, this, blockpos); - } - else - { -@@ -1356,6 +1368,23 @@ - p_70109_1_.func_74757_a("Silent", this.func_174814_R()); + if (iblockstate.func_185904_a() == p_70055_1_) + { +- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F; +- float f1 = (float)(blockpos.func_177956_o() + 1) - f; +- boolean flag = d0 < (double)f1; +- return !flag && this instanceof EntityPlayer ? false : flag; ++ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(p_70055_1_, this, blockpos); + } + else + { +@@ -1534,6 +1542,9 @@ + p_70109_1_.func_74782_a("Tags", nbttaglist); } + if (customEntityData != null) p_70109_1_.func_74782_a("ForgeData", customEntityData); -+ for (String identifier : this.extendedProperties.keySet()) -+ { -+ try -+ { -+ net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.saveNBTData(p_70109_1_); -+ } -+ catch (Throwable t) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe("Failed to save extended properties for %s. This is a mod issue.", identifier); -+ t.printStackTrace(); -+ } -+ } -+ + if (this.capabilities != null) p_70109_1_.func_74782_a("ForgeCaps", this.capabilities.serializeNBT()); + this.func_70014_b(p_70109_1_); - if (this.field_70154_o != null) -@@ -1438,6 +1467,30 @@ - this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible")); - this.field_174837_as.func_179668_a(p_70020_1_); + if (this.func_184207_aI()) +@@ -1629,6 +1640,9 @@ this.func_174810_b(p_70020_1_.func_74767_n("Silent")); -+ + this.func_184195_f(p_70020_1_.func_74767_n("Glowing")); + + if (p_70020_1_.func_74764_b("ForgeData")) customEntityData = p_70020_1_.func_74775_l("ForgeData"); -+ for (String identifier : this.extendedProperties.keySet()) -+ { -+ try -+ { -+ net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.loadNBTData(p_70020_1_); -+ } -+ catch (Throwable t) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe("Failed to load extended properties for %s. This is a mod issue.", identifier); -+ t.printStackTrace(); -+ } -+ } -+ -+ //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly TODO: Remove in 1.9 -+ if (p_70020_1_.func_74764_b("PersistentIDMSB") && p_70020_1_.func_74764_b("PersistentIDLSB")) -+ { -+ this.field_96093_i = new UUID(p_70020_1_.func_74763_f("PersistentIDMSB"), p_70020_1_.func_74763_f("PersistentIDLSB")); -+ } -+ + if (this.capabilities != null && p_70020_1_.func_74764_b("ForgeCaps")) this.capabilities.deserializeNBT(p_70020_1_.func_74775_l("ForgeCaps")); + - this.func_70037_a(p_70020_1_); - - if (this.func_142008_O()) -@@ -1512,7 +1565,10 @@ + if (p_70020_1_.func_150297_b("Tags", 9)) + { + this.field_184236_aF.clear(); +@@ -1715,7 +1729,10 @@ { 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.func_174869_p(); @@ -119,23 +75,23 @@ return entityitem; } else -@@ -1655,6 +1711,7 @@ +@@ -1824,6 +1841,7 @@ - public void func_70078_a(Entity p_70078_1_) + public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) { -+ if(!(this instanceof EntityLivingBase) && !net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_70078_1_, true)){ return; } - this.field_70149_e = 0.0D; - this.field_70147_f = 0.0D; - -@@ -2049,6 +2106,7 @@ ++ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_184205_1_, true)) return false; + if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) + { + if (this.func_184218_aH()) +@@ -2279,6 +2297,7 @@ { if (!this.field_70170_p.field_72995_K && !this.field_70128_L) { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_71027_1_)) return; ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return null; this.field_70170_p.field_72984_F.func_76320_a("changeDimension"); - MinecraftServer minecraftserver = MinecraftServer.func_71276_C(); + MinecraftServer minecraftserver = this.func_184102_h(); int i = this.field_71093_bK; -@@ -2092,7 +2150,7 @@ +@@ -2372,7 +2391,7 @@ public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) { @@ -144,11 +100,10 @@ } public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) -@@ -2353,4 +2411,209 @@ - +@@ -2662,6 +2681,165 @@ EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_); } -+ + + /* ================================== Forge Start =====================================*/ + /** + * Returns a NBTTagCompound that can be used to store custom data for this entity. @@ -179,7 +134,7 @@ + * @param target The full target the player is looking at + * @return A ItemStack to add to the player's inventory, Null if nothing should be added. + */ -+ public ItemStack getPickedResult(MovingObjectPosition target) ++ public ItemStack getPickedResult(RayTraceResult target) + { + if (this instanceof net.minecraft.entity.item.EntityPainting) + { @@ -207,24 +162,23 @@ + } + else if (this instanceof net.minecraft.entity.item.EntityBoat) + { -+ return new ItemStack(net.minecraft.init.Items.field_151124_az); ++ return new ItemStack(((EntityBoat)this).func_184455_j()); + } + else if (this instanceof net.minecraft.entity.item.EntityArmorStand) + { + return new ItemStack(net.minecraft.init.Items.field_179565_cj); + } ++ else if (this instanceof net.minecraft.entity.item.EntityEnderCrystal) ++ { ++ return new ItemStack(net.minecraft.init.Items.field_185158_cP); ++ } + else + { -+ int id = EntityList.func_75619_a(this); -+ if (id > 0 && EntityList.field_75627_a.containsKey(id)) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_151063_bx, 1, id); -+ } + String name = EntityList.func_75621_b(this); -+ if (name != null && net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().containsKey(name)) ++ if (EntityList.field_75627_a.containsKey(name)) + { + ItemStack stack = new ItemStack(net.minecraft.init.Items.field_151063_bx); -+ stack.func_77983_a("entity_name", new net.minecraft.nbt.NBTTagString(name)); ++ net.minecraft.item.ItemMonsterPlacer.func_185078_a(stack, name); + return stack; + } + } @@ -262,51 +216,6 @@ + } + + /** -+ * Register the instance of IExtendedProperties into the entity's collection. -+ * @param identifier The identifier which you can use to retrieve these properties for the entity. -+ * @param properties The instanceof IExtendedProperties to register -+ * @return The identifier that was used to register the extended properties. Empty String indicates an error. If your requested key already existed, this will return a modified one that is unique. -+ */ -+ public String registerExtendedProperties(String identifier, net.minecraftforge.common.IExtendedEntityProperties properties) -+ { -+ if (identifier == null) -+ { -+ net.minecraftforge.fml.common.FMLLog.warning("Someone is attempting to register extended properties using a null identifier. This is not allowed. Aborting. This may have caused instability."); -+ return ""; -+ } -+ if (properties == null) -+ { -+ net.minecraftforge.fml.common.FMLLog.warning("Someone is attempting to register null extended properties. This is not allowed. Aborting. This may have caused instability."); -+ return ""; -+ } -+ -+ String baseIdentifier = identifier; -+ int identifierModCount = 1; -+ while (this.extendedProperties.containsKey(identifier)) -+ { -+ identifier = String.format("%s%d", baseIdentifier, identifierModCount++); -+ } -+ -+ if (baseIdentifier != identifier) -+ { -+ net.minecraftforge.fml.common.FMLLog.info("An attempt was made to register exended properties using an existing key. The duplicate identifier (%s) has been remapped to %s.", baseIdentifier, identifier); -+ } -+ -+ this.extendedProperties.put(identifier, properties); -+ return identifier; -+ } -+ -+ /** -+ * Gets the extended properties identified by the passed in key -+ * @param identifier The key that identifies the extended properties. -+ * @return The instance of IExtendedProperties that was found, or null. -+ */ -+ public net.minecraftforge.common.IExtendedEntityProperties getExtendedProperties(String identifier) -+ { -+ return this.extendedProperties.get(identifier); -+ } -+ -+ /** + * If a rider of this entity can interact with this entity. Should return true on the + * ridden entity if so. + * @@ -353,4 +262,7 @@ + return ret; + } + /* ================================== Forge End =====================================*/ - } ++ + public void func_184178_b(EntityPlayerMP p_184178_1_) + { + } diff --git a/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch b/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch deleted file mode 100644 index 68c17bc54..000000000 --- a/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityAgeable.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityAgeable.java -@@ -31,7 +31,7 @@ - { - if (!this.field_70170_p.field_72995_K) - { -- Class oclass = EntityList.func_90035_a(itemstack.func_77960_j()); -+ Class oclass = EntityList.field_75625_b.get(net.minecraft.item.ItemMonsterPlacer.getEntityName(itemstack)); - - if (oclass != null && this.getClass() == oclass) - { diff --git a/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch index 29d340d07..e81fbae7b 100644 --- a/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityHanging.java +++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java -@@ -123,6 +123,9 @@ - { - BlockPos blockpos1 = blockpos.func_177967_a(enumfacing, k).func_177981_b(l); - Block block = this.field_70170_p.func_180495_p(blockpos1).func_177230_c(); -+ -+ if ( block.isSideSolid( this.field_70170_p, blockpos1, this.field_174860_b )) -+ continue; +@@ -139,6 +139,9 @@ + BlockPos blockpos1 = blockpos.func_177967_a(enumfacing, k + i1).func_177981_b(l + j1); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos1); - if (!block.func_149688_o().func_76220_a() && !BlockRedstoneDiode.func_149909_d(block)) ++ if (iblockstate.isSideSolid(this.field_70170_p, blockpos1, this.field_174860_b)) ++ continue; ++ + if (!iblockstate.func_185904_a().func_76220_a() && !BlockRedstoneDiode.func_185546_B(iblockstate)) { + return false; diff --git a/patches/minecraft/net/minecraft/entity/EntityList.java.patch b/patches/minecraft/net/minecraft/entity/EntityList.java.patch index 0a51ed53e..479c2500d 100644 --- a/patches/minecraft/net/minecraft/entity/EntityList.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityList.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityList.java +++ ../src-work/minecraft/net/minecraft/entity/EntityList.java -@@ -88,6 +88,7 @@ +@@ -91,6 +91,7 @@ public static void func_75618_a(Class p_75618_0_, String p_75618_1_, int p_75618_2_) { @@ -8,9 +8,9 @@ if (field_75625_b.containsKey(p_75618_1_)) { throw new IllegalArgumentException("ID is already registered: " + p_75618_1_); -@@ -151,9 +152,10 @@ - p_75615_0_.func_82580_o("Type"); - } +@@ -148,9 +149,10 @@ + { + Entity entity = null; + Class oclass = null; try @@ -20,7 +20,7 @@ if (oclass != null) { -@@ -167,7 +169,17 @@ +@@ -164,7 +166,17 @@ if (entity != null) { @@ -38,31 +38,3 @@ } else { -@@ -343,7 +355,9 @@ - - public static class EntityEggInfo - { -+ @Deprecated // This is not always a valid number in the global ID list. - public final int field_75613_a; -+ public final String name; - public final int field_75611_b; - public final int field_75612_c; - public final StatBase field_151512_d; -@@ -356,6 +370,17 @@ - this.field_75612_c = p_i1583_3_; - this.field_151512_d = StatList.func_151182_a(this); - this.field_151513_e = StatList.func_151176_b(this); -+ this.name = EntityList.func_75617_a(p_i1583_1_); - } -+ -+ public EntityEggInfo(String name, int primaryColor, int secondaryColor) -+ { -+ this.field_75613_a = -1; -+ this.name = name; -+ this.field_75611_b = primaryColor; -+ this.field_75612_c = secondaryColor; -+ this.field_151512_d = (new StatBase("stat.killEntity." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKill", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).func_75971_g(); -+ this.field_151513_e = (new StatBase("stat.entityKilledBy." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKilledBy", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).func_75971_g(); -+ } - } - } diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 915de5e84..a65718d5f 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java -@@ -121,6 +121,7 @@ +@@ -171,6 +171,7 @@ public void func_70624_b(EntityLivingBase p_70624_1_) { this.field_70696_bz = p_70624_1_; @@ -8,7 +8,7 @@ } public boolean func_70686_a(Class p_70686_1_) -@@ -498,10 +499,22 @@ +@@ -699,10 +700,22 @@ protected void func_70623_bb() { @@ -31,8 +31,8 @@ else { Entity entity = this.field_70170_p.func_72890_a(this, -1.0D); -@@ -621,7 +634,6 @@ - return this.field_70170_p.func_72917_a(this.func_174813_aQ(), this) && this.field_70170_p.func_72945_a(this, this.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(this.func_174813_aQ()); +@@ -835,7 +848,6 @@ + return !this.field_70170_p.func_72953_d(this.func_174813_aQ()) && this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty() && this.field_70170_p.func_72917_a(this.func_174813_aQ(), this); } - @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 7906ba9b3..e9e581bdf 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -1,24 +1,28 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java -@@ -170,6 +170,7 @@ - } +@@ -190,9 +190,11 @@ + float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F); + if (p_184231_4_.func_185904_a() != Material.field_151579_a) ++ if (p_184231_4_.func_177230_c().isAir(p_184231_4_, field_70170_p, p_184231_5_)) + { + double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D); int i = (int)(150.0D * d0); -+ if ( !block.addLandingEffects( (WorldServer)this.field_70170_p, p_180433_5_, iblockstate, this, i ) ) - ((WorldServer)this.field_70170_p).func_175739_a(EnumParticleTypes.BLOCK_DUST, this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.func_176210_f(iblockstate)}); ++ if (!p_184231_4_.func_177230_c().addLandingEffects(p_184231_4_, (WorldServer)this.field_70170_p, p_184231_5_, p_184231_4_, this, i)) + ((WorldServer)this.field_70170_p).func_175739_a(EnumParticleTypes.BLOCK_DUST, this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.func_176210_f(p_184231_4_)}); } } -@@ -237,7 +238,7 @@ +@@ -264,7 +266,7 @@ } } -- 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)) +- if (!this.field_70170_p.field_72995_K && this.func_184218_aH() && this.func_184187_bx() instanceof EntityLivingBase) ++ if (!this.field_70170_p.field_72995_K && this.func_184218_aH() && this.func_184187_bx() != null && this.func_184187_bx().shouldDismountInWater(this)) { - this.func_70078_a((Entity)null); + this.func_184210_p(); } -@@ -319,7 +320,7 @@ - if (!this.field_70170_p.field_72995_K && (this.field_70718_bc > 0 || this.func_70684_aJ()) && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) +@@ -363,7 +365,7 @@ + if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot"))) { int i = this.func_70693_a(this.field_70717_bb); - @@ -26,7 +30,7 @@ while (i > 0) { int j = EntityXPOrb.func_70527_a(i); -@@ -380,6 +381,7 @@ +@@ -424,6 +426,7 @@ { this.field_70755_b = p_70604_1_; this.field_70756_c = this.field_70173_aa; @@ -34,15 +38,7 @@ } public EntityLivingBase func_110144_aD() -@@ -663,7 +665,6 @@ - return this.func_70668_bt() == EnumCreatureAttribute.UNDEAD; - } - -- @SideOnly(Side.CLIENT) - public void func_70618_n(int p_70618_1_) - { - this.field_70713_bf.remove(Integer.valueOf(p_70618_1_)); -@@ -712,6 +713,8 @@ +@@ -775,6 +778,8 @@ public void func_70691_i(float p_70691_1_) { @@ -51,7 +47,7 @@ float f = this.func_110143_aJ(); if (f > 0.0F) -@@ -732,6 +735,7 @@ +@@ -795,6 +800,7 @@ public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -59,7 +55,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; -@@ -797,9 +801,9 @@ +@@ -883,9 +889,9 @@ this.field_70718_bc = 100; this.field_70717_bb = (EntityPlayer)entity; } @@ -71,51 +67,49 @@ if (entitywolf.func_70909_n()) { -@@ -883,6 +887,7 @@ +@@ -1007,6 +1013,7 @@ public void func_70645_a(DamageSource p_70645_1_) { + if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; - Entity entity = p_70645_1_.func_76346_g(); - EntityLivingBase entitylivingbase = this.func_94060_bK(); - -@@ -908,6 +913,9 @@ - i = EnchantmentHelper.func_77519_f((EntityLivingBase)entity); - } - -+ captureDrops = true; -+ capturedDrops.clear(); -+ - if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) - { - this.func_70628_a(this.field_70718_bc > 0, i); -@@ -918,6 +926,16 @@ - this.func_82164_bB(); + if (!this.field_70729_aU) + { + Entity entity = p_70645_1_.func_76346_g(); +@@ -1034,11 +1041,24 @@ + i = EnchantmentHelper.func_185283_h((EntityLivingBase)entity); } - } -+ -+ captureDrops = false; -+ -+ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0)) -+ { -+ for (EntityItem item : capturedDrops) -+ { -+ field_70170_p.func_72838_d(item); -+ } -+ } - } - this.field_70170_p.func_72960_a(this, (byte)3); -@@ -972,7 +990,7 @@ - int j = MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b); - int k = MathHelper.func_76128_c(this.field_70161_v); - Block block = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)).func_177230_c(); -- return (block == Blocks.field_150468_ap || block == Blocks.field_150395_bd) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).func_175149_v()); -+ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(block, field_70170_p, new BlockPos(i, j, k), this); ++ captureDrops = true; ++ capturedDrops.clear(); ++ + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) + { + boolean flag = this.field_70718_bc > 0; + this.func_184610_a(flag, i, p_70645_1_); + } ++ ++ captureDrops = false; ++ ++ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ field_70170_p.func_72838_d(item); ++ } ++ } + } + + this.field_70170_p.func_72960_a(this, (byte)3); +@@ -1113,7 +1133,7 @@ + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); +- return block != Blocks.field_150468_ap && block != Blocks.field_150395_bd ? block instanceof BlockTrapDoor && this.func_184604_a(blockpos, iblockstate) : true; ++ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(iblockstate, field_70170_p, new BlockPos(i, j, k), this); + } } - public boolean func_70089_S() -@@ -982,6 +1000,9 @@ +@@ -1139,6 +1159,9 @@ public void func_180430_e(float p_180430_1_, float p_180430_2_) { @@ -123,9 +117,9 @@ + if (ret == null) return; + p_180430_1_ = ret[0]; p_180430_2_ = ret[1]; super.func_180430_e(p_180430_1_, p_180430_2_); - PotionEffect potioneffect = this.func_70660_b(Potion.field_76430_j); - float f = potioneffect != null ? (float)(potioneffect.func_76458_c() + 1) : 0.0F; -@@ -1094,6 +1115,8 @@ + PotionEffect potioneffect = this.func_70660_b(MobEffects.field_76430_j); + float f = potioneffect == null ? 0.0F : (float)(potioneffect.func_76458_c() + 1); +@@ -1231,6 +1254,8 @@ { if (!this.func_180431_b(p_70665_1_)) { @@ -134,11 +128,11 @@ 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 f = p_70665_2_; -@@ -1142,6 +1165,11 @@ +@@ -1279,6 +1304,11 @@ - public void func_71038_i() + public void func_184609_a(EnumHand p_184609_1_) { -+ ItemStack stack = this.func_70694_bm(); ++ ItemStack stack = this.func_184586_b(p_184609_1_); + if (stack != null && stack.func_77973_b() != null) + { + if (stack.func_77973_b().onEntitySwing(this, stack)) return; @@ -146,15 +140,41 @@ if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { this.field_110158_av = -1; -@@ -1281,6 +1309,7 @@ +@@ -1476,6 +1506,7 @@ public void func_110145_l(Entity p_110145_1_) { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_110145_1_, false)){ return; } - double d0 = p_110145_1_.field_70165_t; - double d1 = p_110145_1_.func_174813_aQ().field_72338_b + (double)p_110145_1_.field_70131_O; - double d2 = p_110145_1_.field_70161_v; -@@ -1346,6 +1375,7 @@ ++ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_110145_1_, false)) return; + if (!(p_110145_1_ instanceof EntityBoat) && !(p_110145_1_ instanceof EntityHorse)) + { + double d1 = p_110145_1_.field_70165_t; +@@ -1500,7 +1531,7 @@ + + if (!this.field_70170_p.func_184143_b(axisalignedbb1)) + { +- if (this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u, d12)).func_185896_q()) ++ if (this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u, d12)).isSideSolid(field_70170_p, new BlockPos(d11, this.field_70163_u, d12), EnumFacing.UP)) + { + this.func_70634_a(d11, this.field_70163_u + 1.0D, d12); + return; +@@ -1508,14 +1539,14 @@ + + BlockPos blockpos = new BlockPos(d11, this.field_70163_u - 1.0D, d12); + +- if (this.field_70170_p.func_180495_p(blockpos).func_185896_q() || this.field_70170_p.func_180495_p(blockpos).func_185904_a() == Material.field_151586_h) ++ if (this.field_70170_p.func_180495_p(blockpos).isSideSolid(field_70170_p, blockpos, EnumFacing.UP) || this.field_70170_p.func_180495_p(blockpos).func_185904_a() == Material.field_151586_h) + { + d1 = d11; + d13 = this.field_70163_u + 1.0D; + d14 = d12; + } + } +- else if (!this.field_70170_p.func_184143_b(axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u + 1.0D, d12)).func_185896_q()) ++ else if (!this.field_70170_p.func_184143_b(axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u + 1.0D, d12)).isSideSolid(field_70170_p, new BlockPos(d11, this.field_70163_u + 1.0D, d12), EnumFacing.UP)) + { + d1 = d11; + d13 = this.field_70163_u + 2.0D; +@@ -1586,6 +1617,7 @@ } this.field_70160_al = true; @@ -162,45 +182,35 @@ } protected void func_70629_bd() -@@ -1530,6 +1560,7 @@ +@@ -1845,6 +1877,7 @@ public void func_70071_h_() { + if (net.minecraftforge.common.ForgeHooks.onLivingUpdate(this)) return; super.func_70071_h_(); + this.func_184608_ct(); - if (!this.field_70170_p.field_72995_K) -@@ -1817,6 +1848,7 @@ - - public void func_70078_a(Entity p_70078_1_) - { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_70078_1_, true)){ return; } - if (this.field_70154_o != null && p_70078_1_ == null) - { - if (!this.field_70170_p.field_72995_K) -@@ -1998,4 +2030,39 @@ - { +@@ -2351,6 +2384,40 @@ this.field_70752_e = true; } -+ + + /*** + * Removes all potion effects that have curativeItem as a curative item for its effect + * @param curativeItem The itemstack we are using to cure potion effects + */ + public void curePotionEffects(ItemStack curativeItem) + { -+ Iterator potionKey = field_70713_bf.keySet().iterator(); + if (field_70170_p.field_72995_K) return; ++ Iterator iterator = this.field_70713_bf.values().iterator(); + -+ while (potionKey.hasNext()) ++ while (iterator.hasNext()) + { -+ Integer key = potionKey.next(); -+ PotionEffect effect = (PotionEffect)field_70713_bf.get(key); ++ PotionEffect effect = iterator.next(); + + if (effect.isCurativeItem(curativeItem)) + { -+ potionKey.remove(); + func_70688_c(effect); ++ iterator.remove(); + this.field_70752_e = true; + } + } @@ -217,4 +227,60 @@ + { + return this instanceof net.minecraft.entity.passive.EntityPig; + } - } ++ + public abstract EnumHandSide func_184591_cq(); + + public boolean func_184587_cr() +@@ -2371,6 +2438,14 @@ + + if (itemstack == this.field_184627_bm) + { ++ field_184628_bn = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_184627_bm, field_184628_bn); ++ if (field_184628_bn <= 0) ++ { ++ this.func_71036_o(); ++ } ++ else ++ { // Forge Keep unindented to lower patch ++ field_184627_bm.func_77973_b().onUsingTick(field_184627_bm, this, field_184628_bn); //Forge Added + if (this.func_184605_cv() <= 25 && this.func_184605_cv() % 4 == 0) + { + this.func_184584_a(this.field_184627_bm, 5); +@@ -2380,6 +2455,7 @@ + { + this.func_71036_o(); + } ++ } + } + else + { +@@ -2394,8 +2470,10 @@ + + if (itemstack != null && !this.func_184587_cr()) + { ++ int duration = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, itemstack, itemstack.func_77988_m()); ++ if (duration <= 0) return; + this.field_184627_bm = itemstack; +- this.field_184628_bn = itemstack.func_77988_m(); ++ this.field_184628_bn = duration; + + if (!this.field_70170_p.field_72995_K) + { +@@ -2478,6 +2556,8 @@ + this.func_184584_a(this.field_184627_bm, 16); + ItemStack itemstack = this.field_184627_bm.func_77950_b(this.field_70170_p, this); + ++ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, field_184627_bm, func_184605_cv(), itemstack); ++ + if (itemstack != null && itemstack.field_77994_a == 0) + { + itemstack = null; +@@ -2508,6 +2588,8 @@ + if (this.field_184627_bm != null) + { + this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); ++ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, field_184627_bm, this.func_184605_cv())) ++ this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); + } + + this.func_184602_cy(); diff --git a/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch b/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch deleted file mode 100644 index 9f22ee7e1..000000000 --- a/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java -@@ -109,6 +109,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, p_130002_1_))) return true; - this.field_145824_a.func_175574_a(p_130002_1_); - return false; - } diff --git a/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch b/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch index ba155b961..1a78df1c3 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java +++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java -@@ -56,6 +56,8 @@ +@@ -75,6 +75,8 @@ public void func_72786_a(Entity p_72786_1_) { @@ -9,11 +9,10 @@ if (p_72786_1_ instanceof EntityPlayerMP) { this.func_72791_a(p_72786_1_, 512, 2); -@@ -331,4 +333,23 @@ - } +@@ -329,6 +331,25 @@ } } -+ + + /* ======================================== FORGE START =====================================*/ + + // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily @@ -32,4 +31,7 @@ + } + + /* ======================================== FORGE END =====================================*/ - } ++ + public void func_151248_b(Entity p_151248_1_, Packet p_151248_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.field_72794_c.func_76041_a(p_151248_1_.func_145782_y()); diff --git a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch index 20e203ef1..c8af86c88 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java +++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java -@@ -379,6 +379,14 @@ +@@ -398,6 +398,14 @@ this.field_73138_k = this.field_73132_a.field_70181_x; this.field_73135_l = this.field_73132_a.field_70179_y; @@ -12,25 +12,26 @@ + net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.makeEntitySpawnAdjustment(this.field_73132_a, p_73117_1_, this.field_73128_d, this.field_73129_e, this.field_73126_f); + } + - if (this.field_73143_t && !(packet instanceof S0FPacketSpawnMob)) + if (flag && !(packet instanceof SPacketSpawnMob)) { - p_73117_1_.field_71135_a.func_147359_a(new S12PacketEntityVelocity(this.field_73132_a.func_145782_y(), this.field_73132_a.field_70159_w, this.field_73132_a.field_70181_x, this.field_73132_a.field_70179_y)); -@@ -426,12 +434,14 @@ - p_73117_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(this.field_73132_a.func_145782_y(), potioneffect)); - } - } + p_73117_1_.field_71135_a.func_147359_a(new SPacketEntityVelocity(this.field_73132_a.func_145782_y(), this.field_73132_a.field_70159_w, this.field_73132_a.field_70181_x, this.field_73132_a.field_70179_y)); +@@ -438,6 +446,7 @@ + + this.field_73132_a.func_184178_b(p_73117_1_); + p_73117_1_.func_184848_d(this.field_73132_a); + net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(field_73132_a, p_73117_1_); } } else if (this.field_73134_o.contains(p_73117_1_)) - { +@@ -445,6 +454,7 @@ this.field_73134_o.remove(p_73117_1_); + this.field_73132_a.func_184203_c(p_73117_1_); p_73117_1_.func_152339_d(this.field_73132_a); + net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(field_73132_a, p_73117_1_); } } } -@@ -463,6 +473,9 @@ +@@ -477,6 +487,9 @@ field_151262_p.warn("Fetching addPacket for removed entity"); } @@ -39,4 +40,4 @@ + if (this.field_73132_a instanceof EntityItem) { - return new S0EPacketSpawnObject(this.field_73132_a, 2, 1); + return new SPacketSpawnObject(this.field_73132_a, 2, 1); diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch similarity index 88% rename from patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch rename to patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch index d869b3547..851c2ecc1 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch @@ -1,15 +1,15 @@ ---- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java -+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java -@@ -20,6 +20,8 @@ - private double field_151497_i; +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java +@@ -21,6 +21,8 @@ private double field_151495_j; private double field_151496_k; + protected final int field_188493_g = 20; + private int failedPathFindingPenalty = 0; + private boolean canPenalize = false; - public EntityAIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) + public EntityAIAttackMelee(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) { -@@ -54,6 +56,19 @@ +@@ -45,6 +47,19 @@ } else { @@ -29,7 +29,7 @@ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); return this.field_75438_g != null; } -@@ -91,6 +106,23 @@ +@@ -89,6 +104,23 @@ this.field_151496_k = entitylivingbase.field_70161_v; this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index 2ccf20bdd..6b9c7e6d5 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -1,14 +1,18 @@ --- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java -@@ -479,9 +479,9 @@ - BlockPos blockpos = new BlockPos(k1, l1, i2); - Block block = this.field_70170_p.func_180495_p(blockpos).func_177230_c(); +@@ -474,13 +474,13 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); -- if (block.func_149688_o() != Material.field_151579_a) -+ if (!block.isAir(field_70170_p, new BlockPos(k1, l1, i2))) +- if (iblockstate.func_185904_a() != Material.field_151579_a && iblockstate.func_185904_a() != Material.field_151581_o) ++ if (!block.isAir(iblockstate, this.field_70170_p, blockpos) && iblockstate.func_185904_a() != Material.field_151581_o) { -- if (block != Blocks.field_180401_cv && block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && block != Blocks.field_150483_bI && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) -+ if (block.canEntityDestroy(field_70170_p, new BlockPos(k1, l1, i2), this) && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) + if (!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { - flag1 = this.field_70170_p.func_175698_g(blockpos) || flag1; + flag = true; } +- else if (block != Blocks.field_180401_cv && block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && block != Blocks.field_150384_bq && block != Blocks.field_150378_br) ++ else if (block.canEntityDestroy(iblockstate, this.field_70170_p, blockpos, this)) + { + if (block != Blocks.field_150483_bI && block != Blocks.field_185776_dc && block != Blocks.field_185777_dd && block != Blocks.field_150411_aY && block != Blocks.field_185775_db) + { diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch index 38dc16d7a..a3c0f0203 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 -@@ -343,7 +343,7 @@ - BlockPos blockpos = new BlockPos(i3, k, l); - Block block = this.field_70170_p.func_180495_p(blockpos).func_177230_c(); +@@ -365,7 +365,7 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); -- if (block.func_149688_o() != Material.field_151579_a && func_181033_a(block)) -+ if (!block.isAir(field_70170_p,blockpos) && func_181033_a(block) && block.canEntityDestroy(field_70170_p, blockpos, this)) +- if (iblockstate.func_185904_a() != Material.field_151579_a && func_181033_a(block)) ++ if (!block.isAir(iblockstate, this.field_70170_p, blockpos)) { flag = this.field_70170_p.func_175655_b(blockpos, true) || flag; } diff --git a/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch b/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch deleted file mode 100644 index ee9c56e4c..000000000 --- a/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/boss/IBossDisplayData.java -+++ ../src-work/minecraft/net/minecraft/entity/boss/IBossDisplayData.java -@@ -4,7 +4,6 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --@SideOnly(Side.CLIENT) - public interface IBossDisplayData - { - float func_110138_aP(); diff --git a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch index 4778abec5..e60918847 100644 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java -@@ -90,7 +90,8 @@ +@@ -104,7 +104,8 @@ for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index 4a8b020c5..d3e4db9d7 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java -@@ -61,6 +61,9 @@ +@@ -84,6 +84,9 @@ if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p && !entityplayermp.func_70608_bn()) { @@ -10,8 +10,8 @@ if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) { EntityEndermite entityendermite = new EntityEndermite(this.field_70170_p); -@@ -74,9 +77,10 @@ - entitylivingbase.func_70078_a((Entity)null); +@@ -97,9 +100,10 @@ + this.func_184210_p(); } - entitylivingbase.func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch new file mode 100644 index 000000000..456c02616 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityFallingBlock.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityFallingBlock.java +@@ -129,6 +129,7 @@ + { + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos1); + ++ if (this.field_70170_p.func_175623_d(new BlockPos(this.field_70165_t, this.field_70163_u - 0.009999999776482582D, this.field_70161_v))) //Forge: Don't indent below. + if (BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - 0.009999999776482582D, this.field_70161_v)))) + { + this.field_70122_E = false; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index 283be7c90..d375ace01 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java -@@ -29,6 +29,11 @@ +@@ -37,6 +37,11 @@ private String field_145802_g; public float field_70290_d; @@ -12,7 +12,7 @@ public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) { super(p_i1709_1_); -@@ -46,6 +51,7 @@ +@@ -54,6 +59,7 @@ { this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); this.func_92058_a(p_i1710_8_); @@ -20,21 +20,21 @@ } protected boolean func_70041_e_() -@@ -69,6 +75,8 @@ +@@ -77,6 +83,8 @@ public void func_70071_h_() { -+ ItemStack stack = this.func_70096_w().func_82710_f(10); ++ ItemStack stack = this.func_184212_Q().func_187225_a(field_184533_c).orNull(); + if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onEntityItemUpdate(this)) return; if (this.func_92059_d() == null) { this.func_70106_y(); -@@ -129,8 +137,16 @@ +@@ -137,8 +145,16 @@ this.func_70072_I(); - if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) -+ ItemStack item = func_70096_w().func_82710_f(10); ++ ItemStack item = this.func_184212_Q().func_187225_a(field_184533_c).orNull(); + + if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) { @@ -47,15 +47,15 @@ this.func_70106_y(); } } -@@ -271,6 +287,7 @@ - p_70014_1_.func_74777_a("Health", (short)((byte)this.field_70291_e)); +@@ -279,6 +295,7 @@ + p_70014_1_.func_74777_a("Health", (short)this.field_70291_e); p_70014_1_.func_74777_a("Age", (short)this.field_70292_b); p_70014_1_.func_74777_a("PickupDelay", (short)this.field_145804_b); + p_70014_1_.func_74768_a("Lifespan", lifespan); if (this.func_145800_j() != null) { -@@ -311,20 +328,23 @@ +@@ -319,20 +336,23 @@ NBTTagCompound nbttagcompound = p_70037_1_.func_74775_l("Item"); this.func_92058_a(ItemStack.func_77949_a(nbttagcompound)); @@ -63,7 +63,7 @@ - { - this.func_70106_y(); - } -+ ItemStack item = func_70096_w().func_82710_f(10); ++ ItemStack item = this.func_184212_Q().func_187225_a(field_184533_c).orNull(); + if (item == null || item.field_77994_a <= 0) this.func_70106_y(); + if (p_70037_1_.func_74764_b("Lifespan")) lifespan = p_70037_1_.func_74762_e("Lifespan"); } @@ -84,15 +84,15 @@ { if (itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150364_r)) { -@@ -361,6 +381,7 @@ +@@ -369,6 +389,7 @@ } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(p_70100_1_, this); if (!this.func_174814_R()) { - this.field_70170_p.func_72956_a(p_70100_1_, "random.pop", 0.2F, ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.0F) * 2.0F); -@@ -402,11 +423,6 @@ + this.field_70170_p.func_184148_a((EntityPlayer)null, p_70100_1_.field_70165_t, p_70100_1_.field_70163_u, p_70100_1_.field_70161_v, SoundEvents.field_187638_cR, SoundCategory.PLAYERS, 0.2F, ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.0F) * 2.0F); +@@ -414,11 +435,6 @@ if (itemstack == null) { @@ -104,7 +104,7 @@ return new ItemStack(Blocks.field_150348_b); } else -@@ -480,6 +496,6 @@ +@@ -492,6 +508,6 @@ public void func_174870_v() { this.func_174871_r(); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch index dfb0cf0e5..122e9e82d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityItemFrame.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityItemFrame.java -@@ -122,7 +122,7 @@ +@@ -137,7 +137,7 @@ { if (p_110131_1_ != null) { diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index da822bd07..8f801c3e9 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java -@@ -50,6 +50,20 @@ +@@ -54,6 +54,20 @@ @SideOnly(Side.CLIENT) private double field_70506_as; @@ -21,7 +21,7 @@ public EntityMinecart(World p_i1712_1_) { super(p_i1712_1_); -@@ -95,17 +109,19 @@ +@@ -99,17 +113,19 @@ public AxisAlignedBB func_70114_g(Entity p_70114_1_) { @@ -42,7 +42,7 @@ } public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) -@@ -309,7 +325,7 @@ +@@ -315,7 +331,7 @@ BlockPos blockpos = new BlockPos(k, l, i1); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); @@ -51,7 +51,7 @@ { this.func_180460_a(blockpos, iblockstate); -@@ -348,7 +364,10 @@ +@@ -354,7 +370,10 @@ this.func_70101_b(this.field_70177_z, this.field_70125_A); @@ -61,9 +61,9 @@ + else box = this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D); + for (Entity entity : this.field_70170_p.func_72839_b(this, box)) { - if (entity != this.field_70153_n && entity.func_70104_M() && entity instanceof EntityMinecart) + if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof EntityMinecart) { -@@ -367,6 +386,7 @@ +@@ -363,6 +382,7 @@ } this.func_70072_I(); @@ -71,7 +71,7 @@ } } -@@ -381,10 +401,21 @@ +@@ -377,10 +397,21 @@ protected void func_180459_n() { @@ -94,7 +94,7 @@ if (this.field_70122_E) { this.field_70159_w *= 0.5D; -@@ -392,13 +423,13 @@ +@@ -388,13 +419,13 @@ this.field_70179_y *= 0.5D; } @@ -112,7 +112,7 @@ } } -@@ -418,25 +449,25 @@ +@@ -414,25 +445,25 @@ flag1 = !flag; } @@ -143,7 +143,7 @@ ++this.field_70163_u; } -@@ -481,7 +512,7 @@ +@@ -478,7 +509,7 @@ } } @@ -152,29 +152,15 @@ { double d17 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); -@@ -527,20 +558,8 @@ - this.field_70165_t = d19 + d1 * d18; - this.field_70161_v = d20 + d2 * d18; +@@ -526,6 +557,7 @@ this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); -- double d22 = this.field_70159_w; -- double d23 = this.field_70179_y; + double d22 = this.field_70159_w; + double d23 = this.field_70179_y; + this.moveMinecartOnRail(p_180460_1_); -- if (this.field_70153_n != null) -- { -- d22 *= 0.75D; -- d23 *= 0.75D; -- } -- -- double d13 = this.func_174898_m(); -- d22 = MathHelper.func_151237_a(d22, -d13, d13); -- d23 = MathHelper.func_151237_a(d23, -d13, d13); -- this.func_70091_d(d22, 0.0D, d23); -- - if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[0][2]) + if (this.func_184207_aI()) { - this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); -@@ -577,8 +596,14 @@ +@@ -574,8 +606,14 @@ this.field_70179_y = d5 * (double)(i - p_180460_1_.func_177952_p()); } @@ -190,11 +176,10 @@ double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); if (d15 > 0.01D) -@@ -817,13 +842,20 @@ +@@ -795,13 +833,19 @@ public void func_70108_f(Entity p_70108_1_) { -+ + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, p_70108_1_)); + if (getCollisionHandler() != null) + { @@ -205,33 +190,33 @@ { if (!p_70108_1_.field_70145_X && !this.field_70145_X) { - if (p_70108_1_ != this.field_70153_n) + if (!this.func_184196_w(p_70108_1_)) { -- if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && this.func_180456_s() == EntityMinecart.EnumMinecartType.RIDEABLE && 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) +- if (p_70108_1_ instanceof EntityLivingBase && this.func_184264_v() == EntityMinecart.Type.RIDEABLE && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && !this.func_184207_aI() && !p_70108_1_.func_184218_aH()) ++ if (p_70108_1_ instanceof EntityLivingBase && canBeRidden() && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && !this.func_184207_aI() && !p_70108_1_.func_184218_aH()) { - p_70108_1_.func_70078_a(this); + p_70108_1_.func_184220_m(this); } -@@ -869,7 +901,7 @@ +@@ -847,7 +891,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)p_70108_1_).func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE && this.func_180456_s() != EntityMinecart.EnumMinecartType.FURNACE) +- if (((EntityMinecart)p_70108_1_).func_184264_v() == EntityMinecart.Type.FURNACE && this.func_184264_v() != EntityMinecart.Type.FURNACE) + if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) { this.field_70159_w *= 0.20000000298023224D; this.field_70179_y *= 0.20000000298023224D; -@@ -877,7 +909,7 @@ +@@ -855,7 +899,7 @@ p_70108_1_.field_70159_w *= 0.949999988079071D; p_70108_1_.field_70179_y *= 0.949999988079071D; } -- else if (((EntityMinecart)p_70108_1_).func_180456_s() != EntityMinecart.EnumMinecartType.FURNACE && this.func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE) -+ else if (((EntityMinecart)p_70108_1_).isPoweredCart() && isPoweredCart()) +- else if (((EntityMinecart)p_70108_1_).func_184264_v() != EntityMinecart.Type.FURNACE && this.func_184264_v() == EntityMinecart.Type.FURNACE) ++ else if (!((EntityMinecart)p_70108_1_).isPoweredCart() && isPoweredCart()) { p_70108_1_.field_70159_w *= 0.20000000298023224D; p_70108_1_.field_70179_y *= 0.20000000298023224D; -@@ -1042,6 +1074,221 @@ - } +@@ -982,6 +1026,221 @@ + this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_)); } + /* =================================== FORGE START ===========================================*/ @@ -265,7 +250,7 @@ + double mX = this.field_70159_w; + double mZ = this.field_70179_y; + -+ if (this.field_70153_n != null) ++ if (this.func_184187_bx() != null) + { + mX *= 0.75D; + mZ *= 0.75D; @@ -363,7 +348,7 @@ + */ + public boolean isPoweredCart() + { -+ return func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE; ++ return func_184264_v() == EntityMinecart.Type.FURNACE; + } + + /** @@ -372,7 +357,7 @@ + */ + public boolean canBeRidden() + { -+ return this.func_180456_s() == EntityMinecart.EnumMinecartType.RIDEABLE; ++ return this.func_184264_v() == EntityMinecart.Type.RIDEABLE; + } + + /** @@ -449,6 +434,6 @@ + + /* =================================== FORGE END ===========================================*/ + - public static enum EnumMinecartType + public static enum Type { RIDEABLE(0, "MinecartRideable"), diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch new file mode 100644 index 000000000..bd1a8f256 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java +@@ -122,6 +122,7 @@ + + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_184230_1_, p_184230_2_, p_184230_3_))) return true; + this.field_145824_a.func_175574_a(p_184230_1_); + return false; + } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index b40c6c37c..ecc5f6bf9 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,18 +1,17 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java -@@ -180,6 +180,7 @@ +@@ -200,6 +200,7 @@ - public boolean func_130002_c(EntityPlayer p_130002_1_) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_184230_1_, p_184230_2_, p_184230_3_))) return true; if (!this.field_70170_p.field_72995_K) { - p_130002_1_.func_71007_a(this); -@@ -232,4 +233,22 @@ - this.field_94113_a[i] = null; + p_184230_1_.func_71007_a(this); +@@ -279,6 +280,24 @@ } } -+ + + public net.minecraftforge.items.IItemHandler itemHandler = new net.minecraftforge.items.wrapper.InvWrapper(this); + + @Override @@ -30,4 +29,7 @@ + { + return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); + } - } ++ + public void func_174888_l() + { + this.func_184288_f((EntityPlayer)null); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch index 807d5622e..91c23ee22 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch @@ -1,10 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -@@ -18,6 +18,7 @@ +@@ -19,6 +19,8 @@ - public boolean func_130002_c(EntityPlayer p_130002_1_) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { -+ 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_) ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_184230_1_, p_184230_2_, p_184230_3_))) return true; ++ + if (p_184230_1_.func_70093_af()) { - return true; + return false; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch index a051aba6b..3e1299398 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch @@ -1,10 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -@@ -131,6 +131,7 @@ +@@ -136,6 +136,8 @@ - public boolean func_130002_c(EntityPlayer p_130002_1_) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { -+ 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) ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_184230_1_, p_184230_2_, p_184230_3_))) return true; ++ + if (p_184230_2_ != null && p_184230_2_.func_77973_b() == Items.field_151044_h && this.field_94110_c + 3600 <= 32000) + { + if (!p_184230_1_.field_71075_bZ.field_75098_d) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch index 7fc5668b9..c20829921 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 -@@ -54,6 +54,7 @@ +@@ -56,6 +56,7 @@ - public boolean func_130002_c(EntityPlayer p_130002_1_) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_184230_1_, p_184230_2_, p_184230_3_))) return true; if (!this.field_70170_p.field_72995_K) { - p_130002_1_.func_71007_a(this); + p_184230_1_.func_71007_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 f0c991f61..dbdf0519d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityXPOrb.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityXPOrb.java -@@ -199,6 +199,7 @@ +@@ -204,6 +204,7 @@ { if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) { + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.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)); + this.field_70170_p.func_184148_a((EntityPlayer)null, p_70100_1_.field_70165_t, p_70100_1_.field_70163_u, p_70100_1_.field_70161_v, SoundEvents.field_187607_bg, SoundCategory.PLAYERS, 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 3f5db488a..c4ef14e35 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -1,24 +1,17 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityEnderman.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java -@@ -198,12 +198,14 @@ +@@ -259,7 +259,9 @@ - protected boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) + private boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) { +- boolean flag = this.func_184595_k(p_70825_1_, p_70825_3_, p_70825_5_); + net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; - double d0 = this.field_70165_t; - double d1 = this.field_70163_u; - double d2 = 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; - BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v); ++ boolean flag = this.func_184595_k(event.targetX, event.targetY, event.targetZ); -@@ -364,6 +366,18 @@ + if (flag) + { +@@ -342,6 +344,18 @@ } } @@ -36,4 +29,4 @@ + public boolean func_70823_r() { - return this.field_70180_af.func_75683_a(18) > 0; + return ((Boolean)this.field_70180_af.func_187225_a(field_184719_bw)).booleanValue(); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch index 72690ba3f..e44b7a1f8 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java -@@ -103,6 +103,7 @@ +@@ -86,6 +86,7 @@ { this.field_70181_x = (double)(0.42F + (float)this.func_70809_q() * 0.1F); this.field_70160_al = true; diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch index 8bd8f7dce..986396cb2 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java -@@ -111,7 +111,7 @@ +@@ -125,7 +125,7 @@ if (this.field_70122_E && !this.field_175452_bi) { int i = this.func_70809_q(); @@ -8,8 +8,8 @@ + if (spawnCustomParticles()) { i = 0; } // don't spawn particles if it's handled by the implementation itself for (int j = 0; j < i * 8; ++j) { - float f = this.field_70146_Z.nextFloat() * (float)Math.PI * 2.0F; -@@ -271,7 +271,7 @@ + float f = this.field_70146_Z.nextFloat() * ((float)Math.PI * 2F); +@@ -291,7 +291,7 @@ BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v)); Chunk chunk = this.field_70170_p.func_175726_f(blockpos); @@ -18,8 +18,8 @@ { return false; } -@@ -336,6 +336,14 @@ - return super.func_180482_a(p_180482_1_, p_180482_2_); +@@ -356,6 +356,14 @@ + return this.func_189101_db() ? SoundEvents.field_189110_fE : SoundEvents.field_187882_fq; } + /* ======================================== FORGE START =====================================*/ diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 5e5a32c79..6fe306eb0 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -1,28 +1,27 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java -@@ -87,7 +87,7 @@ - this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(35.0D); +@@ -101,7 +101,7 @@ 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_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(2.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() * net.minecraftforge.common.ForgeModContainer.zombieSummonBaseChance); } protected void func_70088_a() -@@ -229,12 +229,25 @@ +@@ -259,12 +259,24 @@ entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); } -- if (entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) +- if (entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) + 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); -+ + net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, entitylivingbase, this.func_110148_a(field_110186_bp).func_111126_e()); + if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return true; + + if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || -+ entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) ++ entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) { - int i = MathHelper.func_76128_c(this.field_70165_t); - int j = MathHelper.func_76128_c(this.field_70163_u); @@ -40,8 +39,16 @@ for (int l = 0; l < 50; ++l) { -@@ -249,7 +262,7 @@ - if (!this.field_70170_p.func_175636_b((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_72917_a(entityzombie.func_174813_aQ(), entityzombie) && this.field_70170_p.func_72945_a(entityzombie, entityzombie.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.func_174813_aQ())) +@@ -272,14 +284,14 @@ + int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); + int k1 = k + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); + +- if (this.field_70170_p.func_180495_p(new BlockPos(i1, j1 - 1, k1)).func_185896_q() && this.field_70170_p.func_175671_l(new BlockPos(i1, j1, k1)) < 10) ++ if (this.field_70170_p.func_180495_p(new BlockPos(i1, j1 - 1, k1)).isSideSolid(this.field_70170_p, new BlockPos(i1, j1 - 1, k1), net.minecraft.util.EnumFacing.UP) && this.field_70170_p.func_175671_l(new BlockPos(i1, j1, k1)) < 10) + { + entityzombie.func_70107_b((double)i1, (double)j1, (double)k1); + + if (!this.field_70170_p.func_175636_b((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_72917_a(entityzombie.func_174813_aQ(), entityzombie) && this.field_70170_p.func_184144_a(entityzombie, entityzombie.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.func_174813_aQ())) { this.field_70170_p.func_72838_d(entityzombie); - entityzombie.func_70624_b(entitylivingbase); @@ -49,7 +56,7 @@ entityzombie.func_180482_a(this.field_70170_p.func_175649_E(new BlockPos(entityzombie)), (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)); -@@ -465,7 +478,7 @@ +@@ -483,7 +495,7 @@ if (p_180482_2_ == null) { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch index 988e8b587..fabe725b9 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityHorse.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityHorse.java -@@ -1247,6 +1247,7 @@ +@@ -1200,6 +1200,7 @@ } this.field_110277_bt = 0.0F; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index e996a2886..3926c9c07 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -1,39 +1,38 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java -@@ -9,7 +9,7 @@ - import net.minecraft.util.EnumParticleTypes; +@@ -13,7 +13,7 @@ import net.minecraft.world.World; + import net.minecraft.world.storage.loot.LootTableList; -public class EntityMooshroom extends EntityCow +public class EntityMooshroom extends EntityCow implements net.minecraftforge.common.IShearable { public EntityMooshroom(World p_i1687_1_) { -@@ -18,6 +18,7 @@ +@@ -22,6 +22,7 @@ this.field_175506_bl = Blocks.field_150391_bh; } + @SuppressWarnings("unused") - public boolean func_70085_c(EntityPlayer p_70085_1_) + public boolean func_184645_a(EntityPlayer p_184645_1_, EnumHand p_184645_2_, ItemStack p_184645_3_) { - ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); + if (p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151054_z && this.func_70874_b() >= 0 && !p_184645_1_.field_71075_bZ.field_75098_d) @@ -37,7 +38,7 @@ - } - } -- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) -+ if (false && itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) //Forge Disable, Moved to onSheared + return true; + } +- else if (p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) ++ else if (false && p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) //Forge Disable, Moved to onSheared { this.func_70106_y(); this.field_70170_p.func_175688_a(EnumParticleTypes.EXPLOSION_LARGE, 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, new int[0]); -@@ -77,4 +78,33 @@ - { +@@ -78,6 +79,35 @@ return new EntityMooshroom(this.field_70170_p); } -+ -+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos){ return func_70874_b() >= 0; } + ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos){ return func_70874_b() >= 0; } + @Override -+ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos, int fortune) ++ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos, int fortune) + { + this.func_70106_y(); + this.field_70170_p.func_175688_a(EnumParticleTypes.EXPLOSION_LARGE, 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, new int[0]); @@ -56,7 +55,10 @@ + ret.add(new ItemStack(Blocks.field_150337_Q)); + } + -+ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); ++ this.func_184185_a(SoundEvents.field_187784_dt, 1.0F, 1.0F); + return ret; + } - } ++ + protected ResourceLocation func_184647_J() + { + return LootTableList.field_186400_H; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch index ec6eaae58..921dfecba 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 -@@ -279,7 +279,7 @@ +@@ -285,7 +285,7 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos.func_177977_b()); + Block block = iblockstate.func_177230_c(); - Block block = this.field_70170_p.func_180495_p(blockpos.func_177977_b()).func_177230_c(); - -- 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, blockpos.func_177977_b())) +- if (block == Blocks.field_150349_c || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (block == Blocks.field_150349_c || block.isLeaves(iblockstate, this.field_70170_p, blockpos.func_177977_b())) { 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 7d9799ce8..7552ad705 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -1,29 +1,27 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java -@@ -35,7 +35,7 @@ +@@ -42,7 +42,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class EntitySheep extends EntityAnimal +public class EntitySheep extends EntityAnimal implements net.minecraftforge.common.IShearable { + private static final DataParameter field_184774_bv = EntityDataManager.func_187226_a(EntitySheep.class, DataSerializers.field_187191_a); private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() - { -@@ -140,11 +140,12 @@ +@@ -171,9 +171,10 @@ } } + @SuppressWarnings("unused") - public boolean func_70085_c(EntityPlayer p_70085_1_) + public boolean func_184645_a(EntityPlayer p_184645_1_, EnumHand p_184645_2_, ItemStack p_184645_3_) { - ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); - -- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) -+ if (false && itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) //Forge: Moved to onSheared +- if (p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) ++ if (false && p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) //Forge: Moved to onSheared { if (!this.field_70170_p.field_72995_K) { -@@ -327,4 +328,19 @@ +@@ -356,4 +357,19 @@ field_175514_bm.put(EnumDyeColor.RED, new float[] {0.6F, 0.2F, 0.2F}); field_175514_bm.put(EnumDyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F}); } @@ -39,7 +37,7 @@ + for (int j = 0; j < i; ++j) + ret.add(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_175509_cj().func_176765_a())); + -+ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); ++ this.func_184185_a(SoundEvents.field_187763_eJ, 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 9648a8f59..d661dc5b2 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,23 +1,23 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java -@@ -81,6 +81,7 @@ +@@ -90,6 +90,7 @@ private boolean field_82190_bM; private boolean field_175564_by; private InventoryBasic field_175560_bz; + @Deprecated //Use VillagerRegistry - private static final EntityVillager.ITradeList[][][][] field_175561_bA = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.field_151015_O, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.field_151174_bG, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.field_151172_bF, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.field_151025_P, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150423_aK), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.field_151158_bO, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150440_ba), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151034_e, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.field_151106_aX, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.field_151105_aU, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.field_151115_aP, new EntityVillager.PriceInfo(6, 6), Items.field_179566_aV, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151112_aM, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150325_L), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.field_151097_aZ, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 0), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.field_151032_g, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.field_151031_f, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.func_150898_a(Blocks.field_150351_n), new EntityVillager.PriceInfo(10, 10), Items.field_151145_ak, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151121_aF, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.field_151122_aG, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.field_151111_aL, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150342_X), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.field_151164_bB, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.field_151113_aN, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150359_w), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.field_151057_cb, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151078_bh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.field_151043_k, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.field_151137_ax, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BLUE.func_176767_b()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151061_bv, new EntityVillager.PriceInfo(7, 11)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150426_aN), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151062_by, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151028_Y, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.field_151030_Z, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151163_ad, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.field_151029_X, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151022_W, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.field_151020_U, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151023_V, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151036_c, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151040_l, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151048_u, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151056_x, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151037_a, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151035_b, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151046_w, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151147_al, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.field_151076_bf, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151157_am, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.field_151077_bg, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.field_151116_aA, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151026_S, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151027_R, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.field_151141_av, new EntityVillager.PriceInfo(8, 10))}}}}; + private static final EntityVillager.ITradeList[][][][] field_175561_bA = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.field_151015_O, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.field_151174_bG, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.field_151172_bF, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.field_151025_P, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150423_aK), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.field_151158_bO, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150440_ba), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151034_e, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.field_151106_aX, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.field_151105_aU, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.field_151115_aP, new EntityVillager.PriceInfo(6, 6), Items.field_179566_aV, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151112_aM, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150325_L), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.field_151097_aZ, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L)), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.field_151032_g, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.field_151031_f, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.func_150898_a(Blocks.field_150351_n), new EntityVillager.PriceInfo(10, 10), Items.field_151145_ak, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151121_aF, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.field_151122_aG, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.field_151111_aL, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150342_X), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.field_151164_bB, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.field_151113_aN, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150359_w), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.field_151057_cb, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151078_bh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.field_151043_k, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.field_151137_ax, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BLUE.func_176767_b()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151079_bi, new EntityVillager.PriceInfo(4, 7)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150426_aN), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151062_by, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151028_Y, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.field_151030_Z, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151163_ad, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.field_151029_X, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151022_W, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.field_151020_U, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151023_V, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151036_c, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151040_l, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151048_u, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151056_x, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151037_a, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151035_b, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151046_w, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151147_al, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.field_151076_bf, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151157_am, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.field_151077_bg, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.field_151116_aA, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151026_S, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151027_R, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.field_151141_av, new EntityVillager.PriceInfo(8, 10))}}}}; public EntityVillager(World p_i1747_1_) -@@ -210,7 +211,7 @@ - ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); - boolean flag = itemstack != null && itemstack.func_77973_b() == Items.field_151063_bx; +@@ -221,7 +222,7 @@ + { + boolean flag = p_184645_3_ != null && p_184645_3_.func_77973_b() == Items.field_151063_bx; - 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 (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_() && !p_184645_1_.func_70093_af()) { - if (!this.field_70170_p.field_72995_K && (this.field_70963_i == null || this.field_70963_i.size() > 0)) + if (!this.field_70170_p.field_72995_K && (this.field_70963_i == null || !this.field_70963_i.isEmpty())) { -@@ -522,6 +523,7 @@ +@@ -533,6 +534,7 @@ private void func_175554_cu() { @@ -25,15 +25,15 @@ EntityVillager.ITradeList[][][] aentityvillager$itradelist = field_175561_bA[this.func_70946_n()]; if (this.field_175563_bv != 0 && this.field_175562_bw != 0) -@@ -635,6 +637,7 @@ +@@ -647,6 +649,7 @@ } } + //TODO: Hook into VillagerRegistry to get name if (s1 != null) { - ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("entity.Villager." + s1, new Object[0]); -@@ -697,7 +700,7 @@ + TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("entity.Villager." + s1, new Object[0]); +@@ -708,7 +711,7 @@ public IEntityLivingData func_180482_a(DifficultyInstance p_180482_1_, IEntityLivingData p_180482_2_) { p_180482_2_ = super.func_180482_a(p_180482_1_, p_180482_2_); diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 20055aad9..b6f1f0782 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java -@@ -80,6 +80,11 @@ +@@ -93,6 +93,11 @@ @SuppressWarnings("incomplete-switch") public abstract class EntityPlayer extends EntityLivingBase { @@ -9,20 +9,10 @@ + private java.util.HashMap spawnForcedMap = new java.util.HashMap(); + public float eyeHeight = this.getDefaultEyeHeight(); + - public InventoryPlayer field_71071_by = new InventoryPlayer(this); - private InventoryEnderChest field_71078_a = new InventoryEnderChest(); - public Container field_71069_bz; -@@ -175,7 +180,8 @@ - { - if (this.field_71074_e != null) - { -- this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); -+ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, field_71074_e, this.field_71072_f)) -+ this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); - } - - this.func_71041_bz(); -@@ -199,6 +205,7 @@ + private static final DataParameter field_184829_a = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187193_c); + private static final DataParameter field_184830_b = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187192_b); + protected static final DataParameter field_184827_bp = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187191_a); +@@ -174,6 +179,7 @@ public void func_70071_h_() { @@ -30,30 +20,7 @@ this.field_70145_X = this.func_175149_v(); if (this.func_175149_v()) -@@ -212,6 +219,14 @@ - - if (itemstack == this.field_71074_e) - { -+ field_71072_f = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_71074_e, field_71072_f); -+ if (field_71072_f <= 0) -+ { -+ this.func_71036_o(); -+ } -+ else -+ { // Forge Keep unindented to lower patch -+ field_71074_e.func_77973_b().onUsingTick(field_71074_e, this, field_71072_f); //Forge Added - if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) - { - this.func_71010_c(itemstack, 5); -@@ -221,6 +236,7 @@ - { - this.func_71036_o(); - } -+ } - } - else - { -@@ -266,7 +282,7 @@ +@@ -219,7 +225,7 @@ super.func_70071_h_(); @@ -62,43 +29,29 @@ { this.func_71053_j(); this.field_71070_bA = this.field_71069_bz; -@@ -343,6 +359,7 @@ - { - this.func_70107_b(d3, this.field_70163_u, d4); +@@ -360,6 +366,7 @@ + this.func_70105_a(f, f1); + } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPostTick(this); } public int func_82145_z() -@@ -412,11 +429,12 @@ - int i = this.field_71074_e.field_77994_a; - ItemStack itemstack = this.field_71074_e.func_77950_b(this.field_70170_p, this); - -+ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, field_71074_e, field_71072_f, itemstack); - if (itemstack != this.field_71074_e || itemstack != null && itemstack.field_77994_a != i) - { - this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = itemstack; - -- if (itemstack.field_77994_a == 0) -+ if (itemstack != null && itemstack.field_77994_a == 0) - { - this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = null; - } -@@ -476,11 +494,11 @@ +@@ -442,11 +449,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.field_70154_o instanceof EntityPig) -+ if (this.field_70154_o instanceof EntityLivingBase && ((EntityLivingBase)field_70154_o).shouldRiderFaceForward(this)) +- if (this.func_184187_bx() instanceof EntityPig) ++ if (this.func_184187_bx() instanceof EntityLivingBase && ((EntityLivingBase)this.func_94060_bK()).shouldRiderFaceForward(this)) { 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; +- this.field_70761_aq = ((EntityPig)this.func_184187_bx()).field_70761_aq; ++ this.field_70761_aq = ((EntityLivingBase)this.func_184187_bx()).field_70761_aq; } } } -@@ -610,11 +628,15 @@ +@@ -576,11 +583,15 @@ public void func_70645_a(DamageSource p_70645_1_) { @@ -114,7 +67,7 @@ if (this.func_70005_c_().equals("Notch")) { this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false); -@@ -625,6 +647,9 @@ +@@ -591,6 +602,9 @@ this.field_71071_by.func_70436_m(); } @@ -123,8 +76,8 @@ + if (p_70645_1_ != null) { - this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * (float)Math.PI / 180.0F) * 0.1F); -@@ -707,12 +732,25 @@ + this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * 0.017453292F) * 0.1F); +@@ -678,12 +692,25 @@ public EntityItem func_71040_bB(boolean p_71040_1_) { @@ -152,34 +105,31 @@ } public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) -@@ -770,13 +808,25 @@ +@@ -746,15 +773,22 @@ - public void func_71012_a(EntityItem p_71012_1_) + public ItemStack func_184816_a(EntityItem p_184816_1_) { -+ if (captureDrops) -+ { -+ capturedDrops.add(p_71012_1_); -+ return; -+ } -+ - this.field_70170_p.func_72838_d(p_71012_1_); ++ if (captureDrops) capturedDrops.add(p_184816_1_); ++ else // Forge: Don't indent to keep patch smaller. + this.field_70170_p.func_72838_d(p_184816_1_); + ItemStack itemstack = p_184816_1_.func_92059_d(); + return itemstack; } + @Deprecated //Use location sensitive version below - public float func_180471_a(Block p_180471_1_) + public float func_184813_a(IBlockState p_184813_1_) { -- float f = this.field_71071_by.func_146023_a(p_180471_1_); -+ return getBreakSpeed(p_180471_1_.func_176223_P(), new BlockPos(0, -1, 0)); +- float f = this.field_71071_by.func_184438_a(p_184813_1_); ++ return getBreakSpeed(p_184813_1_, new BlockPos(0, -1, 0)); + } + public float getBreakSpeed(IBlockState state, BlockPos pos) + { -+ ItemStack stack = field_71071_by.func_70448_g(); -+ float f = (stack == null ? 1.0F : stack.func_77973_b().getDigSpeed(stack, state)); ++ float f = this.field_71071_by.func_184438_a(state); if (f > 1.0F) { - int i = EnchantmentHelper.func_77509_b(this); -@@ -826,12 +876,13 @@ + int i = EnchantmentHelper.func_185293_e(this); +@@ -804,12 +838,13 @@ f /= 5.0F; } @@ -188,14 +138,14 @@ + return (f < 0 ? 0 : f); } - public boolean func_146099_a(Block p_146099_1_) + public boolean func_184823_b(IBlockState p_184823_1_) { -- return this.field_71071_by.func_146025_b(p_146099_1_); -+ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.field_71071_by.func_146025_b(p_146099_1_)); +- return this.field_71071_by.func_184432_b(p_184823_1_); ++ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_184823_1_, this.field_71071_by.func_184432_b(p_184823_1_)); } public void func_70037_a(NBTTagCompound p_70037_1_) -@@ -867,6 +918,16 @@ +@@ -845,6 +880,16 @@ this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); } @@ -212,7 +162,7 @@ this.field_71100_bB.func_75112_a(p_70037_1_); this.field_71075_bZ.func_75095_b(p_70037_1_); -@@ -898,6 +959,23 @@ +@@ -877,6 +922,23 @@ p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d); } @@ -236,7 +186,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()); -@@ -911,6 +989,7 @@ +@@ -884,6 +946,7 @@ public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -244,42 +194,36 @@ if (this.func_180431_b(p_70097_1_)) { return false; -@@ -1007,12 +1086,15 @@ +@@ -966,6 +1029,7 @@ + if (this.field_184627_bm.field_77994_a <= 0) + { + EnumHand enumhand = this.func_184600_cs(); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, this.field_184627_bm, enumhand); + + if (enumhand == EnumHand.MAIN_HAND) + { +@@ -1001,8 +1065,12 @@ { if (!this.func_180431_b(p_70665_1_)) { + p_70665_2_ = net.minecraftforge.common.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) - { - p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; - } - -- p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); + 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_); + p_70665_2_ = net.minecraftforge.common.ISpecialArmor.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 f = p_70665_2_; p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); -@@ -1074,6 +1156,7 @@ + this.func_110149_m(this.func_110139_bj() - (f - p_70665_2_)); +@@ -1067,6 +1135,7 @@ } else { -+ if (!net.minecraftforge.event.ForgeEventFactory.canInteractWith(this, p_70998_1_)) return false; - ItemStack itemstack = this.func_71045_bC(); - ItemStack itemstack1 = itemstack != null ? itemstack.func_77946_l() : null; ++ if (!net.minecraftforge.event.ForgeEventFactory.canInteractWith(this, p_184822_1_, p_184822_2_, p_184822_3_)) return EnumActionResult.PASS; + ItemStack itemstack = p_184822_2_ != null ? p_184822_2_.func_77946_l() : null; -@@ -1125,7 +1208,9 @@ - - public void func_71028_bD() - { -+ ItemStack orig = func_71045_bC(); - this.field_71071_by.func_70299_a(this.field_71071_by.field_70461_c, (ItemStack)null); -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, orig); - } - - public double func_70033_W() -@@ -1135,6 +1220,7 @@ + if (!p_184822_1_.func_184230_a(this, p_184822_2_, p_184822_3_)) +@@ -1123,6 +1192,7 @@ public void func_71059_n(Entity p_71059_1_) { @@ -287,7 +231,7 @@ if (p_71059_1_.func_70075_an()) { if (!p_71059_1_.func_85031_j(this)) -@@ -1311,6 +1397,8 @@ +@@ -1410,6 +1480,8 @@ public EntityPlayer.EnumStatus func_180469_a(BlockPos p_180469_1_) { @@ -296,19 +240,21 @@ if (!this.field_70170_p.field_72995_K) { if (this.func_70608_bn() || !this.func_70089_S()) -@@ -1350,9 +1438,9 @@ +@@ -1449,9 +1521,10 @@ this.func_70105_a(0.2F, 0.2F); - if (this.field_70170_p.func_175667_e(p_180469_1_)) -+ if (this.field_70170_p.func_175667_e(p_180469_1_) && field_70170_p.func_180495_p(p_180469_1_).func_177230_c().isBed(field_70170_p, p_180469_1_, this)) - { -- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(p_180469_1_).func_177229_b(BlockDirectional.field_176387_N); -+ EnumFacing enumfacing = this.field_70170_p.func_180495_p(p_180469_1_).func_177230_c().getBedDirection(field_70170_p, p_180469_1_); +- { +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(p_180469_1_).func_177229_b(BlockHorizontal.field_185512_D); ++ IBlockState state = null; ++ if (this.field_70170_p.func_175667_e(p_180469_1_)) state = this.field_70170_p.func_180495_p(p_180469_1_); ++ if (state != null && state.func_177230_c().isBed(state, this.field_70170_p, p_180469_1_, this)) { ++ EnumFacing enumfacing = state.func_177230_c().getBedDirection(state, this.field_70170_p, p_180469_1_); float f = 0.5F; float f1 = 0.5F; -@@ -1415,13 +1503,14 @@ +@@ -1514,13 +1587,14 @@ public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { @@ -317,16 +263,16 @@ IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); - if (this.field_71081_bT != null && iblockstate.func_177230_c() == Blocks.field_150324_C) -+ if (this.field_71081_bT != null && iblockstate.func_177230_c().isBed(field_70170_p, field_71081_bT, this)) ++ if (this.field_71081_bT != null && iblockstate.func_177230_c().isBed(iblockstate, field_70170_p, field_71081_bT, this)) { - this.field_70170_p.func_180501_a(this.field_71081_bT, iblockstate.func_177226_a(BlockBed.field_176471_b, Boolean.valueOf(false)), 4); - BlockPos blockpos = BlockBed.func_176468_a(this.field_70170_p, this.field_71081_bT, 0); + iblockstate.func_177230_c().setBedOccupied(field_70170_p, field_71081_bT, this, false); -+ BlockPos blockpos = iblockstate.func_177230_c().getBedSpawnPosition(field_70170_p, field_71081_bT, this); ++ BlockPos blockpos = iblockstate.func_177230_c().getBedSpawnPosition(iblockstate, field_70170_p, field_71081_bT, this); if (blockpos == null) { -@@ -1430,6 +1519,10 @@ +@@ -1529,6 +1603,10 @@ this.func_70107_b((double)((float)blockpos.func_177958_n() + 0.5F), (double)((float)blockpos.func_177956_o() + 0.1F), (double)((float)blockpos.func_177952_p() + 0.5F)); } @@ -337,7 +283,7 @@ this.field_71083_bS = false; -@@ -1448,14 +1541,14 @@ +@@ -1547,14 +1625,15 @@ private boolean func_175143_p() { @@ -347,19 +293,21 @@ public static BlockPos func_180467_a(World p_180467_0_, BlockPos p_180467_1_, boolean p_180467_2_) { - Block block = p_180467_0_.func_180495_p(p_180467_1_).func_177230_c(); +- Block block = p_180467_0_.func_180495_p(p_180467_1_).func_177230_c(); ++ IBlockState state = p_180467_0_.func_180495_p(p_180467_1_); ++ Block block = state.func_177230_c(); - if (block != Blocks.field_150324_C) -+ if (!block.isBed(p_180467_0_, p_180467_1_, null)) ++ if (!block.isBed(state, p_180467_0_, p_180467_1_, null)) { if (!p_180467_2_) { -@@ -1470,16 +1563,16 @@ +@@ -1569,16 +1648,17 @@ } else { - return BlockBed.func_176468_a(p_180467_0_, p_180467_1_, 0); -+ return p_180467_0_.func_180495_p(p_180467_1_).func_177230_c().getBedSpawnPosition(p_180467_0_, p_180467_1_, null); ++ return block.getBedSpawnPosition(state, p_180467_0_, p_180467_1_, null); } } @@ -367,14 +315,15 @@ public float func_71051_bG() { - if (this.field_71081_bT != null) -+ if (this.field_71081_bT != null && field_70170_p.func_180495_p(field_71081_bT).func_177230_c().isBed(field_70170_p, field_71081_bT, this)) ++ IBlockState state = this.field_71081_bT == null ? null : this.field_70170_p.func_180495_p(field_71081_bT); ++ if (state != null && state.func_177230_c().isBed(state, field_70170_p, field_71081_bT, this)) { -- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockDirectional.field_176387_N); -+ EnumFacing enumfacing = this.field_70170_p.func_180495_p(this.field_71081_bT).func_177230_c().getBedDirection(field_70170_p, field_71081_bT); +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockHorizontal.field_185512_D); ++ EnumFacing enumfacing = state.func_177230_c().getBedDirection(state, field_70170_p, field_71081_bT); switch (enumfacing) { -@@ -1519,16 +1612,24 @@ +@@ -1618,16 +1698,24 @@ public BlockPos func_180470_cg() { @@ -401,7 +350,7 @@ if (p_180473_1_ != null) { this.field_71077_c = p_180473_1_; -@@ -1712,6 +1813,10 @@ +@@ -1822,6 +1910,10 @@ super.func_180430_e(p_180430_1_, p_180430_2_); } @@ -412,38 +361,10 @@ } protected void func_71061_d_() -@@ -1735,6 +1840,7 @@ - } - - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(EntityList.func_75619_a(p_70074_1_))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.func_75621_b(p_70074_1_)); - - if (entitylist$entityegginfo != null) - { -@@ -1847,6 +1953,8 @@ - { - if (p_71008_1_ != this.field_71074_e) - { -+ p_71008_2_ = net.minecraftforge.event.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_; - -@@ -1918,6 +2026,10 @@ - this.field_181016_an = p_71049_1_.field_181016_an; - this.field_181017_ao = p_71049_1_.field_181017_ao; - this.field_181018_ap = p_71049_1_.field_181018_ap; -+ //Copy and re-init ExtendedProperties when switching dimensions. -+ this.extendedProperties = p_71049_1_.extendedProperties; -+ for (net.minecraftforge.common.IExtendedEntityProperties p : this.extendedProperties.values()) -+ p.init(this, this.field_70170_p); - } - else if (this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) - { -@@ -1931,6 +2043,18 @@ +@@ -2022,6 +2114,18 @@ this.field_175152_f = p_71049_1_.field_175152_f; this.field_71078_a = p_71049_1_.field_71078_a; - this.func_70096_w().func_75692_b(10, Byte.valueOf(p_71049_1_.func_70096_w().func_75683_a(10))); + this.func_184212_Q().func_187227_b(field_184827_bp, p_71049_1_.func_184212_Q().func_187225_a(field_184827_bp)); + + this.spawnChunkMap = p_71049_1_.spawnChunkMap; + this.spawnForcedMap = p_71049_1_.spawnForcedMap; @@ -459,35 +380,19 @@ } protected boolean func_70041_e_() -@@ -1968,7 +2092,14 @@ +@@ -2120,7 +2224,10 @@ - public void func_70062_b(int p_70062_1_, ItemStack p_70062_2_) + public ITextComponent func_145748_c_() { -- this.field_71071_by.field_70460_b[p_70062_1_] = p_70062_2_; -+ if (p_70062_1_ == 0) //Forge: Fix issue in Player where it doen't take into account selected item -+ { -+ this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = p_70062_2_; -+ } -+ else -+ { -+ this.field_71071_by.field_70460_b[p_70062_1_ - 1] = p_70062_2_; -+ } - } - - @SideOnly(Side.CLIENT) -@@ -2013,7 +2144,10 @@ - - public IChatComponent func_145748_c_() - { -- IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); -+ IChatComponent ichatcomponent = new ChatComponentText(""); -+ if (!prefixes.isEmpty()) for (net.minecraft.util.IChatComponent prefix : prefixes) ichatcomponent.func_150257_a(prefix); -+ ichatcomponent.func_150257_a(new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.getDisplayNameString()))); -+ if (!suffixes.isEmpty()) for (net.minecraft.util.IChatComponent suffix : suffixes) ichatcomponent.func_150257_a(suffix); - ichatcomponent.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); - ichatcomponent.func_150256_b().func_150209_a(this.func_174823_aP()); - ichatcomponent.func_150256_b().func_179989_a(this.func_70005_c_()); -@@ -2022,7 +2156,7 @@ +- ITextComponent itextcomponent = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); ++ ITextComponent itextcomponent = new TextComponentString(""); ++ if (!prefixes.isEmpty()) for (ITextComponent prefix : prefixes) itextcomponent.func_150257_a(prefix); ++ itextcomponent.func_150257_a(new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_()))); ++ if (!suffixes.isEmpty()) for (ITextComponent suffix : suffixes) itextcomponent.func_150257_a(suffix); + itextcomponent.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); + itextcomponent.func_150256_b().func_150209_a(this.func_174823_aP()); + itextcomponent.func_150256_b().func_179989_a(this.func_70005_c_()); +@@ -2129,7 +2236,7 @@ public float func_70047_e() { @@ -496,8 +401,8 @@ if (this.func_70608_bn()) { -@@ -2155,6 +2289,136 @@ - this.field_175153_bG = p_175150_1_; +@@ -2340,6 +2447,136 @@ + return (float)this.func_110148_a(SharedMonsterAttributes.field_188792_h).func_111126_e(); } + /** @@ -610,23 +515,23 @@ + this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); + } + -+ private final java.util.Collection prefixes = new java.util.LinkedList(); -+ private final java.util.Collection suffixes = new java.util.LinkedList(); ++ private final java.util.Collection prefixes = new java.util.LinkedList(); ++ private final java.util.Collection suffixes = new java.util.LinkedList(); + + /** + * Add a prefix to the player's username in chat + * @param prefix The prefix + */ -+ public void addPrefix(net.minecraft.util.IChatComponent prefix) { prefixes.add(prefix); } ++ public void addPrefix(ITextComponent prefix) { prefixes.add(prefix); } + + /** + * Add a suffix to the player's username in chat + * @param suffix The suffix + */ -+ public void addSuffix(net.minecraft.util.IChatComponent suffix) { suffixes.add(suffix); } ++ public void addSuffix(ITextComponent suffix) { suffixes.add(suffix); } + -+ public java.util.Collection getPrefixes() { return this.prefixes; } -+ public java.util.Collection getSuffixes() { return this.suffixes; } ++ public java.util.Collection getPrefixes() { return this.prefixes; } ++ public java.util.Collection getSuffixes() { return this.suffixes; } + + /* ======================================== 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 0dd5fb674..e61f8cfba 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java -@@ -123,14 +123,15 @@ +@@ -134,14 +134,15 @@ public int field_71138_i; public boolean field_71136_j; + @SuppressWarnings("unused") - public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_) + public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, PlayerInteractionManager p_i45285_4_) { super(p_i45285_2_, p_i45285_3_); p_i45285_4_.field_73090_b = this; @@ -16,9 +16,9 @@ - if (!p_i45285_2_.field_73011_w.func_177495_o() && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) + if (false && !p_i45285_2_.field_73011_w.func_177495_o() && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) { - int i = Math.max(5, p_i45285_1_.func_82357_ak() - 6); + int i = Math.max(0, p_i45285_1_.func_184108_a(p_i45285_2_)); int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p())); -@@ -223,7 +224,7 @@ +@@ -250,7 +251,7 @@ this.field_71070_bA.func_75142_b(); @@ -27,25 +27,17 @@ { this.func_71053_j(); this.field_71070_bA = this.field_71069_bz; -@@ -294,6 +295,7 @@ - for (Chunk chunk1 : list) - { - this.func_71121_q().func_73039_n().func_85172_a(this, chunk1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk1.func_76632_l(), this)); - } - } - } -@@ -424,6 +426,7 @@ +@@ -433,6 +434,7 @@ public void func_70645_a(DamageSource p_70645_1_) { + if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; - if (this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages")) - { - Team team = this.func_96124_cp(); -@@ -447,7 +450,20 @@ + boolean flag = this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages"); + this.field_71135_a.func_147359_a(new SPacketCombatEvent(this.func_110142_aN(), SPacketCombatEvent.Event.ENTITY_DIED, flag)); - if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) +@@ -459,7 +461,20 @@ + + if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory") && !this.func_175149_v()) { + captureDrops = true; + capturedDrops.clear(); @@ -58,29 +50,30 @@ + { + for (net.minecraft.entity.item.EntityItem item : capturedDrops) + { -+ func_71012_a(item); ++ this.field_70170_p.func_72838_d(item); + } + } } - for (ScoreObjective scoreobjective : this.field_70170_p.func_96441_U().func_96520_a(IScoreObjectiveCriteria.field_96642_c)) -@@ -461,6 +477,7 @@ - if (entitylivingbase != null) - { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(EntityList.func_75619_a(entitylivingbase))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.func_75621_b(entitylivingbase)); + for (ScoreObjective scoreobjective : this.field_70170_p.func_96441_U().func_96520_a(IScoreCriteria.field_96642_c)) +@@ -540,6 +555,7 @@ - if (entitylist$entityegginfo != null) - { -@@ -528,6 +545,7 @@ - - public void func_71027_c(int p_71027_1_) + public Entity func_184204_a(int p_184204_1_) { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_71027_1_)) return; - if (this.field_71093_bK == 1 && p_71027_1_ == 1) ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return this; + this.field_184851_cj = true; + + if (this.field_71093_bK == 1 && p_184204_1_ == 1) +@@ -697,7 +713,7 @@ + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_70170_p, blockpos)) { - this.func_71029_a(AchievementList.field_76003_C); -@@ -831,6 +849,7 @@ + BlockPos blockpos1 = blockpos.func_177977_b(); + IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1); +@@ -921,6 +937,7 @@ { if (p_71064_1_ != null) { diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index f59794311..879c821bd 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,22 +1,23 @@ --- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -272,12 +272,8 @@ - { - if (this.field_70462_a[j] == null) +@@ -270,13 +270,8 @@ + + if (itemstack == null) { -- this.field_70462_a[j] = new ItemStack(item, 0, p_70452_1_.func_77960_j()); +- itemstack = new ItemStack(item, 0, p_70452_1_.func_77960_j()); - - if (p_70452_1_.func_77942_o()) - { -- this.field_70462_a[j].func_77982_d((NBTTagCompound)p_70452_1_.func_77978_p().func_74737_b()); +- itemstack.func_77982_d((NBTTagCompound)p_70452_1_.func_77978_p().func_74737_b()); - } -+ this.field_70462_a[j] = p_70452_1_.func_77946_l(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. -+ this.field_70462_a[j].field_77994_a = 0; +- ++ itemstack = p_70452_1_.func_77946_l(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. ++ itemstack.field_77994_a = 0; + this.func_70299_a(j, itemstack); } - int k = i; -@@ -315,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); +@@ -344,6 +339,14 @@ + } } } + @@ -29,4 +30,4 @@ + } } - public boolean func_146026_a(Item p_146026_1_) + public boolean func_70441_a(final ItemStack p_70441_1_) diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch deleted file mode 100644 index b859938da..000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFishHook.java -+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFishHook.java -@@ -567,11 +567,19 @@ - } - } - -+ @SuppressWarnings("unused") - private ItemStack func_146033_f() - { - float f = this.field_70170_p.field_73012_v.nextFloat(); - int i = EnchantmentHelper.func_151386_g(this.field_146042_b); - int j = EnchantmentHelper.func_151387_h(this.field_146042_b); -+ -+ if (true) -+ { -+ this.field_146042_b.func_71064_a(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); -+ return net.minecraftforge.common.FishingHooks.getRandomFishable(this.field_70146_Z, f, i, j); -+ } -+ - float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; - float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; - f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); diff --git a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch index 4b2ed93f3..ab15f50df 100644 --- a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch +++ b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/init/Bootstrap.java +++ ../src-work/minecraft/net/minecraft/init/Bootstrap.java -@@ -65,6 +65,7 @@ +@@ -74,6 +74,7 @@ return field_151355_a; } @@ -8,12 +8,35 @@ static void func_151353_a() { BlockDispenser.field_149943_a.func_82595_a(Items.field_151032_g, new BehaviorProjectileDispense() -@@ -78,23 +79,23 @@ +@@ -87,9 +88,9 @@ + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_185167_i, new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) + { +- EntityTippedArrow entitytippedarrow = new EntityTippedArrow(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); ++ EntityTippedArrow entitytippedarrow = new EntityTippedArrow(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); + entitytippedarrow.func_184555_a(p_82499_3_); + entitytippedarrow.field_70251_a = EntityArrow.PickupStatus.ALLOWED; + return entitytippedarrow; +@@ -97,32 +98,32 @@ + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_185166_h, new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) + { +- EntityArrow entityarrow = new EntitySpectralArrow(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); ++ EntityArrow entityarrow = new EntitySpectralArrow(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); + entityarrow.field_70251_a = EntityArrow.PickupStatus.ALLOWED; + return entityarrow; + } }); BlockDispenser.field_149943_a.func_82595_a(Items.field_151110_aK, new BehaviorProjectileDispense() { -- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) -+ protected IProjectile func_82499_a(World worldIn, IPosition position) +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) { - return new EntityEgg(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); + return new EntityEgg(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); @@ -21,8 +44,8 @@ }); BlockDispenser.field_149943_a.func_82595_a(Items.field_151126_ay, new BehaviorProjectileDispense() { -- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) -+ protected IProjectile func_82499_a(World worldIn, IPosition position) +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) { - return new EntitySnowball(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); + return new EntitySnowball(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); @@ -30,85 +53,84 @@ }); BlockDispenser.field_149943_a.func_82595_a(Items.field_151062_by, new BehaviorProjectileDispense() { -- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) -+ protected IProjectile func_82499_a(World worldIn, IPosition position) +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) { - return new EntityExpBottle(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); + return new EntityExpBottle(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); } protected float func_82498_a() { -@@ -108,13 +109,13 @@ - BlockDispenser.field_149943_a.func_82595_a(Items.field_151068_bn, new IBehaviorDispenseItem() +@@ -135,13 +136,13 @@ + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_185155_bH, new IBehaviorDispenseItem() { - private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); - public ItemStack func_82482_a(IBlockSource p_82482_1_, final ItemStack p_82482_2_) + public ItemStack func_82482_a(IBlockSource source, final ItemStack stack) { -- return ItemPotion.func_77831_g(p_82482_2_.func_77960_j()) ? (new BehaviorProjectileDispense() -+ return ItemPotion.func_77831_g(stack.func_77960_j()) ? (new BehaviorProjectileDispense() + return (new BehaviorProjectileDispense() { -- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) -+ protected IProjectile func_82499_a(World worldIn, IPosition position) +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) { - return new EntityPotion(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c(), p_82482_2_.func_77946_l()); + return new EntityPotion(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c(), stack.func_77946_l()); } protected float func_82498_a() { -@@ -124,7 +125,7 @@ +@@ -151,18 +152,18 @@ { return super.func_82500_b() * 1.25F; } -- }).func_82482_a(p_82482_1_, p_82482_2_): this.field_150843_b.func_82482_a(p_82482_1_, p_82482_2_); -+ }).func_82482_a(source, stack): this.field_150843_b.func_82482_a(source, stack); +- }).func_82482_a(p_82482_1_, p_82482_2_); ++ }).func_82482_a(source, stack); + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_185156_bI, new IBehaviorDispenseItem() + { +- public ItemStack func_82482_a(IBlockSource p_82482_1_, final ItemStack p_82482_2_) ++ public ItemStack func_82482_a(IBlockSource source, final ItemStack stack) + { + return (new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_, ItemStack p_82499_3_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position, ItemStack p_82499_3_) + { +- return new EntityPotion(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c(), p_82482_2_.func_77946_l()); ++ return new EntityPotion(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c(), stack.func_77946_l()); + } + protected float func_82498_a() + { +@@ -172,7 +173,7 @@ + { + return super.func_82500_b() * 1.25F; + } +- }).func_82482_a(p_82482_1_, p_82482_2_); ++ }).func_82482_a(source, stack); } }); BlockDispenser.field_149943_a.func_82595_a(Items.field_151063_bx, new BehaviorDefaultDispenseItem() -@@ -135,7 +136,7 @@ - double d0 = p_82487_1_.func_82615_a() + (double)enumfacing.func_82601_c(); - double d1 = (double)((float)p_82487_1_.func_180699_d().func_177956_o() + 0.2F); - double d2 = p_82487_1_.func_82616_c() + (double)enumfacing.func_82599_e(); -- Entity entity = ItemMonsterPlacer.func_77840_a(p_82487_1_.func_82618_k(), p_82487_2_.func_77960_j(), d0, d1, d2); -+ Entity entity = ItemMonsterPlacer.spawnCreature(p_82487_1_.func_82618_k(), ItemMonsterPlacer.getEntityName(p_82487_2_), d0, d1, d2); - - if (entity instanceof EntityLivingBase && p_82487_2_.func_82837_s()) - { -@@ -190,14 +191,14 @@ - BlockDispenser.field_149943_a.func_82595_a(Items.field_151124_az, new BehaviorDefaultDispenseItem() +@@ -215,25 +216,25 @@ + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151059_bz, new BehaviorDefaultDispenseItem() { - private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); - public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) + public ItemStack func_82487_b(IBlockSource source, ItemStack stack) { - EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.func_82620_h()); -- World world = p_82487_1_.func_82618_k(); -- double d0 = p_82487_1_.func_82615_a() + (double)((float)enumfacing.func_82601_c() * 1.125F); -- double d1 = p_82487_1_.func_82617_b() + (double)((float)enumfacing.func_96559_d() * 1.125F); -- double d2 = p_82487_1_.func_82616_c() + (double)((float)enumfacing.func_82599_e() * 1.125F); -- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(enumfacing); +- IPosition iposition = BlockDispenser.func_149939_a(p_82487_1_); + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.func_82620_h()); ++ IPosition iposition = BlockDispenser.func_149939_a(source); + double d0 = iposition.func_82615_a() + (double)((float)enumfacing.func_82601_c() * 0.3F); + double d1 = iposition.func_82617_b() + (double)((float)enumfacing.func_96559_d() * 0.3F); + double d2 = iposition.func_82616_c() + (double)((float)enumfacing.func_82599_e() * 0.3F); +- World world = p_82487_1_.func_82618_k(); + World world = source.func_82618_k(); -+ double d0 = source.func_82615_a() + (double)((float)enumfacing.func_82601_c() * 1.125F); -+ double d1 = source.func_82617_b() + (double)((float)enumfacing.func_96559_d() * 1.125F); -+ double d2 = source.func_82616_c() + (double)((float)enumfacing.func_82599_e() * 1.125F); -+ BlockPos blockpos = source.func_180699_d().func_177972_a(enumfacing); - Material material = world.func_180495_p(blockpos).func_177230_c().func_149688_o(); - double d3; - -@@ -209,7 +210,7 @@ - { - if (!Material.field_151579_a.equals(material) || !Material.field_151586_h.equals(world.func_180495_p(blockpos.func_177977_b()).func_177230_c().func_149688_o())) - { -- return this.field_150842_b.func_82482_a(p_82487_1_, p_82487_2_); -+ return this.field_150842_b.func_82482_a(source, stack); - } - - d3 = 0.0D; -@@ -217,31 +218,31 @@ - - EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2); - world.func_72838_d(entityboat); + Random random = world.field_73012_v; + double d3 = random.nextGaussian() * 0.05D + (double)enumfacing.func_82601_c(); + double d4 = random.nextGaussian() * 0.05D + (double)enumfacing.func_96559_d(); + double d5 = random.nextGaussian() * 0.05D + (double)enumfacing.func_82599_e(); + world.func_72838_d(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5)); - p_82487_2_.func_77979_a(1); - return p_82487_2_; + stack.func_77979_a(1); @@ -117,10 +139,12 @@ - protected void func_82485_a(IBlockSource p_82485_1_) + protected void func_82485_a(IBlockSource source) { -- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); -+ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); +- p_82485_1_.func_82618_k().func_175718_b(1018, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1018, source.func_180699_d(), 0); } }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151124_az, new Bootstrap.BehaviorDispenseBoat(EntityBoat.Type.OAK)); +@@ -245,20 +246,20 @@ IBehaviorDispenseItem ibehaviordispenseitem = new BehaviorDefaultDispenseItem() { private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); @@ -132,8 +156,8 @@ + ItemBucket itembucket = (ItemBucket)stack.func_77973_b(); + BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); -- if (itembucket.func_180616_a(p_82487_1_.func_82618_k(), blockpos)) -+ if (itembucket.func_180616_a(source.func_82618_k(), blockpos)) +- if (itembucket.func_180616_a((EntityPlayer)null, p_82487_1_.func_82618_k(), blockpos)) ++ if (itembucket.func_180616_a((EntityPlayer)null, source.func_82618_k(), blockpos)) { - p_82487_2_.func_150996_a(Items.field_151133_ar); - p_82487_2_.field_77994_a = 1; @@ -149,7 +173,7 @@ } } }; -@@ -250,10 +251,10 @@ +@@ -267,10 +268,10 @@ BlockDispenser.field_149943_a.func_82595_a(Items.field_151133_ar, new BehaviorDefaultDispenseItem() { private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); @@ -162,8 +186,8 @@ + BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); IBlockState iblockstate = world.func_180495_p(blockpos); Block block = iblockstate.func_177230_c(); - Material material = block.func_149688_o(); -@@ -267,7 +268,7 @@ + Material material = iblockstate.func_185904_a(); +@@ -284,7 +285,7 @@ { if (!Material.field_151587_i.equals(material) || !(block instanceof BlockLiquid) || ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() != 0) { @@ -172,7 +196,7 @@ } item = Items.field_151129_at; -@@ -275,34 +276,34 @@ +@@ -292,34 +293,34 @@ world.func_175698_g(blockpos); @@ -218,7 +242,7 @@ } } else if (world.func_180495_p(blockpos).func_177230_c() == Blocks.field_150335_W) -@@ -315,17 +316,17 @@ +@@ -332,31 +333,31 @@ this.field_150839_b = false; } @@ -240,8 +264,36 @@ } } }); -@@ -358,15 +359,15 @@ - return super.func_82487_b(p_82487_1_, p_82487_2_); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151100_aR, new BehaviorDefaultDispenseItem() + { + private boolean field_150838_b = true; +- protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ protected ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- if (EnumDyeColor.WHITE == EnumDyeColor.func_176766_a(p_82487_2_.func_77960_j())) ++ if (EnumDyeColor.WHITE == EnumDyeColor.func_176766_a(stack.func_77960_j())) + { +- World world = p_82487_1_.func_82618_k(); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(p_82487_1_.func_82620_h())); ++ World world = source.func_82618_k(); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); + +- if (ItemDye.func_179234_a(p_82487_2_, world, blockpos)) ++ if (ItemDye.func_179234_a(stack, world, blockpos)) + { + if (!world.field_72995_K) + { +@@ -368,49 +369,49 @@ + this.field_150838_b = false; + } + +- return p_82487_2_; ++ return stack; + } + else + { +- return super.func_82487_b(p_82487_1_, p_82487_2_); ++ return super.func_82487_b(source, stack); } } - protected void func_82485_a(IBlockSource p_82485_1_) @@ -255,6 +307,119 @@ else { - p_82485_1_.func_82618_k().func_175718_b(1001, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1001, source.func_180699_d(), 0); + } + } + }); + BlockDispenser.field_149943_a.func_82595_a(Item.func_150898_a(Blocks.field_150335_W), new BehaviorDefaultDispenseItem() + { +- protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ protected ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- World world = p_82487_1_.func_82618_k(); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(p_82487_1_.func_82620_h())); ++ World world = source.func_82618_k(); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o(), (double)blockpos.func_177952_p() + 0.5D, (EntityLivingBase)null); + world.func_72838_d(entitytntprimed); + world.func_184148_a((EntityPlayer)null, entitytntprimed.field_70165_t, entitytntprimed.field_70163_u, entitytntprimed.field_70161_v, SoundEvents.field_187904_gd, SoundCategory.BLOCKS, 1.0F, 1.0F); +- --p_82487_2_.field_77994_a; +- return p_82487_2_; ++ --stack.field_77994_a; ++ return stack; + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151144_bL, new BehaviorDefaultDispenseItem() + { + private boolean field_179240_b = true; +- protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ protected ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- World world = p_82487_1_.func_82618_k(); +- EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.func_82620_h()); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(enumfacing); ++ World world = source.func_82618_k(); ++ EnumFacing enumfacing = BlockDispenser.func_149937_b(source.func_82620_h()); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(enumfacing); + BlockSkull blockskull = Blocks.field_150465_bP; + +- if (world.func_175623_d(blockpos) && blockskull.func_176415_b(world, blockpos, p_82487_2_)) ++ if (world.func_175623_d(blockpos) && blockskull.func_176415_b(world, blockpos, stack)) + { + if (!world.field_72995_K) + { +@@ -419,13 +420,13 @@ + + if (tileentity instanceof TileEntitySkull) + { +- if (p_82487_2_.func_77960_j() == 3) ++ if (stack.func_77960_j() == 3) + { + GameProfile gameprofile = null; + +- if (p_82487_2_.func_77942_o()) ++ if (stack.func_77942_o()) + { +- NBTTagCompound nbttagcompound = p_82487_2_.func_77978_p(); ++ NBTTagCompound nbttagcompound = stack.func_77978_p(); + + if (nbttagcompound.func_150297_b("SkullOwner", 10)) + { +@@ -446,32 +447,32 @@ + } + else + { +- ((TileEntitySkull)tileentity).func_152107_a(p_82487_2_.func_77960_j()); ++ ((TileEntitySkull)tileentity).func_152107_a(stack.func_77960_j()); + } + + ((TileEntitySkull)tileentity).func_145903_a(enumfacing.func_176734_d().func_176736_b() * 4); + Blocks.field_150465_bP.func_180679_a(world, blockpos, (TileEntitySkull)tileentity); + } + +- --p_82487_2_.field_77994_a; ++ --stack.field_77994_a; + } + } +- else if (ItemArmor.func_185082_a(p_82487_1_, p_82487_2_) == null) ++ else if (ItemArmor.func_185082_a(source, stack) == null) + { + this.field_179240_b = false; + } + +- return p_82487_2_; ++ return stack; + } +- protected void func_82485_a(IBlockSource p_82485_1_) ++ protected void func_82485_a(IBlockSource source) + { + if (this.field_179240_b) + { +- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); + } + else + { +- p_82485_1_.func_82618_k().func_175718_b(1001, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1001, source.func_180699_d(), 0); + } + } + }); +@@ -505,15 +506,15 @@ + + return p_82487_2_; + } +- protected void func_82485_a(IBlockSource p_82485_1_) ++ protected void func_82485_a(IBlockSource source) + { + if (this.field_179241_b) + { +- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); + } + else + { +- p_82485_1_.func_82618_k().func_175718_b(1001, p_82485_1_.func_180699_d(), 0); + source.func_82618_k().func_175718_b(1001, source.func_180699_d(), 0); } } diff --git a/patches/minecraft/net/minecraft/inventory/Container.java.patch b/patches/minecraft/net/minecraft/inventory/Container.java.patch index 0fdc592c4..a14906ef9 100644 --- a/patches/minecraft/net/minecraft/inventory/Container.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Container.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/Container.java +++ ../src-work/minecraft/net/minecraft/inventory/Container.java -@@ -608,7 +608,7 @@ +@@ -646,7 +646,7 @@ Slot slot1 = (Slot)this.field_75151_b.get(i); ItemStack itemstack1 = slot1.func_75211_c(); diff --git a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch index 4e3f446a3..cf54412a4 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -1,29 +1,21 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java -@@ -154,7 +154,7 @@ +@@ -196,7 +196,7 @@ - public boolean func_75214_a(ItemStack p_75214_1_) - { -- return p_75214_1_ != null ? p_75214_1_.func_77973_b().func_150892_m(p_75214_1_) : false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_75214_1_); - } - - public int func_75219_a() -@@ -185,7 +185,7 @@ - - public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + public boolean func_75214_a(ItemStack p_75214_1_) { -- 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 net.minecraft.item.ItemPotion && p_82870_2_.func_77960_j() > 0) - { - this.field_75244_a.func_71029_a(AchievementList.field_76001_A); +- return p_75214_1_ != null && PotionHelper.func_185205_a(p_75214_1_); ++ return p_75214_1_ != null && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_75214_1_); + } + + public int func_75219_a() +@@ -243,8 +243,7 @@ + } + else + { +- Item item = p_75243_0_.func_77973_b(); +- return item == Items.field_151068_bn || item == Items.field_151069_bo || item == Items.field_185155_bH || item == Items.field_185156_bI; ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_75243_0_); } -@@ -195,7 +195,7 @@ - - public static boolean func_75243_a_(ItemStack p_75243_0_) - { -- 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 net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_75243_0_); } } - } diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 79534c19d..6eb1cab47 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerEnchantment.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java -@@ -65,9 +65,12 @@ +@@ -68,9 +68,12 @@ }); this.func_75146_a(new Slot(this.field_75168_e, 1, 35, 47) { @@ -14,7 +14,7 @@ } }); -@@ -146,6 +149,7 @@ +@@ -155,6 +158,7 @@ if (!this.field_75172_h.field_72995_K) { int l = 0; @@ -22,7 +22,7 @@ for (int j = -1; j <= 1; ++j) { -@@ -153,37 +157,14 @@ +@@ -162,37 +166,14 @@ { if ((j != 0 || k != 0) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 0, j)) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 1, j))) { @@ -66,12 +66,12 @@ } } } -@@ -193,7 +174,7 @@ +@@ -202,7 +183,7 @@ for (int i1 = 0; i1 < 3; ++i1) { - this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, l, itemstack); + this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, (int)power, itemstack); - this.field_178151_h[i1] = -1; + this.field_185001_h[i1] = -1; + this.field_185002_i[i1] = -1; - if (this.field_75167_g[i1] < i1 + 1) diff --git a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch index b34ce8231..a77e0a042 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 -@@ -43,7 +43,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_f : (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_f == 0)); -+ if (p_75214_1_ == null) return false; -+ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, k_f, field_82862_h); +@@ -48,8 +48,7 @@ + } + else + { +- EntityEquipmentSlot entityequipmentslot1 = EntityLiving.func_184640_d(p_75214_1_); +- return entityequipmentslot1 == entityequipmentslot; ++ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, entityequipmentslot, field_82862_h); + } } @SideOnly(Side.CLIENT) - public String func_178171_c() diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index aad74b86d..78d93064a 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java -@@ -70,6 +70,8 @@ +@@ -69,6 +69,8 @@ p_82870_1_.func_82242_a(-ContainerRepair.this.field_82854_e); } @@ -9,7 +9,7 @@ ContainerRepair.this.field_82853_g.func_70299_a(0, (ItemStack)null); if (ContainerRepair.this.field_82856_l > 0) -@@ -94,7 +96,7 @@ +@@ -93,7 +95,7 @@ ContainerRepair.this.field_82854_e = 0; IBlockState iblockstate = p_i45807_2_.func_180495_p(p_i45807_3_); @@ -18,25 +18,30 @@ { int l = ((Integer)iblockstate.func_177229_b(BlockAnvil.field_176505_b)).intValue(); ++l; -@@ -172,6 +174,7 @@ +@@ -160,10 +162,12 @@ + Map map = EnchantmentHelper.func_82781_a(itemstack1); + j = j + itemstack.func_82838_A() + (itemstack2 == null ? 0 : itemstack2.func_82838_A()); + this.field_82856_l = 0; ++ boolean flag = false; if (itemstack2 != null) { -+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, i2)) return; - flag = itemstack2.func_77973_b() == Items.field_151134_bR && Items.field_151134_bR.func_92110_g(itemstack2).func_74745_c() > 0; +- boolean flag = itemstack2.func_77973_b() == Items.field_151134_bR && !Items.field_151134_bR.func_92110_g(itemstack2).func_82582_d(); ++ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, j)) return; ++ flag = itemstack2.func_77973_b() == Items.field_151134_bR && !Items.field_151134_bR.func_92110_g(itemstack2).func_82582_d(); if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) -@@ -264,7 +267,8 @@ - { - int i4 = ((Integer)iterator.next()).intValue(); + { +@@ -235,7 +239,7 @@ -- if (i4 != i5 && !enchantment.func_77326_a(Enchantment.func_180306_c(i4))) -+ Enchantment e2 = Enchantment.func_180306_c(i4); -+ if (i4 != i5 && !(enchantment.func_77326_a(e2) && e2.func_77326_a(enchantment))) //Forge BugFix: Let Both enchantments veto being together + for (Enchantment enchantment : map.keySet()) + { +- if (enchantment != enchantment1 && !enchantment1.func_77326_a(enchantment)) ++ if (enchantment != enchantment1 && !(enchantment1.func_77326_a(enchantment) && enchantment.func_77326_a(enchantment1))) //Forge BugFix: Let Both enchantments veto being together { flag1 = false; - ++l1; -@@ -315,6 +319,8 @@ + ++i; +@@ -279,6 +283,8 @@ } } diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index 58adc5a1a..a35783d0c 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java +++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java -@@ -112,8 +112,11 @@ +@@ -107,8 +107,11 @@ public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { diff --git a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch index 33dcc7b7e..090b18f53 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch @@ -8,4 +8,4 @@ + if (p_75208_1_.func_77973_b() == Items.field_151042_j) { - this.field_75229_a.func_71029_a(AchievementList.field_76016_k); + this.field_75229_a.func_71029_a(AchievementList.field_187987_k); diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 9bbc3ff94..46f446cc9 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -1,18 +1,18 @@ --- ../src-base/minecraft/net/minecraft/item/Item.java +++ ../src-work/minecraft/net/minecraft/item/Item.java -@@ -48,8 +48,8 @@ +@@ -58,8 +58,8 @@ public class Item { - public static final RegistryNamespaced field_150901_e = new RegistryNamespaced(); - private static final Map field_179220_a = Maps.newHashMap(); -+ public static final RegistryNamespaced field_150901_e = net.minecraftforge.fml.common.registry.GameData.getItemRegistry(); ++ public static final RegistryNamespaced field_150901_e = net.minecraftforge.fml.common.registry.GameData.getItemRegistry();; + private static final Map field_179220_a = net.minecraftforge.fml.common.registry.GameData.getBlockItemMap(); - protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - private CreativeTabs field_77701_a; - protected static Random field_77697_d = new Random(); -@@ -61,6 +61,9 @@ - private String field_77785_bY; + private static final IItemPropertyGetter field_185046_b = new IItemPropertyGetter() + { + @SideOnly(Side.CLIENT) +@@ -104,6 +104,9 @@ + private Item field_77700_c; private String field_77774_bZ; + public final net.minecraftforge.fml.common.registry.RegistryDelegate delegate = @@ -21,7 +21,7 @@ public static int func_150891_b(Item p_150891_0_) { return p_150891_0_ == null ? 0 : field_150901_e.func_148757_b(p_150891_0_); -@@ -126,6 +129,7 @@ +@@ -192,6 +195,7 @@ return p_77654_1_; } @@ -29,7 +29,7 @@ public int func_77639_j() { return this.field_77777_bU; -@@ -239,6 +243,7 @@ +@@ -312,6 +316,7 @@ return this.field_77700_c; } @@ -37,7 +37,7 @@ public boolean func_77634_r() { return this.field_77700_c != null; -@@ -316,7 +321,7 @@ +@@ -367,7 +372,7 @@ public boolean func_77616_k(ItemStack p_77616_1_) { @@ -45,8 +45,8 @@ + return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m(); } - protected MovingObjectPosition func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) -@@ -334,6 +339,10 @@ + protected RayTraceResult func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) +@@ -385,6 +390,10 @@ float f6 = f3 * f4; float f7 = f2 * f4; double d3 = 5.0D; @@ -54,15 +54,15 @@ + { + d3 = ((net.minecraft.entity.player.EntityPlayerMP)p_77621_2_).field_71134_c.getBlockReachDistance(); + } - Vec3 vec31 = vec3.func_72441_c((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); - return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); + Vec3d vec3d1 = vec3d.func_72441_c((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); + return p_77621_1_.func_147447_a(vec3d, vec3d1, p_77621_3_, !p_77621_3_, false); } -@@ -371,11 +380,670 @@ +@@ -422,11 +431,588 @@ return false; } + @Deprecated // Use ItemStack sensitive version below. - public Multimap func_111205_h() + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) { return HashMultimap.create(); } @@ -71,9 +71,9 @@ + /** + * ItemStack sensitive version of getItemAttributeModifiers + */ -+ public Multimap getAttributeModifiers(ItemStack stack) ++ public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) + { -+ return this.func_111205_h(); ++ return this.func_111205_h(slot); + } + + /** @@ -96,7 +96,7 @@ + * by a user in the displayed name, such as a mode of operation. + * + * @param item the ItemStack for the item. -+ * @param the name that will be displayed unless it is changed in this method. ++ * @param displayName the name that will be displayed unless it is changed in this method. + */ + public String getHighlightTip( ItemStack item, String displayName ) + { @@ -110,25 +110,14 @@ + * @param world The Current World + * @param pos Target position + * @param side The side of the target hit -+ * @return Return true to prevent any further processing. ++ * @param hand Which hand the item is being held in. ++ * @return Return PASS to allow vanilla handling, any other to skip normal code. + */ -+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) ++ public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) + { -+ return false; ++ return EnumActionResult.PASS; + } + -+ /** -+ * Metadata-sensitive version of getStrVsBlock -+ * @param itemstack The Item Stack -+ * @param state The block state -+ * @return The damage strength -+ */ -+ public float getDigSpeed(ItemStack itemstack, net.minecraft.block.state.IBlockState state) -+ { -+ return func_150893_a(itemstack, state.func_177230_c()); -+ } -+ -+ + protected boolean canRepair = true; + /** + * Called by CraftingManager to determine if an item is reparable. @@ -170,7 +159,7 @@ + * @param player The Player using the item + * @param count The amount of time in tick the item has been used for continuously + */ -+ public void onUsingTick(ItemStack stack, EntityPlayer player, int count) ++ public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) + { + } + @@ -190,20 +179,6 @@ + } + + /** -+ * Player, Render pass, and item usage sensitive version of getIconIndex. -+ * -+ * @param stack The item stack to get the icon for. -+ * @param player The player holding the item -+ * @param useRemaining The ticks remaining for the active item. -+ * @return Null to use default model, or a custom ModelResourceLocation for the stage of use. -+ */ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.client.resources.model.ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) -+ { -+ return null; -+ } -+ -+ /** + * ItemStack sensitive version of getContainerItem. + * Returns a full ItemStack instance of the result. + * @@ -308,40 +283,6 @@ + } + + /** -+ * Return the correct icon for rendering based on the supplied ItemStack and render pass. -+ * -+ * Defers to {@link #getIconFromDamageForRenderPass(int, int)} -+ * @param stack to render for -+ * @param pass the multi-render pass -+ * @return the icon -+ * / -+ public IIcon getIcon(ItemStack stack, int pass) -+ { -+ return func_77618_c(stack.getMetadata(), pass); -+ } -+ */ -+ -+ /** -+ * Generates the base Random item for a specific instance of the chest gen, -+ * Enchanted books use this to pick a random enchantment. -+ * -+ * @param chest The chest category to generate for -+ * @param rnd World RNG -+ * @param original Original result registered with the chest gen hooks. -+ * @return New values to use as the random item, typically this will be original -+ */ -+ public net.minecraft.util.WeightedRandomChestContent getChestGenBase(net.minecraftforge.common.ChestGenHooks chest, Random rnd, net.minecraft.util.WeightedRandomChestContent original) -+ { -+ if (this instanceof ItemEnchantedBook) -+ { -+ return ((ItemEnchantedBook)this).func_92112_a(rnd, -+ original.field_76295_d, -+ original.field_76296_e, original.field_76292_a); -+ } -+ return original; -+ } -+ -+ /** + * + * Should this item, when held, allow sneak-clicks to pass through to the underlying block? + * @@ -350,7 +291,7 @@ + * @param player The Player that is wielding the item + * @return + */ -+ public boolean doesSneakBypassUse(World world, BlockPos pos, EntityPlayer player) ++ public boolean doesSneakBypassUse(ItemStack stack, net.minecraft.world.IBlockAccess world, BlockPos pos, EntityPlayer player) + { + return false; + } @@ -368,19 +309,9 @@ + * @param entity The entity trying to equip the armor + * @return True if the given ItemStack can be inserted in the slot + */ -+ public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) ++ public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) + { -+ if (this instanceof ItemArmor) -+ { -+ return ((ItemArmor)this).field_77881_a == armorType; -+ } -+ -+ if (armorType == 0) -+ { -+ return this == Item.func_150898_a(Blocks.field_150423_aK) || this == Items.field_151144_bL; -+ } -+ -+ return false; ++ return net.minecraft.entity.EntityLiving.func_184640_d(stack) == armorType; + } + + /** @@ -408,7 +339,7 @@ + * @param type The subtype, can be null or "overlay" + * @return Path of texture to bind, or null to use default + */ -+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) ++ public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) + { + return null; + } @@ -427,29 +358,18 @@ + } + + /** -+ * @deprecated Use 4-argument version. -+ */ -+ // remove 1.9 -+ @SideOnly(Side.CLIENT) -+ @Deprecated -+ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) -+ { -+ return null; -+ } -+ -+ /** + * Override this method to have an item handle its own armor rendering. + * + * @param entityLiving The entity wearing the armor + * @param itemStack The itemStack to render the model of -+ * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet ++ * @param armorSlot The slot the armor is in + * @param _default Original armor model. Will have attributes set. + * @return A ModelBiped to render instead of the default + */ + @SideOnly(Side.CLIENT) -+ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot, net.minecraft.client.model.ModelBiped _default) ++ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) + { -+ return getArmorModel(entityLiving, itemStack, armorSlot); ++ return null; + } + + /** @@ -559,14 +479,14 @@ + } + + /** -+ * ItemStack sensitive version of {@link #canHarvestBlock(Block)} -+ * @param par1Block The block trying to harvest -+ * @param itemStack The itemstack used to harvest the block ++ * ItemStack sensitive version of {@link #canHarvestBlock(IBlockState)} ++ * @param state The block trying to harvest ++ * @param stack The itemstack used to harvest the block + * @return true if can harvest the block + */ -+ public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) ++ public boolean canHarvestBlock(IBlockState state, ItemStack stack) + { -+ return func_150897_b(par1Block); ++ return func_150897_b(state); + } + + /** @@ -574,7 +494,7 @@ + * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() + * + * @param stack The ItemStack -+ * @return THe maximum number this item can be stacked to ++ * @return The maximum number this item can be stacked to + */ + public int getItemStackLimit(ItemStack stack) + { @@ -641,7 +561,6 @@ + return this == Items.field_151166_bC || this == Items.field_151045_i || this == Items.field_151043_k || this == Items.field_151042_j; + } + -+ + /** + * Determine if the player switching between these two item stacks + * @param oldStack The old stack that was equipped @@ -656,7 +575,6 @@ + return !ItemStack.func_77989_b(oldStack, newStack); + } + -+ + private ResourceLocation registryName = null; + /** + * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. @@ -728,7 +646,7 @@ public static void func_150900_l() { func_179214_a(Blocks.field_150348_b, (new ItemMultiTexture(Blocks.field_150348_b, Blocks.field_150348_b, new Function() -@@ -855,6 +1523,10 @@ +@@ -935,6 +1521,10 @@ private final float field_78011_i; private final int field_78008_j; @@ -739,21 +657,21 @@ private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) { this.field_78001_f = p_i1874_3_; -@@ -889,9 +1561,36 @@ +@@ -969,9 +1559,36 @@ return this.field_78008_j; } + @Deprecated // Use getRepairItemStack below public Item func_150995_f() { -- 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)))); +- 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 == DIAMOND ? Items.field_151045_i : null)))); + switch (this) + { + 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; ++ case DIAMOND: return Items.field_151045_i; + default: return customCraftingMaterial; + } } @@ -761,7 +679,7 @@ + public ToolMaterial setRepairItem(ItemStack stack) + { + if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); -+ if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); ++ if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == DIAMOND) throw new RuntimeException("Can not change vanilla tool repair materials"); + this.repairMaterial = stack; + this.customCraftingMaterial = stack.func_77973_b(); + return this; diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index c81e15e77..8559d5846 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -1,34 +1,15 @@ --- ../src-base/minecraft/net/minecraft/item/ItemArmor.java +++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java -@@ -37,7 +37,7 @@ - if (list.size() > 0) - { - EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); -- int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; -+ int l = 0;// Forge: We fix the indexes. Mojang Stop hard coding this! - int i1 = EntityLiving.func_82159_b(p_82487_2_); - ItemStack itemstack = p_82487_2_.func_77946_l(); - itemstack.field_77994_a = 1; -@@ -190,7 +190,7 @@ - - if (itemstack == null) - { -- 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; - } - -@@ -210,6 +210,9 @@ +@@ -235,6 +235,8 @@ private final int[] field_78049_g; private final int field_78055_h; - + private final SoundEvent field_185020_j; + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; -+ - private ArmorMaterial(String p_i45789_3_, int p_i45789_4_, int[] p_i45789_5_, int p_i45789_6_) + + private ArmorMaterial(String p_i46796_3_, int p_i46796_4_, int[] p_i46796_5_, int p_i46796_6_, SoundEvent p_i46796_7_) { - this.field_179243_f = p_i45789_3_; -@@ -235,7 +238,15 @@ +@@ -267,7 +269,15 @@ public Item func_151685_b() { diff --git a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch index b87dbda54..845906f7c 100644 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBlock.java +++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java -@@ -54,16 +54,8 @@ +@@ -50,16 +50,8 @@ int i = this.func_77647_b(p_180614_1_.func_77960_j()); - IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_3_, p_180614_4_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_2_); + IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_3_, p_180614_4_, p_180614_6_, p_180614_7_, p_180614_8_, p_180614_9_, i, p_180614_2_); -- if (p_180614_3_.func_180501_a(p_180614_4_, iblockstate1, 3)) -+ if (placeBlockAt(p_180614_1_, p_180614_2_, p_180614_3_, p_180614_4_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, iblockstate1)) +- if (p_180614_3_.func_180501_a(p_180614_4_, iblockstate1, 11)) ++ if (placeBlockAt(p_180614_1_, p_180614_2_, p_180614_3_, p_180614_4_, p_180614_6_, p_180614_7_, p_180614_8_, p_180614_9_, iblockstate1)) { - iblockstate1 = p_180614_3_.func_180495_p(p_180614_4_); - @@ -15,10 +15,10 @@ - this.field_150939_a.func_180633_a(p_180614_3_, p_180614_4_, iblockstate1, p_180614_2_, p_180614_1_); - } - - p_180614_3_.func_72908_a((double)((float)p_180614_4_.func_177958_n() + 0.5F), (double)((float)p_180614_4_.func_177956_o() + 0.5F), (double)((float)p_180614_4_.func_177952_p() + 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); + SoundType soundtype = this.field_150939_a.func_185467_w(); + p_180614_3_.func_184133_a(p_180614_2_, p_180614_4_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); --p_180614_1_.field_77994_a; - } -@@ -124,7 +116,7 @@ +@@ -121,7 +113,7 @@ { Block block = p_179222_1_.func_180495_p(p_179222_2_).func_177230_c(); @@ -27,7 +27,7 @@ { p_179222_3_ = EnumFacing.UP; } -@@ -162,4 +154,26 @@ +@@ -159,4 +151,26 @@ { return this.field_150939_a; } diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index 098450a80..d91f85c80 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -1,22 +1,31 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBow.java +++ ../src-work/minecraft/net/minecraft/item/ItemBow.java -@@ -27,6 +27,9 @@ - if (flag || p_77615_3_.field_71071_by.func_146028_b(Items.field_151032_g)) - { - int i = this.func_77626_a(p_77615_1_) - p_77615_4_; -+ net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(p_77615_3_, p_77615_1_, i); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; -+ i = event.charge; - float f = (float)i / 20.0F; - f = (f * f + f * 2.0F) / 3.0F; +@@ -90,6 +90,10 @@ + boolean flag = entityplayer.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantments.field_185312_x, p_77615_1_) > 0; + ItemStack itemstack = this.func_185060_a(entityplayer); -@@ -104,6 +107,9 @@ - - public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) - { -+ net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(p_77659_3_, p_77659_1_); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; ++ int i = this.func_77626_a(p_77615_1_) - p_77615_4_; ++ i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(p_77615_1_, p_77615_2_, (EntityPlayer)p_77615_3_, i, itemstack != null || flag); ++ if (i < 0) return; + - if (p_77659_3_.field_71075_bZ.field_75098_d || p_77659_3_.field_71071_by.func_146028_b(Items.field_151032_g)) + if (itemstack != null || flag) + { + if (itemstack == null) +@@ -97,7 +101,6 @@ + itemstack = new ItemStack(Items.field_151032_g); + } + +- int i = this.func_77626_a(p_77615_1_) - p_77615_4_; + float f = func_185059_b(i); + + if ((double)f >= 0.1D) +@@ -189,6 +192,9 @@ + { + boolean flag = this.func_185060_a(p_77659_3_) != null; + ++ ActionResult ret = net.minecraftforge.event.ForgeEventFactory.onArrowNock(p_77659_1_, p_77659_2_, p_77659_3_, p_77659_4_, flag); ++ if (ret != null) return ret; ++ + if (!p_77659_3_.field_71075_bZ.field_75098_d && !flag) { - p_77659_3_.func_71008_a(p_77659_1_, this.func_77626_a(p_77659_1_)); + return !flag ? new ActionResult(EnumActionResult.FAIL, p_77659_1_) : new ActionResult(EnumActionResult.PASS, p_77659_1_); diff --git a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch index b2f98aa45..344645f97 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -1,12 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBucket.java +++ ../src-work/minecraft/net/minecraft/item/ItemBucket.java -@@ -36,6 +36,9 @@ - } - else +@@ -36,6 +36,8 @@ + { + boolean flag = this.field_77876_a == Blocks.field_150350_a; + RayTraceResult raytraceresult = this.func_77621_a(p_77659_2_, p_77659_3_, flag); ++ ActionResult ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(p_77659_3_, p_77659_2_, p_77659_1_, raytraceresult); ++ if (ret != null) return ret; + + if (raytraceresult == null) { -+ ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(p_77659_3_, p_77659_2_, p_77659_1_, movingobjectposition); -+ if (ret != null) return ret; -+ - if (movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) - { - BlockPos blockpos = movingobjectposition.func_178782_a(); diff --git a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index a14a80107..3420e5327 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java +++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java -@@ -23,7 +23,7 @@ +@@ -27,7 +27,7 @@ if (!p_77654_2_.field_72995_K) { @@ -8,4 +8,4 @@ + p_77654_3_.curePotionEffects(p_77654_1_); } - p_77654_3_.func_71029_a(StatList.field_75929_E[Item.func_150891_b(this)]); + if (p_77654_3_ instanceof EntityPlayer) diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index a698baa69..4ed0d3e9f 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemDye.java +++ ../src-work/minecraft/net/minecraft/item/ItemDye.java -@@ -47,7 +47,7 @@ +@@ -50,7 +50,7 @@ if (enumdyecolor == EnumDyeColor.WHITE) { @@ -9,36 +9,47 @@ { if (!p_180614_3_.field_72995_K) { -@@ -97,8 +97,18 @@ +@@ -97,22 +97,32 @@ public static boolean func_179234_a(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_) { +- IBlockState iblockstate = p_179234_1_.func_180495_p(p_179234_2_); + if (p_179234_1_ instanceof net.minecraft.world.WorldServer) + return applyBonemeal(p_179234_0_, p_179234_1_, p_179234_2_, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.WorldServer)p_179234_1_)); + return false; + } -+ -+ public static boolean applyBonemeal(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_, EntityPlayer player) -+ { - IBlockState iblockstate = p_179234_1_.func_180495_p(p_179234_2_); -+ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, p_179234_1_, p_179234_2_, iblockstate, p_179234_0_); ++ public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target, EntityPlayer player) ++ { ++ IBlockState iblockstate = worldIn.func_180495_p(target); ++ ++ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, worldIn, target, iblockstate, stack); + if (hook != 0) return hook > 0; + if (iblockstate.func_177230_c() instanceof IGrowable) { IGrowable igrowable = (IGrowable)iblockstate.func_177230_c(); -@@ -132,7 +142,7 @@ - Block block = p_180617_0_.func_180495_p(p_180617_1_).func_177230_c(); +- if (igrowable.func_176473_a(p_179234_1_, p_179234_2_, iblockstate, p_179234_1_.field_72995_K)) ++ if (igrowable.func_176473_a(worldIn, target, iblockstate, worldIn.field_72995_K)) + { +- if (!p_179234_1_.field_72995_K) ++ if (!worldIn.field_72995_K) + { +- if (igrowable.func_180670_a(p_179234_1_, p_179234_1_.field_73012_v, p_179234_2_, iblockstate)) ++ if (igrowable.func_180670_a(worldIn, worldIn.field_73012_v, target, iblockstate)) + { +- igrowable.func_176474_b(p_179234_1_, p_179234_1_.field_73012_v, p_179234_2_, iblockstate); ++ igrowable.func_176474_b(worldIn, worldIn.field_73012_v, target, iblockstate); + } -- if (block.func_149688_o() != Material.field_151579_a) -+ if (block.isAir(p_180617_0_, p_180617_1_)) - { - block.func_180654_a(p_180617_0_, p_180617_1_); +- --p_179234_0_.field_77994_a; ++ --stack.field_77994_a; + } -@@ -144,6 +154,16 @@ - p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * block.func_149669_A(), (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2, new int[0]); + return true; +@@ -142,6 +152,16 @@ + p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * iblockstate.func_185900_c(p_180617_0_, p_180617_1_).field_72337_e, (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2, new int[0]); } } + else @@ -53,4 +64,4 @@ + } } - public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) + public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_, EnumHand p_111207_4_) diff --git a/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch b/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch index aaf05d09d..c38e2ed9f 100644 --- a/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/ItemEmptyMap.java +++ ../src-work/minecraft/net/minecraft/item/ItemEmptyMap.java -@@ -22,7 +22,7 @@ +@@ -25,7 +25,7 @@ p_77659_2_.func_72823_a(s, mapdata); mapdata.field_76197_d = 0; mapdata.func_176054_a(p_77659_3_.field_70165_t, p_77659_3_.field_70161_v, mapdata.field_76197_d); -- mapdata.field_76200_c = (byte)p_77659_2_.field_73011_w.func_177502_q(); -+ mapdata.field_76200_c = p_77659_2_.field_73011_w.func_177502_q(); +- mapdata.field_76200_c = (byte)p_77659_2_.field_73011_w.func_186058_p().func_186068_a(); ++ mapdata.field_76200_c = p_77659_2_.field_73011_w.func_186058_p().func_186068_a(); + mapdata.field_186210_e = true; mapdata.func_76185_a(); --p_77659_1_.field_77994_a; - diff --git a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch index 624bf5ffc..9e1f53a17 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 -@@ -27,7 +27,7 @@ +@@ -31,7 +31,7 @@ } else { -- if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o() == Material.field_151579_a) +- if (p_180614_3_.func_180495_p(p_180614_4_).func_185904_a() == Material.field_151579_a) + if (p_180614_3_.func_175623_d(p_180614_4_)) { - p_180614_3_.func_72908_a((double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + 0.5D, (double)p_180614_4_.func_177952_p() + 0.5D, "fire.ignite", 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); - p_180614_3_.func_175656_a(p_180614_4_, Blocks.field_150480_ab.func_176223_P()); + p_180614_3_.func_184133_a(p_180614_2_, p_180614_4_, SoundEvents.field_187649_bu, SoundCategory.BLOCKS, 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); + p_180614_3_.func_180501_a(p_180614_4_, Blocks.field_150480_ab.func_176223_P(), 11); diff --git a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch index 3d3e201ef..98f3a2028 100644 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/item/ItemHoe.java +++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java -@@ -34,10 +34,13 @@ +@@ -45,10 +45,13 @@ } else { + int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(p_180614_1_, p_180614_2_, p_180614_3_, p_180614_4_); -+ if (hook != 0) return hook > 0; ++ if (hook != 0) return hook > 0 ? EnumActionResult.SUCCESS : EnumActionResult.FAIL; + IBlockState iblockstate = p_180614_3_.func_180495_p(p_180614_4_); Block block = iblockstate.func_177230_c(); -- if (p_180614_5_ != EnumFacing.DOWN && p_180614_3_.func_180495_p(p_180614_4_.func_177984_a()).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180614_5_ != EnumFacing.DOWN && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) +- if (p_180614_6_ != EnumFacing.DOWN && p_180614_3_.func_180495_p(p_180614_4_.func_177984_a()).func_185904_a() == Material.field_151579_a) ++ if (p_180614_6_ != EnumFacing.DOWN && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { - if (block == Blocks.field_150349_c) + if (block == Blocks.field_150349_c || block == Blocks.field_185774_da) { diff --git a/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch b/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch index e0bd7c80c..784e8a296 100644 --- a/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch @@ -1,17 +1,18 @@ --- ../src-base/minecraft/net/minecraft/item/ItemLilyPad.java +++ ../src-work/minecraft/net/minecraft/item/ItemLilyPad.java -@@ -49,7 +49,14 @@ +@@ -47,6 +47,15 @@ - if (iblockstate.func_177230_c().func_149688_o() == Material.field_151586_h && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_77659_2_.func_175623_d(blockpos1)) + if (iblockstate.func_185904_a() == Material.field_151586_h && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_77659_2_.func_175623_d(blockpos1)) { + // special case for handling block placement with water lilies + net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_2_, blockpos1); - p_77659_2_.func_175656_a(blockpos1, Blocks.field_150392_bi.func_176223_P()); ++ p_77659_2_.func_175656_a(blockpos1, Blocks.field_150392_bi.func_176223_P()); + if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_3_, blocksnapshot, net.minecraft.util.EnumFacing.UP).isCanceled()) + { + blocksnapshot.restore(true, false); -+ return p_77659_1_; ++ return new ActionResult(EnumActionResult.FAIL, p_77659_1_); + } ++ + p_77659_2_.func_180501_a(blockpos1, Blocks.field_150392_bi.func_176223_P(), 11); if (!p_77659_3_.field_71075_bZ.field_75098_d) - { diff --git a/patches/minecraft/net/minecraft/item/ItemMap.java.patch b/patches/minecraft/net/minecraft/item/ItemMap.java.patch index c8f63dba2..ed071b6b5 100644 --- a/patches/minecraft/net/minecraft/item/ItemMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMap.java.patch @@ -4,8 +4,8 @@ mapdata = new MapData(s); mapdata.field_76197_d = 3; mapdata.func_176054_a((double)p_77873_2_.func_72912_H().func_76079_c(), (double)p_77873_2_.func_72912_H().func_76074_e(), mapdata.field_76197_d); -- mapdata.field_76200_c = (byte)p_77873_2_.field_73011_w.func_177502_q(); -+ mapdata.field_76200_c = p_77873_2_.field_73011_w.func_177502_q(); +- mapdata.field_76200_c = (byte)p_77873_2_.field_73011_w.func_186058_p().func_186068_a(); ++ mapdata.field_76200_c = p_77873_2_.field_73011_w.func_186058_p().func_186068_a(); mapdata.func_76185_a(); p_77873_2_.func_72823_a(s, mapdata); } diff --git a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch index 589f68776..04e7c10df 100644 --- a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch @@ -1,113 +1,30 @@ --- ../src-base/minecraft/net/minecraft/item/ItemMonsterPlacer.java +++ ../src-work/minecraft/net/minecraft/item/ItemMonsterPlacer.java -@@ -36,7 +36,7 @@ - public String func_77653_i(ItemStack p_77653_1_) - { - String s = ("" + StatCollector.func_74838_a(this.func_77658_a() + ".name")).trim(); -- String s1 = EntityList.func_75617_a(p_77653_1_.func_77960_j()); -+ String s1 = ItemMonsterPlacer.getEntityName(p_77653_1_); - - if (s1 != null) - { -@@ -49,7 +49,7 @@ - @SideOnly(Side.CLIENT) - public int func_82790_a(ItemStack p_82790_1_, int p_82790_2_) - { -- EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(p_82790_1_.func_77960_j())); -+ EntityList.EntityEggInfo entitylist$entityegginfo = ItemMonsterPlacer.getEggInfo(p_82790_1_); - return entitylist$entityegginfo != null ? (p_82790_2_ == 0 ? entitylist$entityegginfo.field_75611_b : entitylist$entityegginfo.field_75612_c) : 16777215; - } - -@@ -74,7 +74,7 @@ - if (tileentity instanceof TileEntityMobSpawner) - { - MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).func_145881_a(); -- mobspawnerbaselogic.func_98272_a(EntityList.func_75617_a(p_180614_1_.func_77960_j())); -+ mobspawnerbaselogic.func_98272_a(ItemMonsterPlacer.getEntityName(p_180614_1_)); - tileentity.func_70296_d(); - p_180614_3_.func_175689_h(p_180614_4_); - -@@ -90,12 +90,12 @@ - p_180614_4_ = p_180614_4_.func_177972_a(p_180614_5_); +@@ -88,7 +88,7 @@ + p_180614_4_ = p_180614_4_.func_177972_a(p_180614_6_); double d0 = 0.0D; -- if (p_180614_5_ == EnumFacing.UP && iblockstate instanceof BlockFence) -+ if (p_180614_5_ == EnumFacing.UP && iblockstate.func_177230_c() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block +- if (p_180614_6_ == EnumFacing.UP && iblockstate instanceof BlockFence) ++ if (p_180614_6_ == EnumFacing.UP && iblockstate.func_177230_c() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block { d0 = 0.5D; } - -- Entity entity = func_77840_a(p_180614_3_, p_180614_1_.func_77960_j(), (double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + d0, (double)p_180614_4_.func_177952_p() + 0.5D); -+ Entity entity = spawnCreature(p_180614_3_, ItemMonsterPlacer.getEntityName(p_180614_1_), (double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + d0, (double)p_180614_4_.func_177952_p() + 0.5D); - - if (entity != null) - { -@@ -146,7 +146,7 @@ - - if (p_77659_2_.func_180495_p(blockpos).func_177230_c() instanceof BlockLiquid) - { -- Entity entity = func_77840_a(p_77659_2_, p_77659_1_.func_77960_j(), (double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D); -+ Entity entity = spawnCreature(p_77659_2_, ItemMonsterPlacer.getEntityName(p_77659_1_), (double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D); - - if (entity != null) - { -@@ -170,19 +170,29 @@ +@@ -195,15 +195,15 @@ } } -+ @Deprecated // Use string version below. - public static Entity func_77840_a(World p_77840_0_, int p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) +- public static Entity func_77840_a(World p_77840_0_, String p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) ++ public static Entity func_77840_a(World p_77840_0_, String name, double p_77840_2_, double p_77840_4_, double p_77840_6_) { - if (!EntityList.field_75627_a.containsKey(Integer.valueOf(p_77840_1_))) - { - return null; - } -+ return spawnCreature(p_77840_0_, EntityList.func_75617_a(p_77840_1_), p_77840_2_, p_77840_4_, p_77840_6_); -+ } -+ -+ public static Entity spawnCreature(World p_77840_0_, String name, double p_77840_2_, double p_77840_4_, double p_77840_6_) -+ { -+ if (!EntityList.field_75625_b.containsKey(name)) -+ { -+ return null; -+ } - else +- if (p_77840_1_ != null && EntityList.field_75627_a.containsKey(p_77840_1_)) ++ if (name != null && EntityList.field_75627_a.containsKey(name)) { Entity entity = null; for (int i = 0; i < 1; ++i) { -- entity = EntityList.func_75616_a(p_77840_1_, p_77840_0_); -+ entity = EntityList.func_75620_a(name, p_77840_0_); +- entity = EntityList.func_188429_b(p_77840_1_, p_77840_0_); ++ entity = EntityList.func_188429_b(name, p_77840_0_); if (entity instanceof EntityLivingBase) { -@@ -207,5 +217,28 @@ - { - p_150895_3_.add(new ItemStack(p_150895_1_, 1, entitylist$entityegginfo.field_75613_a)); - } -+ -+ for (String name : net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().keySet()) -+ { -+ ItemStack stack = new ItemStack(p_150895_1_); -+ net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound(); -+ nbt.func_74778_a("entity_name", name); -+ stack.func_77982_d(nbt); -+ p_150895_3_.add(stack); -+ } - } -+ -+ public static String getEntityName(ItemStack stack) -+ { -+ if (stack.func_77942_o() && stack.func_77978_p().func_150297_b("entity_name", 8)) -+ return stack.func_77978_p().func_74779_i("entity_name"); -+ return EntityList.func_75617_a(stack.func_77960_j()); -+ } -+ -+ private static EntityList.EntityEggInfo getEggInfo(ItemStack stack) -+ { -+ if (stack.func_77942_o() && stack.func_77978_p().func_150297_b("entity_name", 8)) -+ return net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(stack.func_77978_p().func_74779_i("entity_name")); -+ return (EntityList.EntityEggInfo)EntityList.field_75627_a.get(stack.func_77960_j()); -+ } - } diff --git a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch index dcafa7df7..16e050b5b 100644 --- a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch @@ -1,10 +1,9 @@ --- ../src-base/minecraft/net/minecraft/item/ItemRecord.java +++ ../src-work/minecraft/net/minecraft/item/ItemRecord.java -@@ -76,4 +76,15 @@ - { - return (ItemRecord)field_150928_b.get(p_150926_0_); +@@ -73,6 +73,17 @@ + return EnumRarity.RARE; } -+ + + /** + * Retrieves the resource location of the sound to play for this record. + * @@ -15,4 +14,7 @@ + { + return new net.minecraft.util.ResourceLocation(name); + } - } ++ + @SideOnly(Side.CLIENT) + public static ItemRecord func_185074_a(SoundEvent p_185074_0_) + { diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 1d4182528..462562362 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSeedFood.java +++ ../src-work/minecraft/net/minecraft/item/ItemSeedFood.java -@@ -6,7 +6,7 @@ - import net.minecraft.util.EnumFacing; +@@ -8,7 +8,7 @@ + import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class ItemSeedFood extends ItemFood @@ -9,17 +9,18 @@ { private Block field_150908_b; private Block field_82809_c; -@@ -28,7 +28,7 @@ +@@ -22,7 +22,8 @@ + + public EnumActionResult func_180614_a(ItemStack p_180614_1_, EntityPlayer p_180614_2_, World p_180614_3_, BlockPos p_180614_4_, EnumHand p_180614_5_, EnumFacing p_180614_6_, float p_180614_7_, float p_180614_8_, float p_180614_9_) + { +- if (p_180614_6_ == EnumFacing.UP && p_180614_2_.func_175151_a(p_180614_4_.func_177972_a(p_180614_6_), p_180614_6_, p_180614_1_) && p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_82809_c && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) ++ net.minecraft.block.state.IBlockState state = p_180614_3_.func_180495_p(p_180614_4_); ++ if (p_180614_6_ == EnumFacing.UP && p_180614_2_.func_175151_a(p_180614_4_.func_177972_a(p_180614_6_), p_180614_6_, p_180614_1_) && state.func_177230_c().canSustainPlant(state, p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { - return false; - } -- else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_82809_c && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) -+ else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().canSustainPlant(p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) - { - p_180614_3_.func_175656_a(p_180614_4_.func_177984_a(), this.field_150908_b.func_176223_P()); + p_180614_3_.func_180501_a(p_180614_4_.func_177984_a(), this.field_150908_b.func_176223_P(), 11); --p_180614_1_.field_77994_a; -@@ -39,4 +39,16 @@ - return false; +@@ -33,4 +34,16 @@ + return EnumActionResult.FAIL; } } + diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index 08fd7261b..c433dc17c 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSeeds.java +++ ../src-work/minecraft/net/minecraft/item/ItemSeeds.java -@@ -7,7 +7,7 @@ - import net.minecraft.util.EnumFacing; +@@ -9,7 +9,7 @@ + import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class ItemSeeds extends Item @@ -9,17 +9,18 @@ { private Block field_150925_a; private Block field_77838_b; -@@ -29,7 +29,7 @@ - { - return false; - } -- else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_77838_b && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) -+ else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().canSustainPlant(p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) +@@ -23,7 +23,8 @@ + + public EnumActionResult func_180614_a(ItemStack p_180614_1_, EntityPlayer p_180614_2_, World p_180614_3_, BlockPos p_180614_4_, EnumHand p_180614_5_, EnumFacing p_180614_6_, float p_180614_7_, float p_180614_8_, float p_180614_9_) + { +- if (p_180614_6_ == EnumFacing.UP && p_180614_2_.func_175151_a(p_180614_4_.func_177972_a(p_180614_6_), p_180614_6_, p_180614_1_) && p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_77838_b && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) ++ net.minecraft.block.state.IBlockState state = p_180614_3_.func_180495_p(p_180614_4_); ++ if (p_180614_6_ == EnumFacing.UP && p_180614_2_.func_175151_a(p_180614_4_.func_177972_a(p_180614_6_), p_180614_6_, p_180614_1_) && state.func_177230_c().canSustainPlant(state, p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { p_180614_3_.func_175656_a(p_180614_4_.func_177984_a(), this.field_150925_a.func_176223_P()); --p_180614_1_.field_77994_a; -@@ -40,4 +40,16 @@ - return false; +@@ -34,4 +35,16 @@ + return EnumActionResult.FAIL; } } + diff --git a/patches/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch index 3f6119ca8..700dd18bd 100644 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemShears.java.patch @@ -1,28 +1,30 @@ --- ../src-base/minecraft/net/minecraft/item/ItemShears.java +++ ../src-work/minecraft/net/minecraft/item/ItemShears.java -@@ -19,13 +19,12 @@ +@@ -6,6 +6,7 @@ + import net.minecraft.creativetab.CreativeTabs; + import net.minecraft.entity.EntityLivingBase; + import net.minecraft.init.Blocks; ++import net.minecraft.util.EnumHand; + import net.minecraft.util.math.BlockPos; + import net.minecraft.world.World; - public boolean func_179218_a(ItemStack p_179218_1_, World p_179218_2_, Block p_179218_3_, BlockPos p_179218_4_, EntityLivingBase p_179218_5_) +@@ -22,7 +23,7 @@ { -- if (p_179218_3_.func_149688_o() != Material.field_151584_j && p_179218_3_ != Blocks.field_150321_G && p_179218_3_ != Blocks.field_150329_H && p_179218_3_ != Blocks.field_150395_bd && p_179218_3_ != Blocks.field_150473_bD && p_179218_3_ != Blocks.field_150325_L) -+ if (p_179218_3_.func_149688_o() != Material.field_151584_j && p_179218_3_ != Blocks.field_150321_G && p_179218_3_ != Blocks.field_150329_H && p_179218_3_ != Blocks.field_150395_bd && p_179218_3_ != Blocks.field_150473_bD && p_179218_3_ != Blocks.field_150325_L && !(p_179218_3_ instanceof net.minecraftforge.common.IShearable)) - { - return super.func_179218_a(p_179218_1_, p_179218_2_, p_179218_3_, p_179218_4_, p_179218_5_); - } - else - { -- p_179218_1_.func_77972_a(1, p_179218_5_); - return true; - } + p_179218_1_.func_77972_a(1, p_179218_5_); + Block block = p_179218_3_.func_177230_c(); +- return p_179218_3_.func_185904_a() != Material.field_151584_j && block != Blocks.field_150321_G && block != Blocks.field_150329_H && block != Blocks.field_150395_bd && block != Blocks.field_150473_bD && block != Blocks.field_150325_L ? super.func_179218_a(p_179218_1_, p_179218_2_, p_179218_3_, p_179218_4_, p_179218_5_) : true; ++ return p_179218_3_.func_185904_a() != Material.field_151584_j && block != Blocks.field_150321_G && block != Blocks.field_150329_H && block != Blocks.field_150395_bd && block != Blocks.field_150473_bD && block != Blocks.field_150325_L && !(p_179218_3_ instanceof net.minecraftforge.common.IShearable) ? super.func_179218_a(p_179218_1_, p_179218_2_, p_179218_3_, p_179218_4_, p_179218_5_) : true; } -@@ -39,4 +38,71 @@ - { - 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; + + public boolean func_150897_b(IBlockState p_150897_1_) +@@ -36,4 +37,71 @@ + Block block = p_150893_2_.func_177230_c(); + return block != Blocks.field_150321_G && p_150893_2_.func_185904_a() != Material.field_151584_j ? (block == Blocks.field_150325_L ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; } + + + @Override -+ public boolean func_111207_a(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity) ++ public boolean func_111207_a(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity, EnumHand hand) + { + if (entity.field_70170_p.field_72995_K) + { @@ -35,7 +37,7 @@ + if (target.isShearable(itemstack, entity.field_70170_p, pos)) + { + java.util.List drops = target.onSheared(itemstack, entity.field_70170_p, pos, -+ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantment.field_77346_s.field_77352_x, itemstack)); ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.init.Enchantments.field_185308_t, itemstack)); + + java.util.Random rand = new java.util.Random(); + for(ItemStack stack : drops) @@ -66,7 +68,7 @@ + if (target.isShearable(itemstack, player.field_70170_p, pos)) + { + java.util.List drops = target.onSheared(itemstack, player.field_70170_p, pos, -+ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantment.field_77346_s.field_77352_x, itemstack)); ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.init.Enchantments.field_185308_t, itemstack)); + java.util.Random rand = new java.util.Random(); + + for(ItemStack stack : drops) @@ -81,7 +83,7 @@ + } + + itemstack.func_77972_a(1, player); -+ player.func_71064_a(net.minecraft.stats.StatList.field_75934_C[Block.func_149682_b(block)], 1); ++ player.func_71029_a(net.minecraft.stats.StatList.func_188055_a(block)); + } + } + return false; diff --git a/patches/minecraft/net/minecraft/item/ItemSkull.java.patch b/patches/minecraft/net/minecraft/item/ItemSkull.java.patch index 0e97068ef..ac5e80329 100644 --- a/patches/minecraft/net/minecraft/item/ItemSkull.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSkull.java.patch @@ -1,31 +1,22 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSkull.java +++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java -@@ -34,6 +34,11 @@ - - public boolean func_180614_a(ItemStack p_180614_1_, EntityPlayer p_180614_2_, World p_180614_3_, BlockPos p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) - { -+ if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_176200_f(p_180614_3_, p_180614_4_) && p_180614_5_ != EnumFacing.DOWN) -+ { -+ p_180614_5_ = EnumFacing.UP; -+ p_180614_4_ = p_180614_4_.func_177977_b(); -+ } - if (p_180614_5_ == EnumFacing.DOWN) +@@ -42,13 +42,18 @@ + } + else { - return false; -@@ -46,7 +51,7 @@ ++ if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_176200_f(p_180614_3_, p_180614_4_)) ++ { ++ p_180614_6_ = EnumFacing.UP; ++ p_180614_4_ = p_180614_4_.func_177977_b(); ++ } + IBlockState iblockstate = p_180614_3_.func_180495_p(p_180614_4_); + Block block = iblockstate.func_177230_c(); + boolean flag = block.func_176200_f(p_180614_3_, p_180614_4_); if (!flag) { -- if (!p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o().func_76220_a()) -+ if (!p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o().func_76220_a() && !p_180614_3_.isSideSolid(p_180614_4_, p_180614_5_, true)) +- if (!p_180614_3_.func_180495_p(p_180614_4_).func_185904_a().func_76220_a()) ++ if (!p_180614_3_.func_180495_p(p_180614_4_).func_185904_a().func_76220_a() && !p_180614_3_.isSideSolid(p_180614_4_, p_180614_6_, true)) { - return false; + return EnumActionResult.FAIL; } -@@ -66,6 +71,7 @@ - { - if (!p_180614_3_.field_72995_K) - { -+ if (!Blocks.field_150465_bP.func_176198_a(p_180614_3_, p_180614_4_, p_180614_5_)) return false; - p_180614_3_.func_180501_a(p_180614_4_, Blocks.field_150465_bP.func_176223_P().func_177226_a(BlockSkull.field_176418_a, p_180614_5_), 3); - int i = 0; - diff --git a/patches/minecraft/net/minecraft/item/ItemSnow.java.patch b/patches/minecraft/net/minecraft/item/ItemSnow.java.patch index 984fba4ed..3f3cea17a 100644 --- a/patches/minecraft/net/minecraft/item/ItemSnow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSnow.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSnow.java +++ ../src-work/minecraft/net/minecraft/item/ItemSnow.java -@@ -67,4 +67,10 @@ +@@ -68,4 +68,10 @@ { return p_77647_1_; } diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 7d0836f32..f7f888960 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/item/ItemStack.java +++ ../src-work/minecraft/net/minecraft/item/ItemStack.java -@@ -35,7 +35,7 @@ +@@ -41,7 +41,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public final class ItemStack +public final class ItemStack implements net.minecraftforge.common.capabilities.ICapabilitySerializable { - public static final DecimalFormat field_111284_a = new DecimalFormat("#.###"); + public static final DecimalFormat field_111284_a = new DecimalFormat("#.##"); public int field_77994_a; -@@ -49,6 +49,10 @@ +@@ -55,6 +55,10 @@ private Block field_179550_j; private boolean field_179551_k; @@ -20,7 +20,7 @@ public ItemStack(Block p_i1876_1_) { this((Block)p_i1876_1_, 1); -@@ -74,13 +78,15 @@ +@@ -80,13 +84,15 @@ this((Item)p_i1880_1_, p_i1880_2_, 0); } @@ -38,16 +38,16 @@ this.field_77994_a = p_i1881_2_; this.field_77991_e = p_i1881_3_; -@@ -107,7 +113,7 @@ - +@@ -114,7 +120,7 @@ public ItemStack func_77979_a(int p_77979_1_) { + p_77979_1_ = Math.min(p_77979_1_, this.field_77994_a); - ItemStack itemstack = new ItemStack(this.field_151002_e, p_77979_1_, this.field_77991_e); + ItemStack itemstack = new ItemStack(this.field_151002_e, p_77979_1_, this.field_77991_e, this.capabilities != null ? this.capabilities.serializeNBT() : null); if (this.field_77990_d != null) { -@@ -120,11 +126,12 @@ +@@ -127,11 +133,12 @@ public Item func_77973_b() { @@ -55,13 +55,13 @@ + return this.delegate != null ? this.delegate.get() : null; } - public boolean func_179546_a(EntityPlayer p_179546_1_, World p_179546_2_, BlockPos p_179546_3_, EnumFacing p_179546_4_, float p_179546_5_, float p_179546_6_, float p_179546_7_) + public EnumActionResult func_179546_a(EntityPlayer p_179546_1_, World p_179546_2_, BlockPos p_179546_3_, EnumHand p_179546_4_, EnumFacing p_179546_5_, float p_179546_6_, float p_179546_7_, float p_179546_8_) { -+ if (!p_179546_2_.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_); - boolean flag = this.func_77973_b().func_180614_a(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_); ++ if (!p_179546_2_.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_5_, p_179546_6_, p_179546_7_, p_179546_8_, p_179546_4_); + EnumActionResult enumactionresult = this.func_77973_b().func_180614_a(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_, p_179546_8_); - if (flag) -@@ -162,19 +169,23 @@ + if (enumactionresult == EnumActionResult.SUCCESS) +@@ -169,12 +176,16 @@ p_77955_1_.func_74782_a("tag", this.field_77990_d); } @@ -72,22 +72,14 @@ public void func_77963_c(NBTTagCompound p_77963_1_) { +- this.field_151002_e = Item.func_111206_d(p_77963_1_.func_74779_i("id")); + this.capNBT = p_77963_1_.func_74764_b("ForgeCaps") ? p_77963_1_.func_74775_l("ForgeCaps") : null; - if (p_77963_1_.func_150297_b("id", 8)) - { -- this.field_151002_e = Item.func_111206_d(p_77963_1_.func_74779_i("id")); -+ this.func_150996_a(Item.func_111206_d(p_77963_1_.func_74779_i("id"))); - } - else - { -- this.field_151002_e = Item.func_150899_d(p_77963_1_.func_74765_d("id")); -+ this.func_150996_a(Item.func_150899_d(p_77963_1_.func_74765_d("id"))); - } ++ this.func_150996_a(Item.func_111206_d(p_77963_1_.func_74779_i("id"))); + this.capNBT = null; - this.field_77994_a = p_77963_1_.func_74771_c("Count"); this.field_77991_e = p_77963_1_.func_74765_d("Damage"); -@@ -197,7 +208,7 @@ + +@@ -196,7 +207,7 @@ public int func_77976_d() { @@ -96,7 +88,7 @@ } public boolean func_77985_e() -@@ -207,7 +218,7 @@ +@@ -206,7 +217,7 @@ public boolean func_77984_f() { @@ -105,7 +97,7 @@ } public boolean func_77981_g() -@@ -217,32 +228,27 @@ +@@ -216,32 +227,27 @@ public boolean func_77951_h() { @@ -138,12 +130,12 @@ public int func_77958_k() { -- return this.field_151002_e.func_77612_l(); -+ return this.field_151002_e.getMaxDamage(this); +- return this.field_151002_e == null ? 0 : this.field_151002_e.func_77612_l(); ++ return this.field_151002_e == null ? 0 : this.field_151002_e.getMaxDamage(this); } public boolean func_96631_a(int p_96631_1_, Random p_96631_2_) -@@ -274,8 +280,8 @@ +@@ -273,8 +279,8 @@ } } @@ -154,16 +146,16 @@ } } -@@ -334,7 +340,7 @@ +@@ -328,7 +334,7 @@ - public boolean func_150998_b(Block p_150998_1_) + public boolean func_150998_b(IBlockState p_150998_1_) { - return this.field_151002_e.func_150897_b(p_150998_1_); + return func_77973_b().canHarvestBlock(p_150998_1_, this); } - public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_) -@@ -344,7 +350,7 @@ + public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_, EnumHand p_111282_3_) +@@ -338,7 +344,7 @@ public ItemStack func_77946_l() { @@ -172,7 +164,7 @@ if (this.field_77990_d != null) { -@@ -742,6 +748,7 @@ +@@ -759,6 +765,7 @@ } } @@ -180,16 +172,16 @@ return list; } -@@ -852,7 +859,7 @@ +@@ -869,7 +876,7 @@ } else { -- multimap = this.func_77973_b().func_111205_h(); -+ multimap = this.func_77973_b().getAttributeModifiers(this); +- multimap = this.func_77973_b().func_111205_h(p_111283_1_); ++ multimap = this.func_77973_b().getAttributeModifiers(p_111283_1_, this); } return multimap; -@@ -860,6 +867,18 @@ +@@ -901,6 +908,18 @@ public void func_150996_a(Item p_150996_1_) { @@ -208,7 +200,7 @@ this.field_151002_e = p_150996_1_; } -@@ -946,4 +965,26 @@ +@@ -987,4 +1006,26 @@ return false; } } diff --git a/patches/minecraft/net/minecraft/item/ItemSword.java.patch b/patches/minecraft/net/minecraft/item/ItemSword.java.patch index 2b99d22f1..cd88c3377 100644 --- a/patches/minecraft/net/minecraft/item/ItemSword.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSword.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSword.java +++ ../src-work/minecraft/net/minecraft/item/ItemSword.java -@@ -101,7 +101,9 @@ +@@ -88,7 +88,9 @@ public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) { @@ -10,4 +10,4 @@ + return super.func_82789_a(p_82789_1_, p_82789_2_); } - public Multimap func_111205_h() + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) diff --git a/patches/minecraft/net/minecraft/item/ItemTool.java.patch b/patches/minecraft/net/minecraft/item/ItemTool.java.patch index 2a0e7450b..efb12b0b5 100644 --- a/patches/minecraft/net/minecraft/item/ItemTool.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemTool.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/item/ItemTool.java +++ ../src-work/minecraft/net/minecraft/item/ItemTool.java -@@ -28,6 +28,18 @@ - this.field_77864_a = p_i45333_2_.func_77998_b(); - this.field_77865_bY = p_i45333_1_ + p_i45333_2_.func_78000_c(); +@@ -33,6 +33,18 @@ + this.field_77865_bY = p_i46745_1_ + p_i46745_3_.func_78000_c(); + this.field_185065_c = p_i46745_2_; this.func_77637_a(CreativeTabs.field_78040_i); + if (this instanceof ItemPickaxe) + { @@ -18,8 +18,20 @@ + } } - public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) -@@ -74,7 +86,9 @@ + protected ItemTool(Item.ToolMaterial p_i46746_1_, Set p_i46746_2_) +@@ -42,6 +54,11 @@ + + public float func_150893_a(ItemStack p_150893_1_, IBlockState p_150893_2_) + { ++ for (String type : getToolClasses(p_150893_1_)) ++ { ++ if (p_150893_2_.func_177230_c().isToolEffective(type, p_150893_2_)) ++ return field_77864_a; ++ } + return this.field_150914_c.contains(p_150893_2_.func_177230_c()) ? this.field_77864_a : 1.0F; + } + +@@ -84,7 +101,9 @@ public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) { @@ -29,9 +41,9 @@ + return super.func_82789_a(p_82789_1_, p_82789_2_); } - public Multimap func_111205_h() -@@ -83,4 +97,38 @@ - multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.field_77865_bY, 0)); + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) +@@ -99,4 +118,27 @@ + return multimap; } + @@ -56,16 +68,5 @@ + { + return toolClass != null ? com.google.common.collect.ImmutableSet.of(toolClass) : super.getToolClasses(stack); + } -+ -+ @Override -+ public float getDigSpeed(ItemStack stack, net.minecraft.block.state.IBlockState state) -+ { -+ for (String type : getToolClasses(stack)) -+ { -+ if (state.func_177230_c().isToolEffective(type, state)) -+ return field_77864_a; -+ } -+ return super.getDigSpeed(stack, state); -+ } + /*===================================== FORGE END =================================*/ } diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index cd73ea934..0d6a291aa 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -@@ -72,6 +72,7 @@ +@@ -73,6 +73,7 @@ public void func_151394_a(ItemStack p_151394_1_, ItemStack p_151394_2_, float p_151394_3_) { @@ -8,7 +8,7 @@ this.field_77604_b.put(p_151394_1_, p_151394_2_); this.field_77605_c.put(p_151394_2_, Float.valueOf(p_151394_3_)); } -@@ -101,6 +102,9 @@ +@@ -102,6 +103,9 @@ public float func_151398_b(ItemStack p_151398_1_) { diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch index 8a494fdfb..c626278f8 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/nbt/NBTTagCompound.java +++ ../src-work/minecraft/net/minecraft/nbt/NBTTagCompound.java -@@ -395,6 +395,7 @@ +@@ -454,6 +454,7 @@ private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException { @@ -8,7 +8,7 @@ return p_152447_0_.readByte(); } -@@ -405,6 +406,7 @@ +@@ -464,6 +465,7 @@ static NBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) throws IOException { diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index dfe8c66c5..657125557 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -1,51 +1,6 @@ --- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java +++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java -@@ -254,6 +254,8 @@ - this.field_147369_b.field_70154_o.func_70043_V(); - } - -+ if (!this.field_147380_r) return; //Fixes teleportation kick while riding entities -+ - this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); - - if (this.field_147369_b.field_70154_o != null) -@@ -350,6 +352,8 @@ - this.field_147369_b.func_70664_aZ(); - } - -+ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - this.field_147369_b.func_70091_d(d11, d12, d13); - this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); - d11 = d8 - this.field_147369_b.field_70165_t; -@@ -370,6 +374,8 @@ - field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!"); - } - -+ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - this.field_147369_b.func_70080_a(d8, d9, d10, f1, f2); - this.field_147369_b.func_71000_j(this.field_147369_b.field_70165_t - d0, this.field_147369_b.field_70163_u - d1, this.field_147369_b.field_70161_v - d2); - -@@ -377,7 +383,7 @@ - { - boolean flag2 = worldserver.func_72945_a(this.field_147369_b, this.field_147369_b.func_174813_aQ().func_72331_e((double)f3, (double)f3, (double)f3)).isEmpty(); - -- 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.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2); - return; -@@ -405,6 +411,8 @@ - this.field_147365_f = 0; - } - -+ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - 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 - d7, p_147347_1_.func_149465_i()); -@@ -497,7 +505,10 @@ +@@ -612,7 +612,10 @@ double d2 = this.field_147369_b.field_70161_v - ((double)blockpos.func_177952_p() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -57,77 +12,57 @@ { return; } -@@ -549,6 +560,7 @@ - WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); - ItemStack itemstack = this.field_147369_b.field_71071_by.func_70448_g(); - boolean flag = false; -+ boolean placeResult = true; - BlockPos blockpos = p_147346_1_.func_179724_a(); - EnumFacing enumfacing = EnumFacing.func_82600_a(p_147346_1_.func_149568_f()); - this.field_147369_b.func_143004_u(); -@@ -560,13 +572,20 @@ - return; - } +@@ -670,7 +673,9 @@ -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_147369_b, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, worldserver, new BlockPos(0, 0, 0), null, new net.minecraft.util.Vec3(p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j())); -+ if (event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { - this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); -+ } - } - else if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z() - 1 || enumfacing != EnumFacing.UP && blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) + if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z() - 1 || enumfacing != EnumFacing.UP && blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) { -- if (this.field_147380_r && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < 64.0D && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) +- if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < 64.0D && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) + double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 3; + dist *= dist; -+ if (this.field_147380_r && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < dist && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) ++ if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < dist && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) { -- this.field_147369_b.field_71134_c.func_180236_a(this.field_147369_b, worldserver, itemstack, blockpos, enumfacing, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); -+ // record block place result so we can update client itemstack size if place event was cancelled. -+ placeResult = this.field_147369_b.field_71134_c.func_180236_a(this.field_147369_b, worldserver, itemstack, blockpos, enumfacing, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); - } - - flag = true; -@@ -598,12 +617,18 @@ - this.field_147369_b.field_71137_h = true; - this.field_147369_b.field_71071_by.field_70462_a[this.field_147369_b.field_71071_by.field_70461_c] = ItemStack.func_77944_b(this.field_147369_b.field_71071_by.field_70462_a[this.field_147369_b.field_71071_by.field_70461_c]); - Slot slot = this.field_147369_b.field_71070_bA.func_75147_a(this.field_147369_b.field_71071_by, this.field_147369_b.field_71071_by.field_70461_c); -+ int windowId = this.field_147369_b.field_71070_bA.field_75152_c; -+ if (slot == null) // Forge: Fix 'slotless' inventories not selecting a valid slot to update -+ { -+ slot = this.field_147369_b.field_71069_bz.func_75147_a(this.field_147369_b.field_71071_by, this.field_147369_b.field_71071_by.field_70461_c); -+ windowId = this.field_147369_b.field_71069_bz.field_75152_c; -+ } - this.field_147369_b.field_71070_bA.func_75142_b(); - this.field_147369_b.field_71137_h = false; - -- if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g())) -+ if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g()) || !placeResult) // force client itemstack update if place event was cancelled - { -- this.func_147359_a(new S2FPacketSetSlot(this.field_147369_b.field_71070_bA.field_75152_c, slot.field_75222_d, this.field_147369_b.field_71071_by.func_70448_g())); -+ this.func_147359_a(new S2FPacketSetSlot(windowId, slot.field_75222_d, this.field_147369_b.field_71071_by.func_70448_g())); + this.field_147369_b.field_71134_c.func_187251_a(this.field_147369_b, worldserver, itemstack, enumhand, blockpos, enumfacing, p_184337_1_.func_187026_d(), p_184337_1_.func_187025_e(), p_184337_1_.func_187020_f()); } +@@ -689,6 +694,7 @@ + if (itemstack != null && itemstack.field_77994_a == 0) + { + this.field_147369_b.func_184611_a(enumhand, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_147369_b, itemstack, enumhand); + itemstack = null; } } -@@ -770,8 +795,10 @@ +@@ -703,12 +709,14 @@ + + if (itemstack != null) + { ++ //TODO: Hook interact event here... we don't know the type of itneration tho... + this.field_147369_b.field_71134_c.func_187250_a(this.field_147369_b, worldserver, itemstack, enumhand); + itemstack = this.field_147369_b.func_184586_b(enumhand); + + if (itemstack != null && itemstack.field_77994_a == 0) + { + this.field_147369_b.func_184611_a(enumhand, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_147369_b, itemstack, enumhand); + itemstack = null; + } + } +@@ -888,7 +896,9 @@ } else { -- IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); -- this.field_147367_d.func_71203_ab().func_148544_a(ichatcomponent, false); -+ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); -+ IChatComponent chat = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); -+ if (chat == null) return; -+ this.field_147367_d.func_71203_ab().func_148544_a(chat, false); +- ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); ++ ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); ++ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, itextcomponent); ++ if (itextcomponent == null) return; + this.field_147367_d.func_184103_al().func_148544_a(itextcomponent, false); } - this.field_147374_l += 20; -@@ -916,7 +943,7 @@ +@@ -1057,7 +1067,7 @@ return; } -- 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); - } +- this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, 0, false); ++ this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); - break; + if (this.field_147367_d.func_71199_h()) + { diff --git a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch index d86528608..e2a7a2c03 100644 --- a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/network/NetworkManager.java +++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java -@@ -93,6 +93,11 @@ +@@ -89,6 +89,11 @@ this.field_179294_g = p_i46004_1_; } @@ -12,7 +12,7 @@ public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception { super.channelActive(p_channelActive_1_); -@@ -208,7 +213,7 @@ +@@ -205,7 +210,7 @@ final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_); final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get(); @@ -21,7 +21,7 @@ { field_150735_g.debug("Disabled auto read"); this.field_150746_k.config().setAutoRead(false); -@@ -216,7 +221,7 @@ +@@ -213,7 +218,7 @@ if (this.field_150746_k.eventLoop().inEventLoop()) { @@ -30,7 +30,7 @@ { this.func_150723_a(enumconnectionstate); } -@@ -236,7 +241,7 @@ +@@ -233,7 +238,7 @@ { public void run() { @@ -39,7 +39,7 @@ { NetworkManager.this.func_150723_a(enumconnectionstate); } -@@ -455,6 +460,11 @@ +@@ -452,6 +457,11 @@ } } @@ -50,4 +50,4 @@ + static class InboundHandlerTuplePacketListener { - private final Packet field_150774_a; + private final Packet field_150774_a; diff --git a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch index e31f320e9..76ca4cff8 100644 --- a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/network/NetworkSystem.java +++ ../src-work/minecraft/net/minecraft/network/NetworkSystem.java -@@ -115,7 +115,7 @@ +@@ -111,7 +111,7 @@ ; } -- p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); -+ p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); +- p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new LegacyPingHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new NettyVarint21FrameDecoder())).addLast((String)"decoder", (ChannelHandler)(new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new NettyVarint21FrameEncoder())).addLast((String)"encoder", (ChannelHandler)(new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND))); ++ p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new LegacyPingHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new NettyVarint21FrameDecoder())).addLast((String)"decoder", (ChannelHandler)(new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new NettyVarint21FrameEncoder())).addLast((String)"encoder", (ChannelHandler)(new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND))); NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); NetworkSystem.this.field_151272_f.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); diff --git a/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch b/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch index 856c5c869..388c5ef4b 100644 --- a/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch +++ b/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch @@ -1,23 +1,23 @@ --- ../src-base/minecraft/net/minecraft/network/ServerStatusResponse.java +++ ../src-work/minecraft/net/minecraft/network/ServerStatusResponse.java @@ -29,6 +29,7 @@ - public void func_151315_a(IChatComponent p_151315_1_) + public void func_151315_a(ITextComponent p_151315_1_) { this.field_151326_a = p_151315_1_; + invalidateJson(); } - public ServerStatusResponse.PlayerCountData func_151318_b() + public ServerStatusResponse.Players func_151318_b() @@ -39,6 +40,7 @@ - public void func_151319_a(ServerStatusResponse.PlayerCountData p_151319_1_) + public void func_151319_a(ServerStatusResponse.Players p_151319_1_) { this.field_151324_b = p_151319_1_; + invalidateJson(); } - public ServerStatusResponse.MinecraftProtocolVersionIdentifier func_151322_c() + public ServerStatusResponse.Version func_151322_c() @@ -49,11 +51,13 @@ - public void func_151321_a(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_151321_1_) + public void func_151321_a(ServerStatusResponse.Version p_151321_1_) { this.field_151325_c = p_151321_1_; + invalidateJson(); @@ -30,7 +30,7 @@ } public String func_151316_d() -@@ -215,6 +219,7 @@ +@@ -176,6 +180,7 @@ serverstatusresponse.func_151320_a(JsonUtils.func_151200_h(jsonobject, "favicon")); } @@ -38,7 +38,7 @@ return serverstatusresponse; } -@@ -242,7 +247,47 @@ +@@ -203,10 +208,50 @@ jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d()); } @@ -46,7 +46,7 @@ return jsonobject; } } -+ + + private java.util.concurrent.Semaphore mutex = new java.util.concurrent.Semaphore(1); + private String json = null; + /** @@ -69,7 +69,7 @@ + ret = this.json; + if (ret == null) + { -+ ret = net.minecraft.network.status.server.S00PacketServerInfo.field_149297_a.toJson(this); ++ ret = net.minecraft.network.status.server.SPacketServerInfo.field_149297_a.toJson(this); + this.json = ret; + } + mutex.release(); @@ -85,4 +85,7 @@ + { + this.json = null; + } - } ++ + public static class Version + { + private final String field_151306_a; diff --git a/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch similarity index 74% rename from patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch rename to patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch index 1345ee125..b0ba90495 100644 --- a/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch +++ b/patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java -+++ ../src-work/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java +--- ../src-base/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java @@ -47,7 +47,11 @@ public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { diff --git a/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch similarity index 74% rename from patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch rename to patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch index 9604b555a..01ef581c1 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java -+++ ../src-work/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java +--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java @@ -46,7 +46,11 @@ public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { diff --git a/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch b/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch deleted file mode 100644 index 6e9d12a15..000000000 --- a/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java -+++ ../src-work/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java -@@ -34,7 +34,7 @@ - - public void func_148840_b(PacketBuffer p_148840_1_) throws IOException - { -- p_148840_1_.func_180714_a(field_149297_a.toJson((Object)this.field_149296_b)); -+ p_148840_1_.func_180714_a(this.field_149296_b.getJson()); - } - - public void func_148833_a(INetHandlerStatusClient p_148833_1_) diff --git a/patches/minecraft/net/minecraft/potion/Potion.java.patch b/patches/minecraft/net/minecraft/potion/Potion.java.patch index 1ee629dcc..d8ed60afc 100644 --- a/patches/minecraft/net/minecraft/potion/Potion.java.patch +++ b/patches/minecraft/net/minecraft/potion/Potion.java.patch @@ -1,49 +1,15 @@ --- ../src-base/minecraft/net/minecraft/potion/Potion.java +++ ../src-work/minecraft/net/minecraft/potion/Potion.java -@@ -21,7 +21,7 @@ +@@ -23,7 +23,7 @@ public class Potion { -- public static final Potion[] field_76425_a = new Potion[32]; -+ public static final Potion[] field_76425_a = new Potion[256]; - private static final Map field_180150_I = Maps.newHashMap(); - public static final Potion field_180151_b = null; - public static final Potion field_76424_c = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).func_76390_b("potion.moveSpeed").func_76399_b(0, 0).func_111184_a(SharedMonsterAttributes.field_111263_d, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); -@@ -64,10 +64,10 @@ - private double field_76412_L; - private boolean field_76413_M; - -+ @Deprecated // use the Constructor without potion ID or everything will explode. - protected Potion(int p_i45897_1_, ResourceLocation p_i45897_2_, boolean p_i45897_3_, int p_i45897_4_) - { -- this.field_76415_H = p_i45897_1_; -- field_76425_a[p_i45897_1_] = this; -+ net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().func_177775_a(p_i45897_1_, p_i45897_2_, this); - field_180150_I.put(p_i45897_2_, this); - this.field_76418_K = p_i45897_3_; - -@@ -83,14 +83,18 @@ - this.field_76414_N = p_i45897_4_; - } - -+ protected Potion(ResourceLocation location, boolean badEffect, int potionColor) { -+ this(-1, location, badEffect, potionColor); -+ } -+ - public static Potion func_180142_b(String p_180142_0_) - { -- return (Potion)field_180150_I.get(new ResourceLocation(p_180142_0_)); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().func_82594_a(new ResourceLocation(p_180142_0_)); - } - - public static Set func_181168_c() - { -- return field_180150_I.keySet(); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().func_148742_b(); - } - - protected Potion func_76399_b(int p_76399_1_, int p_76399_2_) -@@ -230,7 +234,6 @@ +- public static final RegistryNamespaced field_188414_b = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_188414_b = net.minecraftforge.fml.common.registry.GameData.getPotionRegistry(); + private final Map field_111188_I = Maps.newHashMap(); + private final boolean field_76418_K; + private final int field_76414_N; +@@ -195,7 +195,6 @@ return this.field_76417_J; } @@ -51,11 +17,10 @@ public boolean func_76398_f() { return this.field_76418_K; -@@ -310,4 +313,34 @@ - { +@@ -266,7 +265,37 @@ return p_111183_2_.func_111164_d() * (double)(p_111183_1_ + 1); } -+ + + /* ======================================== FORGE START =====================================*/ + + /** @@ -83,6 +48,10 @@ + * @param effect the active PotionEffect + * @param mc the Minecraft instance, for convenience + */ -+ @SideOnly(Side.CLIENT) + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } - } ++ ++ @SideOnly(Side.CLIENT) + public boolean func_188408_i() + { + return this.field_188415_h; diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch index 8b588f66a..b68c6378c 100644 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -1,41 +1,32 @@ --- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java +++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java -@@ -18,6 +18,8 @@ +@@ -19,6 +19,8 @@ @SideOnly(Side.CLIENT) private boolean field_100013_f; - private boolean field_180156_h; + private boolean field_188421_h; + /** List of ItemStack that can cure the potion effect **/ + private java.util.List curativeItems; - public PotionEffect(int p_i1574_1_, int p_i1574_2_) + public PotionEffect(Potion p_i46811_1_) { -@@ -36,6 +38,8 @@ - this.field_76461_c = p_i45896_3_; - this.field_82724_e = p_i45896_4_; - this.field_180156_h = p_i45896_5_; -+ this.curativeItems = new java.util.ArrayList(); -+ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.field_151117_aB)); - } - - public PotionEffect(PotionEffect p_i1577_1_) -@@ -45,6 +49,7 @@ +@@ -51,6 +53,7 @@ this.field_76461_c = p_i1577_1_.field_76461_c; this.field_82724_e = p_i1577_1_.field_82724_e; - this.field_180156_h = p_i1577_1_.field_180156_h; + this.field_188421_h = p_i1577_1_.field_188421_h; + this.curativeItems = p_i1577_1_.curativeItems; } public void func_76452_a(PotionEffect p_76452_1_) -@@ -190,7 +195,7 @@ +@@ -200,7 +203,7 @@ public static PotionEffect func_82722_b(NBTTagCompound p_82722_0_) { - int i = p_82722_0_.func_74771_c("Id"); -+ int i = p_82722_0_.func_74771_c("Id") & 0xff; ++ int i = p_82722_0_.func_74771_c("Id") & 0xFF; + Potion potion = Potion.func_188412_a(i); - if (i >= 0 && i < Potion.field_76425_a.length && Potion.field_76425_a[i] != null) - { -@@ -223,4 +228,53 @@ + if (potion == null) +@@ -240,4 +243,58 @@ { return this.field_100013_f; } @@ -47,6 +38,11 @@ + */ + public java.util.List getCurativeItems() + { ++ if (this.curativeItems == null) //Lazy load this so that we don't create a circular dep on Items. ++ { ++ this.curativeItems = new java.util.ArrayList(); ++ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.field_151117_aB)); ++ } + return this.curativeItems; + } + @@ -57,7 +53,7 @@ + */ + public boolean isCurativeItem(net.minecraft.item.ItemStack stack) + { -+ for (net.minecraft.item.ItemStack curativeItem : this.curativeItems) ++ for (net.minecraft.item.ItemStack curativeItem : this.getCurativeItems()) + { + if (curativeItem.func_77969_a(stack)) + { @@ -85,7 +81,7 @@ + { + if (!this.isCurativeItem(stack)) + { -+ this.curativeItems.add(stack); ++ this.getCurativeItems().add(stack); + } + } } diff --git a/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch b/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch index 485a416d0..cc6875454 100644 --- a/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch +++ b/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch @@ -12,8 +12,8 @@ return; } -- RealmsConnect.this.connection.func_179290_a(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); -+ RealmsConnect.this.connection.func_179290_a(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); +- RealmsConnect.this.connection.func_179290_a(new C00Handshake(107, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); ++ RealmsConnect.this.connection.func_179290_a(new C00Handshake(107, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); if (RealmsConnect.this.aborted) { diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index c8298d70a..a10465427 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java +++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java -@@ -98,7 +98,7 @@ +@@ -100,7 +100,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 PlayerList field_71318_t; private boolean field_71317_u = true; private boolean field_71316_v; -@@ -115,7 +115,8 @@ +@@ -117,7 +117,8 @@ private int field_71280_D; private int field_143008_E = 0; public final long[] field_71311_j = new long[100]; @@ -19,7 +19,7 @@ private KeyPair field_71292_I; private String field_71293_J; private String field_71294_K; -@@ -227,8 +228,6 @@ +@@ -215,8 +216,6 @@ { this.func_71237_c(p_71247_1_); this.func_71192_d("menu.loadingLevel"); @@ -28,7 +28,7 @@ ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true); this.func_175584_a(this.func_71270_I(), isavehandler); WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -259,47 +258,21 @@ +@@ -247,47 +246,21 @@ worldsettings = new WorldSettings(worldinfo); } @@ -84,7 +84,7 @@ this.func_147139_a(this.func_147135_j()); this.func_71222_d(); } -@@ -314,7 +287,7 @@ +@@ -302,7 +275,7 @@ this.func_71192_d("menu.generatingTerrain"); int j1 = 0; field_147145_h.info("Preparing start region for level " + j1); @@ -93,40 +93,32 @@ BlockPos blockpos = worldserver.func_175694_M(); long k1 = func_130071_aq(); -@@ -403,7 +376,7 @@ - - public void func_71260_j() - { -- if (!this.field_71290_O) -+ if (!this.field_71290_O && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !field_71316_v) // make sure the save is valid and we don't save twice - { - field_147145_h.info("Stopping server"); - -@@ -427,8 +400,15 @@ - for (int i = 0; i < this.field_71305_c.length; ++i) +@@ -420,9 +393,15 @@ + { + if (this.field_71305_c[j] != null) { - WorldServer worldserver = this.field_71305_c[i]; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.func_73041_k(); - } -+ -+ WorldServer[] tmp = field_71305_c; -+ for (WorldServer world : tmp) -+ { -+ net.minecraftforge.common.DimensionManager.setWorld(world.field_73011_w.func_177502_q(), null); -+ } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(this.field_71305_c[j])); } + this.field_71305_c[j].func_73041_k(); +- } } ++ ++ WorldServer[] tmp = field_71305_c; ++ for (WorldServer world : tmp) ++ { ++ net.minecraftforge.common.DimensionManager.setWorld(world.field_73011_w.getDimension(), null, this); ++ } + } - if (this.field_71307_n.func_76468_d()) -@@ -460,6 +440,7 @@ + if (this.field_71307_n.func_76468_d()) +@@ -447,6 +426,7 @@ { if (this.func_71197_b()) { + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarted(); this.field_175591_ab = func_130071_aq(); long i = 0L; - this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C)); -@@ -504,12 +485,20 @@ + this.field_147147_p.func_151315_a(new TextComponentString(this.field_71286_C)); +@@ -491,12 +471,20 @@ Thread.sleep(Math.max(1L, 50L - i)); this.field_71296_Q = true; } @@ -147,7 +139,7 @@ catch (Throwable throwable1) { field_147145_h.error("Encountered an unexpected exception", throwable1); -@@ -535,14 +524,15 @@ +@@ -522,14 +510,15 @@ field_147145_h.error("We were unable to save this crash report to disk."); } @@ -164,7 +156,7 @@ } catch (Throwable throwable) { -@@ -550,6 +540,8 @@ +@@ -537,6 +526,8 @@ } finally { @@ -173,7 +165,7 @@ this.func_71240_o(); } } -@@ -599,6 +591,7 @@ +@@ -604,6 +595,7 @@ public void func_71217_p() { long i = System.nanoTime(); @@ -181,7 +173,7 @@ ++this.field_71315_w; if (this.field_71295_T) -@@ -625,6 +618,7 @@ +@@ -630,6 +622,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.field_147147_p.func_151318_b().func_151330_a(agameprofile); @@ -189,7 +181,7 @@ } if (this.field_71315_w % 900 == 0) -@@ -652,6 +646,7 @@ +@@ -657,6 +650,7 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76319_b(); @@ -197,7 +189,7 @@ } public void func_71190_q() -@@ -667,14 +662,17 @@ +@@ -672,14 +666,17 @@ } this.field_71304_b.func_76318_c("levels"); @@ -218,7 +210,7 @@ this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j()); if (this.field_71315_w % 20 == 0) -@@ -685,6 +683,7 @@ +@@ -690,6 +687,7 @@ } this.field_71304_b.func_76320_a("tick"); @@ -226,7 +218,7 @@ try { -@@ -708,6 +707,7 @@ +@@ -713,6 +711,7 @@ throw new ReportedException(crashreport1); } @@ -234,7 +226,7 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76320_a("tracker"); worldserver.func_73039_n().func_72788_a(); -@@ -715,9 +715,11 @@ +@@ -720,9 +719,11 @@ this.field_71304_b.func_76319_b(); } @@ -247,7 +239,7 @@ this.field_71304_b.func_76318_c("connection"); this.func_147137_ag().func_151269_c(); this.field_71304_b.func_76318_c("players"); -@@ -739,6 +741,7 @@ +@@ -744,6 +745,7 @@ public void func_71256_s() { @@ -255,7 +247,7 @@ this.field_175590_aa = new Thread(this, "Server thread"); this.field_175590_aa.start(); } -@@ -755,7 +758,13 @@ +@@ -760,7 +762,13 @@ public WorldServer func_71218_a(int p_71218_1_) { @@ -270,7 +262,7 @@ } public String func_71249_w() -@@ -785,7 +794,7 @@ +@@ -790,7 +798,7 @@ public String getServerModName() { @@ -279,11 +271,3 @@ } public CrashReport func_71230_b(CrashReport p_71230_1_) -@@ -996,6 +1005,7 @@ - - if (worldserver != null) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.func_73041_k(); - } - } diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index c0eff5da9..d750cdb46 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/server/dedicated/DedicatedServer.java +++ ../src-work/minecraft/net/minecraft/server/dedicated/DedicatedServer.java -@@ -49,6 +49,7 @@ +@@ -56,6 +56,7 @@ private boolean field_71338_p; private WorldSettings.GameType field_71337_q; private boolean field_71335_s; + public static boolean allowPlayerLogins = false; - public DedicatedServer(File p_i1508_1_) + public DedicatedServer(File p_i47086_1_, DataFixer p_i47086_2_, YggdrasilAuthenticationService p_i47086_3_, MinecraftSessionService p_i47086_4_, GameProfileRepository p_i47086_5_, PlayerProfileCache p_i47086_6_) { -@@ -82,6 +83,7 @@ +@@ -89,6 +90,7 @@ { public void run() { @@ -16,7 +16,7 @@ BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in)); String s4; -@@ -107,6 +109,8 @@ +@@ -114,6 +116,8 @@ field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } @@ -25,23 +25,23 @@ field_155771_h.info("Loading properties"); this.field_71340_o = new PropertyManager(new File("server.properties")); this.field_154332_n = new ServerEula(new File("eula.txt")); -@@ -198,6 +202,7 @@ +@@ -205,6 +209,7 @@ } else { + net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStarted(); - this.func_152361_a(new DedicatedPlayerList(this)); + this.func_184105_a(new DedicatedPlayerList(this)); long j = System.nanoTime(); -@@ -244,6 +249,7 @@ - this.func_71191_d((this.func_71207_Z() + 8) / 16 * 16); - this.func_71191_d(MathHelper.func_76125_a(this.func_71207_Z(), 64, 256)); - this.field_71340_o.func_73667_a("max-build-height", Integer.valueOf(this.func_71207_Z())); +@@ -254,6 +259,7 @@ + TileEntitySkull.func_184293_a(this.func_152358_ax()); + TileEntitySkull.func_184294_a(this.func_147130_as()); + PlayerProfileCache.func_187320_a(this.func_71266_T()); + if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; field_155771_h.info("Preparing level \"" + this.func_71270_I() + "\""); this.func_71247_a(this.func_71270_I(), this.func_71270_I(), k, worldtype, s2); long i1 = System.nanoTime() - j; -@@ -272,7 +278,7 @@ +@@ -282,7 +288,7 @@ thread1.start(); } @@ -50,11 +50,13 @@ } } } -@@ -621,4 +627,7 @@ - this.field_71321_q.func_71556_a(RConConsoleSource.func_175570_h(), p_71252_1_); - return RConConsoleSource.func_175570_h().func_70008_c(); +@@ -580,6 +586,9 @@ + return this.field_71340_o.func_73669_a("network-compression-threshold", super.func_175577_aI()); } -+ + + //Forge: Enable formated text for colors in console. -+ @Override public void func_145747_a(net.minecraft.util.IChatComponent message) { field_155771_h.info(message.func_150254_d()); } - } ++ @Override public void func_145747_a(net.minecraft.util.text.ITextComponent message) { field_155771_h.info(message.func_150254_d()); } ++ + protected boolean func_152368_aE() throws IOException + { + boolean flag = false; diff --git a/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch index 06a26df6e..8b9416cb1 100644 --- a/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ b/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/gui/MinecraftServerGui.java +++ ../src-work/minecraft/net/minecraft/server/gui/MinecraftServerGui.java -@@ -78,6 +78,7 @@ +@@ -77,6 +77,7 @@ System.exit(0); } }); @@ -8,7 +8,7 @@ } public MinecraftServerGui(DedicatedServer p_i2362_1_) -@@ -162,8 +163,13 @@ +@@ -161,8 +162,13 @@ return jpanel; } diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index 7962cb7ac..473fa124d 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java +++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java -@@ -71,8 +71,6 @@ +@@ -68,8 +68,6 @@ 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.func_71237_c(p_71247_1_); @@ -9,20 +9,19 @@ ISaveHandler isavehandler = this.func_71254_M().func_75804_a(p_71247_1_, true); this.func_175584_a(this.func_71270_I(), isavehandler); WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -86,44 +84,24 @@ +@@ -83,44 +81,23 @@ worldinfo.func_76062_a(p_71247_2_); } - for (int i = 0; i < this.field_71305_c.length; ++i) -- { -- int j = 0; + WorldServer overWorld = (func_71242_L() ? (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b() : + (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b()); + overWorld.func_72963_a(this.field_71350_m); - -- if (i == 1) + for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) -+ { + { +- int j = 0; +- +- if (i == 1) + WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.field_71304_b)).func_175643_b()); + world.func_72954_a(new WorldManager(this, world)); + if (!this.func_71264_H()) @@ -58,15 +57,15 @@ + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); } -- this.func_71203_ab().func_72364_a(this.field_71305_c); -+ this.func_71203_ab().func_72364_a(new WorldServer[]{ overWorld }); +- this.func_184103_al().func_72364_a(this.field_71305_c); ++ this.func_184103_al().func_72364_a(new WorldServer[]{ overWorld }); - if (this.field_71305_c[0].func_72912_H().func_176130_y() == null) + if (overWorld.func_72912_H().func_176130_y() == null) { this.func_147139_a(this.field_71349_l.field_71474_y.field_74318_M); } -@@ -141,9 +119,10 @@ +@@ -138,9 +115,10 @@ this.func_71245_h(true); field_147148_h.info("Generating keypair"); this.func_71253_a(CryptManager.func_75891_b()); @@ -78,7 +77,7 @@ } public void func_71217_p() -@@ -216,6 +195,7 @@ +@@ -213,6 +191,7 @@ public EnumDifficulty func_147135_j() { diff --git a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch deleted file mode 100644 index 3114e1a6a..000000000 --- a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch +++ /dev/null @@ -1,266 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/management/ItemInWorldManager.java -+++ ../src-work/minecraft/net/minecraft/server/management/ItemInWorldManager.java -@@ -22,6 +22,8 @@ - - public class ItemInWorldManager - { -+ /** Forge reach distance */ -+ private double blockReachDistance = 5.0d; - public World field_73092_a; - public EntityPlayerMP field_73090_b; - private WorldSettings.GameType field_73091_c = WorldSettings.GameType.NOT_SET; -@@ -116,7 +118,7 @@ - else - { - int k = this.field_73100_i - this.field_73089_e; -- float f1 = block1.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180241_i) * (float)(k + 1); -+ float f1 = block1.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180240_f) * (float)(k + 1); //Forge: Fix network break progress using wrong position - int l = (int)(f1 * 10.0F); - - if (l != this.field_73094_o) -@@ -130,6 +132,14 @@ - - public void func_180784_a(BlockPos p_180784_1_, EnumFacing p_180784_2_) - { -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_73090_b, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, field_73092_a, p_180784_1_, p_180784_2_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(field_73090_b, getBlockReachDistance() + 1)); -+ if (event.isCanceled()) -+ { -+ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); -+ return; -+ } -+ - if (this.func_73083_d()) - { - if (!this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_)) -@@ -164,18 +174,35 @@ - } - } - -- this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); -+ // - this.field_73089_e = this.field_73100_i; - float f = 1.0F; - -- if (block.func_149688_o() != Material.field_151579_a) -+ if (!block.isAir(field_73092_a, p_180784_1_)) - { -- block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { -+ block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); -+ this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); -+ } -+ else -+ { -+ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); -+ } - f = block.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180784_1_); - } - -- if (block.func_149688_o() != Material.field_151579_a && f >= 1.0F) -+ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) - { -+ if (f >= 1.0F) -+ { -+ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); -+ } -+ return; -+ } -+ -+ if (!block.isAir(field_73092_a, p_180784_1_) && f >= 1.0F) -+ { - this.func_180237_b(p_180784_1_); - } - else -@@ -196,7 +223,7 @@ - int i = this.field_73100_i - this.field_73089_e; - Block block = this.field_73092_a.func_180495_p(p_180785_1_).func_177230_c(); - -- if (block.func_149688_o() != Material.field_151579_a) -+ if (!block.isAir(field_73092_a, p_180785_1_)) - { - float f = block.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180785_1_) * (float)(i + 1); - -@@ -225,9 +252,13 @@ - - private boolean func_180235_c(BlockPos p_180235_1_) - { -+ return removeBlock(p_180235_1_, false); -+ } -+ private boolean removeBlock(BlockPos p_180235_1_, boolean canHarvest) -+ { - IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180235_1_); - iblockstate.func_177230_c().func_176208_a(this.field_73092_a, p_180235_1_, iblockstate, this.field_73090_b); -- boolean flag = this.field_73092_a.func_175698_g(p_180235_1_); -+ boolean flag = iblockstate.func_177230_c().removedByPlayer(field_73092_a, p_180235_1_, field_73090_b, canHarvest); - - if (flag) - { -@@ -239,7 +270,8 @@ - - public boolean func_180237_b(BlockPos p_180237_1_) - { -- 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) -+ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_180237_1_); -+ if (exp == -1) - { - return false; - } -@@ -248,40 +280,21 @@ - IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180237_1_); - TileEntity tileentity = this.field_73092_a.func_175625_s(p_180237_1_); - -- if (this.field_73091_c.func_82752_c()) -- { -- if (this.field_73091_c == WorldSettings.GameType.SPECTATOR) -- { -- return false; -- } -+ ItemStack stack = field_73090_b.func_71045_bC(); -+ if (stack != null && stack.func_77973_b().onBlockStartBreak(stack, p_180237_1_, field_73090_b)) return false; - -- if (!this.field_73090_b.func_175142_cm()) -- { -- ItemStack itemstack = this.field_73090_b.func_71045_bC(); -- -- if (itemstack == null) -- { -- return false; -- } -- -- if (!itemstack.func_179544_c(iblockstate.func_177230_c())) -- { -- return false; -- } -- } -- } -- - this.field_73092_a.func_180498_a(this.field_73090_b, 2001, p_180237_1_, Block.func_176210_f(iblockstate)); -- boolean flag1 = this.func_180235_c(p_180237_1_); -+ boolean flag1 = false; - - if (this.func_73083_d()) - { -+ flag1 = this.func_180235_c(p_180237_1_); - this.field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(this.field_73092_a, p_180237_1_)); - } - else - { - ItemStack itemstack1 = this.field_73090_b.func_71045_bC(); -- boolean flag = this.field_73090_b.func_146099_a(iblockstate.func_177230_c()); -+ boolean flag = iblockstate.func_177230_c().canHarvestBlock(field_73092_a, p_180237_1_, field_73090_b); - - if (itemstack1 != null) - { -@@ -293,12 +306,18 @@ - } - } - -+ flag1 = this.removeBlock(p_180237_1_, flag); - if (flag1 && flag) - { - iblockstate.func_177230_c().func_180657_a(this.field_73092_a, this.field_73090_b, p_180237_1_, iblockstate, tileentity); - } - } - -+ // Drop experiance -+ if (!this.func_73083_d() && flag1 && exp > 0) -+ { -+ iblockstate.func_177230_c().func_180637_b(field_73092_a, p_180237_1_, exp); -+ } - return flag1; - } - } -@@ -332,6 +351,7 @@ - if (itemstack.field_77994_a == 0) - { - p_73085_1_.field_71071_by.field_70462_a[p_73085_1_.field_71071_by.field_70461_c] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_73085_1_, itemstack); - } - - if (!p_73085_1_.func_71039_bw()) -@@ -380,33 +400,51 @@ - } - else - { -- if (!p_180236_1_.func_70093_af() || p_180236_1_.func_70694_bm() == null) -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(p_180236_1_, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, p_180236_2_, p_180236_4_, p_180236_5_, new net.minecraft.util.Vec3(p_180236_6_, p_180236_7_, p_180236_8_)); -+ if (event.isCanceled()) - { -- IBlockState iblockstate = p_180236_2_.func_180495_p(p_180236_4_); -- -- if (iblockstate.func_177230_c().func_180639_a(p_180236_2_, p_180236_4_, iblockstate, p_180236_1_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_)) -- { -- return true; -- } -+ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180236_4_)); -+ return false; - } - -- if (p_180236_3_ == null) -+ if (p_180236_3_ != null && p_180236_3_.func_77973_b().onItemUseFirst(p_180236_3_, p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_)) - { -- return false; -+ if (p_180236_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_180236_3_); -+ return true; - } -- else if (this.func_73083_d()) -+ -+ IBlockState iblockstate = p_180236_2_.func_180495_p(p_180236_4_); -+ boolean isAir = p_180236_2_.func_175623_d(p_180236_4_); -+ boolean useBlock = !p_180236_1_.func_70093_af() || p_180236_1_.func_70694_bm() == null; -+ if (!useBlock) useBlock = p_180236_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_180236_2_, p_180236_4_, p_180236_1_); -+ boolean result = false; -+ -+ if (useBlock) - { -- int j = p_180236_3_.func_77960_j(); -- int i = p_180236_3_.field_77994_a; -- boolean flag = p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); -- p_180236_3_.func_77964_b(j); -- p_180236_3_.field_77994_a = i; -- return flag; -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { -+ result = iblockstate.func_177230_c().func_180639_a(p_180236_2_, p_180236_4_, iblockstate, p_180236_1_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); -+ } -+ else -+ { -+ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180236_4_)); -+ result = event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW; -+ } - } -- else -+ if (p_180236_3_ != null && !result && event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) - { -- return p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); -+ int meta = p_180236_3_.func_77960_j(); -+ int size = p_180236_3_.field_77994_a; -+ result = p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); -+ if (func_73083_d()) -+ { -+ p_180236_3_.func_77964_b(meta); -+ p_180236_3_.field_77994_a = size; -+ } -+ if (p_180236_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_180236_3_); - } -+ return result; - } - } - -@@ -414,4 +452,13 @@ - { - this.field_73092_a = p_73080_1_; - } -+ -+ public double getBlockReachDistance() -+ { -+ return blockReachDistance; -+ } -+ public void setBlockReachDistance(double distance) -+ { -+ blockReachDistance = distance; -+ } - } diff --git a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch new file mode 100644 index 000000000..021fd24ea --- /dev/null +++ b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch @@ -0,0 +1,220 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerInteractionManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerInteractionManager.java +@@ -27,6 +27,8 @@ + + public class PlayerInteractionManager + { ++ /** Forge reach distance */ ++ private double blockReachDistance = 5.0d; + public World field_73092_a; + public EntityPlayerMP field_73090_b; + private WorldSettings.GameType field_73091_c = WorldSettings.GameType.NOT_SET; +@@ -88,7 +90,7 @@ + IBlockState iblockstate = this.field_73092_a.func_180495_p(this.field_180241_i); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (block.isAir(iblockstate, field_73092_a, field_180241_i)) + { + this.field_73097_j = false; + } +@@ -115,7 +117,7 @@ + IBlockState iblockstate1 = this.field_73092_a.func_180495_p(this.field_180240_f); + Block block1 = iblockstate1.func_177230_c(); + +- if (iblockstate1.func_185904_a() == Material.field_151579_a) ++ if (block1.isAir(iblockstate1, field_73092_a, field_180240_f)) + { + this.field_73092_a.func_175715_c(this.field_73090_b.func_145782_y(), this.field_180240_f, -1); + this.field_73094_o = -1; +@@ -124,7 +126,7 @@ + else + { + int k = this.field_73100_i - this.field_73089_e; +- float f1 = iblockstate1.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180241_i) * (float)(k + 1); ++ float f1 = iblockstate1.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180240_f) * (float)(k + 1); // Forge: Fix network break progress using wrong position + int l = (int)(f1 * 10.0F); + + if (l != this.field_73094_o) +@@ -138,6 +140,14 @@ + + public void func_180784_a(BlockPos p_180784_1_, EnumFacing p_180784_2_) + { ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_73090_b, ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, field_73092_a, p_180784_1_, p_180784_2_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(field_73090_b, getBlockReachDistance() + 1)); ++ if (event.isCanceled()) ++ { ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ return; ++ } ++ + if (this.func_73083_d()) + { + if (!this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_)) +@@ -173,17 +183,32 @@ + } + } + +- this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); + this.field_73089_e = this.field_73100_i; + float f = 1.0F; + +- if (iblockstate.func_185904_a() != Material.field_151579_a) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180784_1_)) + { +- block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); ++ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); ++ this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); ++ } ++ else ++ { ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ } + f = iblockstate.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180784_1_); + } ++ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ if (f >= 1.0F) ++ { ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ } ++ return; ++ } + +- if (iblockstate.func_185904_a() != Material.field_151579_a && f >= 1.0F) ++ if (iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180784_1_) && f >= 1.0F) + { + this.func_180237_b(p_180784_1_); + } +@@ -205,7 +230,7 @@ + int i = this.field_73100_i - this.field_73089_e; + IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180785_1_); + +- if (iblockstate.func_185904_a() != Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180785_1_)) + { + float f = iblockstate.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180785_1_) * (float)(i + 1); + +@@ -234,13 +259,18 @@ + + private boolean func_180235_c(BlockPos p_180235_1_) + { +- IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180235_1_); +- iblockstate.func_177230_c().func_176208_a(this.field_73092_a, p_180235_1_, iblockstate, this.field_73090_b); +- boolean flag = this.field_73092_a.func_175698_g(p_180235_1_); ++ return removeBlock(p_180235_1_, false); ++ } + ++ private boolean removeBlock(BlockPos pos, boolean canHarvest) ++ { ++ IBlockState iblockstate = this.field_73092_a.func_180495_p(pos); ++ iblockstate.func_177230_c().func_176208_a(this.field_73092_a, pos, iblockstate, this.field_73090_b); ++ boolean flag = iblockstate.func_177230_c().removedByPlayer(iblockstate, field_73092_a, pos, field_73090_b, canHarvest); ++ + if (flag) + { +- iblockstate.func_177230_c().func_176206_d(this.field_73092_a, p_180235_1_, iblockstate); ++ iblockstate.func_177230_c().func_176206_d(this.field_73092_a, pos, iblockstate); + } + + return flag; +@@ -248,7 +278,8 @@ + + public boolean func_180237_b(BlockPos p_180237_1_) + { +- if (this.field_73091_c.func_77145_d() && this.field_73090_b.func_184614_ca() != null && this.field_73090_b.func_184614_ca().func_77973_b() instanceof ItemSword) ++ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_180237_1_); ++ if (exp == -1) + { + return false; + } +@@ -264,41 +295,22 @@ + } + else + { +- if (this.field_73091_c.func_82752_c()) +- { +- if (this.field_73091_c == WorldSettings.GameType.SPECTATOR) +- { +- return false; +- } ++ ItemStack stack = field_73090_b.func_184614_ca(); ++ if (stack != null && stack.func_77973_b().onBlockStartBreak(stack, p_180237_1_, field_73090_b)) return false; + +- if (!this.field_73090_b.func_175142_cm()) +- { +- ItemStack itemstack = this.field_73090_b.func_184614_ca(); +- +- if (itemstack == null) +- { +- return false; +- } +- +- if (!itemstack.func_179544_c(iblockstate.func_177230_c())) +- { +- return false; +- } +- } +- } +- + this.field_73092_a.func_180498_a(this.field_73090_b, 2001, p_180237_1_, Block.func_176210_f(iblockstate)); +- boolean flag1 = this.func_180235_c(p_180237_1_); ++ boolean flag1 = false; + + if (this.func_73083_d()) + { ++ flag1 = this.func_180235_c(p_180237_1_); + this.field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(this.field_73092_a, p_180237_1_)); + } + else + { + ItemStack itemstack1 = this.field_73090_b.func_184614_ca(); + ItemStack itemstack2 = itemstack1 == null ? null : itemstack1.func_77946_l(); +- boolean flag = this.field_73090_b.func_184823_b(iblockstate); ++ boolean flag = iblockstate.func_177230_c().canHarvestBlock(field_73092_a, p_180237_1_, field_73090_b); + + if (itemstack1 != null) + { +@@ -310,12 +322,18 @@ + } + } + ++ flag1 = this.removeBlock(p_180237_1_, flag); + if (flag1 && flag) + { + iblockstate.func_177230_c().func_180657_a(this.field_73092_a, this.field_73090_b, p_180237_1_, iblockstate, tileentity, itemstack2); + } + } + ++ // Drop experience ++ if (!this.func_73083_d() && flag1 && exp > 0) ++ { ++ iblockstate.func_177230_c().func_180637_b(field_73092_a, p_180237_1_, exp); ++ } + return flag1; + } + } +@@ -359,6 +377,7 @@ + if (itemstack.field_77994_a == 0) + { + p_187250_1_.func_184611_a(p_187250_4_, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187250_1_, itemstack, p_187250_4_); + } + + if (!p_187250_1_.func_184587_cr()) +@@ -445,4 +464,13 @@ + { + this.field_73092_a = p_73080_1_; + } ++ ++ public double getBlockReachDistance() ++ { ++ return blockReachDistance; ++ } ++ public void setBlockReachDistance(double distance) ++ { ++ blockReachDistance = distance; ++ } + } diff --git a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch new file mode 100644 index 000000000..8e24f9923 --- /dev/null +++ b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -0,0 +1,377 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerList.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerList.java +@@ -101,65 +101,76 @@ + this.field_72405_c = 8; + } + +- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) ++ public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn, NetHandlerPlayServer nethandlerplayserver) + { +- GameProfile gameprofile = p_72355_2_.func_146103_bH(); ++ GameProfile gameprofile = playerIn.func_146103_bH(); + PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax(); + GameProfile gameprofile1 = playerprofilecache.func_152652_a(gameprofile.getId()); + String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); + playerprofilecache.func_152649_a(gameprofile); +- NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); +- p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK)); +- p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); ++ NBTTagCompound nbttagcompound = this.func_72380_a(playerIn); ++ playerIn.func_70029_a(this.field_72400_f.func_71218_a(playerIn.field_71093_bK)); ++ ++ World playerWorld = this.field_72400_f.func_71218_a(playerIn.field_71093_bK); ++ if (playerWorld == null) ++ { ++ playerIn.field_71093_bK = 0; ++ playerWorld = this.field_72400_f.func_71218_a(0); ++ BlockPos spawnPoint = playerWorld.field_73011_w.getRandomizedSpawnPoint(); ++ playerIn.func_70107_b(spawnPoint.func_177958_n(), spawnPoint.func_177956_o(), spawnPoint.func_177952_p()); ++ } ++ ++ playerIn.func_70029_a(playerWorld); ++ playerIn.field_71134_c.func_73080_a((WorldServer)playerIn.field_70170_p); + String s1 = "local"; + +- if (p_72355_1_.func_74430_c() != null) ++ if (netManager.func_74430_c() != null) + { +- s1 = p_72355_1_.func_74430_c().toString(); ++ s1 = netManager.func_74430_c().toString(); + } + +- field_148546_d.info(p_72355_2_.func_70005_c_() + "[" + s1 + "] logged in with entity id " + p_72355_2_.func_145782_y() + " at (" + p_72355_2_.field_70165_t + ", " + p_72355_2_.field_70163_u + ", " + p_72355_2_.field_70161_v + ")"); +- WorldServer worldserver = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); ++ field_148546_d.info(playerIn.func_70005_c_() + "[" + s1 + "] logged in with entity id " + playerIn.func_145782_y() + " at (" + playerIn.field_70165_t + ", " + playerIn.field_70163_u + ", " + playerIn.field_70161_v + ")"); ++ WorldServer worldserver = this.field_72400_f.func_71218_a(playerIn.field_71093_bK); + WorldInfo worldinfo = worldserver.func_72912_H(); + BlockPos blockpos = worldserver.func_175694_M(); +- this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver); +- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_); +- nethandlerplayserver.func_147359_a(new SPacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.func_186058_p().func_186068_a(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); ++ this.func_72381_a(playerIn, (EntityPlayerMP)null, worldserver); ++ playerIn.field_71135_a = nethandlerplayserver; ++ nethandlerplayserver.func_147359_a(new SPacketJoinGame(playerIn.func_145782_y(), playerIn.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.func_186058_p().func_186068_a(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); + nethandlerplayserver.func_147359_a(new SPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName()))); + nethandlerplayserver.func_147359_a(new SPacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z())); + nethandlerplayserver.func_147359_a(new SPacketSpawnPosition(blockpos)); +- nethandlerplayserver.func_147359_a(new SPacketPlayerAbilities(p_72355_2_.field_71075_bZ)); +- nethandlerplayserver.func_147359_a(new SPacketHeldItemChange(p_72355_2_.field_71071_by.field_70461_c)); +- this.func_187243_f(p_72355_2_); +- p_72355_2_.func_147099_x().func_150877_d(); +- p_72355_2_.func_147099_x().func_150884_b(p_72355_2_); +- this.func_96456_a((ServerScoreboard)worldserver.func_96441_U(), p_72355_2_); ++ nethandlerplayserver.func_147359_a(new SPacketPlayerAbilities(playerIn.field_71075_bZ)); ++ nethandlerplayserver.func_147359_a(new SPacketHeldItemChange(playerIn.field_71071_by.field_70461_c)); ++ this.func_187243_f(playerIn); ++ playerIn.func_147099_x().func_150877_d(); ++ playerIn.func_147099_x().func_150884_b(playerIn); ++ this.func_96456_a((ServerScoreboard)worldserver.func_96441_U(), playerIn); + this.field_72400_f.func_147132_au(); + TextComponentTranslation textcomponenttranslation; + +- if (!p_72355_2_.func_70005_c_().equalsIgnoreCase(s)) ++ if (!playerIn.func_70005_c_().equalsIgnoreCase(s)) + { +- textcomponenttranslation = new TextComponentTranslation("multiplayer.player.joined.renamed", new Object[] {p_72355_2_.func_145748_c_(), s}); ++ textcomponenttranslation = new TextComponentTranslation("multiplayer.player.joined.renamed", new Object[] {playerIn.func_145748_c_(), s}); + } + else + { +- textcomponenttranslation = new TextComponentTranslation("multiplayer.player.joined", new Object[] {p_72355_2_.func_145748_c_()}); ++ textcomponenttranslation = new TextComponentTranslation("multiplayer.player.joined", new Object[] {playerIn.func_145748_c_()}); + } + + textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.YELLOW); + this.func_148539_a(textcomponenttranslation); +- this.func_72377_c(p_72355_2_); +- nethandlerplayserver.func_147364_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A); +- this.func_72354_b(p_72355_2_, worldserver); ++ this.func_72377_c(playerIn); ++ nethandlerplayserver.func_147364_a(playerIn.field_70165_t, playerIn.field_70163_u, playerIn.field_70161_v, playerIn.field_70177_z, playerIn.field_70125_A); ++ this.func_72354_b(playerIn, worldserver); + + if (!this.field_72400_f.func_147133_T().isEmpty()) + { +- p_72355_2_.func_175397_a(this.field_72400_f.func_147133_T(), this.field_72400_f.func_175581_ab()); ++ playerIn.func_175397_a(this.field_72400_f.func_147133_T(), this.field_72400_f.func_175581_ab()); + } + +- for (PotionEffect potioneffect : p_72355_2_.func_70651_bq()) ++ for (PotionEffect potioneffect : playerIn.func_70651_bq()) + { +- nethandlerplayserver.func_147359_a(new SPacketEntityEffect(p_72355_2_.func_145782_y(), potioneffect)); ++ nethandlerplayserver.func_147359_a(new SPacketEntityEffect(playerIn.func_145782_y(), potioneffect)); + } + + if (nbttagcompound != null) +@@ -175,7 +186,7 @@ + + if (entity2.func_110124_au().equals(uuid)) + { +- p_72355_2_.func_184205_a(entity2, true); ++ playerIn.func_184205_a(entity2, true); + } + else + { +@@ -183,13 +194,13 @@ + { + if (entity.func_110124_au().equals(uuid)) + { +- p_72355_2_.func_184205_a(entity, true); ++ playerIn.func_184205_a(entity, true); + break; + } + } + } + +- if (!p_72355_2_.func_184218_aH()) ++ if (!playerIn.func_184218_aH()) + { + field_148546_d.warn("Couldn\'t reattach entity to player"); + worldserver.func_72973_f(entity2); +@@ -207,12 +218,13 @@ + + if (entity1 != null) + { +- p_72355_2_.func_184205_a(entity1, true); ++ playerIn.func_184205_a(entity1, true); + } + } + } + +- p_72355_2_.func_71116_b(); ++ playerIn.func_71116_b(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(playerIn); + } + + protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) +@@ -302,6 +314,7 @@ + nbttagcompound1 = this.field_72400_f.func_184110_aI().func_188257_a(FixTypes.PLAYER, nbttagcompound); + p_72380_1_.func_70020_e(nbttagcompound1); + field_148546_d.debug("loading single player"); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString()); + } + else + { +@@ -311,8 +324,24 @@ + return nbttagcompound1; + } + ++ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) ++ { ++ // Hacky method to allow loading the NBT for a player prior to login ++ NBTTagCompound nbttagcompound = this.field_72400_f.field_71305_c[0].func_72912_H().func_76072_h(); ++ if (player.func_70005_c_().equals(this.field_72400_f.func_71214_G()) && nbttagcompound != null) ++ { ++ return nbttagcompound; ++ } ++ else ++ { ++ return ((net.minecraft.world.storage.SaveHandler)this.field_72412_k).getPlayerNBT(player); ++ } ++ } ++ + protected void func_72391_b(EntityPlayerMP p_72391_1_) + { ++ if (p_72391_1_.field_71135_a == null) return; ++ + this.field_72412_k.func_75753_a(p_72391_1_); + StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(p_72391_1_.func_110124_au()); + +@@ -334,6 +363,7 @@ + p_72377_1_.field_71135_a.func_147359_a(new SPacketPlayerListItem(SPacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {(EntityPlayerMP)this.field_72404_b.get(i)})); + } + ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + worldserver.func_72838_d(p_72377_1_); + this.func_72375_a(p_72377_1_, (WorldServer)null); + } +@@ -345,6 +375,7 @@ + + public void func_72367_e(EntityPlayerMP p_72367_1_) + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); + WorldServer worldserver = p_72367_1_.func_71121_q(); + p_72367_1_.func_71029_a(StatList.field_75947_j); + this.func_72391_b(p_72367_1_); +@@ -379,6 +410,7 @@ + this.field_177454_f.remove(uuid); + this.field_148547_k.remove(uuid); + } ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + + this.func_148540_a(new SPacketPlayerListItem(SPacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {p_72367_1_})); + } +@@ -462,13 +494,23 @@ + + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) + { ++ World world = field_72400_f.func_71218_a(p_72368_2_); ++ if (world == null) ++ { ++ p_72368_2_ = 0; ++ } ++ else if (!world.field_73011_w.func_76567_e()) ++ { ++ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); ++ } ++ + 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_184164_w().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_); +- BlockPos blockpos = p_72368_1_.func_180470_cg(); +- boolean flag = p_72368_1_.func_82245_bX(); ++ BlockPos blockpos = p_72368_1_.getBedLocation(p_72368_2_); ++ boolean flag = p_72368_1_.isSpawnForced(p_72368_2_); + p_72368_1_.field_71093_bK = p_72368_2_; + PlayerInteractionManager playerinteractionmanager; + +@@ -484,7 +526,8 @@ + EntityPlayerMP entityplayermp = 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(), playerinteractionmanager); + entityplayermp.field_71135_a = p_72368_1_.field_71135_a; + entityplayermp.func_71049_a(p_72368_1_, p_72368_3_); +- entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); ++ entityplayermp.field_71093_bK = p_72368_2_; ++ entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); + entityplayermp.func_174817_o(p_72368_1_); + entityplayermp.func_184819_a(p_72368_1_.func_184591_cq()); + +@@ -531,6 +574,7 @@ + this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp); + entityplayermp.func_71116_b(); + entityplayermp.func_70606_j(entityplayermp.func_110143_aJ()); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp); + return entityplayermp; + } + +@@ -545,15 +589,20 @@ + + public void func_187242_a(EntityPlayerMP p_187242_1_, int p_187242_2_) + { ++ transferPlayerToDimension(p_187242_1_, p_187242_2_, field_72400_f.func_71218_a(p_187242_2_).func_85176_s()); ++ } ++ ++ public void transferPlayerToDimension(EntityPlayerMP p_187242_1_, int p_187242_2_, net.minecraft.world.Teleporter teleporter) ++ { + int i = p_187242_1_.field_71093_bK; + WorldServer worldserver = this.field_72400_f.func_71218_a(p_187242_1_.field_71093_bK); + p_187242_1_.field_71093_bK = p_187242_2_; + WorldServer worldserver1 = this.field_72400_f.func_71218_a(p_187242_1_.field_71093_bK); +- p_187242_1_.field_71135_a.func_147359_a(new SPacketRespawn(p_187242_1_.field_71093_bK, p_187242_1_.field_70170_p.func_175659_aa(), p_187242_1_.field_70170_p.func_72912_H().func_76067_t(), p_187242_1_.field_71134_c.func_73081_b())); ++ p_187242_1_.field_71135_a.func_147359_a(new SPacketRespawn(p_187242_1_.field_71093_bK, worldserver1.func_175659_aa(), worldserver1.func_72912_H().func_76067_t(), p_187242_1_.field_71134_c.func_73081_b())); + this.func_187243_f(p_187242_1_); + worldserver.func_72973_f(p_187242_1_); + p_187242_1_.field_70128_L = false; +- this.func_82448_a(p_187242_1_, i, worldserver, worldserver1); ++ this.transferEntityToWorld(p_187242_1_, i, worldserver, worldserver1, teleporter); + this.func_72375_a(p_187242_1_, worldserver); + p_187242_1_.field_71135_a.func_147364_a(p_187242_1_.field_70165_t, p_187242_1_.field_70163_u, p_187242_1_.field_70161_v, p_187242_1_.field_70177_z, p_187242_1_.field_70125_A); + p_187242_1_.field_71134_c.func_73080_a(worldserver1); +@@ -565,39 +614,50 @@ + { + p_187242_1_.field_71135_a.func_147359_a(new SPacketEntityEffect(p_187242_1_.func_145782_y(), potioneffect)); + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_187242_1_, i, p_187242_2_); + } + + 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; ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); ++ } ++ ++ @SuppressWarnings("unused") ++ public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) ++ { ++ net.minecraft.world.WorldProvider pOld = p_82448_3_.field_73011_w; ++ net.minecraft.world.WorldProvider pNew = p_82448_4_.field_73011_w; ++ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); ++ double d0 = entityIn.field_70165_t * moveFactor; ++ double d1 = entityIn.field_70161_v * moveFactor; + double d2 = 8.0D; +- float f = p_82448_1_.field_70177_z; ++ float f = entityIn.field_70177_z; + p_82448_3_.field_72984_F.func_76320_a("moving"); + +- if (p_82448_1_.field_71093_bK == -1) ++ if (false && entityIn.field_71093_bK == -1) + { + d0 = MathHelper.func_151237_a(d0 / d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 / d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); +- 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); ++ entityIn.func_70012_b(d0, entityIn.field_70163_u, d1, entityIn.field_70177_z, entityIn.field_70125_A); + +- if (p_82448_1_.func_70089_S()) ++ if (entityIn.func_70089_S()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ p_82448_3_.func_72866_a(entityIn, false); + } + } +- else if (p_82448_1_.field_71093_bK == 0) ++ else if (false && entityIn.field_71093_bK == 0) + { + d0 = MathHelper.func_151237_a(d0 * d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 * d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); +- 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); ++ entityIn.func_70012_b(d0, entityIn.field_70163_u, d1, entityIn.field_70177_z, entityIn.field_70125_A); + +- if (p_82448_1_.func_70089_S()) ++ if (entityIn.func_70089_S()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ p_82448_3_.func_72866_a(entityIn, false); + } + } +- else ++ ++ if (entityIn.field_71093_bK == 1) + { + BlockPos blockpos; + +@@ -611,13 +671,13 @@ + } + + d0 = (double)blockpos.func_177958_n(); +- p_82448_1_.field_70163_u = (double)blockpos.func_177956_o(); ++ entityIn.field_70163_u = (double)blockpos.func_177956_o(); + d1 = (double)blockpos.func_177952_p(); +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, 90.0F, 0.0F); ++ entityIn.func_70012_b(d0, entityIn.field_70163_u, d1, 90.0F, 0.0F); + +- if (p_82448_1_.func_70089_S()) ++ if (entityIn.func_70089_S()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ p_82448_3_.func_72866_a(entityIn, false); + } + } + +@@ -629,18 +689,18 @@ + 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 (entityIn.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_180266_a(p_82448_1_, f); +- p_82448_4_.func_72838_d(p_82448_1_); +- p_82448_4_.func_72866_a(p_82448_1_, false); ++ entityIn.func_70012_b(d0, entityIn.field_70163_u, d1, entityIn.field_70177_z, entityIn.field_70125_A); ++ teleporter.func_180266_a(entityIn, f); ++ p_82448_4_.func_72838_d(entityIn); ++ p_82448_4_.func_72866_a(entityIn, false); + } + + p_82448_3_.field_72984_F.func_76319_b(); + } + +- p_82448_1_.func_70029_a(p_82448_4_); ++ entityIn.func_70029_a(p_82448_4_); + } + + public void func_72374_b() diff --git a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch index e0c026df7..7bb6f7e6d 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch @@ -1,32 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/management/PlayerManager.java +++ ../src-work/minecraft/net/minecraft/server/management/PlayerManager.java -@@ -117,15 +117,24 @@ - int j = (int)p_72683_1_.field_70161_v >> 4; - p_72683_1_.field_71131_d = p_72683_1_.field_70165_t; - p_72683_1_.field_71132_e = p_72683_1_.field_70161_v; -+ // Load nearby chunks first -+ List chunkList = Lists.newArrayList(); - - for (int k = i - this.field_72698_e; k <= i + this.field_72698_e; ++k) - { - for (int l = j - this.field_72698_e; l <= j + this.field_72698_e; ++l) - { -- this.func_72690_a(k, l, true).func_73255_a(p_72683_1_); -+ chunkList.add(new ChunkCoordIntPair(k, l)); - } - } - -+ java.util.Collections.sort(chunkList, new net.minecraftforge.common.util.ChunkCoordComparator(p_72683_1_)); -+ -+ for (ChunkCoordIntPair pair : chunkList) -+ { -+ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72683_1_); -+ } -+ - this.field_72699_b.add(p_72683_1_); - this.func_72691_b(p_72683_1_); - } -@@ -225,6 +234,7 @@ +@@ -338,6 +338,7 @@ int i1 = this.field_72698_e; int j1 = i - k; int k1 = j - l; @@ -34,187 +8,3 @@ if (j1 != 0 || k1 != 0) { -@@ -234,7 +244,7 @@ - { - if (!this.func_72684_a(l1, i2, k, l, i1)) - { -- this.func_72690_a(l1, i2, true).func_73255_a(p_72685_1_); -+ chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); - } - - if (!this.func_72684_a(l1 - j1, i2 - k1, i, j, i1)) -@@ -252,6 +262,18 @@ - this.func_72691_b(p_72685_1_); - p_72685_1_.field_71131_d = p_72685_1_.field_70165_t; - p_72685_1_.field_71132_e = p_72685_1_.field_70161_v; -+ // send nearest chunks first -+ java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); -+ -+ for (ChunkCoordIntPair pair : chunksToLoad) -+ { -+ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72685_1_); -+ } -+ -+ if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) -+ { -+ java.util.Collections.sort(p_72685_1_.field_71129_f, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); -+ } - } - } - } -@@ -322,11 +344,20 @@ - private int field_73262_e; - private int field_73260_f; - private long field_111198_g; -+ private final java.util.HashMap players = new java.util.HashMap(); -+ private boolean loaded = false; -+ private Runnable loadedRunnable = new Runnable() -+ { -+ public void run() -+ { -+ PlayerInstance.this.loaded = true; -+ } -+ }; - - public PlayerInstance(int p_i1518_2_, int p_i1518_3_) - { - this.field_73264_c = new ChunkCoordIntPair(p_i1518_2_, p_i1518_3_); -- PlayerManager.this.func_72688_a().field_73059_b.func_73158_c(p_i1518_2_, p_i1518_3_); -+ PlayerManager.this.func_72688_a().field_73059_b.loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); - } - - public void func_73255_a(EntityPlayerMP p_73255_1_) -@@ -343,7 +374,24 @@ - } - - this.field_73263_b.add(p_73255_1_); -+ Runnable playerRunnable = null; -+ if (this.loaded) -+ { - p_73255_1_.field_71129_f.add(this.field_73264_c); -+ } -+ else -+ { -+ final EntityPlayerMP tmp = p_73255_1_; -+ playerRunnable = new Runnable() -+ { -+ public void run() -+ { -+ tmp.field_71129_f.add(PlayerInstance.this.field_73264_c); -+ } -+ }; -+ PlayerManager.this.func_72688_a().field_73059_b.loadChunk(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, playerRunnable); -+ } -+ this.players.put(p_73255_1_, playerRunnable); - } - } - -@@ -351,6 +399,24 @@ - { - if (this.field_73263_b.contains(p_73252_1_)) - { -+ // If we haven't loaded yet don't load the chunk just so we can clean it up -+ if (!this.loaded) -+ { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.players.get(p_73252_1_)); -+ this.field_73263_b.remove(p_73252_1_); -+ this.players.remove(p_73252_1_); -+ -+ if (this.field_73263_b.isEmpty()) -+ { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.loadedRunnable); -+ long i = (long) this.field_73264_c.field_77276_a + 2147483647L | (long) this.field_73264_c.field_77275_b + 2147483647L << 32; -+ PlayerManager.this.field_72700_c.func_76159_d(i); -+ PlayerManager.this.field_111193_e.remove(this); -+ } -+ -+ return; -+ } -+ - Chunk chunk = PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b); - - if (chunk.func_150802_k()) -@@ -358,9 +424,12 @@ - p_73252_1_.field_71135_a.func_147359_a(new S21PacketChunkData(chunk, true, 0)); - } - -+ this.players.remove(p_73252_1_); - this.field_73263_b.remove(p_73252_1_); - p_73252_1_.field_71129_f.remove(this.field_73264_c); - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(field_73264_c, p_73252_1_)); -+ - if (this.field_73263_b.isEmpty()) - { - long i = (long)this.field_73264_c.field_77276_a + 2147483647L | (long)this.field_73264_c.field_77275_b + 2147483647L << 32; -@@ -398,7 +467,7 @@ - - this.field_73260_f |= 1 << (p_151253_2_ >> 4); - -- if (this.field_73262_e < 64) -+ //Forge; Cache everything, so always run - { - short short1 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); - -@@ -410,6 +479,10 @@ - } - } - -+ if (field_73262_e == field_151254_d.length) -+ { -+ field_151254_d = java.util.Arrays.copyOf(field_151254_d, field_151254_d.length << 1); -+ } - this.field_151254_d[this.field_73262_e++] = short1; - } - } -@@ -427,6 +500,7 @@ - } - } - -+ @SuppressWarnings("unused") - public void func_73254_a() - { - if (this.field_73262_e != 0) -@@ -439,18 +513,19 @@ - BlockPos blockpos = new BlockPos(i, j, k); - this.func_151251_a(new S23PacketBlockChange(PlayerManager.this.field_72701_a, blockpos)); - -- if (PlayerManager.this.field_72701_a.func_180495_p(blockpos).func_177230_c().func_149716_u()) -+ if (PlayerManager.this.field_72701_a.func_180495_p(blockpos).func_177230_c().hasTileEntity(PlayerManager.this.field_72701_a.func_180495_p(blockpos))) - { - this.func_151252_a(PlayerManager.this.field_72701_a.func_175625_s(blockpos)); - } - } -- else if (this.field_73262_e == 64) -+ else if (this.field_73262_e >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) - { - int i1 = this.field_73264_c.field_77276_a * 16; - int k1 = 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)); - -- for (int i2 = 0; i2 < 16; ++i2) -+ // Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones -+ for (int i2 = 0; false && i2 < 16; ++i2) - { - if ((this.field_73260_f & 1 << i2) != 0) - { -@@ -467,7 +542,9 @@ - else - { - 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.field_72701_a; - for (int j1 = 0; j1 < this.field_73262_e; ++j1) - { - int l1 = (this.field_151254_d[j1] >> 12 & 15) + this.field_73264_c.field_77276_a * 16; -@@ -475,7 +552,7 @@ - int l2 = (this.field_151254_d[j1] >> 8 & 15) + this.field_73264_c.field_77275_b * 16; - BlockPos blockpos1 = new BlockPos(l1, j2, l2); - -- if (PlayerManager.this.field_72701_a.func_180495_p(blockpos1).func_177230_c().func_149716_u()) -+ if (world.func_180495_p(blockpos1).func_177230_c().hasTileEntity(world.func_180495_p(blockpos1))) - { - this.func_151252_a(PlayerManager.this.field_72701_a.func_175625_s(blockpos1)); - } diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch deleted file mode 100644 index 2f7ace96d..000000000 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ /dev/null @@ -1,223 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -+++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -@@ -99,7 +99,7 @@ - this.field_72405_c = 8; - } - -- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) -+ public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_, NetHandlerPlayServer nethandlerplayserver) - { - GameProfile gameprofile = p_72355_2_.func_146103_bH(); - PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax(); -@@ -108,6 +108,17 @@ - playerprofilecache.func_152649_a(gameprofile); - NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); - p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK)); -+ -+ World playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); -+ if (playerWorld == null) -+ { -+ p_72355_2_.field_71093_bK=0; -+ playerWorld=this.field_72400_f.func_71218_a(0); -+ BlockPos spawnPoint = playerWorld.field_73011_w.getRandomizedSpawnPoint(); -+ p_72355_2_.func_70107_b(spawnPoint.func_177958_n(), spawnPoint.func_177956_o(), spawnPoint.func_177952_p()); -+ } -+ -+ p_72355_2_.func_70029_a(playerWorld); - p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); - String s1 = "local"; - -@@ -121,7 +132,7 @@ - WorldInfo worldinfo = worldserver.func_72912_H(); - BlockPos blockpos = worldserver.func_175694_M(); - this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver); -- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_); -+ p_72355_2_.field_71135_a = nethandlerplayserver; - nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.func_177502_q(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); - nethandlerplayserver.func_147359_a(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName()))); - nethandlerplayserver.func_147359_a(new S41PacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z())); -@@ -161,6 +172,7 @@ - - p_72355_2_.func_71116_b(); - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(p_72355_2_); - if (nbttagcompound != null && nbttagcompound.func_150297_b("Riding", 10)) - { - Entity entity = EntityList.func_75615_a(nbttagcompound.func_74775_l("Riding"), worldserver); -@@ -262,6 +274,7 @@ - p_72380_1_.func_70020_e(nbttagcompound); - nbttagcompound1 = nbttagcompound; - field_148546_d.debug("loading single player"); -+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString()); - } - else - { -@@ -271,8 +284,23 @@ - return nbttagcompound1; - } - -+ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) -+ { -+ // Hacky method to allow loading the NBT for a player prior to login -+ NBTTagCompound nbttagcompound = this.field_72400_f.field_71305_c[0].func_72912_H().func_76072_h(); -+ if (player.func_70005_c_().equals(this.field_72400_f.func_71214_G()) && nbttagcompound != null) -+ { -+ return nbttagcompound; -+ } -+ else -+ { -+ return ((net.minecraft.world.storage.SaveHandler)this.field_72412_k).getPlayerNBT(player); -+ } -+ } - protected void func_72391_b(EntityPlayerMP p_72391_1_) - { -+ if (p_72391_1_.field_71135_a == null) return; -+ - this.field_72412_k.func_75753_a(p_72391_1_); - StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(p_72391_1_.func_110124_au()); - -@@ -288,6 +316,7 @@ - this.field_177454_f.put(p_72377_1_.func_110124_au(), p_72377_1_); - this.func_148540_a(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {p_72377_1_})); - WorldServer worldserver = this.field_72400_f.func_71218_a(p_72377_1_.field_71093_bK); -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); - worldserver.func_72838_d(p_72377_1_); - this.func_72375_a(p_72377_1_, (WorldServer)null); - -@@ -305,6 +334,7 @@ - - public void func_72367_e(EntityPlayerMP p_72367_1_) - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); - p_72367_1_.func_71029_a(StatList.field_75947_j); - this.func_72391_b(p_72367_1_); - WorldServer worldserver = p_72367_1_.func_71121_q(); -@@ -326,6 +356,7 @@ - this.field_177454_f.remove(uuid); - this.field_148547_k.remove(uuid); - } -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); - - this.func_148540_a(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {p_72367_1_})); - } -@@ -409,13 +440,23 @@ - - public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) - { -+ World world = field_72400_f.func_71218_a(p_72368_2_); -+ if (world == null) -+ { -+ p_72368_2_ = 0; -+ } -+ else if (!world.field_73011_w.func_76567_e()) -+ { -+ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); -+ } -+ - 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_); -- BlockPos blockpos = p_72368_1_.func_180470_cg(); -- boolean flag = p_72368_1_.func_82245_bX(); -+ BlockPos blockpos = p_72368_1_.getBedLocation(p_72368_2_); -+ boolean flag = p_72368_1_.isSpawnForced(p_72368_2_); - p_72368_1_.field_71093_bK = p_72368_2_; - ItemInWorldManager iteminworldmanager; - -@@ -431,6 +472,7 @@ - EntityPlayerMP entityplayermp = 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); - entityplayermp.field_71135_a = p_72368_1_.field_71135_a; - entityplayermp.func_71049_a(p_72368_1_, p_72368_3_); -+ entityplayermp.field_71093_bK = p_72368_2_; - entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); - entityplayermp.func_174817_o(p_72368_1_); - WorldServer worldserver = this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK); -@@ -470,19 +512,25 @@ - this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp); - entityplayermp.func_71116_b(); - entityplayermp.func_70606_j(entityplayermp.func_110143_aJ()); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp); - return entityplayermp; - } - - public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_) - { -+ transferPlayerToDimension(p_72356_1_, p_72356_2_, field_72400_f.func_71218_a(p_72356_2_).func_85176_s()); -+ } -+ -+ public void transferPlayerToDimension(EntityPlayerMP p_72356_1_, int p_72356_2_, net.minecraft.world.Teleporter teleporter) -+ { - int i = 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.func_175659_aa(), p_72356_1_.field_70170_p.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); -+ p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, worldserver1.func_175659_aa(), worldserver1.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_, i, worldserver, worldserver1); -+ this.transferEntityToWorld(p_72356_1_, i, worldserver, worldserver1, teleporter); - 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); -@@ -493,17 +541,27 @@ - { - p_72356_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(p_72356_1_.func_145782_y(), potioneffect)); - } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, i, p_72356_2_); - } - - 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; -+ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); -+ } -+ -+ @SuppressWarnings("unused") -+ public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) -+ { -+ net.minecraft.world.WorldProvider pOld = p_82448_3_.field_73011_w; -+ net.minecraft.world.WorldProvider pNew = p_82448_4_.field_73011_w; -+ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); -+ double d0 = p_82448_1_.field_70165_t * moveFactor; -+ double d1 = p_82448_1_.field_70161_v * moveFactor; - double d2 = 8.0D; - float f = p_82448_1_.field_70177_z; - p_82448_3_.field_72984_F.func_76320_a("moving"); - -- if (p_82448_1_.field_71093_bK == -1) -+ if (false && p_82448_1_.field_71093_bK == -1) //Forge Kill it but dont comment out so we can rename it. - { - d0 = MathHelper.func_151237_a(d0 / d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); - d1 = MathHelper.func_151237_a(d1 / d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); -@@ -514,7 +572,7 @@ - p_82448_3_.func_72866_a(p_82448_1_, false); - } - } -- else if (p_82448_1_.field_71093_bK == 0) -+ else if (false && p_82448_1_.field_71093_bK == 0) //Forge Kill it but dont comment out so we can rename it. - { - d0 = MathHelper.func_151237_a(d0 * d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); - d1 = MathHelper.func_151237_a(d1 * d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); -@@ -525,7 +583,8 @@ - p_82448_3_.func_72866_a(p_82448_1_, false); - } - } -- else -+ -+ if (p_82448_1_.field_71093_bK == 1) - { - BlockPos blockpos; - -@@ -560,7 +619,7 @@ - if (p_82448_1_.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_180266_a(p_82448_1_, f); -+ teleporter.func_180266_a(p_82448_1_, f); - p_82448_4_.func_72838_d(p_82448_1_); - p_82448_4_.func_72866_a(p_82448_1_, false); - } diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch index ad1cf3005..624eebff6 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -1,26 +1,20 @@ --- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java +++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java -@@ -66,12 +66,12 @@ +@@ -66,7 +66,7 @@ if (entityplayermp == null) { this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -- this.field_147327_f.func_71203_ab().func_72355_a(this.field_147333_a, this.field_181025_l); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_71203_ab(), this.field_147333_a, this.field_181025_l); +- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_181025_l); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_181025_l); this.field_181025_l = null; } } - -- if (this.field_147336_h++ == 600) -+ if (this.field_147336_h++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) - { - this.func_147322_a("Took too long to log in"); - } @@ -130,7 +130,7 @@ } else { -- this.field_147327_f.func_71203_ab().func_72355_a(this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_71203_ab(), this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); +- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i)); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i)); } } } diff --git a/patches/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch index 61bd2d01f..8eca04494 100644 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatList.java.patch @@ -1,24 +1,24 @@ --- ../src-base/minecraft/net/minecraft/stats/StatList.java +++ ../src-work/minecraft/net/minecraft/stats/StatList.java -@@ -119,7 +119,7 @@ +@@ -155,7 +155,7 @@ } } -- func_75924_a(field_75928_D); -+ replaceAllSimilarBlocks(field_75928_D, true); +- func_75924_a(field_188066_af); ++ replaceAllSimilarBlocks(field_188066_af, true); } private static void func_151181_c() -@@ -141,7 +141,7 @@ +@@ -177,7 +177,7 @@ } } -- func_75924_a(field_75934_C); -+ replaceAllSimilarBlocks(field_75934_C, false); +- func_75924_a(field_188065_ae); ++ replaceAllSimilarBlocks(field_188065_ae, false); } private static void func_75925_c() -@@ -165,7 +165,7 @@ +@@ -201,7 +201,7 @@ } } @@ -27,7 +27,16 @@ } private static void func_151179_e() -@@ -184,7 +184,7 @@ +@@ -220,7 +220,7 @@ + } + } + +- func_75924_a(field_75930_F); ++ replaceAllSimilarBlocks(field_75930_F, true); + } + + private static void func_188054_f() +@@ -240,7 +240,7 @@ } } @@ -36,7 +45,7 @@ } private static String func_180204_a(Item p_180204_0_) -@@ -193,28 +193,35 @@ +@@ -249,28 +249,35 @@ return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index d9070581c..05673acff 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java -@@ -17,7 +17,7 @@ +@@ -18,7 +18,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ { private static final Logger field_145852_a = LogManager.getLogger(); private static Map < String, Class > field_145855_i = Maps. < String, Class > newHashMap(); -@@ -59,6 +59,8 @@ +@@ -60,6 +60,8 @@ public void func_145839_a(NBTTagCompound p_145839_1_) { this.field_174879_c = new BlockPos(p_145839_1_.func_74762_e("x"), p_145839_1_.func_74762_e("y"), p_145839_1_.func_74762_e("z")); @@ -18,7 +18,7 @@ } public void func_145841_b(NBTTagCompound p_145841_1_) -@@ -75,6 +77,8 @@ +@@ -76,6 +78,8 @@ p_145841_1_.func_74768_a("x", this.field_174879_c.func_177958_n()); p_145841_1_.func_74768_a("y", this.field_174879_c.func_177956_o()); p_145841_1_.func_74768_a("z", this.field_174879_c.func_177952_p()); @@ -27,37 +27,40 @@ } } -@@ -82,9 +86,10 @@ +@@ -83,10 +87,11 @@ { TileEntity tileentity = null; - + String s = p_184246_1_.func_74779_i("id"); + Class oclass = null; + try { -- Class oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); -+ oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); +- Class oclass = (Class)field_145855_i.get(s); ++ oclass = (Class)field_145855_i.get(s); if (oclass != null) { -@@ -102,7 +107,17 @@ - } - else +@@ -96,6 +101,9 @@ + catch (Throwable throwable1) { -+ try -+ { - field_145852_a.warn("Skipping BlockEntity with id " + p_145827_0_.func_74779_i("id")); -+ } -+ catch (Exception ex) -+ { -+ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, -+ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", -+ p_145827_0_.func_74779_i("id"), oclass.getName()); -+ tileentity = null; -+ } + field_145852_a.error("Failed to create block entity " + s, throwable1); ++ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, throwable1, ++ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ s, oclass.getName()); } - return tileentity; -@@ -134,7 +149,6 @@ + if (tileentity != null) +@@ -107,6 +115,9 @@ + catch (Throwable throwable) + { + field_145852_a.error("Failed to load data for block entity " + s, throwable); ++ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, throwable, ++ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ s, oclass.getName()); + tileentity = null; + } + } +@@ -144,7 +155,6 @@ } } @@ -65,11 +68,10 @@ public double func_145835_a(double p_145835_1_, double p_145835_3_, double p_145835_5_) { double d0 = (double)this.field_174879_c.func_177958_n() + 0.5D - p_145835_1_; -@@ -279,4 +293,183 @@ - func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); - func_145826_a(TileEntityBanner.class, "Banner"); +@@ -271,6 +281,185 @@ + return false; } -+ + + // -- BEGIN FORGE PATCHES -- + /** + * Called when you receive a TileEntityData packet for the location this @@ -80,7 +82,7 @@ + * @param net The NetworkManager the packet originated from + * @param pkt The data packet + */ -+ public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.S35PacketUpdateTileEntity pkt) ++ public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.SPacketUpdateTileEntity pkt) + { + } + @@ -115,7 +117,7 @@ + /** + * Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}. + */ -+ public static final net.minecraft.util.AxisAlignedBB INFINITE_EXTENT_AABB = new net.minecraft.util.AxisAlignedBB(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); ++ public static final net.minecraft.util.math.AxisAlignedBB INFINITE_EXTENT_AABB = new net.minecraft.util.math.AxisAlignedBB(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 @@ -124,24 +126,24 @@ + * @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity} + */ + @SideOnly(Side.CLIENT) -+ public net.minecraft.util.AxisAlignedBB getRenderBoundingBox() ++ public net.minecraft.util.math.AxisAlignedBB getRenderBoundingBox() + { -+ net.minecraft.util.AxisAlignedBB bb = INFINITE_EXTENT_AABB; ++ net.minecraft.util.math.AxisAlignedBB bb = INFINITE_EXTENT_AABB; + Block type = func_145838_q(); + if (type == Blocks.field_150381_bn) + { -+ bb = new net.minecraft.util.AxisAlignedBB(func_174877_v(), func_174877_v().func_177982_a(1, 1, 1)); ++ bb = new net.minecraft.util.math.AxisAlignedBB(func_174877_v(), func_174877_v().func_177982_a(1, 1, 1)); + } + else if (type == Blocks.field_150486_ae || type == Blocks.field_150447_bR) + { -+ bb = new net.minecraft.util.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(2, 2, 2)); ++ bb = new net.minecraft.util.math.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(2, 2, 2)); + } + else if (type != null && type != Blocks.field_150461_bJ) + { -+ net.minecraft.util.AxisAlignedBB cbb = null; ++ net.minecraft.util.math.AxisAlignedBB cbb = null; + try + { -+ cbb = type.func_180640_a(field_145850_b, func_174877_v(), field_145850_b.func_180495_p(func_174877_v())); ++ cbb = field_145850_b.func_180495_p(func_174877_v()).func_185890_d(field_145850_b, func_174877_v()); + } + catch (Exception e) + { @@ -151,7 +153,7 @@ + // So, once again in the long line of US having to accommodate BUKKIT breaking things, + // here it is, assume that the TE is only 1 cubic block. Problem with this is that it may + // cause the TileEntity renderer to error further down the line! But alas, nothing we can do. -+ cbb = new net.minecraft.util.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(1, 1, 1)); ++ cbb = new net.minecraft.util.math.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(1, 1, 1)); + } + if (cbb != null) bb = cbb; + } @@ -248,4 +250,7 @@ + this.func_145841_b(ret); + return ret; + } - } ++ + static + { + func_145826_a(TileEntityFurnace.class, "Furnace"); diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index acb9425af..6ba50bb6f 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java -@@ -169,7 +169,7 @@ +@@ -179,7 +179,7 @@ { Block block = this.field_145850_b.func_180495_p(new BlockPos(j1, i2, k1)).func_177230_c(); @@ -9,7 +9,7 @@ { flag1 = false; break; -@@ -368,7 +368,7 @@ +@@ -371,7 +371,7 @@ public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) { diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index b061d4b42..0350d0b0b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java -@@ -104,7 +104,7 @@ +@@ -140,7 +140,7 @@ private boolean func_145934_k() { @@ -9,16 +9,7 @@ { ItemStack itemstack = this.field_145945_j[3]; -@@ -118,7 +118,7 @@ - - for (int i = 0; i < 3; ++i) - { -- 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.field_145945_j[i].func_77960_j(); - int k = this.func_145936_c(j, itemstack); -@@ -145,19 +145,22 @@ +@@ -165,25 +165,23 @@ } else { @@ -30,57 +21,52 @@ private void func_145940_l() { + if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(field_145945_j)) return; - if (this.func_145934_k()) + ItemStack itemstack = this.field_145945_j[3]; + +- for (int i = 0; i < 3; ++i) +- { +- this.field_145945_j[i] = PotionHelper.func_185212_d(itemstack, this.field_145945_j[i]); +- } ++ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(field_145945_j, field_145945_j[3], field_145947_i); + + --itemstack.field_77994_a; + BlockPos blockpos = this.func_174877_v(); + +- if (itemstack.func_77973_b().func_77634_r()) ++ if (itemstack.func_77973_b().hasContainerItem(itemstack)) { -+ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(field_145945_j, field_145945_j[3], field_145947_i); - ItemStack itemstack = this.field_145945_j[3]; +- ItemStack itemstack1 = new ItemStack(itemstack.func_77973_b().func_77668_q()); ++ ItemStack itemstack1 = itemstack.func_77973_b().getContainerItem(itemstack); -+ if (false) { // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe - for (int i = 0; i < 3; ++i) + if (itemstack.field_77994_a <= 0) { -- 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.field_145945_j[i].func_77960_j(); - int k = this.func_145936_c(j, itemstack); -@@ -177,10 +180,11 @@ - } - } - } -+ } +@@ -202,6 +200,7 @@ -- if (itemstack.func_77973_b().func_77634_r()) -+ if (itemstack.func_77973_b().hasContainerItem(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 - { -@@ -191,6 +195,7 @@ - this.field_145945_j[3] = null; - } - } -+ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(field_145945_j); - } + this.field_145945_j[3] = itemstack; + this.field_145850_b.func_175718_b(1035, blockpos, 0); ++ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(field_145945_j); } -@@ -310,7 +315,9 @@ - - public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) + public void func_145839_a(NBTTagCompound p_145839_1_) +@@ -303,12 +302,12 @@ { -- 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; -+ if (p_94041_1_ == 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_94041_2_)) return true; -+ else if (p_94041_1_ != 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_94041_2_)) return true; -+ return false; - } - - public boolean[] func_174902_m() -@@ -386,4 +393,18 @@ - this.field_145945_j[i] = null; + if (p_94041_1_ == 3) + { +- return PotionHelper.func_185205_a(p_94041_2_); ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_94041_2_); + } + else + { + Item item = p_94041_2_.func_77973_b(); +- return p_94041_1_ == 4 ? item == Items.field_151065_br : item == Items.field_151068_bn || item == Items.field_185155_bH || item == Items.field_185156_bI || item == Items.field_151069_bo; ++ return p_94041_1_ == 4 ? item == Items.field_151065_br : net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_94041_2_); } } -+ + +@@ -362,6 +361,20 @@ + } + } + + net.minecraftforge.items.IItemHandler handlerInput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP); + net.minecraftforge.items.IItemHandler handlerOutput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN); + @@ -94,4 +80,7 @@ + return (T) handlerOutput; + return super.getCapability(capability, facing); + } - } ++ + public int func_174890_g() + { + return 2; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch index 1c77e9b78..41197c4dc 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityChest.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityChest.java -@@ -186,6 +186,7 @@ +@@ -171,6 +171,7 @@ { super.func_145836_u(); this.field_145984_a = false; @@ -8,11 +8,10 @@ } @SuppressWarnings("incomplete-switch") -@@ -468,4 +469,24 @@ - this.field_145985_p[i] = null; +@@ -457,6 +458,26 @@ } } -+ + + public net.minecraftforge.items.VanillaDoubleChestItemHandler doubleChestHandler; + + @Override @@ -32,4 +31,7 @@ + { + return super.getCapability(net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + } - } ++ + public void func_184287_a(ResourceLocation p_184287_1_, long p_184287_2_) + { + this.field_184284_m = p_184287_1_; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 44e66c1e4..abef4b007 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -@@ -141,9 +141,9 @@ +@@ -110,9 +110,9 @@ } } @@ -13,7 +13,7 @@ this.field_145963_i = func_145952_a(this.field_145957_n[1]); if (p_145839_1_.func_150297_b("CustomName", 8)) -@@ -155,9 +155,9 @@ +@@ -124,9 +124,9 @@ public void func_145841_b(NBTTagCompound p_145841_1_) { super.func_145841_b(p_145841_1_); @@ -26,7 +26,7 @@ NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.field_145957_n.length; ++i) -@@ -223,8 +223,7 @@ +@@ -192,8 +192,7 @@ if (this.field_145957_n[1].field_77994_a == 0) { @@ -36,7 +36,7 @@ } } } -@@ -279,7 +278,11 @@ +@@ -248,7 +247,11 @@ else { ItemStack itemstack = FurnaceRecipes.func_77602_a().func_151395_a(this.field_145957_n[0]); @@ -49,7 +49,7 @@ } } -@@ -295,7 +298,7 @@ +@@ -264,7 +267,7 @@ } else if (this.field_145957_n[2].func_77973_b() == itemstack.func_77973_b()) { @@ -58,7 +58,7 @@ } if (this.field_145957_n[0].func_77973_b() == Item.func_150898_a(Blocks.field_150360_v) && this.field_145957_n[0].func_77960_j() == 1 && this.field_145957_n[1] != null && this.field_145957_n[1].func_77973_b() == Items.field_151133_ar) -@@ -342,7 +345,15 @@ +@@ -311,7 +314,15 @@ } } @@ -75,7 +75,7 @@ } } -@@ -451,4 +462,21 @@ +@@ -432,4 +443,21 @@ this.field_145957_n[i] = null; } } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index a03e41ceb..d55f5e0a4 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java -@@ -260,6 +260,7 @@ +@@ -237,6 +237,7 @@ private boolean func_145883_k() { @@ -8,7 +8,7 @@ IInventory iinventory = this.func_145895_l(); if (iinventory == null) -@@ -366,6 +367,7 @@ +@@ -343,6 +344,7 @@ public static boolean func_145891_a(IHopper p_145891_0_) { @@ -16,7 +16,7 @@ IInventory iinventory = func_145884_b(p_145891_0_); if (iinventory != null) -@@ -515,17 +517,31 @@ +@@ -492,17 +494,31 @@ if (itemstack == null) { @@ -49,7 +49,7 @@ } if (flag) -@@ -668,4 +684,10 @@ +@@ -648,4 +664,10 @@ this.field_145900_a[i] = null; } } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch index 5059fc2d0..116d03a6b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityLockable.java @@ -47,4 +47,25 @@ { - return (IChatComponent)(this.func_145818_k_() ? new ChatComponentText(this.func_70005_c_()) : new ChatComponentTranslation(this.func_70005_c_(), new Object[0])); + return (ITextComponent)(this.func_145818_k_() ? new TextComponentString(this.func_70005_c_()) : new TextComponentTranslation(this.func_70005_c_(), new Object[0])); } + + private net.minecraftforge.items.IItemHandler itemHandler; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch index e3fef4d68..a47e34392 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java -@@ -27,7 +27,9 @@ +@@ -29,7 +29,9 @@ public void func_145877_a() { diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch index a1d1cc237..9a9ead760 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java -@@ -148,7 +148,8 @@ +@@ -201,7 +201,8 @@ if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) { this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3); @@ -10,7 +10,7 @@ } } } -@@ -166,7 +167,8 @@ +@@ -219,7 +220,8 @@ if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) { this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3); diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch index 6b66af8ce..0919e7804 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntitySign.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySign.java -@@ -61,7 +61,7 @@ +@@ -60,7 +60,7 @@ } public boolean func_70003_b(int p_70003_1_, String p_70003_2_) { diff --git a/patches/minecraft/net/minecraft/util/ActionResult.java.patch b/patches/minecraft/net/minecraft/util/ActionResult.java.patch new file mode 100644 index 000000000..28c5a82cf --- /dev/null +++ b/patches/minecraft/net/minecraft/util/ActionResult.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/util/ActionResult.java ++++ ../src-work/minecraft/net/minecraft/util/ActionResult.java +@@ -20,4 +20,10 @@ + { + return this.field_188400_b; + } ++ ++ //Just a generic helper function to make typecasing easier... ++ public static ActionResult newResult(EnumActionResult result, T value) ++ { ++ return new ActionResult(result, value); ++ } + } diff --git a/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch b/patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch similarity index 53% rename from patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch rename to patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch index 7bb192c6d..80055839a 100644 --- a/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch +++ b/patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/util/EnumWorldBlockLayer.java -+++ ../src-work/minecraft/net/minecraft/util/EnumWorldBlockLayer.java +--- ../src-base/minecraft/net/minecraft/util/BlockRenderLayer.java ++++ ../src-work/minecraft/net/minecraft/util/BlockRenderLayer.java @@ -1,9 +1,5 @@ package net.minecraft.util; @@ -7,6 +7,6 @@ -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) - public enum EnumWorldBlockLayer + public enum BlockRenderLayer { SOLID("Solid"), diff --git a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch index a0fbc640d..241b4620f 100644 --- a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch +++ b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/util/EnumFacing.java +++ ../src-work/minecraft/net/minecraft/util/EnumFacing.java -@@ -6,8 +6,6 @@ - import java.util.Iterator; - import java.util.Map; +@@ -8,8 +8,6 @@ import java.util.Random; + import net.minecraft.util.math.MathHelper; + import net.minecraft.util.math.Vec3i; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public enum EnumFacing implements IStringSerializable { -@@ -60,7 +58,6 @@ +@@ -62,7 +60,6 @@ return func_82600_a(this.field_176759_h); } @@ -17,7 +17,7 @@ public EnumFacing func_176732_a(EnumFacing.Axis p_176732_1_) { switch (p_176732_1_) -@@ -111,7 +108,6 @@ +@@ -113,7 +110,6 @@ } } @@ -25,7 +25,7 @@ private EnumFacing func_176744_n() { switch (this) -@@ -131,7 +127,6 @@ +@@ -133,7 +129,6 @@ } } @@ -33,7 +33,7 @@ private EnumFacing func_176738_p() { switch (this) -@@ -192,7 +187,6 @@ +@@ -194,7 +189,6 @@ return this.field_176758_k; } @@ -41,7 +41,7 @@ public static EnumFacing func_176739_a(String p_176739_0_) { return p_176739_0_ == null ? null : (EnumFacing)field_176761_p.get(p_176739_0_.toLowerCase()); -@@ -218,7 +212,6 @@ +@@ -225,7 +219,6 @@ return values()[p_176741_0_.nextInt(values().length)]; } @@ -49,7 +49,7 @@ public static EnumFacing func_176737_a(float p_176737_0_, float p_176737_1_, float p_176737_2_) { EnumFacing enumfacing = NORTH; -@@ -261,7 +254,6 @@ +@@ -268,7 +261,6 @@ throw new IllegalArgumentException("No such direction: " + p_181076_0_ + " " + p_181076_1_); } @@ -57,7 +57,7 @@ public Vec3i func_176730_m() { return this.field_176756_m; -@@ -297,7 +289,6 @@ +@@ -304,7 +296,6 @@ this.field_176723_f = p_i46015_4_; } diff --git a/patches/minecraft/net/minecraft/util/IChatComponent.java.patch b/patches/minecraft/net/minecraft/util/IChatComponent.java.patch deleted file mode 100644 index 2f0530ce4..000000000 --- a/patches/minecraft/net/minecraft/util/IChatComponent.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/IChatComponent.java -+++ ../src-work/minecraft/net/minecraft/util/IChatComponent.java -@@ -31,7 +31,6 @@ - - String func_150260_c(); - -- @SideOnly(Side.CLIENT) - String func_150254_d(); - - List func_150253_a(); diff --git a/patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch b/patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch new file mode 100644 index 000000000..2b9932be9 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/IntIdentityHashBiMap.java ++++ ../src-work/minecraft/net/minecraft/util/IntIdentityHashBiMap.java +@@ -166,7 +166,6 @@ + return Iterators.filter(Iterators.forArray(this.field_186820_d), Predicates.notNull()); + } + +- @SideOnly(Side.CLIENT) + public void func_186812_a() + { + Arrays.fill(this.field_186818_b, (Object)null); diff --git a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch deleted file mode 100644 index f717cac15..000000000 --- a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java -+++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java -@@ -10,6 +10,12 @@ - public Vec3 field_72307_f; - public Entity field_72308_g; - -+ /** Used to determine what sub-segment is hit */ -+ public int subHit = -1; -+ -+ /** Used to add extra hit info */ -+ public Object hitInfo = null; -+ - public MovingObjectPosition(Vec3 p_i45551_1_, EnumFacing p_i45551_2_, BlockPos p_i45551_3_) - { - this(MovingObjectPosition.MovingObjectType.BLOCK, p_i45551_1_, p_i45551_2_, p_i45551_3_); diff --git a/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch b/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch deleted file mode 100644 index bef0586ad..000000000 --- a/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/ResourceLocation.java -+++ ../src-work/minecraft/net/minecraft/util/ResourceLocation.java -@@ -1,7 +1,5 @@ - package net.minecraft.util; - --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - import org.apache.commons.lang3.Validate; - - public class ResourceLocation -@@ -21,7 +19,6 @@ - this(0, func_177516_a(p_i1293_1_)); - } - -- @SideOnly(Side.CLIENT) - public ResourceLocation(String p_i1292_1_, String p_i1292_2_) - { - this(0, new String[] {p_i1292_1_, p_i1292_2_}); -@@ -50,7 +47,6 @@ - return this.field_110625_b; - } - -- @SideOnly(Side.CLIENT) - public String func_110624_b() - { - return this.field_110626_a; diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch index 19d55db7e..6ac324278 100644 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -34,7 +34,7 @@ this.field_74286_b = p_i1098_1_; this.field_148257_b = p_i1098_2_; this.field_148258_c = p_i1098_3_; -@@ -49,11 +66,13 @@ +@@ -49,14 +66,29 @@ try { UUID uuid = UUIDTypeAdapter.fromString(this.func_148255_b()); @@ -50,10 +50,6 @@ } } -@@ -62,6 +81,19 @@ - return this.field_152429_d; - } - + /* ======================================== FORGE START ===================================== */ + //For internal use only. Modders should never need to use this. + public void setProperties(com.mojang.authlib.properties.PropertyMap properties) diff --git a/patches/minecraft/net/minecraft/util/TabCompleter.java.patch b/patches/minecraft/net/minecraft/util/TabCompleter.java.patch new file mode 100644 index 000000000..5fe77be00 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/TabCompleter.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/util/TabCompleter.java ++++ ../src-work/minecraft/net/minecraft/util/TabCompleter.java +@@ -53,13 +53,14 @@ + this.field_186844_a.func_146175_b(i - this.field_186844_a.func_146198_h()); + } + +- this.field_186844_a.func_146191_b((String)this.field_186849_f.get(this.field_186848_e++)); ++ this.field_186844_a.func_146191_b(net.minecraft.util.text.TextFormatting.func_110646_a(this.field_186849_f.get(this.field_186848_e++))); + } + + private void func_186838_a(String p_186838_1_) + { + if (p_186838_1_.length() >= 1) + { ++ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_186838_1_); + Minecraft.func_71410_x().field_71439_g.field_71174_a.func_147297_a(new CPacketTabComplete(p_186838_1_, this.func_186839_b(), this.field_186845_b)); + this.field_186847_d = true; + } +@@ -74,6 +75,12 @@ + this.field_186846_c = false; + this.field_186849_f.clear(); + ++ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; ++ if (complete != null) ++ { ++ p_186840_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_186840_1_, String.class); ++ } ++ + for (String s : p_186840_1_) + { + if (!s.isEmpty()) +@@ -84,6 +91,7 @@ + + String s1 = this.field_186844_a.func_146179_b().substring(this.field_186844_a.func_146197_a(-1, this.field_186844_a.func_146198_h(), false)); + String s2 = org.apache.commons.lang3.StringUtils.getCommonPrefix(p_186840_1_); ++ s2 = net.minecraft.util.text.TextFormatting.func_110646_a(s2); + + if (!s2.isEmpty() && !s1.equalsIgnoreCase(s2)) + { diff --git a/patches/minecraft/net/minecraft/util/Vec3.java.patch b/patches/minecraft/net/minecraft/util/Vec3.java.patch deleted file mode 100644 index 2cc1ac518..000000000 --- a/patches/minecraft/net/minecraft/util/Vec3.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/Vec3.java -+++ ../src-work/minecraft/net/minecraft/util/Vec3.java -@@ -1,8 +1,5 @@ - package net.minecraft.util; - --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; -- - public class Vec3 - { - public final double field_72450_a; -@@ -36,7 +33,6 @@ - this((double)p_i46377_1_.func_177958_n(), (double)p_i46377_1_.func_177956_o(), (double)p_i46377_1_.func_177952_p()); - } - -- @SideOnly(Side.CLIENT) - public Vec3 func_72444_a(Vec3 p_72444_1_) - { - return new Vec3(p_72444_1_.field_72450_a - this.field_72450_a, p_72444_1_.field_72448_b - this.field_72448_b, p_72444_1_.field_72449_c - this.field_72449_c); -@@ -53,7 +49,6 @@ - return this.field_72450_a * p_72430_1_.field_72450_a + this.field_72448_b * p_72430_1_.field_72448_b + this.field_72449_c * p_72430_1_.field_72449_c; - } - -- @SideOnly(Side.CLIENT) - public Vec3 func_72431_c(Vec3 p_72431_1_) - { - return new Vec3(this.field_72448_b * p_72431_1_.field_72449_c - this.field_72449_c * p_72431_1_.field_72448_b, this.field_72449_c * p_72431_1_.field_72450_a - this.field_72450_a * p_72431_1_.field_72449_c, this.field_72450_a * p_72431_1_.field_72448_b - this.field_72448_b * p_72431_1_.field_72450_a); -@@ -79,7 +74,6 @@ - return new Vec3(this.field_72450_a + p_72441_1_, this.field_72448_b + p_72441_3_, this.field_72449_c + p_72441_5_); - } - -- @SideOnly(Side.CLIENT) - public double func_72438_d(Vec3 p_72438_1_) - { - double d0 = p_72438_1_.field_72450_a - this.field_72450_a; diff --git a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch deleted file mode 100644 index b8f7e3aa4..000000000 --- a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/WeightedRandomChestContent.java -+++ ../src-work/minecraft/net/minecraft/util/WeightedRandomChestContent.java -@@ -36,48 +36,39 @@ - for (int i = 0; i < p_177630_3_; ++i) - { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76271_a(p_177630_0_, p_177630_1_); -- int j = weightedrandomchestcontent.field_76295_d + p_177630_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_177630_0_, p_177630_2_); - -- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= j) -+ for (ItemStack itemstack1 : stacks) - { -- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); -- itemstack1.field_77994_a = j; - p_177630_2_.func_70299_a(p_177630_0_.nextInt(p_177630_2_.func_70302_i_()), itemstack1); - } -- else -- { -- for (int k = 0; k < j; ++k) -- { -- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); -- itemstack.field_77994_a = 1; -- p_177630_2_.func_70299_a(p_177630_0_.nextInt(p_177630_2_.func_70302_i_()), itemstack); -- } -- } - } - } - -+ // -- Forge hooks -+ /** -+ * Allow a mod to submit a custom implementation that can delegate item stack generation beyond simple stack lookup -+ * -+ * @param random The current random for generation -+ * @param newInventory The inventory being generated (do not populate it, but you can refer to it) -+ * @return An array of {@link ItemStack} to put into the chest -+ */ -+ protected ItemStack[] generateChestContent(Random random, IInventory newInventory) -+ { -+ return net.minecraftforge.common.ChestGenHooks.generateStacks(random, field_76297_b, field_76295_d, field_76296_e); -+ } -+ - public static void func_177631_a(Random p_177631_0_, List p_177631_1_, TileEntityDispenser p_177631_2_, int p_177631_3_) - { - for (int i = 0; i < p_177631_3_; ++i) - { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76271_a(p_177631_0_, p_177631_1_); -- int j = weightedrandomchestcontent.field_76295_d + p_177631_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_177631_0_, p_177631_2_); - -- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= j) -+ for (ItemStack itemstack1 : stacks) - { -- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); -- itemstack1.field_77994_a = j; - p_177631_2_.func_70299_a(p_177631_0_.nextInt(p_177631_2_.func_70302_i_()), itemstack1); - } -- else -- { -- for (int k = 0; k < j; ++k) -- { -- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); -- itemstack.field_77994_a = 1; -- p_177631_2_.func_70299_a(p_177631_0_.nextInt(p_177631_2_.func_70302_i_()), itemstack); -- } -- } - } - } - diff --git a/patches/minecraft/net/minecraft/util/BlockPos.java.patch b/patches/minecraft/net/minecraft/util/math/BlockPos.java.patch similarity index 55% rename from patches/minecraft/net/minecraft/util/BlockPos.java.patch rename to patches/minecraft/net/minecraft/util/math/BlockPos.java.patch index bb5ccf3d6..70319c078 100644 --- a/patches/minecraft/net/minecraft/util/BlockPos.java.patch +++ b/patches/minecraft/net/minecraft/util/math/BlockPos.java.patch @@ -1,6 +1,6 @@ ---- ../src-base/minecraft/net/minecraft/util/BlockPos.java -+++ ../src-work/minecraft/net/minecraft/util/BlockPos.java -@@ -257,6 +257,21 @@ +--- ../src-base/minecraft/net/minecraft/util/math/BlockPos.java ++++ ../src-work/minecraft/net/minecraft/util/math/BlockPos.java +@@ -270,6 +270,21 @@ }; } @@ -22,9 +22,18 @@ public static final class MutableBlockPos extends BlockPos { private int field_177997_b; -@@ -298,5 +313,7 @@ - this.field_177996_d = p_181079_3_; - return this; +@@ -333,6 +348,8 @@ + { + return new BlockPos(this); + } ++ ++ @Override public BlockPos getImmutable() { return new BlockPos(this); } + } + + public static final class PooledMutableBlockPos extends BlockPos +@@ -443,5 +460,7 @@ + { + return this.func_185343_d(this.field_185347_c + p_185341_1_.func_82601_c(), this.field_185348_d + p_185341_1_.func_96559_d(), this.field_185349_e + p_185341_1_.func_82599_e()); } + + @Override public BlockPos getImmutable() { return new BlockPos(this); } diff --git a/patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch b/patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch new file mode 100644 index 000000000..907251546 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/util/math/RayTraceResult.java ++++ ../src-work/minecraft/net/minecraft/util/math/RayTraceResult.java +@@ -5,6 +5,12 @@ + + public class RayTraceResult + { ++ /** Used to determine what sub-segment is hit */ ++ public int subHit = -1; ++ ++ /** Used to add extra hit info */ ++ public Object hitInfo = null; ++ + private BlockPos field_178783_e; + public RayTraceResult.Type field_72313_a; + public EnumFacing field_178784_b; diff --git a/patches/minecraft/net/minecraft/util/math/Vec3d.java.patch b/patches/minecraft/net/minecraft/util/math/Vec3d.java.patch new file mode 100644 index 000000000..662335a59 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/math/Vec3d.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/util/math/Vec3d.java ++++ ../src-work/minecraft/net/minecraft/util/math/Vec3d.java +@@ -1,8 +1,5 @@ + package net.minecraft.util.math; + +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; +- + public class Vec3d + { + public static final Vec3d field_186680_a = new Vec3d(0.0D, 0.0D, 0.0D); +@@ -53,7 +50,6 @@ + return this.field_72450_a * p_72430_1_.field_72450_a + this.field_72448_b * p_72430_1_.field_72448_b + this.field_72449_c * p_72430_1_.field_72449_c; + } + +- @SideOnly(Side.CLIENT) + public Vec3d func_72431_c(Vec3d p_72431_1_) + { + return new Vec3d(this.field_72448_b * p_72431_1_.field_72449_c - this.field_72449_c * p_72431_1_.field_72448_b, this.field_72449_c * p_72431_1_.field_72450_a - this.field_72450_a * p_72431_1_.field_72449_c, this.field_72450_a * p_72431_1_.field_72448_b - this.field_72448_b * p_72431_1_.field_72450_a); diff --git a/patches/minecraft/net/minecraft/util/registry/RegistryNamespacedDefaultedByKey.java.patch b/patches/minecraft/net/minecraft/util/registry/RegistryNamespacedDefaultedByKey.java.patch new file mode 100644 index 000000000..ae4a01c84 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/registry/RegistryNamespacedDefaultedByKey.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/util/registry/RegistryNamespacedDefaultedByKey.java ++++ ../src-work/minecraft/net/minecraft/util/registry/RegistryNamespacedDefaultedByKey.java +@@ -57,4 +57,11 @@ + V v = super.func_186801_a(p_186801_1_); + return (V)(v == null ? this.field_148761_e : v); + } ++ ++ //Bypass functions to allow querying this registry WITHOUT getting the defaulted value. ++ // MODDERS DO NOT USE THIS IS FOR FORGE INTERNAL CHECKS ++ public int getIDForObjectBypass(V bypass) { return super.func_148757_b(bypass); } ++ public K getNameForObjectBypass(V value) { return super.func_177774_c(value); } ++ public V getObjectBypass(K name) { return super.func_82594_a(name); } ++ public V getObjectByIdBypass(int id){ return super.func_148754_a(id); } + } diff --git a/patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch b/patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch new file mode 100644 index 000000000..d7c43cfc4 --- /dev/null +++ b/patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/text/ITextComponent.java ++++ ../src-work/minecraft/net/minecraft/util/text/ITextComponent.java +@@ -33,7 +33,6 @@ + + String func_150260_c(); + +- @SideOnly(Side.CLIENT) + String func_150254_d(); + + List func_150253_a(); diff --git a/patches/minecraft/net/minecraft/util/ChatStyle.java.patch b/patches/minecraft/net/minecraft/util/text/Style.java.patch similarity index 56% rename from patches/minecraft/net/minecraft/util/ChatStyle.java.patch rename to patches/minecraft/net/minecraft/util/text/Style.java.patch index 55efa51da..93a20c90a 100644 --- a/patches/minecraft/net/minecraft/util/ChatStyle.java.patch +++ b/patches/minecraft/net/minecraft/util/text/Style.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/util/ChatStyle.java -+++ ../src-work/minecraft/net/minecraft/util/ChatStyle.java +--- ../src-base/minecraft/net/minecraft/util/text/Style.java ++++ ../src-work/minecraft/net/minecraft/util/text/Style.java @@ -229,7 +229,6 @@ return this; } diff --git a/patches/minecraft/net/minecraft/util/ChatComponentStyle.java.patch b/patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch similarity index 58% rename from patches/minecraft/net/minecraft/util/ChatComponentStyle.java.patch rename to patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch index fd4f0534d..4307987cc 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentStyle.java.patch +++ b/patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/util/ChatComponentStyle.java -+++ ../src-work/minecraft/net/minecraft/util/ChatComponentStyle.java +--- ../src-base/minecraft/net/minecraft/util/text/TextComponentBase.java ++++ ../src-work/minecraft/net/minecraft/util/text/TextComponentBase.java @@ -74,7 +74,6 @@ return stringbuilder.toString(); } diff --git a/patches/minecraft/net/minecraft/util/StringTranslate.java.patch b/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch similarity index 58% rename from patches/minecraft/net/minecraft/util/StringTranslate.java.patch rename to patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch index be6f42827..b6e9a122f 100644 --- a/patches/minecraft/net/minecraft/util/StringTranslate.java.patch +++ b/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch @@ -1,10 +1,10 @@ ---- ../src-base/minecraft/net/minecraft/util/StringTranslate.java -+++ ../src-work/minecraft/net/minecraft/util/StringTranslate.java +--- ../src-base/minecraft/net/minecraft/util/text/translation/LanguageMap.java ++++ ../src-work/minecraft/net/minecraft/util/text/translation/LanguageMap.java @@ -23,9 +23,29 @@ - public StringTranslate() + public LanguageMap() { -+ InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); ++ InputStream inputstream = LanguageMap.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + inject(this, inputstream); + } + @@ -13,25 +13,25 @@ + inject(field_74817_a, inputstream); + } + -+ private static void inject(StringTranslate inst, InputStream inputstream) ++ private static void inject(LanguageMap inst, InputStream inputstream) + { -+ java.util.HashMap map = parseLangFile(inputstream); ++ Map map = parseLangFile(inputstream); + inst.field_74816_c.putAll(map); + inst.field_150511_e = System.currentTimeMillis(); + } + -+ public static java.util.HashMap parseLangFile(InputStream inputstream) ++ public static Map parseLangFile(InputStream inputstream) + { -+ java.util.HashMap table = Maps.newHashMap(); ++ Map table = Maps.newHashMap(); try { -- InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); +- InputStream inputstream = LanguageMap.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + inputstream = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(table, inputstream); + if (inputstream == null) return table; for (String s : IOUtils.readLines(inputstream, Charsets.UTF_8)) { -@@ -37,17 +57,17 @@ +@@ -37,17 +57,18 @@ { String s1 = astring[0]; String s2 = field_111053_a.matcher(astring[1]).replaceAll("%$1s"); @@ -43,12 +43,12 @@ - this.field_150511_e = System.currentTimeMillis(); } -- catch (IOException var7) -+ catch (Exception var7) + catch (IOException var7) { ; } ++ catch (Exception ex) {} + return table; } - static StringTranslate func_74808_a() + static LanguageMap func_74808_a() diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch index 4bb2bf0d9..7c9098481 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -18,16 +18,17 @@ return this.field_72817_c[i][j].func_177413_a(p_175629_1_, p_175629_2_); } } -@@ -150,7 +154,7 @@ +@@ -150,7 +154,8 @@ public boolean func_175623_d(BlockPos p_175623_1_) { -- return this.func_180495_p(p_175623_1_).func_177230_c().func_149688_o() == Material.field_151579_a; -+ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this, p_175623_1_); +- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a; ++ IBlockState state = this.func_180495_p(p_175623_1_); ++ return state.func_177230_c().isAir(state, this, p_175623_1_); } @SideOnly(Side.CLIENT) -@@ -160,6 +164,7 @@ +@@ -160,6 +165,7 @@ { int i = (p_175628_2_.func_177958_n() >> 4) - this.field_72818_a; int j = (p_175628_2_.func_177952_p() >> 4) - this.field_72816_b; @@ -35,7 +36,7 @@ return this.field_72817_c[i][j].func_177413_a(p_175628_1_, p_175628_2_); } else -@@ -179,4 +184,16 @@ +@@ -178,4 +184,17 @@ { return this.field_72815_e.func_175624_G(); } @@ -49,6 +50,7 @@ + if (x < 0 || x >= field_72817_c.length || z < 0 || z >= field_72817_c[x].length) return _default; + if (field_72817_c[x][z] == null) return _default; + -+ return func_180495_p(pos).func_177230_c().isSideSolid(this, pos, side); ++ IBlockState state = func_180495_p(pos); ++ return state.func_177230_c().isSideSolid(state, this, pos, side); + } } diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index a7cbd02cf..73813f369 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,39 +1,39 @@ --- ../src-base/minecraft/net/minecraft/world/Explosion.java +++ ../src-work/minecraft/net/minecraft/world/Explosion.java -@@ -38,6 +38,7 @@ +@@ -40,6 +40,7 @@ private final float field_77280_f; private final List field_77281_g; - private final Map field_77288_k; -+ private final Vec3 position; + private final Map field_77288_k; ++ private final Vec3d position; @SideOnly(Side.CLIENT) public Explosion(World p_i45752_1_, Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) -@@ -65,6 +66,7 @@ +@@ -67,6 +68,7 @@ this.field_77282_d = p_i45754_7_; this.field_77286_a = p_i45754_10_; this.field_82755_b = p_i45754_11_; -+ this.position = new Vec3(field_77284_b, field_77285_c, field_77282_d); ++ this.position = new Vec3d(field_77284_b, field_77285_c, field_77282_d); } public void func_77278_a() -@@ -99,7 +101,7 @@ +@@ -101,7 +103,7 @@ - if (iblockstate.func_177230_c().func_149688_o() != Material.field_151579_a) + if (iblockstate.func_185904_a() != Material.field_151579_a) { - float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().func_149638_a((Entity)null); + float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().getExplosionResistance(field_77287_j, blockpos, (Entity)null, this); f -= (f2 + 0.3F) * 0.3F; } -@@ -126,6 +128,7 @@ +@@ -128,6 +130,7 @@ int j2 = MathHelper.func_76128_c(this.field_77282_d - (double)f3 - 1.0D); int j1 = MathHelper.func_76128_c(this.field_77282_d + (double)f3 + 1.0D); List list = this.field_77287_j.func_72839_b(this.field_77283_e, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); + net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.field_77287_j, this, list, f3); - Vec3 vec3 = new Vec3(this.field_77284_b, this.field_77285_c, this.field_77282_d); + Vec3d vec3d = new Vec3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); for (int k2 = 0; k2 < list.size(); ++k2) -@@ -213,8 +216,7 @@ +@@ -227,8 +230,7 @@ block.func_180653_a(this.field_77287_j, blockpos, this.field_77287_j.func_180495_p(blockpos), 1.0F / this.field_77280_f, 0); } @@ -43,10 +43,10 @@ } } } -@@ -250,4 +252,6 @@ +@@ -264,4 +266,6 @@ { return this.field_77281_g; } + -+ public Vec3 getPosition(){ return this.position; } ++ public Vec3d getPosition(){ return this.position; } } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index f27243c08..9164dab33 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/World.java +++ ../src-work/minecraft/net/minecraft/world/World.java -@@ -57,6 +57,13 @@ +@@ -60,6 +60,13 @@ public abstract class World implements IBlockAccess { @@ -14,7 +14,7 @@ private int field_181546_a = 63; protected boolean field_72999_e; public final List field_72996_f = Lists.newArrayList(); -@@ -98,6 +105,10 @@ +@@ -101,6 +108,10 @@ private final WorldBorder field_175728_M; int[] field_72994_J; @@ -24,8 +24,8 @@ + protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) { - this.field_72990_M = this.field_73012_v.nextInt(12000); -@@ -110,6 +121,7 @@ + this.field_73021_x = Lists.newArrayList(new IWorldEventListener[] {this.field_184152_t}); +@@ -115,6 +126,7 @@ this.field_73011_w = p_i45749_3_; this.field_72995_K = p_i45749_5_; this.field_175728_M = p_i45749_3_.func_177501_r(); @@ -33,7 +33,7 @@ } public World func_175643_b() -@@ -119,13 +131,18 @@ +@@ -124,13 +136,18 @@ public BiomeGenBase func_180494_b(final BlockPos p_180494_1_) { @@ -55,7 +55,7 @@ } catch (Throwable throwable) { -@@ -135,7 +152,7 @@ +@@ -140,7 +157,7 @@ { public String call() throws Exception { @@ -64,25 +64,25 @@ } }); throw new ReportedException(crashreport); -@@ -143,7 +160,7 @@ +@@ -148,7 +165,7 @@ } else { -- return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, BiomeGenBase.field_76772_c); -+ return this.field_73011_w.func_177499_m().func_180300_a(pos, BiomeGenBase.field_76772_c); +- return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, Biomes.field_76772_c); ++ return this.field_73011_w.func_177499_m().func_180300_a(pos, Biomes.field_76772_c); } } -@@ -184,7 +201,7 @@ +@@ -194,7 +211,7 @@ public boolean func_175623_d(BlockPos p_175623_1_) { -- return this.func_180495_p(p_175623_1_).func_177230_c().func_149688_o() == Material.field_151579_a; -+ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this, p_175623_1_); +- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a; ++ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this.func_180495_p(p_175623_1_), this, p_175623_1_); } public boolean func_175667_e(BlockPos p_175667_1_) -@@ -284,39 +301,63 @@ +@@ -291,37 +308,61 @@ { Chunk chunk = this.func_175726_f(p_180501_1_); Block block = p_180501_2_.func_177230_c(); @@ -93,9 +93,9 @@ + blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, p_180501_1_, p_180501_3_); + this.capturedBlockSnapshots.add(blockSnapshot); + } -+ Block oldBlock = func_180495_p(p_180501_1_).func_177230_c(); -+ int oldLight = oldBlock.getLightValue(this, p_180501_1_); -+ int oldOpacity = oldBlock.getLightOpacity(this, p_180501_1_); ++ IBlockState oldState = func_180495_p(p_180501_1_); ++ int oldLight = oldState.getLightValue(this, p_180501_1_); ++ int oldOpacity = oldState.getLightOpacity(this, p_180501_1_); + IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_); @@ -106,10 +106,8 @@ } else { - Block block1 = iblockstate.func_177230_c(); - -- if (block.func_149717_k() != block1.func_149717_k() || block.func_149750_m() != block1.func_149750_m()) -+ if (block.getLightOpacity(this, p_180501_1_) != oldOpacity || block.getLightValue(this, p_180501_1_) != oldLight) +- if (p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) ++ if (p_180501_2_.getLightOpacity(this, p_180501_1_) != oldOpacity || p_180501_2_.getLightValue(this, p_180501_1_) != oldLight) { this.field_72984_F.func_76320_a("checkLight"); this.func_175664_x(p_180501_1_); @@ -119,35 +117,35 @@ - if ((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) + if (blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates { -- this.func_175689_h(p_180501_1_); -+ this.markAndNotifyBlock(p_180501_1_, chunk, iblockstate, p_180501_2_, p_180501_3_); // Modularize client and physic updates +- this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_); ++ this.markAndNotifyBlock(p_180501_1_, chunk, iblockstate, p_180501_2_, p_180501_3_); } - -- if (!this.field_72995_K && (p_180501_3_ & 1) != 0) + return true; + } + } + } -+ -+ // Split off from original setBlockState(BlockPos, IBlockState Block p_147465_4_, int) method in order to directly send client and physic updates -+ public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState old, IBlockState new_, int flags) + +- if (!this.field_72995_K && (p_180501_3_ & 1) != 0) ++ // Split off from original setBlockState(BlockPos, IBlockState, int) method in order to directly send client and physic updates ++ public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState iblockstate, IBlockState newState, int flags) + { -+ if ((flags & 2) != 0 && (!this.field_72995_K || (flags & 4) == 0) && (chunk == null || chunk.func_150802_k())) -+ { -+ this.func_175689_h(pos); -+ } + { + { -+ if (!this.field_72995_K && (flags & 1) != 0) ++ if ((flags & 2) != 0 && (!this.field_72995_K || (flags & 4) == 0) && (chunk == null || chunk.func_150802_k())) { - this.func_175722_b(p_180501_1_, iblockstate.func_177230_c()); -+ this.func_175722_b(pos, new_.func_177230_c()); ++ this.func_184138_a(pos, iblockstate, newState, flags); ++ } -- if (block.func_149740_M()) -+ if (new_.func_177230_c().func_149740_M()) +- if (p_180501_2_.func_185912_n()) ++ if (!this.field_72995_K && (flags & 1) != 0) ++ { ++ this.func_175722_b(pos, iblockstate.func_177230_c()); ++ ++ if (newState.func_185912_n()) { - this.func_175666_e(p_180501_1_, block); -+ this.func_175666_e(pos, new_.func_177230_c()); ++ this.func_175666_e(pos, newState.func_177230_c()); } } - @@ -155,7 +153,16 @@ } } } -@@ -404,6 +445,9 @@ +@@ -336,7 +377,7 @@ + IBlockState iblockstate = this.func_180495_p(p_175655_1_); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (block.isAir(iblockstate, this, p_175655_1_)) + { + return false; + } +@@ -409,6 +450,9 @@ public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_) { @@ -165,7 +172,7 @@ this.func_180496_d(p_175685_1_.func_177976_e(), p_175685_2_); this.func_180496_d(p_175685_1_.func_177974_f(), p_175685_2_); this.func_180496_d(p_175685_1_.func_177977_b(), p_175685_2_); -@@ -414,6 +458,11 @@ +@@ -419,6 +463,11 @@ public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) { @@ -177,7 +184,16 @@ if (p_175695_3_ != EnumFacing.WEST) { this.func_180496_d(p_175695_1_.func_177976_e(), p_175695_2_); -@@ -777,7 +826,7 @@ +@@ -514,7 +563,7 @@ + { + IBlockState iblockstate = this.func_180495_p(blockpos); + +- if (iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) ++ if (iblockstate.func_177230_c().getLightOpacity(iblockstate, this, blockpos) > 0 && !iblockstate.func_185904_a().func_76224_d()) + { + return false; + } +@@ -782,7 +831,7 @@ public boolean func_72935_r() { @@ -185,34 +201,22 @@ + return this.field_73011_w.isDaytime(); } - public MovingObjectPosition func_72933_a(Vec3 p_72933_1_, Vec3 p_72933_2_) -@@ -972,6 +1021,12 @@ + public RayTraceResult func_72933_a(Vec3d p_72933_1_, Vec3d p_72933_2_) +@@ -982,6 +1031,13 @@ - public void func_72956_a(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) + public void func_184148_a(EntityPlayer p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_72956_1_, p_72956_2_, p_72956_3_, p_72956_4_); -+ if (event.isCanceled() || event.name == null) return; -+ p_72956_2_ = event.name; -+ p_72956_3_ = event.newVolume; -+ p_72956_4_ = event.newPitch; ++ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_); ++ if (event.isCanceled() || event.getSound() == null) return; ++ p_184148_8_ = event.getSound(); ++ p_184148_9_ = event.getCategory(); ++ p_184148_10_ = event.getVolume(); ++ p_184148_11_ = event.getPitch(); + for (int i = 0; i < this.field_73021_x.size(); ++i) { - ((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, p_72956_1_.field_70161_v, p_72956_3_, p_72956_4_); -@@ -980,6 +1035,12 @@ - - public void func_85173_a(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) - { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_85173_1_, p_85173_2_, p_85173_3_, p_85173_4_); -+ if (event.isCanceled() || event.name == null) return; -+ p_85173_2_ = event.name; -+ p_85173_3_ = event.newVolume; -+ p_85173_4_ = event.newPitch; -+ - for (int i = 0; i < this.field_73021_x.size(); ++i) - { - ((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, p_85173_1_.field_70161_v, p_85173_3_, p_85173_4_); -@@ -1033,6 +1094,9 @@ + ((IWorldEventListener)this.field_73021_x.get(i)).func_184375_a(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_2_, p_184148_4_, p_184148_6_, p_184148_10_, p_184148_11_); +@@ -1027,6 +1083,9 @@ public boolean func_72838_d(Entity p_72838_1_) { @@ -222,7 +226,7 @@ int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D); int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D); boolean flag = p_72838_1_.field_98038_p; -@@ -1055,6 +1119,8 @@ +@@ -1049,6 +1108,8 @@ this.func_72854_c(); } @@ -231,7 +235,15 @@ this.func_72964_e(i, j).func_76612_a(p_72838_1_); this.field_72996_f.add(p_72838_1_); this.func_72923_a(p_72838_1_); -@@ -1267,17 +1333,29 @@ +@@ -1285,7 +1346,6 @@ + return list; + } + +- @SideOnly(Side.CLIENT) + public void func_72848_b(IWorldEventListener p_72848_1_) + { + this.field_73021_x.remove(p_72848_1_); +@@ -1348,19 +1408,38 @@ public int func_72967_a(float p_72967_1_) { @@ -250,7 +262,7 @@ + public float getSunBrightnessFactor(float p_72967_1_) + { float f = this.func_72826_c(p_72967_1_); - float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F); f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); f1 = 1.0F - f1; f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D)); @@ -260,11 +272,6 @@ + return f1; } -- @SideOnly(Side.CLIENT) - public void func_72848_b(IWorldAccess p_72848_1_) - { - this.field_73021_x.remove(p_72848_1_); -@@ -1286,6 +1364,12 @@ @SideOnly(Side.CLIENT) public float func_72971_b(float p_72971_1_) { @@ -275,24 +282,28 @@ + public float getSunBrightnessBody(float p_72971_1_) + { float f = this.func_72826_c(p_72971_1_); - float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.2F); f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); -@@ -1298,6 +1382,12 @@ +@@ -1373,23 +1452,27 @@ @SideOnly(Side.CLIENT) - public Vec3 func_72833_a(Entity p_72833_1_, float p_72833_2_) + public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) { +- float f = this.func_72826_c(p_72833_2_); + return this.field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); + } + + @SideOnly(Side.CLIENT) -+ public Vec3 getSkyColorBody(Entity p_72833_1_, float p_72833_2_) ++ public Vec3d getSkyColorBody(Entity entityIn, float partialTicks) + { - float f = this.func_72826_c(p_72833_2_); - float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; ++ float f = this.func_72826_c(partialTicks); + float f1 = MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); -@@ -1305,9 +1395,7 @@ - int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); - int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); +- 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); ++ int i = MathHelper.func_76128_c(entityIn.field_70165_t); ++ int j = MathHelper.func_76128_c(entityIn.field_70163_u); ++ int k = MathHelper.func_76128_c(entityIn.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); - BiomeGenBase biomegenbase = this.func_180494_b(blockpos); - float f2 = biomegenbase.func_180626_a(blockpos); @@ -301,7 +312,33 @@ float f3 = (float)(l >> 16 & 255) / 255.0F; float f4 = (float)(l >> 8 & 255) / 255.0F; float f5 = (float)(l & 255) / 255.0F; -@@ -1367,6 +1455,11 @@ + f3 = f3 * f1; + f4 = f4 * f1; + f5 = f5 * f1; +- float f6 = this.func_72867_j(p_72833_2_); ++ float f6 = this.func_72867_j(partialTicks); + + if (f6 > 0.0F) + { +@@ -1400,7 +1483,7 @@ + f5 = f5 * f8 + f7 * (1.0F - f8); + } + +- float f10 = this.func_72819_i(p_72833_2_); ++ float f10 = this.func_72819_i(partialTicks); + + if (f10 > 0.0F) + { +@@ -1413,7 +1496,7 @@ + + if (this.field_73016_r > 0) + { +- float f12 = (float)this.field_73016_r - p_72833_2_; ++ float f12 = (float)this.field_73016_r - partialTicks; + + if (f12 > 1.0F) + { +@@ -1442,6 +1525,11 @@ public float func_130001_d() { @@ -313,32 +350,50 @@ return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())]; } -@@ -1379,6 +1472,12 @@ +@@ -1454,13 +1542,19 @@ @SideOnly(Side.CLIENT) - public Vec3 func_72824_f(float p_72824_1_) + public Vec3d func_72824_f(float p_72824_1_) { -+ return this.field_73011_w.drawClouds(p_72824_1_); +- float f = this.func_72826_c(p_72824_1_); ++ return this.field_73011_w.getCloudColor(p_72824_1_); + } + + @SideOnly(Side.CLIENT) -+ public Vec3 drawCloudsBody(float p_72824_1_) ++ public Vec3d getCloudColorBody(float partialTicks) + { - float f = this.func_72826_c(p_72824_1_); - float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; ++ float f = this.func_72826_c(partialTicks); + float f1 = MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); -@@ -1434,9 +1533,9 @@ + float f2 = (float)(this.field_73001_c >> 16 & 255L) / 255.0F; + float f3 = (float)(this.field_73001_c >> 8 & 255L) / 255.0F; + float f4 = (float)(this.field_73001_c & 255L) / 255.0F; +- float f5 = this.func_72867_j(p_72824_1_); ++ float f5 = this.func_72867_j(partialTicks); + + if (f5 > 0.0F) + { +@@ -1474,7 +1568,7 @@ + f2 = f2 * (f1 * 0.9F + 0.1F); + f3 = f3 * (f1 * 0.9F + 0.1F); + f4 = f4 * (f1 * 0.85F + 0.15F); +- float f9 = this.func_72819_i(p_72824_1_); ++ float f9 = this.func_72819_i(partialTicks); + + if (f9 > 0.0F) + { +@@ -1509,9 +1603,9 @@ for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) { blockpos1 = blockpos.func_177977_b(); -- Material material = chunk.func_177428_a(blockpos1).func_149688_o(); -+ Block block = chunk.func_177428_a(blockpos1); +- Material material = chunk.func_177435_g(blockpos1).func_185904_a(); ++ IBlockState state = chunk.func_177435_g(blockpos1); - if (material.func_76230_c() && material != Material.field_151584_j) -+ if (block.func_149688_o().func_76230_c() && !block.isLeaves(this, blockpos1) && !block.isFoliage(this, blockpos1)) ++ if (state.func_185904_a().func_76230_c() && !state.func_177230_c().isLeaves(state, this, blockpos1) && !state.func_177230_c().isFoliage(this, blockpos1)) { break; } -@@ -1448,6 +1547,12 @@ +@@ -1523,6 +1617,12 @@ @SideOnly(Side.CLIENT) public float func_72880_h(float p_72880_1_) { @@ -349,47 +404,38 @@ + public float getStarBrightnessBody(float p_72880_1_) + { float f = this.func_72826_c(p_72880_1_); - float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.25F); f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); -@@ -1494,7 +1599,15 @@ +@@ -1574,6 +1674,12 @@ entity.func_85029_a(crashreportcategory); } -- throw new ReportedException(crashreport); + if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) + { + net.minecraftforge.fml.common.FMLLog.severe(crashreport.func_71502_e()); + func_72900_e(entity); + } + else -+ { -+ throw new ReportedException(crashreport); -+ } + throw new ReportedException(crashreport); } - if (entity.field_70128_L) -@@ -1554,7 +1667,15 @@ +@@ -1635,6 +1741,12 @@ CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity"); - CrashReportCategory crashreportcategory2 = crashreport1.func_85058_a("Entity being ticked"); - entity2.func_85029_a(crashreportcategory2); -- throw new ReportedException(crashreport1); + CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked"); + entity2.func_85029_a(crashreportcategory1); + if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) + { + net.minecraftforge.fml.common.FMLLog.severe(crashreport1.func_71502_e()); + func_72900_e(entity2); + } + else -+ { -+ throw new ReportedException(crashreport1); -+ } + throw new ReportedException(crashreport1); } } - -@@ -1601,7 +1722,16 @@ +@@ -1684,6 +1796,13 @@ CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity"); - CrashReportCategory crashreportcategory1 = crashreport2.func_85058_a("Block entity being ticked"); - tileentity.func_145828_a(crashreportcategory1); -- throw new ReportedException(crashreport2); + CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked"); + tileentity.func_145828_a(crashreportcategory2); + if (net.minecraftforge.common.ForgeModContainer.removeErroringTileEntities) + { + net.minecraftforge.fml.common.FMLLog.severe(crashreport2.func_71502_e()); @@ -397,13 +443,10 @@ + this.func_175713_t(tileentity.func_174877_v()); + } + else -+ { -+ throw new ReportedException(crashreport2); -+ } + throw new ReportedException(crashreport2); } } - } -@@ -1618,15 +1748,20 @@ +@@ -1701,15 +1820,20 @@ } } @@ -426,7 +469,7 @@ this.field_72984_F.func_76318_c("pendingBlockEntities"); if (!this.field_147484_a.isEmpty()) -@@ -1660,7 +1795,8 @@ +@@ -1748,7 +1872,8 @@ public boolean func_175700_a(TileEntity p_175700_1_) { @@ -436,7 +479,7 @@ if (flag && p_175700_1_ instanceof ITickable) { -@@ -1699,9 +1835,13 @@ +@@ -1782,9 +1907,13 @@ { int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t); int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v); @@ -452,17 +495,17 @@ { p_72866_1_.field_70142_S = p_72866_1_.field_70165_t; p_72866_1_.field_70137_T = p_72866_1_.field_70163_u; -@@ -1829,7 +1969,7 @@ +@@ -1913,7 +2042,7 @@ { - Block block = this.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c(); + IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_185343_d(k1, l1, i2)); -- if (block.func_149688_o() != Material.field_151579_a) -+ if (!block.isAir(this, new BlockPos(k1, l1, i2))) +- if (iblockstate.func_185904_a() != Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this, new BlockPos(k1, l1, i2))) { + blockpos$pooledmutableblockpos.func_185344_t(); return true; - } -@@ -1894,6 +2034,10 @@ - { +@@ -1983,6 +2112,10 @@ + blockpos$pooledmutableblockpos.func_185344_t(); return true; } + else if (block.isBurning(this, new BlockPos(k1, l1, i2))) @@ -472,34 +515,34 @@ } } } -@@ -1930,6 +2074,16 @@ - blockpos$mutableblockpos.func_181079_c(k1, l1, i2); - IBlockState iblockstate = this.func_180495_p(blockpos$mutableblockpos); +@@ -2022,6 +2155,16 @@ + IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos); Block block = iblockstate.func_177230_c(); -+ -+ Boolean result = block.isEntityInsideMaterial(this, blockpos$mutableblockpos, iblockstate, p_72918_3_, (double)l, p_72918_2_, false); + ++ Boolean result = block.isEntityInsideMaterial(this, blockpos$pooledmutableblockpos, iblockstate, p_72918_3_, (double)l, p_72918_2_, false); + if (result != null && result == true) + { + // Forge: When requested call blocks modifyAcceleration method, and more importantly cause this method to return true, which results in an entity being "inWater" + flag = true; -+ vec3 = block.func_176197_a(this, blockpos$mutableblockpos, p_72918_3_, vec3); ++ vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d); + continue; + } + else if (result != null && result == false) continue; - - if (block.func_149688_o() == p_72918_2_) ++ + if (iblockstate.func_185904_a() == p_72918_2_) { -@@ -2004,6 +2158,9 @@ - IBlockState iblockstate = this.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)); - Block block = iblockstate.func_177230_c(); + double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue())); +@@ -2098,6 +2241,9 @@ + { + IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_185343_d(k1, l1, i2)); -+ Boolean result = block.isAABBInsideMaterial(this, blockpos$mutableblockpos, p_72830_1_, p_72830_2_); ++ Boolean result = iblockstate.func_177230_c().isAABBInsideMaterial(this, blockpos$pooledmutableblockpos, p_72830_1_, p_72830_2_); + if (result != null) return result; + - if (block.func_149688_o() == p_72830_2_) + if (iblockstate.func_185904_a() == p_72830_2_) { int j2 = ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue(); -@@ -2034,6 +2191,7 @@ +@@ -2130,6 +2276,7 @@ public Explosion func_72885_a(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); @@ -507,7 +550,7 @@ explosion.func_77278_a(); explosion.func_77279_a(true); return explosion; -@@ -2180,19 +2338,27 @@ +@@ -2276,19 +2423,27 @@ else { this.func_175700_a(p_175690_2_); @@ -536,7 +579,7 @@ } else { -@@ -2205,6 +2371,7 @@ +@@ -2301,6 +2456,7 @@ this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_); } @@ -544,25 +587,16 @@ } public void func_147457_a(TileEntity p_147457_1_) -@@ -2223,7 +2390,7 @@ - { - IBlockState iblockstate = p_175683_0_.func_180495_p(p_175683_1_); - Block block = iblockstate.func_177230_c(); -- return block.func_149688_o().func_76218_k() && block.func_149686_d() ? true : (block instanceof BlockStairs ? iblockstate.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab ? iblockstate.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? ((Integer)iblockstate.func_177229_b(BlockSnow.field_176315_a)).intValue() == 7 : false)))); -+ return block.isSideSolid(p_175683_0_, p_175683_1_, EnumFacing.UP); - } - - public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) -@@ -2243,7 +2410,7 @@ +@@ -2327,7 +2483,7 @@ + if (chunk != null && !chunk.func_76621_g()) + { + IBlockState iblockstate = this.func_180495_p(p_175677_1_); +- return iblockstate.func_185904_a().func_76218_k() && iblockstate.func_185917_h(); ++ return iblockstate.func_177230_c().isNormalCube(iblockstate, this, p_175677_1_); + } else { - Block block = this.func_180495_p(p_175677_1_).func_177230_c(); -- return block.func_149688_o().func_76218_k() && block.func_149686_d(); -+ return block.isNormalCube(this, p_175677_1_); - } - } - } -@@ -2262,6 +2429,7 @@ +@@ -2350,6 +2506,7 @@ { this.field_72985_G = p_72891_1_; this.field_72992_H = p_72891_2_; @@ -570,7 +604,7 @@ } public void func_72835_b() -@@ -2271,6 +2439,11 @@ +@@ -2359,6 +2516,11 @@ protected void func_72947_a() { @@ -582,7 +616,7 @@ if (this.field_72986_A.func_76059_o()) { this.field_73004_o = 1.0F; -@@ -2284,6 +2457,11 @@ +@@ -2372,6 +2534,11 @@ protected void func_72979_l() { @@ -594,74 +628,107 @@ if (!this.field_73011_w.func_177495_o()) { if (!this.field_72995_K) -@@ -2378,6 +2556,7 @@ - { - this.field_72993_I.clear(); - this.field_72984_F.func_76320_a("buildList"); -+ this.field_72993_I.addAll(getPersistentChunks().keySet()); - - for (int i = 0; i < this.field_73010_i.size(); ++i) - { -@@ -2434,8 +2613,9 @@ - Block block = p_147467_3_.func_177428_a(blockpos); - j = j + p_147467_1_; - k = k + p_147467_2_; -+ BlockPos worldpos = blockpos.func_177982_a(p_147467_1_, 0, p_147467_2_); - -- if (block.func_149688_o() == Material.field_151579_a && this.func_175699_k(blockpos) <= this.field_73012_v.nextInt(8) && this.func_175642_b(EnumSkyBlock.SKY, blockpos) <= 0) -+ if (block.isAir(this, worldpos) && this.func_175699_k(worldpos) <= this.field_73012_v.nextInt(8) && this.func_175642_b(EnumSkyBlock.SKY, worldpos) <= 0) //Forge: isAir, and fix arguments to world positions instead of chunk position - { - EntityPlayer entityplayer = this.func_72977_a((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); - -@@ -2475,6 +2655,11 @@ +@@ -2491,28 +2658,33 @@ public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) { +- BiomeGenBase biomegenbase = this.func_180494_b(p_175670_1_); +- float f = biomegenbase.func_180626_a(p_175670_1_); + return this.field_73011_w.canBlockFreeze(p_175670_1_, p_175670_2_); + } -+ -+ public boolean canBlockFreezeBody(BlockPos p_175670_1_, boolean p_175670_2_) -+ { - BiomeGenBase biomegenbase = this.func_180494_b(p_175670_1_); - float f = biomegenbase.func_180626_a(p_175670_1_); -@@ -2516,6 +2701,11 @@ ++ public boolean canBlockFreezeBody(BlockPos pos, boolean noWaterAdj) ++ { ++ BiomeGenBase biomegenbase = this.func_180494_b(pos); ++ float f = biomegenbase.func_180626_a(pos); ++ + if (f > 0.15F) + { + return false; + } + else + { +- if (p_175670_1_.func_177956_o() >= 0 && p_175670_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175670_1_) < 10) ++ if (pos.func_177956_o() >= 0 && pos.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, pos) < 10) + { +- IBlockState iblockstate = this.func_180495_p(p_175670_1_); ++ IBlockState iblockstate = this.func_180495_p(pos); + Block block = iblockstate.func_177230_c(); + + if ((block == Blocks.field_150355_j || block == Blocks.field_150358_i) && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0) + { +- if (!p_175670_2_) ++ if (!noWaterAdj) + { + return true; + } + +- boolean flag = this.func_175696_F(p_175670_1_.func_177976_e()) && this.func_175696_F(p_175670_1_.func_177974_f()) && this.func_175696_F(p_175670_1_.func_177978_c()) && this.func_175696_F(p_175670_1_.func_177968_d()); ++ boolean flag = this.func_175696_F(pos.func_177976_e()) && this.func_175696_F(pos.func_177974_f()) && this.func_175696_F(pos.func_177978_c()) && this.func_175696_F(pos.func_177968_d()); + + if (!flag) + { +@@ -2532,24 +2704,29 @@ public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) { +- BiomeGenBase biomegenbase = this.func_180494_b(p_175708_1_); +- float f = biomegenbase.func_180626_a(p_175708_1_); + return this.field_73011_w.canSnowAt(p_175708_1_, p_175708_2_); + } -+ -+ public boolean canSnowAtBody(BlockPos p_175708_1_, boolean p_175708_2_) + ++ public boolean canSnowAtBody(BlockPos pos, boolean checkLight) + { - BiomeGenBase biomegenbase = this.func_180494_b(p_175708_1_); - float f = biomegenbase.func_180626_a(p_175708_1_); - -@@ -2533,7 +2723,7 @@ ++ BiomeGenBase biomegenbase = this.func_180494_b(pos); ++ float f = biomegenbase.func_180626_a(pos); ++ + if (f > 0.15F) + { + return false; + } +- else if (!p_175708_2_) ++ else if (!checkLight) + { + return true; + } + else + { +- if (p_175708_1_.func_177956_o() >= 0 && p_175708_1_.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, p_175708_1_) < 10) ++ if (pos.func_177956_o() >= 0 && pos.func_177956_o() < 256 && this.func_175642_b(EnumSkyBlock.BLOCK, pos) < 10) { - Block block = this.func_180495_p(p_175708_1_).func_177230_c(); +- IBlockState iblockstate = this.func_180495_p(p_175708_1_); ++ IBlockState iblockstate = this.func_180495_p(pos); -- if (block.func_149688_o() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) -+ if (block.isAir(this, p_175708_1_) && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) +- if (iblockstate.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this, pos) && Blocks.field_150431_aC.func_176196_c(this, pos)) { return true; } -@@ -2565,10 +2755,11 @@ +@@ -2581,10 +2758,11 @@ else { - Block block = this.func_180495_p(p_175638_1_).func_177230_c(); -- int i = p_175638_2_ == EnumSkyBlock.SKY ? 0 : block.func_149750_m(); -- int j = block.func_149717_k(); -+ int blockLight = block.getLightValue(this, p_175638_1_); + IBlockState iblockstate = this.func_180495_p(p_175638_1_); +- int i = p_175638_2_ == EnumSkyBlock.SKY ? 0 : iblockstate.func_185906_d(); +- int j = iblockstate.func_185891_c(); ++ int blockLight = iblockstate.func_177230_c().getLightValue(iblockstate, this, p_175638_1_); + int i = p_175638_2_ == EnumSkyBlock.SKY ? 0 : blockLight; -+ int j = block.getLightOpacity(this, p_175638_1_); ++ int j = iblockstate.func_177230_c().getLightOpacity(iblockstate, this, p_175638_1_); -- if (j >= 15 && block.func_149750_m() > 0) +- if (j >= 15 && iblockstate.func_185906_d() > 0) + if (j >= 15 && blockLight > 0) { j = 1; } -@@ -2768,10 +2959,10 @@ +@@ -2683,7 +2861,7 @@ + int j4 = j2 + enumfacing.func_96559_d(); + int k4 = k2 + enumfacing.func_82599_e(); + blockpos$pooledmutableblockpos.func_185343_d(i4, j4, k4); +- int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c()); ++ int l4 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_177230_c().getLightOpacity(this.func_180495_p(blockpos$pooledmutableblockpos), this, blockpos$pooledmutableblockpos)); + i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos); + + if (i3 == l2 - l4 && j < this.field_72994_J.length) +@@ -2789,10 +2967,10 @@ public List func_175674_a(Entity p_175674_1_, AxisAlignedBB p_175674_2_, Predicate p_175674_3_) { List list = Lists.newArrayList(); @@ -676,22 +743,22 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -2824,10 +3015,10 @@ +@@ -2845,10 +3023,10 @@ public List func_175647_a(Class p_175647_1_, AxisAlignedBB p_175647_2_, Predicate p_175647_3_) { - int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D); -- int j = MathHelper.func_76128_c((p_175647_2_.field_72336_d + 2.0D) / 16.0D); +- int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D); - int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D); -- int l = MathHelper.func_76128_c((p_175647_2_.field_72334_f + 2.0D) / 16.0D); +- int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D); + int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.func_76128_c((p_175647_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); + int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.func_76128_c((p_175647_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); List list = Lists.newArrayList(); - for (int i1 = i; i1 <= j; ++i1) -@@ -2905,11 +3096,13 @@ + for (int i1 = i; i1 < j; ++i1) +@@ -2926,11 +3104,13 @@ public void func_175650_b(Collection p_175650_1_) { @@ -708,27 +775,25 @@ } } -@@ -2922,7 +3115,9 @@ +@@ -2943,7 +3123,7 @@ { - Block block = this.func_180495_p(p_175716_2_).func_177230_c(); - AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_180640_a(this, p_175716_2_, p_175716_1_.func_176223_P()); -- return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_175716_5_) ? false : (block.func_149688_o() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ ? true : block.func_149688_o().func_76222_j() && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_)); -+ if (axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_175716_5_)) return false; -+ if (block.func_149688_o() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ) return true; -+ return block.func_176200_f(this, p_175716_2_) && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_); + IBlockState iblockstate = this.func_180495_p(p_175716_2_); + AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_176223_P().func_185890_d(this, p_175716_2_); +- return axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_175716_2_), p_175716_5_) ? false : (iblockstate.func_185904_a() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ ? true : iblockstate.func_185904_a().func_76222_j() && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_)); ++ return axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_175716_2_), p_175716_5_) ? false : (iblockstate.func_185904_a() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ ? true : iblockstate.func_177230_c().func_176200_f(this, p_175716_2_) && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_)); } public int func_181545_F() -@@ -3007,7 +3202,7 @@ +@@ -3026,7 +3206,7 @@ + public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) { IBlockState iblockstate = this.func_180495_p(p_175651_1_); - Block block = iblockstate.func_177230_c(); -- return block.func_149721_r() ? this.func_175676_y(p_175651_1_) : block.func_180656_a(this, p_175651_1_, iblockstate, p_175651_2_); -+ return block.shouldCheckWeakPower(this, p_175651_1_, p_175651_2_) ? this.func_175676_y(p_175651_1_) : block.func_180656_a(this, p_175651_1_, iblockstate, p_175651_2_); +- return iblockstate.func_185915_l() ? this.func_175676_y(p_175651_1_) : iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_); ++ return iblockstate.func_177230_c().shouldCheckWeakPower(iblockstate, this, p_175651_1_, p_175651_2_) ? this.func_175676_y(p_175651_1_) : iblockstate.func_185911_a(this, p_175651_1_, p_175651_2_); } public boolean func_175640_z(BlockPos p_175640_1_) -@@ -3134,7 +3329,7 @@ +@@ -3215,7 +3395,7 @@ public long func_72905_C() { @@ -737,7 +802,7 @@ } public long func_82737_E() -@@ -3144,17 +3339,17 @@ +@@ -3225,17 +3405,17 @@ public long func_72820_D() { @@ -758,7 +823,7 @@ if (!this.func_175723_af().func_177746_a(blockpos)) { -@@ -3166,7 +3361,7 @@ +@@ -3247,7 +3427,7 @@ public void func_175652_B(BlockPos p_175652_1_) { @@ -767,7 +832,7 @@ } @SideOnly(Side.CLIENT) -@@ -3186,12 +3381,18 @@ +@@ -3267,12 +3447,18 @@ if (!this.field_72996_f.contains(p_72897_1_)) { @@ -781,12 +846,12 @@ + return this.field_73011_w.canMineBlock(p_175660_1_, p_175660_2_); + } + -+ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) ++ public boolean canMineBlockBody(EntityPlayer player, BlockPos pos) + { return true; } -@@ -3285,8 +3486,7 @@ +@@ -3366,8 +3552,7 @@ public boolean func_180502_D(BlockPos p_180502_1_) { @@ -796,7 +861,7 @@ } public MapStorage func_175693_T() -@@ -3345,12 +3545,12 @@ +@@ -3426,12 +3611,12 @@ public int func_72800_K() { @@ -811,7 +876,7 @@ } public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) -@@ -3405,7 +3605,7 @@ +@@ -3481,7 +3666,7 @@ @SideOnly(Side.CLIENT) public double func_72919_O() { @@ -820,7 +885,7 @@ } public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) -@@ -3439,7 +3639,7 @@ +@@ -3515,7 +3700,7 @@ public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) { @@ -829,36 +894,33 @@ { BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing); -@@ -3447,18 +3647,14 @@ +@@ -3523,18 +3708,14 @@ { IBlockState iblockstate = this.func_180495_p(blockpos); -- if (Blocks.field_150441_bU.func_149907_e(iblockstate.func_177230_c())) +- if (Blocks.field_150441_bU.func_185547_C(iblockstate)) + iblockstate.func_177230_c().onNeighborChange(this, blockpos, p_175666_1_); -+ if (iblockstate.func_177230_c().isNormalCube(this, blockpos)) ++ if (iblockstate.func_177230_c().isNormalCube(iblockstate, this, blockpos)) { - iblockstate.func_177230_c().func_176204_a(this, blockpos, iblockstate, p_175666_2_); - } -- else if (iblockstate.func_177230_c().func_149721_r()) +- else if (iblockstate.func_185915_l()) - { -- blockpos = blockpos.func_177972_a(enumfacing); -- iblockstate = this.func_180495_p(blockpos); + blockpos = blockpos.func_177972_a(enumfacing); + iblockstate = this.func_180495_p(blockpos); - -- if (Blocks.field_150441_bU.func_149907_e(iblockstate.func_177230_c())) -+ BlockPos posOther = blockpos.func_177972_a(enumfacing); -+ Block other = func_180495_p(posOther).func_177230_c(); -+ if (other.getWeakChanges(this, posOther)) +- if (Blocks.field_150441_bU.func_185547_C(iblockstate)) ++ if (iblockstate.func_177230_c().getWeakChanges(this, blockpos)) { - iblockstate.func_177230_c().func_176204_a(this, blockpos, iblockstate, p_175666_2_); -+ other.onNeighborChange(this, posOther, p_175666_1_); ++ iblockstate.func_177230_c().onNeighborChange(this, blockpos, p_175666_1_); } } } -@@ -3528,4 +3724,81 @@ - int k = 128; +@@ -3600,6 +3781,87 @@ return i >= -k && i <= k && j >= -k && j <= k; } -+ + + /* ======================================== FORGE START =====================================*/ + /** + * Determine if the given block is considered solid on the @@ -889,7 +951,7 @@ + + Chunk chunk = func_175726_f(pos); + if (chunk == null || chunk.func_76621_g()) return _default; -+ return func_180495_p(pos).func_177230_c().isSideSolid(this, pos, side); ++ return func_180495_p(pos).isSideSolid(this, pos, side); + } + + /** @@ -902,6 +964,10 @@ + return net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this); + } + ++ public Iterator getPersistentChunkIterable(Iterator chunkIterator) ++ { ++ return net.minecraftforge.common.ForgeChunkManager.getPersistentChunksIterableFor(this, chunkIterator); ++ } + /** + * Readded as it was removed, very useful helper function + * @@ -935,4 +1001,7 @@ + { + return perWorldStorage; + } - } ++ + public void func_184135_a(Packet p_184135_1_) + { + throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client."); diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch similarity index 74% rename from patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch rename to patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch index 6a68367cc..b8d9d1052 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch @@ -1,25 +1,26 @@ ---- ../src-base/minecraft/net/minecraft/world/SpawnerAnimals.java -+++ ../src-work/minecraft/net/minecraft/world/SpawnerAnimals.java -@@ -69,14 +69,15 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldEntitySpawner.java ++++ ../src-work/minecraft/net/minecraft/world/WorldEntitySpawner.java +@@ -77,15 +77,17 @@ { if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_)) { -- int j4 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()); -+ int j4 = p_77192_1_.countEntities(enumcreaturetype, true); - int k4 = enumcreaturetype.func_75601_b() * i / field_180268_a; +- int k4 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()); ++ int k4 = p_77192_1_.countEntities(enumcreaturetype, true); + int l4 = enumcreaturetype.func_75601_b() * i / field_180268_a; - if (j4 <= k4) + if (k4 <= l4) { + java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.field_77193_b); + java.util.Collections.shuffle(shuffled); - label374: -- + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + label415: + - for (ChunkCoordIntPair chunkcoordintpair1 : this.field_77193_b) + for (ChunkCoordIntPair chunkcoordintpair1 : shuffled) { BlockPos blockpos = func_180621_a(p_77192_1_, chunkcoordintpair1.field_77276_a, chunkcoordintpair1.field_77275_b); int k1 = blockpos.func_177958_n(); -@@ -134,8 +135,10 @@ +@@ -144,8 +146,10 @@ entityliving.func_70012_b((double)f, (double)i3, (double)f1, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); @@ -31,21 +32,23 @@ ientitylivingdata = entityliving.func_180482_a(p_77192_1_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata); if (entityliving.func_70058_J()) -@@ -144,7 +147,7 @@ - p_77192_1_.func_72838_d(entityliving); +@@ -158,7 +162,7 @@ + entityliving.func_70106_y(); } - if (j2 >= entityliving.func_70641_bl()) + if (i2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { - continue label374; + continue label415; } -@@ -193,7 +196,7 @@ +@@ -211,8 +215,9 @@ + else { BlockPos blockpos = p_180267_2_.func_177977_b(); ++ IBlockState state = p_180267_1_.func_180495_p(blockpos); -- if (!World.func_175683_a(p_180267_1_, blockpos)) -+ if (!p_180267_1_.func_180495_p(blockpos).func_177230_c().canCreatureSpawn(p_180267_1_, blockpos, p_180267_0_)) +- if (!p_180267_1_.func_180495_p(blockpos).func_185896_q()) ++ if (!state.func_177230_c().canCreatureSpawn(state, p_180267_1_, blockpos, p_180267_0_)) { return false; } diff --git a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch index 1bfabc7e5..f67afd1b3 100644 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/WorldProvider.java +++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java -@@ -51,26 +51,12 @@ +@@ -52,26 +52,12 @@ protected void func_76572_b() { @@ -9,34 +9,27 @@ - if (worldtype == WorldType.field_77138_c) - { - FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.func_82651_a(this.field_76579_a.func_72912_H().func_82571_y()); -- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), BiomeGenBase.field_180279_ad), 0.5F); +- this.field_76578_c = new BiomeProviderSingle(BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), Biomes.field_180279_ad)); - } - else if (worldtype == WorldType.field_180272_g) - { -- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.0F); +- this.field_76578_c = new BiomeProviderSingle(Biomes.field_76772_c); - } - else - { -- this.field_76578_c = new WorldChunkManager(this.field_76579_a); +- this.field_76578_c = new BiomeProvider(this.field_76579_a.func_72912_H()); - } -+ this.field_76578_c = field_76577_b.getChunkManager(field_76579_a); ++ this.field_76578_c = field_76577_b.getBiomeProvider(field_76579_a); } - public IChunkProvider func_76555_c() + public IChunkGenerator func_186060_c() { -- return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : (this.field_76577_b == WorldType.field_180272_g ? new ChunkProviderDebug(this.field_76579_a) : (this.field_76577_b == WorldType.field_180271_f ? new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c)))); +- return (IChunkGenerator)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : (this.field_76577_b == WorldType.field_180272_g ? new ChunkProviderDebug(this.field_76579_a) : (this.field_76577_b == WorldType.field_180271_f ? new ChunkProviderOverworld(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : new ChunkProviderOverworld(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c)))); + return field_76577_b.getChunkGenerator(field_76579_a, field_82913_c); } public boolean func_76566_a(int p_76566_1_, int p_76566_2_) -@@ -153,13 +139,13 @@ - - public static WorldProvider func_76570_a(int p_76570_0_) - { -- return (WorldProvider)(p_76570_0_ == -1 ? new WorldProviderHell() : (p_76570_0_ == 0 ? new WorldProviderSurface() : (p_76570_0_ == 1 ? new WorldProviderEnd() : null))); -+ return net.minecraftforge.common.DimensionManager.createProviderFor(p_76570_0_); - } - +@@ -156,7 +142,7 @@ @SideOnly(Side.CLIENT) public float func_76571_f() { @@ -45,7 +38,7 @@ } @SideOnly(Side.CLIENT) -@@ -175,13 +161,13 @@ +@@ -172,13 +158,13 @@ public int func_76557_i() { @@ -61,25 +54,30 @@ } @SideOnly(Side.CLIENT) -@@ -223,4 +209,319 @@ - { +@@ -212,6 +198,327 @@ return new WorldBorder(); } -+ + + /*======================================= Forge Start =========================================*/ + private net.minecraftforge.client.IRenderHandler skyRenderer = null; + private net.minecraftforge.client.IRenderHandler cloudRenderer = null; + private net.minecraftforge.client.IRenderHandler weatherRenderer = null; ++ private int dimensionId; + + /** + * Sets the providers current dimension ID, used in default getSaveFolder() + * Added to allow default providers to be registered for multiple dimensions. ++ * This is to denote the exact dimension ID opposed to the 'type' in WorldType + * + * @param dim Dimension ID + */ + public void setDimension(int dim) + { -+ this.field_76574_g = dim; ++ this.dimensionId = dim; ++ } ++ public int getDimension() ++ { ++ return this.dimensionId; + } + + /** @@ -89,7 +87,7 @@ + */ + public String getSaveFolder() + { -+ return (field_76574_g == 0 ? null : "DIM" + field_76574_g); ++ return (dimensionId == 0 ? null : "DIM" + dimensionId); + } + + /** @@ -184,7 +182,7 @@ + BlockPos ret = this.field_76579_a.func_175694_M(); + + boolean isAdventure = field_76579_a.func_72912_H().func_76077_q() == WorldSettings.GameType.ADVENTURE; -+ int spawnFuzz = field_76577_b.getSpawnFuzz(); ++ int spawnFuzz = this.field_76579_a instanceof WorldServer ? field_76577_b.getSpawnFuzz((WorldServer)this.field_76579_a, this.field_76579_a.func_73046_m()) : 1; + int border = MathHelper.func_76128_c(field_76579_a.func_175723_af().func_177729_b(ret.func_177958_n(), ret.func_177952_p())); + if (border < spawnFuzz) spawnFuzz = border; + if (spawnFuzz < 1) spawnFuzz = 1; @@ -208,7 +206,7 @@ + */ + public boolean shouldMapSpin(String entity, double x, double y, double z) + { -+ return field_76574_g < 0; ++ return dimensionId < 0; + } + + /** @@ -258,15 +256,15 @@ + } + + @SideOnly(Side.CLIENT) -+ public Vec3 getSkyColor(net.minecraft.entity.Entity cameraEntity, float partialTicks) ++ public Vec3d getSkyColor(net.minecraft.entity.Entity cameraEntity, float partialTicks) + { + return field_76579_a.getSkyColorBody(cameraEntity, partialTicks); + } + + @SideOnly(Side.CLIENT) -+ public Vec3 drawClouds(float partialTicks) ++ public Vec3d getCloudColor(float partialTicks) + { -+ return field_76579_a.drawCloudsBody(partialTicks); ++ return field_76579_a.getCloudColorBody(partialTicks); + } + + /** @@ -380,4 +378,7 @@ + { + return true; + } - } ++ + public void func_186061_a(EntityPlayerMP p_186061_1_) + { + } diff --git a/patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch b/patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch new file mode 100644 index 000000000..97526ec7e --- /dev/null +++ b/patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProviderSurface.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProviderSurface.java +@@ -9,6 +9,6 @@ + + public boolean func_186056_c(int p_186056_1_, int p_186056_2_) + { +- return !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_); ++ return !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_) || !net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_76579_a.field_73011_w.getDimension()); + } + } diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index 08b38c2ab..e18196b2e 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -1,37 +1,30 @@ --- ../src-base/minecraft/net/minecraft/world/WorldServer.java +++ ../src-work/minecraft/net/minecraft/world/WorldServer.java -@@ -94,30 +94,46 @@ - private static final List field_73069_S = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151055_y, 0, 1, 3, 10), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150344_f), 0, 1, 3, 10), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150364_r), 0, 1, 3, 10), new WeightedRandomChestContent(Items.field_151049_t, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151053_p, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151050_s, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151039_o, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151034_e, 0, 2, 3, 5), new WeightedRandomChestContent(Items.field_151025_P, 0, 2, 3, 3), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150363_s), 0, 1, 3, 10)}); +@@ -97,30 +97,39 @@ + private int field_147489_T; private List field_94579_S = Lists.newArrayList(); + /** Stores the recently processed (lighting) chunks */ + protected Set doneChunks = new java.util.HashSet(); + public List customTeleporters = new ArrayList(); -+ private static boolean initChest = false; -+ public static void fillChestHook() -+ { -+ if (!initChest) -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.BONUS_CHEST, field_73069_S, 10, 10); -+ initChest = true; -+ } + public WorldServer(MinecraftServer p_i45921_1_, ISaveHandler p_i45921_2_, WorldInfo p_i45921_3_, int p_i45921_4_, Profiler p_i45921_5_) { - super(p_i45921_2_, p_i45921_3_, WorldProvider.func_76570_a(p_i45921_4_), p_i45921_5_, false); + super(p_i45921_2_, p_i45921_3_, DimensionType.func_186069_a(p_i45921_4_).func_186070_d(), p_i45921_5_, false); this.field_73061_a = p_i45921_1_; this.field_73062_L = new EntityTracker(this); this.field_73063_M = new PlayerManager(this); + // Guarantee the dimension ID was not reset by the provider -+ int providerDim = this.field_73011_w.field_76574_g; ++ int providerDim = this.field_73011_w.getDimension(); this.field_73011_w.func_76558_a(this); -+ this.field_73011_w.field_76574_g = providerDim; ++ this.field_73011_w.setDimension(providerDim); this.field_73020_y = this.func_72970_h(); + perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, p_i45921_2_)); this.field_85177_Q = new Teleporter(this); this.func_72966_v(); this.func_72947_a(); this.func_175723_af().func_177725_a(p_i45921_1_.func_175580_aG()); -+ net.minecraftforge.common.DimensionManager.setWorld(p_i45921_4_, this); ++ net.minecraftforge.common.DimensionManager.setWorld(p_i45921_4_, this, field_73061_a); } public World func_175643_b() @@ -49,7 +42,7 @@ } else { -@@ -210,6 +226,10 @@ +@@ -214,6 +223,10 @@ this.field_175740_d.func_75528_a(); this.field_72984_F.func_76318_c("portalForcer"); this.field_85177_Q.func_85189_a(this.func_82737_E()); @@ -60,7 +53,7 @@ this.field_72984_F.func_76319_b(); this.func_147488_Z(); } -@@ -217,12 +237,14 @@ +@@ -221,12 +234,14 @@ public BiomeGenBase.SpawnListEntry func_175734_a(EnumCreatureType p_175734_1_, BlockPos p_175734_2_) { List list = this.func_72863_F().func_177458_a(p_175734_1_, p_175734_2_); @@ -75,7 +68,7 @@ return list != null && !list.isEmpty() ? list.contains(p_175732_2_) : false; } -@@ -268,10 +290,7 @@ +@@ -272,10 +287,7 @@ private void func_73051_P() { @@ -87,16 +80,25 @@ } public boolean func_73056_e() -@@ -349,7 +367,7 @@ +@@ -368,7 +380,7 @@ + boolean flag1 = this.func_72911_I(); + this.field_72984_F.func_76320_a("pollingChunks"); + +- for (Iterator iterator = this.field_73063_M.func_187300_b(); iterator.hasNext(); this.field_72984_F.func_76319_b()) ++ for (Iterator iterator = getPersistentChunkIterable(this.field_73063_M.func_187300_b()); iterator.hasNext(); this.field_72984_F.func_76319_b()) + { + this.field_72984_F.func_76320_a("getChunk"); + Chunk chunk = (Chunk)iterator.next(); +@@ -380,7 +392,7 @@ chunk.func_150804_b(false); this.field_72984_F.func_76318_c("thunder"); -- if (this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) -+ if (this.field_73011_w.canDoLightning(chunk) && this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) +- if (flag && flag1 && this.field_73012_v.nextInt(100000) == 0) ++ if (this.field_73011_w.canDoLightning(chunk) && flag && flag1 && this.field_73012_v.nextInt(100000) == 0) { this.field_73005_l = this.field_73005_l * 3 + 1013904223; - int i1 = this.field_73005_l >> 2; -@@ -363,7 +381,7 @@ + int l = this.field_73005_l >> 2; +@@ -409,7 +421,7 @@ this.field_72984_F.func_76318_c("iceandsnow"); @@ -104,27 +106,27 @@ + if (this.field_73011_w.canDoRainSnowIce(chunk) && this.field_73012_v.nextInt(16) == 0) { this.field_73005_l = this.field_73005_l * 3 + 1013904223; - int k2 = this.field_73005_l >> 2; -@@ -456,6 +474,9 @@ + int j2 = this.field_73005_l >> 2; +@@ -527,6 +539,9 @@ if (p_175654_2_.func_149698_L()) { i = 8; + //Keeping here as a note for future when it may be restored. -+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.field_180282_a.func_177958_n() >> 4, nextticklistentry.field_180282_a.func_177952_p() >> 4)); ++ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(p_175654_1_.func_177958_n() >> 4, p_175654_1_.func_177952_p() >> 4)); + i = isForced ? 0 : 8; - if (this.func_175707_a(nextticklistentry.field_180282_a.func_177982_a(-i, -i, -i), nextticklistentry.field_180282_a.func_177982_a(i, i, i))) + if (this.func_175707_a(p_175654_1_.func_177982_a(-i, -i, -i), p_175654_1_.func_177982_a(i, i, i))) { -@@ -508,7 +529,7 @@ +@@ -588,7 +603,7 @@ public void func_72939_s() { - if (this.field_73010_i.isEmpty()) + if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) { - if (this.field_80004_Q++ >= 1200) + if (this.field_80004_Q++ >= 300) { -@@ -573,6 +594,9 @@ +@@ -712,6 +727,9 @@ { NextTickListEntry nextticklistentry1 = (NextTickListEntry)iterator.next(); iterator.remove(); @@ -134,7 +136,7 @@ int k = 0; if (this.func_175707_a(nextticklistentry1.field_180282_a.func_177982_a(-k, -k, -k), nextticklistentry1.field_180282_a.func_177982_a(k, k, k))) -@@ -696,22 +720,40 @@ +@@ -838,24 +856,42 @@ { List list = Lists.newArrayList(); @@ -175,47 +177,41 @@ public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) { +- return !this.field_73061_a.func_175579_a(this, p_175660_2_, p_175660_1_) && this.func_175723_af().func_177746_a(p_175660_2_); + return super.func_175660_a(p_175660_1_, p_175660_2_); -+ } -+ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) -+ { - return !this.field_73061_a.func_175579_a(this, p_175660_2_, p_175660_1_) && this.func_175723_af().func_177746_a(p_175660_2_); } ++ public boolean canMineBlockBody(EntityPlayer player, BlockPos pos) ++ { ++ return !this.field_73061_a.func_175579_a(this, pos, player) && this.func_175723_af().func_177746_a(pos); ++ } -@@ -777,6 +819,7 @@ + public void func_72963_a(WorldSettings p_72963_1_) + { +@@ -919,6 +955,7 @@ } else { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; this.field_72987_B = true; - WorldChunkManager worldchunkmanager = this.field_73011_w.func_177499_m(); - List list = worldchunkmanager.func_76932_a(); -@@ -822,7 +865,7 @@ - - protected void func_73047_i() - { -- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(field_73069_S, 10); -+ WorldGeneratorBonusChest worldgeneratorbonuschest = net.minecraftforge.common.ForgeHooks.getBonusChest(field_73012_v); - - for (int i = 0; i < 10; ++i) - { -@@ -859,6 +902,7 @@ + BiomeProvider biomeprovider = this.field_73011_w.func_177499_m(); + List list = biomeprovider.func_76932_a(); +@@ -1003,6 +1040,7 @@ } - this.field_73020_y.func_73151_a(p_73044_1_, p_73044_2_); + chunkproviderserver.func_186027_a(p_73044_1_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Save(this)); - for (Chunk chunk : Lists.newArrayList(this.field_73059_b.func_152380_a())) + for (Chunk chunk : Lists.newArrayList(chunkproviderserver.func_152380_a())) { -@@ -892,6 +936,7 @@ +@@ -1047,6 +1085,7 @@ this.field_72986_A.func_176135_e(this.func_175723_af().func_177732_i()); - this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_71203_ab().func_72378_q()); + this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_184103_al().func_72378_q()); this.field_72988_C.func_75744_a(); + this.perWorldStorage.func_75744_a(); } - public void func_72923_a(Entity p_72923_1_) -@@ -947,6 +992,7 @@ + public boolean func_72838_d(Entity p_72838_1_) +@@ -1161,6 +1200,7 @@ public Explosion func_72885_a(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); @@ -223,8 +219,8 @@ explosion.func_77278_a(); explosion.func_77279_a(false); -@@ -1026,19 +1072,23 @@ - this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_177502_q()); +@@ -1240,19 +1280,23 @@ + this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_186058_p().func_186068_a()); } + /* The function in use here has been replaced in order to only send the weather info to players in the correct dimension, @@ -235,29 +231,29 @@ { if (flag) { -- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(2, 0.0F)); -+ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(2, 0.0F), this.field_73011_w.field_76574_g); +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(2, 0.0F)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(2, 0.0F), this.field_73011_w.getDimension()); } else { -- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(1, 0.0F)); -+ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(1, 0.0F), this.field_73011_w.field_76574_g); +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(1, 0.0F)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(1, 0.0F), this.field_73011_w.getDimension()); } -- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(7, this.field_73004_o)); -- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(8, this.field_73017_q)); -+ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.field_76574_g); -+ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.field_76574_g); +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(7, this.field_73004_o)); +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(8, this.field_73017_q)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.getDimension()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.getDimension()); } } -@@ -1104,6 +1154,11 @@ +@@ -1329,6 +1373,11 @@ return this.field_73061_a.func_152345_ab(); } + public java.io.File getChunkSaveLocation() + { -+ return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)field_73059_b.field_73247_e).field_75825_d; ++ return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)func_72863_F().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 dc61a1c4d..915671b99 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -30,9 +30,9 @@ } public World func_175643_b() -@@ -58,12 +61,12 @@ - this.field_72988_C = this.field_175743_a.func_175693_T(); +@@ -59,12 +62,12 @@ this.field_96442_D = this.field_175743_a.func_96441_U(); + this.field_184151_B = this.field_175743_a.func_184146_ak(); String s = VillageCollection.func_176062_a(this.field_73011_w); - VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, s); + VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, s); @@ -45,11 +45,10 @@ } else { -@@ -73,4 +76,12 @@ - +@@ -75,6 +78,14 @@ return this; } -+ + + + @Override + public void func_73041_k() @@ -57,4 +56,7 @@ + super.func_73041_k(); + this.field_175743_a.func_175723_af().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. + } - } ++ + public void func_184166_c() + { + this.field_73011_w.func_186057_q(); diff --git a/patches/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch index 1f7e26efa..55e06c22c 100644 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldType.java.patch @@ -1,6 +1,16 @@ --- ../src-base/minecraft/net/minecraft/world/WorldType.java +++ ../src-work/minecraft/net/minecraft/world/WorldType.java -@@ -27,6 +27,7 @@ +@@ -1,5 +1,9 @@ + package net.minecraft.world; + ++import net.minecraft.world.chunk.IChunkGenerator; ++import net.minecraft.world.gen.ChunkProviderDebug; ++import net.minecraft.world.gen.ChunkProviderFlat; ++import net.minecraft.world.gen.ChunkProviderOverworld; + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +@@ -27,6 +31,7 @@ private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) { @@ -8,33 +18,34 @@ this.field_77133_f = p_i1960_2_; this.field_77134_g = p_i1960_3_; this.field_77140_h = true; -@@ -113,4 +114,144 @@ +@@ -113,4 +118,145 @@ this.field_151361_l = true; return this; } + -+ public net.minecraft.world.biome.WorldChunkManager getChunkManager(World world) ++ public net.minecraft.world.biome.BiomeProvider getBiomeProvider(World world) + { + if (this == field_77138_c) + { + net.minecraft.world.gen.FlatGeneratorInfo flatgeneratorinfo = net.minecraft.world.gen.FlatGeneratorInfo.func_82651_a(world.func_72912_H().func_82571_y()); -+ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), net.minecraft.world.biome.BiomeGenBase.field_180279_ad), 0.5F); ++ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.world.biome.BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), net.minecraft.init.Biomes.field_180279_ad)); + } + else if (this == field_180272_g) + { -+ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.field_76772_c, 0.0F); ++ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.init.Biomes.field_76772_c); + } + else + { -+ return new net.minecraft.world.biome.WorldChunkManager(world); ++ return new net.minecraft.world.biome.BiomeProvider(world.func_72912_H()); + } + } + -+ public net.minecraft.world.chunk.IChunkProvider getChunkGenerator(World world, String generatorOptions) ++ public net.minecraft.world.chunk.IChunkGenerator getChunkGenerator(World world, String generatorOptions) + { + if (this == field_77138_c) return new net.minecraft.world.gen.ChunkProviderFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); + if (this == field_180272_g) return new net.minecraft.world.gen.ChunkProviderDebug(world); -+ return new net.minecraft.world.gen.ChunkProviderGenerate(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ if (this == field_180271_f) return new net.minecraft.world.gen.ChunkProviderOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ return new net.minecraft.world.gen.ChunkProviderOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); + } + + public int getMinimumSpawnHeight(World world) @@ -93,9 +104,9 @@ + * Useful for void world types. + * @return Fuzz for entity initial spawn in blocks. + */ -+ public int getSpawnFuzz() ++ public int getSpawnFuzz(WorldServer world, net.minecraft.server.MinecraftServer server) + { -+ return Math.max(5, net.minecraft.server.MinecraftServer.func_71276_C().func_82357_ak() - 6); ++ return Math.max(0, server.func_184108_a(world)); + } + + /** diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch deleted file mode 100644 index 4c72cae17..000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/biome/BiomeColorHelper.java -+++ ../src-work/minecraft/net/minecraft/world/biome/BiomeColorHelper.java -@@ -26,7 +26,7 @@ - { - public int func_180283_a(BiomeGenBase p_180283_1_, BlockPos p_180283_2_) - { -- return p_180283_1_.field_76759_H; -+ return p_180283_1_.getWaterColorMultiplier(); - } - }; - diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index c18d05315..584c76ae8 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -1,169 +1,167 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeDecorator.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java -@@ -105,8 +105,10 @@ +@@ -91,8 +91,10 @@ - protected void func_150513_a(BiomeGenBase p_150513_1_) + protected void func_150513_a(BiomeGenBase p_150513_1_, World p_150513_2_, Random p_150513_3_) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(field_76815_a, field_76813_b, field_180294_c)); - this.func_76797_b(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(p_150513_2_, p_150513_3_, field_180294_c)); + this.func_76797_b(p_150513_2_, p_150513_3_); -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) for (int i = 0; i < this.field_76805_H; ++i) { - int j = this.field_76813_b.nextInt(16) + 8; -@@ -114,6 +116,7 @@ - this.field_76810_g.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175672_r(this.field_180294_c.func_177982_a(j, 0, k))); + int j = p_150513_3_.nextInt(16) + 8; +@@ -100,6 +102,7 @@ + this.field_76810_g.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175672_r(this.field_180294_c.func_177982_a(j, 0, k))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) for (int i1 = 0; i1 < this.field_76806_I; ++i1) { - int l1 = this.field_76813_b.nextInt(16) + 8; -@@ -121,6 +124,7 @@ - this.field_76809_f.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175672_r(this.field_180294_c.func_177982_a(l1, 0, i6))); + int l1 = p_150513_3_.nextInt(16) + 8; +@@ -107,6 +110,7 @@ + this.field_76809_f.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175672_r(this.field_180294_c.func_177982_a(l1, 0, i6))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) for (int j1 = 0; j1 < this.field_76801_G; ++j1) { - int i2 = this.field_76813_b.nextInt(16) + 8; -@@ -135,6 +139,7 @@ + int i2 = p_150513_3_.nextInt(16) + 8; +@@ -121,6 +125,7 @@ ++k1; } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) for (int j2 = 0; j2 < k1; ++j2) { - int k6 = this.field_76813_b.nextInt(16) + 8; -@@ -149,6 +154,7 @@ + int k6 = p_150513_3_.nextInt(16) + 8; +@@ -135,6 +140,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) for (int k2 = 0; k2 < this.field_76807_J; ++k2) { - int l6 = this.field_76813_b.nextInt(16) + 8; -@@ -156,6 +162,7 @@ - this.field_76826_u.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175645_m(this.field_180294_c.func_177982_a(l6, 0, k10))); + int l6 = p_150513_3_.nextInt(16) + 8; +@@ -142,6 +148,7 @@ + this.field_76826_u.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175645_m(this.field_180294_c.func_177982_a(l6, 0, k10))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) for (int l2 = 0; l2 < this.field_76802_A; ++l2) { - int i7 = this.field_76813_b.nextInt(16) + 8; -@@ -177,6 +184,7 @@ + int i7 = p_150513_3_.nextInt(16) + 8; +@@ -163,6 +170,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) for (int i3 = 0; i3 < this.field_76803_B; ++i3) { - int j7 = this.field_76813_b.nextInt(16) + 8; -@@ -190,6 +198,7 @@ + int j7 = p_150513_3_.nextInt(16) + 8; +@@ -176,6 +184,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) for (int j3 = 0; j3 < this.field_76804_C; ++j3) { - int k7 = this.field_76813_b.nextInt(16) + 8; -@@ -203,6 +212,7 @@ + int k7 = p_150513_3_.nextInt(16) + 8; +@@ -189,6 +198,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) for (int k3 = 0; k3 < this.field_76833_y; ++k3) { - int l7 = this.field_76813_b.nextInt(16) + 8; -@@ -229,6 +239,8 @@ + int l7 = p_150513_3_.nextInt(16) + 8; +@@ -215,6 +225,8 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) + { for (int l3 = 0; l3 < this.field_76798_D; ++l3) { - if (this.field_76813_b.nextInt(4) == 0) -@@ -279,7 +291,9 @@ - this.field_76827_t.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_180294_c.func_177982_a(j4, l15, l8)); + if (p_150513_3_.nextInt(4) == 0) +@@ -265,7 +277,9 @@ + this.field_76827_t.func_180709_b(p_150513_2_, p_150513_3_, this.field_180294_c.func_177982_a(j4, l15, l8)); } } - + } // End of Mushroom generation -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED)) + { for (int k4 = 0; k4 < this.field_76799_E; ++k4) { - int i9 = this.field_76813_b.nextInt(16) + 8; -@@ -305,7 +319,8 @@ - this.field_76825_v.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_180294_c.func_177982_a(j9, i19, i13)); + int i9 = p_150513_3_.nextInt(16) + 8; +@@ -291,7 +305,8 @@ + this.field_76825_v.func_180709_b(p_150513_2_, p_150513_3_, this.field_180294_c.func_177982_a(j9, i19, i13)); } } - + } // End of Reed generation -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) - if (this.field_76813_b.nextInt(32) == 0) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) + if (p_150513_3_.nextInt(32) == 0) { - int i5 = this.field_76813_b.nextInt(16) + 8; -@@ -319,6 +334,7 @@ + int i5 = p_150513_3_.nextInt(16) + 8; +@@ -305,6 +320,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) for (int j5 = 0; j5 < this.field_76800_F; ++j5) { - int l9 = this.field_76813_b.nextInt(16) + 8; -@@ -334,6 +350,7 @@ + int l9 = p_150513_3_.nextInt(16) + 8; +@@ -320,6 +336,7 @@ if (this.field_76808_K) { -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) for (int k5 = 0; k5 < 50; ++k5) { - int i10 = this.field_76813_b.nextInt(16) + 8; -@@ -348,6 +365,7 @@ + int i10 = p_150513_3_.nextInt(16) + 8; +@@ -334,6 +351,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) for (int l5 = 0; l5 < 20; ++l5) { - int j10 = this.field_76813_b.nextInt(16) + 8; -@@ -357,6 +375,7 @@ - (new WorldGenLiquids(Blocks.field_150356_k)).func_180709_b(this.field_76815_a, this.field_76813_b, blockpos3); + int j10 = p_150513_3_.nextInt(16) + 8; +@@ -343,21 +361,35 @@ + (new WorldGenLiquids(Blocks.field_150356_k)).func_180709_b(p_150513_2_, p_150513_3_, blockpos3); } } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(field_76815_a, field_76813_b, field_180294_c)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(p_150513_2_, p_150513_3_, field_180294_c)); } - protected void func_76795_a(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) -@@ -397,16 +416,29 @@ - - protected void func_76797_b() + protected void func_76797_b(World p_76797_1_, Random p_76797_2_) { -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(field_76815_a, field_76813_b, field_180294_c)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76823_i, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) - this.func_76795_a(this.field_180293_d.field_177790_J, this.field_76823_i, this.field_180293_d.field_177791_K, this.field_180293_d.field_177784_L); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76820_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) - this.func_76795_a(this.field_180293_d.field_177786_N, this.field_76820_j, this.field_180293_d.field_177787_O, this.field_180293_d.field_177797_P); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180297_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) - this.func_76795_a(this.field_180293_d.field_177795_V, this.field_180297_k, this.field_180293_d.field_177794_W, this.field_180293_d.field_177801_X); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180296_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) - this.func_76795_a(this.field_180293_d.field_177799_R, this.field_180296_j, this.field_180293_d.field_177798_S, this.field_180293_d.field_177793_T); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180295_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) - this.func_76795_a(this.field_180293_d.field_177802_Z, this.field_180295_l, this.field_180293_d.field_177846_aa, this.field_180293_d.field_177847_ab); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76821_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) - this.func_76795_a(this.field_180293_d.field_177845_ad, this.field_76821_k, this.field_180293_d.field_177851_ae, this.field_180293_d.field_177853_af); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76818_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) - this.func_76795_a(this.field_180293_d.field_177849_ah, this.field_76818_l, this.field_180293_d.field_177832_ai, this.field_180293_d.field_177834_aj); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76819_m, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) - this.func_76795_a(this.field_180293_d.field_177830_al, this.field_76819_m, this.field_180293_d.field_177840_am, this.field_180293_d.field_177842_an); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180299_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) - this.func_76795_a(this.field_180293_d.field_177838_ap, this.field_180299_p, this.field_180293_d.field_177818_aq, this.field_180293_d.field_177816_ar); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180298_q, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) - this.func_76795_a(this.field_180293_d.field_177812_at, this.field_180298_q, this.field_180293_d.field_177826_au, this.field_180293_d.field_177824_av); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76831_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) - this.func_76793_b(this.field_180293_d.field_177820_ax, this.field_76831_p, this.field_180293_d.field_177807_ay, this.field_180293_d.field_177805_az); -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(field_76815_a, field_76813_b, field_180294_c)); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(p_76797_1_, p_76797_2_, field_180294_c)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76823_i, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177790_J, this.field_76823_i, this.field_180293_d.field_177791_K, this.field_180293_d.field_177784_L); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76820_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177786_N, this.field_76820_j, this.field_180293_d.field_177787_O, this.field_180293_d.field_177797_P); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180297_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177795_V, this.field_180297_k, this.field_180293_d.field_177794_W, this.field_180293_d.field_177801_X); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180296_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177799_R, this.field_180296_j, this.field_180293_d.field_177798_S, this.field_180293_d.field_177793_T); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180295_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177802_Z, this.field_180295_l, this.field_180293_d.field_177846_aa, this.field_180293_d.field_177847_ab); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76821_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177845_ad, this.field_76821_k, this.field_180293_d.field_177851_ae, this.field_180293_d.field_177853_af); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76818_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177849_ah, this.field_76818_l, this.field_180293_d.field_177832_ai, this.field_180293_d.field_177834_aj); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76819_m, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177830_al, this.field_76819_m, this.field_180293_d.field_177840_am, this.field_180293_d.field_177842_an); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180299_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177838_ap, this.field_180299_p, this.field_180293_d.field_177818_aq, this.field_180293_d.field_177816_ar); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180298_q, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177812_at, this.field_180298_q, this.field_180293_d.field_177826_au, this.field_180293_d.field_177824_av); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76831_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) + this.func_76793_b(p_76797_1_, p_76797_2_, this.field_180293_d.field_177820_ax, this.field_76831_p, this.field_180293_d.field_177807_ay, this.field_180293_d.field_177805_az); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(p_76797_1_, p_76797_2_, field_180294_c)); } - } + + protected void func_76795_a(World p_76795_1_, Random p_76795_2_, int p_76795_3_, WorldGenerator p_76795_4_, int p_76795_5_, int p_76795_6_) diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 032589894..62e355cce 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -1,25 +1,15 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenBase.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenBase.java -@@ -138,6 +138,10 @@ - - public BiomeGenBase(int p_i1971_1_) - { -+ this(p_i1971_1_, true); -+ } -+ public BiomeGenBase(int p_i1971_1_, boolean register) -+ { - this.field_76748_D = field_150596_a.field_150777_a; - this.field_76749_E = field_150596_a.field_150776_b; - this.field_76750_F = 0.5F; -@@ -152,6 +156,7 @@ - this.field_76758_O = new WorldGenBigTree(false); - this.field_76763_Q = new WorldGenSwamp(); - this.field_76756_M = p_i1971_1_; -+ if (register) - field_76773_a[p_i1971_1_] = this; - this.field_76760_I = this.func_76729_a(); - this.field_76762_K.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); -@@ -168,11 +173,12 @@ +@@ -70,7 +70,7 @@ + protected static final WorldGenTrees field_76757_N = new WorldGenTrees(false); + protected static final WorldGenBigTree field_76758_O = new WorldGenBigTree(false); + protected static final WorldGenSwamp field_76763_Q = new WorldGenSwamp(); +- public static final RegistryNamespaced field_185377_q = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_185377_q = net.minecraftforge.fml.common.registry.GameData.getBiomeRegistry(); + private final String field_76791_y; + private final float field_76748_D; + private final float field_76749_E; +@@ -128,11 +128,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)); @@ -32,8 +22,8 @@ + return getModdedBiomeDecorator(new BiomeDecorator()); } - public BiomeGenBase func_76732_a(float p_76732_1_, float p_76732_2_) -@@ -342,7 +348,7 @@ + public boolean func_185363_b() +@@ -228,7 +229,7 @@ { double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180627_1_), 0.0F, 1.0F); double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); @@ -41,8 +31,8 @@ + return getModdedBiomeGrassColor(ColorizerGrass.func_77480_a(d0, d1)); } - @SideOnly(Side.CLIENT) -@@ -350,7 +356,7 @@ + public final void func_180628_b(World p_180628_1_, Random p_180628_2_, ChunkPrimer p_180628_3_, int p_180628_4_, int p_180628_5_, double p_180628_6_) +@@ -321,7 +322,7 @@ { double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180625_1_), 0.0F, 1.0F); double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); @@ -50,9 +40,9 @@ + return getModdedBiomeFoliageColor(ColorizerFoliage.func_77470_a(d0, d1)); } - public boolean func_150559_j() -@@ -497,6 +503,84 @@ - } + public Class func_150562_l() +@@ -386,6 +387,83 @@ + return this.field_76766_R; } + /* ========================================= FORGE START ======================================*/ @@ -130,9 +120,8 @@ + world.func_180501_a(pos, flower.state, 3); + } + -+ + /* ========================================= FORGE END ======================================*/ + - static + public static void func_185358_q() { - field_76772_c.func_150566_k(); + func_185354_a(0, "ocean", new BiomeGenOcean((new BiomeGenBase.BiomeProperties("Ocean")).func_185398_c(-1.0F).func_185400_d(0.1F))); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch index 95b469419..24cfe1620 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch @@ -1,14 +1,13 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenForest.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenForest.java -@@ -201,4 +201,20 @@ - }; +@@ -147,6 +147,22 @@ } } -+ + + @Override + public void addDefaultFlowers() + { -+ if (field_150632_aF != 1) ++ if (field_150632_aF != BiomeGenForest.Type.FLOWER) + { + super.addDefaultFlowers(); + return; @@ -20,4 +19,7 @@ + addFlower(net.minecraft.init.Blocks.field_150328_O.func_176223_P().func_177226_a(net.minecraft.init.Blocks.field_150328_O.func_176494_l(), type), 10); + } + } - } ++ + public Class func_150562_l() + { + return BiomeGenForest.class; diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch index 129a16dfc..7354b7b77 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenHills.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenHills.java -@@ -40,28 +40,20 @@ +@@ -37,28 +37,20 @@ public void func_180624_a(World p_180624_1_, Random p_180624_2_, BlockPos p_180624_3_) { super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); @@ -36,9 +36,9 @@ } public void func_180622_a(World p_180622_1_, Random p_180622_2_, ChunkPrimer p_180622_3_, int p_180622_4_, int p_180622_5_, double p_180622_6_) -@@ -97,4 +89,23 @@ - { - return (new BiomeGenHills(p_180277_1_, false)).func_150633_b(this); +@@ -86,4 +78,24 @@ + EXTRA_TREES, + MUTATED; } + + private static class EmeraldGenerator extends WorldGenerator @@ -51,7 +51,8 @@ + { + BlockPos blockpos = pos.func_177982_a(rand.nextInt(16), rand.nextInt(28) + 4, rand.nextInt(16)); + -+ if (worldIn.func_180495_p(blockpos).func_177230_c().isReplaceableOreGen(worldIn, blockpos, net.minecraft.block.state.pattern.BlockHelper.func_177642_a(Blocks.field_150348_b))) ++ net.minecraft.block.state.IBlockState state = worldIn.func_180495_p(blockpos); ++ if (state.func_177230_c().isReplaceableOreGen(state, worldIn, blockpos, net.minecraft.block.state.pattern.BlockMatcher.func_177642_a(Blocks.field_150348_b))) + { + worldIn.func_180501_a(blockpos, Blocks.field_150412_bA.func_176223_P(), 2); + } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch index 275d4491a..a15220f7f 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenPlains.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenPlains.java -@@ -103,4 +103,19 @@ - biomegenplains.field_150609_ah = 14273354; - return biomegenplains; +@@ -92,4 +92,19 @@ + + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); } + + @Override diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch index 2df358347..d3c19e270 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java -@@ -84,4 +84,10 @@ +@@ -86,4 +86,10 @@ { return 6975545; } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch new file mode 100644 index 000000000..f66ae2e41 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeProvider.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeProvider.java +@@ -15,6 +15,7 @@ + + public class BiomeProvider + { ++ public static List allowedBiomes = Lists.newArrayList(Biomes.field_76767_f, Biomes.field_76772_c, Biomes.field_76768_g, Biomes.field_76784_u, Biomes.field_76785_t, Biomes.field_76782_w, Biomes.field_76792_x); + private GenLayer field_76944_d; + private GenLayer field_76945_e; + private final BiomeCache field_76942_f; +@@ -23,13 +24,14 @@ + protected BiomeProvider() + { + this.field_76942_f = new BiomeCache(this); +- this.field_76943_g = Lists.newArrayList(new BiomeGenBase[] {Biomes.field_76767_f, Biomes.field_76772_c, Biomes.field_76768_g, Biomes.field_76784_u, Biomes.field_76785_t, Biomes.field_76782_w, Biomes.field_76792_x}); ++ this.field_76943_g = Lists.newArrayList(allowedBiomes); + } + + private BiomeProvider(long p_i45744_1_, WorldType p_i45744_3_, String p_i45744_4_) + { + this(); + GenLayer[] agenlayer = GenLayer.func_180781_a(p_i45744_1_, p_i45744_3_, p_i45744_4_); ++ agenlayer = getModdedBiomeGenerators(p_i45744_3_, p_i45744_1_, agenlayer); + this.field_76944_d = agenlayer[0]; + this.field_76945_e = agenlayer[1]; + } +@@ -196,4 +198,11 @@ + { + this.field_76942_f.func_76838_a(); + } ++ ++ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) ++ { ++ net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); ++ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ return event.newBiomeGens; ++ } + } diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch deleted file mode 100644 index 5378a0e20..000000000 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/biome/WorldChunkManager.java -+++ ../src-work/minecraft/net/minecraft/world/biome/WorldChunkManager.java -@@ -16,6 +16,7 @@ - - public class WorldChunkManager - { -+ public static List allowedBiomes = Lists.newArrayList(BiomeGenBase.field_76767_f, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g, BiomeGenBase.field_76784_u, BiomeGenBase.field_76785_t, BiomeGenBase.field_76782_w, BiomeGenBase.field_76792_x); - private GenLayer field_76944_d; - private GenLayer field_76945_e; - private BiomeCache field_76942_f; -@@ -27,13 +28,7 @@ - this.field_76942_f = new BiomeCache(this); - this.field_180301_f = ""; - this.field_76943_g = Lists.newArrayList(); -- 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 p_i45744_1_, WorldType p_i45744_3_, String p_i45744_4_) -@@ -41,6 +36,7 @@ - this(); - this.field_180301_f = p_i45744_4_; - GenLayer[] agenlayer = GenLayer.func_180781_a(p_i45744_1_, p_i45744_3_, p_i45744_4_); -+ agenlayer = getModdedBiomeGenerators(p_i45744_3_, p_i45744_1_, agenlayer); - this.field_76944_d = agenlayer[0]; - this.field_76945_e = agenlayer[1]; - } -@@ -249,4 +245,11 @@ - { - this.field_76942_f.func_76838_a(); - } -+ -+ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) -+ { -+ net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); -+ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); -+ return event.newBiomeGens; -+ } - } diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 9f9c2fefc..7db81e41c 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -1,38 +1,38 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/Chunk.java +++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java -@@ -167,7 +167,7 @@ +@@ -175,7 +175,7 @@ { - Block block = this.func_150810_a(j, l - 1, k); + IBlockState iblockstate = this.func_186032_a(j, l - 1, k); -- if (block.func_149717_k() != 0) -+ if (func_150808_b(j, l - 1, k) != 0) +- if (iblockstate.func_185891_c() != 0) ++ if (iblockstate.getLightOpacity(this.field_76637_e, new BlockPos(j, l - 1, k)) != 0) { this.field_76634_f[k << 4 | j] = l; -@@ -440,12 +440,12 @@ +@@ -448,12 +448,12 @@ public int func_177437_b(BlockPos p_177437_1_) { -- return this.func_177428_a(p_177437_1_).func_149717_k(); -+ return this.func_177428_a(p_177437_1_).getLightOpacity(field_76637_e, p_177437_1_); +- return this.func_177435_g(p_177437_1_).func_185891_c(); ++ return this.func_177435_g(p_177437_1_).getLightOpacity(this.field_76637_e, p_177437_1_); } private int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { -- return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).func_149717_k(); -+ return func_177437_b(new BlockPos((field_76635_g << 4) + p_150808_1_, p_150808_2_, (field_76647_h << 4) + p_150808_3_)); +- return this.func_186032_a(p_150808_1_, p_150808_2_, p_150808_3_).func_185891_c(); ++ return this.func_186032_a(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(this.field_76637_e, new BlockPos(p_150808_1_, p_150808_2_, p_150808_3_)); } - private Block func_150810_a(int p_150810_1_, int p_150810_2_, int p_150810_3_) -@@ -607,6 +607,7 @@ + public IBlockState func_177435_g(BlockPos p_177435_1_) +@@ -534,6 +534,7 @@ { Block block = p_177436_2_.func_177230_c(); Block block1 = iblockstate.func_177230_c(); -+ int k1 = block1.getLightOpacity(this.field_76637_e, p_177436_1_); // Relocate old light value lookup here, so that it is called before TE is removed. ++ int k1 = iblockstate.getLightOpacity(this.field_76637_e, p_177436_1_); // Relocate old light value lookup here, so that it is called before TE is removed. ExtendedBlockStorage extendedblockstorage = this.field_76652_q[j >> 4]; boolean flag = false; -@@ -623,14 +624,19 @@ +@@ -550,14 +551,19 @@ extendedblockstorage.func_177484_a(i, j & 15, k, p_177436_2_); @@ -54,17 +54,17 @@ this.field_76637_e.func_175713_t(p_177436_1_); } } -@@ -647,8 +653,7 @@ +@@ -574,8 +580,7 @@ } else { -- int j1 = block.func_149717_k(); -- int k1 = block1.func_149717_k(); -+ int j1 = block.getLightOpacity(this.field_76637_e, p_177436_1_); +- int j1 = p_177436_2_.func_185891_c(); +- int k1 = iblockstate.func_185891_c(); ++ int j1 = p_177436_2_.getLightOpacity(this.field_76637_e, p_177436_1_); if (j1 > 0) { -@@ -668,28 +673,18 @@ +@@ -595,28 +600,18 @@ } } @@ -95,7 +95,7 @@ this.field_76637_e.func_175690_a(p_177436_1_, tileentity1); } -@@ -792,6 +787,7 @@ +@@ -719,6 +714,7 @@ k = this.field_76645_j.length - 1; } @@ -103,13 +103,12 @@ p_76612_1_.field_70175_ag = true; p_76612_1_.field_70176_ah = this.field_76635_g; p_76612_1_.field_70162_ai = k; -@@ -830,13 +826,20 @@ - private TileEntity func_177422_i(BlockPos p_177422_1_) +@@ -758,13 +754,19 @@ { - Block block = this.func_177428_a(p_177422_1_); -- return !block.func_149716_u() ? null : ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, this.func_177418_c(p_177422_1_)); -+ IBlockState state = block.func_176203_a(this.func_177418_c(p_177422_1_)); -+ return !block.hasTileEntity(state) ? null : block.createTileEntity(this.field_76637_e, state); + IBlockState iblockstate = this.func_177435_g(p_177422_1_); + Block block = iblockstate.func_177230_c(); +- return !block.func_149716_u() ? null : ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, iblockstate.func_177230_c().func_176201_c(iblockstate)); ++ return !block.hasTileEntity(iblockstate) ? null : block.createTileEntity(this.field_76637_e, iblockstate); } public TileEntity func_177424_a(BlockPos p_177424_1_, Chunk.EnumCreateEntityType p_177424_2_) @@ -125,7 +124,7 @@ if (tileentity == null) { if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) -@@ -846,14 +849,9 @@ +@@ -774,14 +776,9 @@ } else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED) { @@ -141,16 +140,16 @@ return tileentity; } -@@ -873,7 +871,7 @@ +@@ -801,7 +798,7 @@ p_177426_2_.func_145834_a(this.field_76637_e); p_177426_2_.func_174878_a(p_177426_1_); -- if (this.func_177428_a(p_177426_1_) instanceof ITileEntityProvider) -+ if (this.func_177428_a(p_177426_1_).hasTileEntity(func_177428_a(p_177426_1_).func_176203_a(this.func_177418_c(p_177426_1_)))) +- if (this.func_177435_g(p_177426_1_).func_177230_c() instanceof ITileEntityProvider) ++ if (this.func_177435_g(p_177426_1_).func_177230_c().hasTileEntity(this.func_177435_g(p_177426_1_))) { if (this.field_150816_i.containsKey(p_177426_1_)) { -@@ -882,6 +880,7 @@ +@@ -810,6 +807,7 @@ p_177426_2_.func_145829_t(); this.field_150816_i.put(p_177426_1_, p_177426_2_); @@ -158,7 +157,7 @@ } } -@@ -910,8 +909,9 @@ +@@ -838,8 +836,9 @@ entity.func_110123_P(); } @@ -169,7 +168,7 @@ } public void func_76623_d() -@@ -927,6 +927,7 @@ +@@ -855,6 +854,7 @@ { this.field_76637_e.func_175681_c(this.field_76645_j[i]); } @@ -177,7 +176,7 @@ } public void func_76630_e() -@@ -936,8 +937,8 @@ +@@ -864,8 +864,8 @@ public void func_177414_a(Entity p_177414_1_, AxisAlignedBB p_177414_2_, List p_177414_3_, Predicate p_177414_4_) { @@ -188,7 +187,7 @@ 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); -@@ -976,8 +977,8 @@ +@@ -904,8 +904,8 @@ public void func_177430_a(Class p_177430_1_, AxisAlignedBB p_177430_2_, List p_177430_3_, Predicate p_177430_4_) { @@ -199,21 +198,26 @@ 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); -@@ -1137,8 +1138,10 @@ - while (!this.field_177447_w.isEmpty()) +@@ -994,6 +994,7 @@ + { + this.func_150809_p(); + p_186034_1_.func_185931_b(this.field_76635_g, this.field_76647_h); ++ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(this.field_76635_g, this.field_76647_h, this.field_76637_e, p_186034_1_, this.field_76637_e.func_72863_F()); + this.func_76630_e(); + } + } +@@ -1050,7 +1051,7 @@ { BlockPos blockpos = (BlockPos)this.field_177447_w.poll(); -+ Block block = this.func_177428_a(blockpos); -+ IBlockState state = block.func_176203_a(this.func_177418_c(blockpos)); -- if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177428_a(blockpos).func_149716_u()) -+ if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && block.hasTileEntity(state)) +- if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177435_g(blockpos).func_177230_c().func_149716_u()) ++ if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177435_g(blockpos).func_177230_c().hasTileEntity(this.func_177435_g(blockpos))) { TileEntity tileentity = this.func_177422_i(blockpos); this.field_76637_e.func_175690_a(blockpos, tileentity); -@@ -1200,6 +1203,13 @@ +@@ -1114,6 +1115,13 @@ @SideOnly(Side.CLIENT) - public void func_177439_a(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) + public void func_186033_a(PacketBuffer p_186033_1_, int p_186033_2_, boolean p_186033_3_) { + for(TileEntity tileEntity : field_150816_i.values()) + { @@ -222,10 +226,10 @@ + tileEntity.func_145838_q(); + } + - int i = 0; boolean flag = !this.field_76637_e.field_73011_w.func_177495_o(); -@@ -1267,10 +1277,16 @@ + for (int i = 0; i < this.field_76652_q.length; ++i) +@@ -1162,10 +1170,16 @@ this.field_76646_k = true; this.func_76590_a(); @@ -241,8 +245,33 @@ + for (TileEntity te : invalidList) te.func_145843_s(); } - public BiomeGenBase func_177411_a(BlockPos p_177411_1_, WorldChunkManager p_177411_2_) -@@ -1583,4 +1599,20 @@ + public BiomeGenBase func_177411_a(BlockPos p_177411_1_, BiomeProvider p_177411_2_) +@@ -1233,13 +1247,13 @@ + BlockPos blockpos1 = blockpos.func_177982_a(k, (j << 4) + i1, l); + boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15; + +- if (this.field_76652_q[j] == field_186036_a && flag || this.field_76652_q[j] != field_186036_a && this.field_76652_q[j].func_177485_a(k, i1, l).func_185904_a() == Material.field_151579_a) ++ if (this.field_76652_q[j] == field_186036_a && flag || this.field_76652_q[j] != field_186036_a && this.field_76652_q[j].func_177485_a(k, i1, l).func_177230_c().isAir(this.field_76652_q[j].func_177485_a(k, i1, l), this.field_76637_e, blockpos1)) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + BlockPos blockpos2 = blockpos1.func_177972_a(enumfacing); + +- if (this.field_76637_e.func_180495_p(blockpos2).func_185906_d() > 0) ++ if (this.field_76637_e.func_180495_p(blockpos2).getLightValue(this.field_76637_e, blockpos2) > 0) + { + this.field_76637_e.func_175664_x(blockpos2); + } +@@ -1370,7 +1384,7 @@ + { + blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.func_177958_n(), l, blockpos$mutableblockpos.func_177952_p()); + +- if (this.func_177435_g(blockpos$mutableblockpos).func_185906_d() > 0) ++ if (this.func_177435_g(blockpos$mutableblockpos).getLightValue(this.field_76637_e, blockpos$mutableblockpos) > 0) + { + this.field_76637_e.func_175664_x(blockpos$mutableblockpos); + } +@@ -1481,4 +1495,20 @@ QUEUED, CHECK; } 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 cd92eee57..50331158f 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java -@@ -42,8 +42,41 @@ - this.field_75825_d = p_i2003_1_; +@@ -46,8 +46,41 @@ + this.field_186055_e = p_i46673_2_; } + public boolean chunkExists(World world, int x, int z) @@ -42,8 +42,8 @@ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_75815_2_, p_75815_3_); NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkcoordintpair); -@@ -59,11 +92,17 @@ - nbttagcompound = CompressedStreamTools.func_74794_a(datainputstream); +@@ -63,11 +96,17 @@ + nbttagcompound = this.field_186055_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream)); } - return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); @@ -61,11 +61,11 @@ if (!p_75822_4_.func_150297_b("Level", 10)) { field_151505_a.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing level data, skipping"); -@@ -87,10 +126,29 @@ +@@ -91,10 +130,29 @@ field_151505_a.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is in the wrong location; relocating. (Expected " + p_75822_2_ + ", " + p_75822_3_ + ", got " + chunk.field_76635_g + ", " + chunk.field_76647_h + ")"); nbttagcompound.func_74768_a("xPos", p_75822_2_); nbttagcompound.func_74768_a("zPos", p_75822_3_); -+ ++ + // Have to move tile entities since we don't load them at this stage + NBTTagList _tileEntities = nbttagcompound.func_150295_c("TileEntities", 10); + @@ -92,43 +92,41 @@ } } } -@@ -105,6 +163,7 @@ - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); +@@ -110,6 +168,7 @@ nbttagcompound.func_74782_a("Level", nbttagcompound1); + nbttagcompound.func_74768_a("DataVersion", 169); this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound); } catch (Exception exception) -@@ -281,11 +340,20 @@ - { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); +@@ -265,8 +324,17 @@ -+ try -+ { - if (entity.func_70039_c(nbttagcompound1)) + if (entity.func_70039_c(nbttagcompound2)) { ++ try ++ { p_75820_1_.func_177409_g(true); - nbttaglist1.func_74742_a(nbttagcompound1); + nbttaglist1.func_74742_a(nbttagcompound2); ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, ++ "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", ++ entity.getClass().getName()); ++ } } -+ } -+ catch (Exception e) -+ { -+ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, -+ "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", -+ entity.getClass().getName()); -+ } } } +@@ -276,9 +344,18 @@ -@@ -295,8 +363,17 @@ for (TileEntity tileentity : p_75820_1_.func_177434_r().values()) { - NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + try + { - tileentity.func_145841_b(nbttagcompound2); - nbttaglist2.func_74742_a(nbttagcompound2); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + tileentity.func_145841_b(nbttagcompound3); + nbttaglist2.func_74742_a(nbttagcompound3); + } + catch (Exception e) + { @@ -139,7 +137,7 @@ } p_75820_3_.func_74782_a("TileEntities", nbttaglist2); -@@ -376,6 +453,12 @@ +@@ -347,6 +424,12 @@ chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes")); } @@ -152,11 +150,12 @@ NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10); if (nbttaglist1 != null) -@@ -447,7 +530,5 @@ +@@ -399,8 +482,6 @@ } } } - - return chunk; } - } + + public static Entity func_186050_a(NBTTagCompound p_186050_0_, World p_186050_1_, Chunk p_186050_2_) 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 9e563a70b..82936874a 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -20,18 +20,12 @@ +@@ -21,18 +21,12 @@ { File file1 = this.func_75765_b(); @@ -10,14 +10,14 @@ - File file3 = new File(file1, "DIM-1"); + File file3 = new File(file1, p_75763_1_.getSaveFolder()); file3.mkdirs(); - return new AnvilChunkLoader(file3); + return new AnvilChunkLoader(file3, this.field_186341_a); } - else if (p_75763_1_ instanceof WorldProviderEnd) - { - File file2 = new File(file1, "DIM1"); - file2.mkdirs(); -- return new AnvilChunkLoader(file2); +- return new AnvilChunkLoader(file2, this.field_186341_a); - } else { - return new AnvilChunkLoader(file1); + return new AnvilChunkLoader(file1, this.field_186341_a); diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch index 1992d6dad..4f7ea6449 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/RegionFile.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/RegionFile.java -@@ -101,6 +101,39 @@ +@@ -94,6 +94,39 @@ } } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index f4cec46a7..370b21be0 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -1,67 +1,72 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java -@@ -32,6 +32,9 @@ - double[] field_73193_e; - double[] field_73190_f; - double[] field_73191_g; +@@ -39,6 +39,9 @@ + double[] field_185967_f; + double[] field_185968_g; + private final WorldGenEndIsland field_185975_r = new WorldGenEndIsland(); + // temporary variables used during event handling + private int chunkX = 0; + private int chunkZ = 0; - public ChunkProviderEnd(World p_i2007_1_, long p_i2007_2_) + public ChunkProviderEnd(World p_i46667_1_, boolean p_i46667_2_, long p_i46667_3_) { -@@ -42,6 +45,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); +@@ -51,6 +54,16 @@ + this.field_73214_a = new NoiseGeneratorOctaves(this.field_73220_k, 10); + this.field_73212_b = new NoiseGeneratorOctaves(this.field_73220_k, 16); + this.field_185973_o = new NoiseGeneratorSimplex(this.field_73220_k); + -+ NoiseGenerator[] noiseGens = {field_73201_j, field_73202_k, field_73199_l, field_73196_a, field_73194_b}; -+ noiseGens = net.minecraftforge.event.terraingen.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]; ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd(field_185969_i, field_185970_j, field_185971_k, field_73214_a, field_73212_b, field_185973_o); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i46667_1_, this.field_73220_k, ctx); ++ this.field_185969_i = ctx.getLPerlin1(); ++ this.field_185970_j = ctx.getLPerlin2(); ++ this.field_185971_k = ctx.getPerlin(); ++ this.field_73214_a = ctx.getDepth(); ++ this.field_73212_b = ctx.getScale(); ++ this.field_185973_o = ctx.getIsland(); } - public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer p_180520_3_) -@@ -114,6 +125,9 @@ + public void func_180518_a(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) +@@ -123,6 +136,7 @@ - public void func_180519_a(ChunkPrimer p_180519_1_) + public void func_185962_a(ChunkPrimer p_185962_1_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, chunkX, chunkZ, p_180519_1_, this.field_73200_m); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, this.chunkX, this.chunkZ, p_185962_1_, this.field_73230_p)) return; for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) -@@ -165,6 +179,7 @@ +@@ -174,6 +188,7 @@ - public Chunk func_73154_d(int p_73154_1_, int p_73154_2_) + public Chunk func_185932_a(int p_185932_1_, int p_185932_2_) { -+ chunkX = p_73154_1_; chunkZ = p_73154_2_; - this.field_73204_i.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); ++ this.chunkX = p_185932_1_; this.chunkZ = p_185932_2_; + this.field_73220_k.setSeed((long)p_185932_1_ * 341873128712L + (long)p_185932_2_ * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); - this.field_73198_o = this.field_73200_m.func_72959_q().func_76933_b(this.field_73198_o, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); -@@ -184,6 +199,10 @@ + this.field_73231_z = this.field_73230_p.func_72959_q().func_76933_b(this.field_73231_z, p_185932_1_ * 16, p_185932_2_ * 16, 16, 16); +@@ -255,6 +270,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_) + private double[] func_185963_a(double[] p_185963_1_, int p_185963_2_, int p_185963_3_, int p_185963_4_, int p_185963_5_, int p_185963_6_, int p_185963_7_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); ++ net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185963_1_, p_185963_2_, p_185963_3_, p_185963_4_, p_185963_5_, p_185963_6_, p_185963_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; + - if (p_73187_1_ == null) + if (p_185963_1_ == null) { - p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; -@@ -273,8 +292,10 @@ - public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + p_185963_1_ = new double[p_185963_5_ * p_185963_6_ * p_185963_7_]; +@@ -327,6 +346,7 @@ + public void func_185931_b(int p_185931_1_, int p_185931_2_) { BlockFalling.field_149832_M = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); - BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); - this.field_73200_m.func_180494_b(blockpos.func_177982_a(16, 0, 16)).func_180624_a(this.field_73200_m, this.field_73200_m.field_73012_v, blockpos); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_73230_p, p_185931_1_, p_185931_2_, false); + BlockPos blockpos = new BlockPos(p_185931_1_ * 16, 0, p_185931_2_ * 16); + + if (this.field_73229_q) +@@ -374,6 +394,7 @@ + } + } + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_73230_p, p_185931_1_, p_185931_2_, 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 deleted file mode 100644 index d8d3ed7df..000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java -+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java -@@ -58,6 +58,15 @@ - - public ChunkProviderGenerate(World p_i45636_1_, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) - { -+ { -+ field_73226_t = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73226_t, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); -+ field_73225_u = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73225_u, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); -+ field_73224_v = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73224_v, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); -+ field_73223_w = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73223_w, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); -+ field_73233_x = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73233_x, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); -+ field_73232_y = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73232_y, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); -+ field_177474_A = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_177474_A, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); -+ } - this.field_73230_p = p_i45636_1_; - this.field_73229_q = p_i45636_4_; - this.field_177475_o = p_i45636_1_.func_72912_H().func_76067_t(); -@@ -87,6 +96,16 @@ - this.field_177476_s = this.field_177477_r.field_177778_E ? Blocks.field_150353_l : Blocks.field_150355_j; - p_i45636_1_.func_181544_b(this.field_177477_r.field_177841_q); - } -+ -+ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, field_73214_a, field_73212_b, field_73213_c}; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45636_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.field_73214_a = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.field_73212_b = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.field_73213_c = (NoiseGeneratorOctaves)noiseGens[6]; - } - - public void func_180518_a(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) -@@ -160,6 +179,10 @@ - - public void func_180517_a(int p_180517_1_, int p_180517_2_, ChunkPrimer p_180517_3_, BiomeGenBase[] p_180517_4_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180517_1_, p_180517_2_, p_180517_3_, this.field_73230_p); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; -+ - double d0 = 0.03125D; - this.field_73227_s = this.field_147430_m.func_151599_a(this.field_73227_s, (double)(p_180517_1_ * 16), (double)(p_180517_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); - -@@ -366,6 +389,8 @@ - boolean flag = false; - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); -+ - if (this.field_177477_r.field_177829_w && this.field_73229_q) - { - this.field_73223_w.func_175794_a(this.field_73230_p, this.field_73220_k, chunkcoordintpair); -@@ -391,7 +416,8 @@ - this.field_177474_A.func_175794_a(this.field_73230_p, this.field_73220_k, chunkcoordintpair); - } - -- if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && this.field_177477_r.field_177781_A && !flag && this.field_73220_k.nextInt(this.field_177477_r.field_177782_B) == 0) -+ if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && this.field_177477_r.field_177781_A && !flag && this.field_73220_k.nextInt(this.field_177477_r.field_177782_B) == 0 -+ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) - { - int i1 = this.field_73220_k.nextInt(16) + 8; - int j1 = this.field_73220_k.nextInt(256); -@@ -399,7 +425,8 @@ - (new WorldGenLakes(Blocks.field_150355_j)).func_180709_b(this.field_73230_p, this.field_73220_k, blockpos.func_177982_a(i1, j1, k1)); - } - -- if (!flag && this.field_73220_k.nextInt(this.field_177477_r.field_177777_D / 10) == 0 && this.field_177477_r.field_177783_C) -+ if (!flag && this.field_73220_k.nextInt(this.field_177477_r.field_177777_D / 10) == 0 && this.field_177477_r.field_177783_C && -+ net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) - { - int i2 = this.field_73220_k.nextInt(16) + 8; - int l2 = this.field_73220_k.nextInt(this.field_73220_k.nextInt(248) + 8); -@@ -413,7 +440,8 @@ - - if (this.field_177477_r.field_177837_s) - { -- for (int j2 = 0; j2 < this.field_177477_r.field_177835_t; ++j2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON); -+ for (int j2 = 0; doGen && j2 < this.field_177477_r.field_177835_t; ++j2) - { - int i3 = this.field_73220_k.nextInt(16) + 8; - int l3 = this.field_73220_k.nextInt(256); -@@ -423,10 +451,14 @@ - } - - biomegenbase.func_180624_a(this.field_73230_p, this.field_73220_k, new BlockPos(i, 0, j)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) -+ { - SpawnerAnimals.func_77191_a(this.field_73230_p, biomegenbase, i + 8, j + 8, 16, 16, this.field_73220_k); -+ } - blockpos = blockpos.func_177982_a(8, 0, 8); - -- for (int k2 = 0; k2 < 16; ++k2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE); -+ for (int k2 = 0; doGen && k2 < 16; ++k2) - { - for (int j3 = 0; j3 < 16; ++j3) - { -@@ -445,6 +477,8 @@ - } - } - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); -+ - 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 216df8267..f54b2aa4a 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -1,141 +1,104 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java -@@ -49,8 +49,8 @@ - private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.field_150356_k, false); - private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.field_150338_P); - private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.field_150337_Q); -- private final MapGenNetherBridge field_73172_c = new MapGenNetherBridge(); -- private final MapGenBase field_73182_t = new MapGenCavesHell(); -+ private final MapGenNetherBridge field_73172_c; -+ private final MapGenBase field_73182_t; - double[] field_73169_d; - double[] field_73170_e; - double[] field_73167_f; -@@ -59,16 +59,29 @@ - - public ChunkProviderHell(World p_i45637_1_, boolean p_i45637_2_, long p_i45637_3_) - { -+ this.field_73172_c = (MapGenNetherBridge) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenNetherBridge(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); -+ this.field_73182_t = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenCavesHell(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); - this.field_73175_o = p_i45637_1_; - this.field_177466_i = p_i45637_2_; - this.field_73181_i = new Random(p_i45637_3_); -- this.field_73178_j = new NoiseGeneratorOctaves(this.field_73181_i, 16); -- this.field_73179_k = new NoiseGeneratorOctaves(this.field_73181_i, 16); -- this.field_73176_l = new NoiseGeneratorOctaves(this.field_73181_i, 8); -- this.field_73177_m = new NoiseGeneratorOctaves(this.field_73181_i, 4); -- 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); -+ NoiseGeneratorOctaves netherNoiseGen1 = new NoiseGeneratorOctaves(this.field_73181_i, 16); -+ NoiseGeneratorOctaves netherNoiseGen2 = new NoiseGeneratorOctaves(this.field_73181_i, 16); -+ NoiseGeneratorOctaves netherNoiseGen3 = new NoiseGeneratorOctaves(this.field_73181_i, 8); -+ NoiseGeneratorOctaves slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.field_73181_i, 4); -+ NoiseGeneratorOctaves netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.field_73181_i, 4); -+ NoiseGeneratorOctaves netherNoiseGen6 = new NoiseGeneratorOctaves(this.field_73181_i, 10); -+ NoiseGeneratorOctaves netherNoiseGen7 = new NoiseGeneratorOctaves(this.field_73181_i, 16); -+ NoiseGenerator[] noiseGens = new NoiseGenerator[] { -+ netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7 -+ }; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45637_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]; +@@ -76,6 +76,19 @@ + this.field_185946_g = new NoiseGeneratorOctaves(this.field_185954_p, 10); + this.field_185947_h = new NoiseGeneratorOctaves(this.field_185954_p, 16); p_i45637_1_.func_181544_b(63); ++ ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell(field_185957_u, field_185958_v, field_185959_w, field_73177_m, field_73174_n, field_185946_g, field_185947_h); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45637_1_, this.field_185954_p, ctx); ++ this.field_185957_u = ctx.getLPerlin1(); ++ this.field_185958_v = ctx.getLPerlin2(); ++ this.field_185959_w = ctx.getPerlin(); ++ this.field_73177_m = ctx.getPerlin2(); ++ this.field_73174_n = ctx.getPerlin3(); ++ this.field_185946_g = ctx.getScale(); ++ this.field_185947_h = ctx.getDepth(); ++ this.field_73172_c = (MapGenNetherBridge)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73172_c, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); ++ this.field_185939_I = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185939_I, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); } -@@ -148,6 +161,10 @@ + public void func_185936_a(int p_185936_1_, int p_185936_2_, ChunkPrimer p_185936_3_) +@@ -154,6 +167,7 @@ - public void func_180516_b(int p_180516_1_, int p_180516_2_, ChunkPrimer p_180516_3_) + public void func_185937_b(int p_185937_1_, int p_185937_2_, ChunkPrimer p_185937_3_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180516_1_, p_180516_2_, p_180516_3_, this.field_73175_o); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; -+ - int i = this.field_73175_o.func_181545_F() + 1; ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, p_185937_1_, p_185937_2_, p_185937_3_, this.field_185952_n)) return; + int i = this.field_185952_n.func_181545_F() + 1; double d0 = 0.03125D; - this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); -@@ -265,6 +282,10 @@ + this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_185937_1_ * 16, p_185937_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); +@@ -276,6 +290,10 @@ + p_185938_1_ = new double[p_185938_5_ * p_185938_6_ * p_185938_7_]; + } - 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_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); ++ net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185938_1_, p_185938_2_, p_185938_3_, p_185938_4_, p_185938_5_, p_185938_6_, p_185938_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; + - if (p_73164_1_ == null) - { - p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; -@@ -356,50 +377,60 @@ - public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + double d0 = 684.412D; + double d1 = 2053.236D; + this.field_73168_g = this.field_185946_g.func_76304_a(this.field_73168_g, p_185938_2_, p_185938_3_, p_185938_4_, p_185938_5_, 1, p_185938_7_, 1.0D, 0.0D, 1.0D); +@@ -357,20 +375,25 @@ + public void func_185931_b(int p_185931_1_, int p_185931_2_) { BlockFalling.field_149832_M = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); - BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); - this.field_73172_c.func_175794_a(this.field_73175_o, this.field_73181_i, chunkcoordintpair); ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_185952_n, p_185931_1_, p_185931_2_, false); + BlockPos blockpos = new BlockPos(p_185931_1_ * 16, 0, p_185931_2_ * 16); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_185931_1_, p_185931_2_); + this.field_73172_c.func_175794_a(this.field_185952_n, this.field_185954_p, chunkcoordintpair); -- for (int i = 0; i < 8; ++i) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA); -+ for (int i = 0; doGen && i < 8; ++i) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA)) + for (int i = 0; i < 8; ++i) { - this.field_177472_y.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); + this.field_177472_y.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); } -- for (int j = 0; j < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; ++j) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE); -+ for (int j = 0; doGen && j < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; ++j) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE)) + for (int j = 0; j < this.field_185954_p.nextInt(this.field_185954_p.nextInt(10) + 1) + 1; ++j) { - this.field_177470_t.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); + this.field_177470_t.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); } -- for (int k = 0; k < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); ++k) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE); -+ for (int k = 0; doGen && k < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); ++k) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE)) ++ { + for (int k = 0; k < this.field_185954_p.nextInt(this.field_185954_p.nextInt(10) + 1); ++k) { - this.field_177469_u.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); - } - -- for (int l = 0; l < 10; ++l) -+ for (int l = 0; doGen && l < 10; ++l) + this.field_177469_u.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); +@@ -380,7 +403,13 @@ { - this.field_177468_v.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); + this.field_177468_v.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); } ++ }//Forge: End doGLowstone -- if (this.field_73181_i.nextBoolean()) -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(field_73175_o, field_73181_i, blockpos)); ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_185952_n, p_185931_1_, p_185931_2_, false); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(this.field_185952_n, this.field_185954_p, blockpos)); + -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.decorate(field_73175_o, field_73181_i, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM); -+ if (doGen && this.field_73181_i.nextBoolean()) ++ if (net.minecraftforge.event.terraingen.TerrainGen.decorate(this.field_185952_n, this.field_185954_p, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) ++ { + if (this.field_185954_p.nextBoolean()) { - this.field_177471_z.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); + this.field_177471_z.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); +@@ -390,17 +419,22 @@ + { + this.field_177465_A.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); + } ++ } + ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(this.field_185952_n, this.field_185954_p, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ)) + for (int i1 = 0; i1 < 16; ++i1) + { + this.field_177467_w.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16), this.field_185954_p.nextInt(108) + 10, this.field_185954_p.nextInt(16))); } -- if (this.field_73181_i.nextBoolean()) -+ if (doGen && this.field_73181_i.nextBoolean()) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2)) + for (int j1 = 0; j1 < 16; ++j1) { - this.field_177465_A.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); + this.field_177473_x.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16), this.field_185954_p.nextInt(108) + 10, this.field_185954_p.nextInt(16))); } -- for (int i1 = 0; i1 < 16; ++i1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_73175_o, field_73181_i, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ); -+ for (int i1 = 0; doGen && i1 < 16; ++i1) - { - this.field_177467_w.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16), this.field_73181_i.nextInt(108) + 10, this.field_73181_i.nextInt(16))); - } - -- for (int j1 = 0; j1 < 16; ++j1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2); -+ for (int j1 = 0; doGen && j1 < 16; ++j1) - { - this.field_177473_x.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16), this.field_73181_i.nextInt(108) + 10, this.field_73181_i.nextInt(16))); - } - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(this.field_185952_n, this.field_185954_p, blockpos)); ++ BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderOverworld.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderOverworld.java.patch new file mode 100644 index 000000000..61da97cbd --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderOverworld.java.patch @@ -0,0 +1,101 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderOverworld.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderOverworld.java +@@ -59,6 +59,15 @@ + + public ChunkProviderOverworld(World p_i46668_1_, long p_i46668_2_, boolean p_i46668_4_, String p_i46668_5_) + { ++ { ++ field_186003_v = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186003_v, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); ++ field_186004_w = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186004_w, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); ++ field_186005_x = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186005_x, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); ++ field_186006_y = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186006_y, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); ++ field_186007_z = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186007_z, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); ++ field_185979_A = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185979_A, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); ++ field_185980_B = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185980_B, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); ++ } + this.field_185995_n = p_i46668_1_; + this.field_185996_o = p_i46668_4_; + this.field_185997_p = p_i46668_1_.func_72912_H().func_76067_t(); +@@ -88,6 +97,17 @@ + this.field_186001_t = this.field_186000_s.field_177778_E ? Blocks.field_150353_l.func_176223_P() : Blocks.field_150355_j.func_176223_P(); + p_i46668_1_.func_181544_b(this.field_186000_s.field_177841_q); + } ++ ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextOverworld ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextOverworld(field_185991_j, field_185992_k, field_185993_l, field_185994_m, field_185983_b, field_185984_c, field_185985_d); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i46668_1_, this.field_185990_i, ctx); ++ this.field_185991_j = ctx.getLPerlin1(); ++ this.field_185992_k = ctx.getLPerlin2(); ++ this.field_185993_l = ctx.getPerlin(); ++ this.field_185994_m = ctx.getHeight(); ++ this.field_185983_b = ctx.getScale(); ++ this.field_185984_c = ctx.getDepth(); ++ this.field_185985_d = ctx.getForest(); + } + + public void func_185976_a(int p_185976_1_, int p_185976_2_, ChunkPrimer p_185976_3_) +@@ -161,6 +181,7 @@ + + public void func_185977_a(int p_185977_1_, int p_185977_2_, ChunkPrimer p_185977_3_, BiomeGenBase[] p_185977_4_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, p_185977_1_, p_185977_2_, p_185977_3_, this.field_185995_n)) return; + double d0 = 0.03125D; + this.field_186002_u = this.field_185994_m.func_151599_a(this.field_186002_u, (double)(p_185977_1_ * 16), (double)(p_185977_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + +@@ -365,6 +386,8 @@ + boolean flag = false; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_185931_1_, p_185931_2_); + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_185995_n, p_185931_1_, p_185931_2_, flag); ++ + if (this.field_185996_o) + { + if (this.field_186000_s.field_177829_w) +@@ -394,6 +417,7 @@ + } + + if (biomegenbase != Biomes.field_76769_d && biomegenbase != Biomes.field_76786_s && this.field_186000_s.field_177781_A && !flag && this.field_185990_i.nextInt(this.field_186000_s.field_177782_B) == 0) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) + { + int i1 = this.field_185990_i.nextInt(16) + 8; + int j1 = this.field_185990_i.nextInt(256); +@@ -402,6 +426,7 @@ + } + + if (!flag && this.field_185990_i.nextInt(this.field_186000_s.field_177777_D / 10) == 0 && this.field_186000_s.field_177783_C) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) + { + int i2 = this.field_185990_i.nextInt(16) + 8; + int l2 = this.field_185990_i.nextInt(this.field_185990_i.nextInt(248) + 8); +@@ -414,6 +439,7 @@ + } + + if (this.field_186000_s.field_177837_s) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON)) + { + for (int j2 = 0; j2 < this.field_186000_s.field_177835_t; ++j2) + { +@@ -425,9 +451,12 @@ + } + + biomegenbase.func_180624_a(this.field_185995_n, this.field_185990_i, new BlockPos(i, 0, j)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) + WorldEntitySpawner.func_77191_a(this.field_185995_n, biomegenbase, i + 8, j + 8, 16, 16, this.field_185990_i); + blockpos = blockpos.func_177982_a(8, 0, 8); + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE)) ++ { + for (int k2 = 0; k2 < 16; ++k2) + { + for (int j3 = 0; j3 < 16; ++j3) +@@ -446,7 +475,10 @@ + } + } + } ++ }//Forge: End ICE + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_185995_n, p_185931_1_, p_185931_2_, flag); ++ + 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 cd28c7ec7..0b75b8269 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -1,34 +1,25 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java -@@ -36,6 +36,7 @@ - public LongHashMap field_73244_f = new LongHashMap(); - public List field_73245_g = Lists.newArrayList(); - public WorldServer field_73251_h; +@@ -33,6 +33,7 @@ + public final LongHashMap field_73244_f = new LongHashMap(); + public final List field_73245_g = Lists.newArrayList(); + public final WorldServer field_73251_h; + private Set loadingChunks = com.google.common.collect.Sets.newHashSet(); - public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) + public ChunkProviderServer(WorldServer p_i46838_1_, IChunkLoader p_i46838_2_, IChunkGenerator p_i46838_3_) { -@@ -57,7 +58,7 @@ +@@ -92,14 +93,65 @@ - public void func_73241_b(int p_73241_1_, int p_73241_2_) + public Chunk func_186025_d(int p_186025_1_, int p_186025_2_) { -- if (this.field_73251_h.field_73011_w.func_76567_e()) -+ if (this.field_73251_h.field_73011_w.func_76567_e() && net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.func_177502_q())) - { - if (!this.field_73251_h.func_72916_c(p_73241_1_, p_73241_2_)) - { -@@ -80,12 +81,64 @@ - - public Chunk func_73158_c(int p_73158_1_, int p_73158_2_) - { -+ return loadChunk(p_73158_1_, p_73158_2_, null); ++ return loadChunk(p_186025_1_, p_186025_2_, null); + } + -+ public Chunk loadChunk(int par1, int par2, Runnable runnable) ++ public Chunk loadChunk(int X, int Z, Runnable runnable) + { -+ long k = ChunkCoordIntPair.func_77272_a(par1, par2); -+ this.field_73248_b.remove(Long.valueOf(k)); -+ Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(k); ++ long pos = ChunkCoordIntPair.func_77272_a(X, Z); ++ this.field_73248_b.remove(Long.valueOf(pos)); ++ Chunk chunk = this.field_73244_f.func_76164_a(pos); + net.minecraft.world.chunk.storage.AnvilChunkLoader loader = null; + + if (this.field_73247_e instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader) @@ -37,21 +28,21 @@ + } + + // We can only use the queue for already generated chunks -+ if (chunk == null && loader != null && loader.chunkExists(this.field_73251_h, par1, par2)) ++ if (chunk == null && loader != null && loader.chunkExists(this.field_73251_h, X, Z)) + { + if (runnable != null) + { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, par1, par2, runnable); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, X, Z, runnable); + return null; + } + else + { -+ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, par1, par2); ++ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, X, Z); + } + } + else if (chunk == null) + { -+ chunk = this.originalLoadChunk(par1, par2); ++ chunk = this.originalLoadChunk(X, Z); + } + + // If we didn't load the chunk async and have a callback run it now @@ -63,42 +54,36 @@ + return chunk; + } + -+ public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_) ++ public Chunk originalLoadChunk(int p_186025_1_, int p_186025_2_) + { - long i = ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_); - this.field_73248_b.remove(Long.valueOf(i)); - Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(i); + Chunk chunk = this.func_186028_c(p_186025_1_, p_186025_2_); if (chunk == null) { -+ boolean added = loadingChunks.add(i); -+ if (!added) + long i = ChunkCoordIntPair.func_77272_a(p_186025_1_, p_186025_2_); +- chunk = this.func_73239_e(p_186025_1_, p_186025_2_); ++ if (!loadingChunks.add(i)) + { -+ net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in di >mension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, field_73251_h.field_73011_w.func_177502_q()); ++ net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in di >mension %d that is already being loaded. This will cause weird chunk breakages.", p_186025_1_, p_186025_2_, field_73251_h.field_73011_w.getDimension()); + } + chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(i, this.field_73251_h); -+ -+ if (chunk == null) - chunk = this.func_73239_e(p_73158_1_, p_73158_2_); if (chunk == null) -@@ -114,6 +167,7 @@ ++ chunk = this.func_73239_e(p_186025_1_, p_186025_2_); ++ ++ if (chunk == null) + { + try + { +@@ -118,6 +170,7 @@ this.field_73244_f.func_76163_a(i, chunk); this.field_73245_g.add(chunk); + loadingChunks.remove(i); chunk.func_76631_c(); - chunk.func_76624_a(this, this, p_73158_1_, p_73158_2_); + chunk.func_186030_a(this, this.field_186029_c); } -@@ -205,6 +259,7 @@ - if (this.field_73246_d != null) - { - this.field_73246_d.func_73153_a(p_73153_1_, p_73153_2_, p_73153_3_); -+ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(p_73153_2_, p_73153_3_, field_73251_h, field_73246_d, p_73153_1_); - chunk.func_76630_e(); - } - } -@@ -266,6 +321,11 @@ +@@ -214,6 +267,11 @@ { if (!this.field_73251_h.field_73058_d) { @@ -110,14 +95,14 @@ for (int i = 0; i < 100; ++i) { if (!this.field_73248_b.isEmpty()) -@@ -280,6 +340,12 @@ +@@ -228,6 +286,12 @@ this.func_73243_a(chunk); this.field_73244_f.func_76159_d(olong.longValue()); this.field_73245_g.remove(chunk); + net.minecraftforge.common.ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.func_77272_a(chunk.field_76635_g, chunk.field_76647_h), chunk); -+ if(field_73245_g.size() == 0 && net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this.field_73251_h).size() == 0 && !net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.func_177502_q())){ -+ net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.func_177502_q()); -+ return field_73246_d.func_73156_b(); ++ if(field_73245_g.size() == 0 && net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this.field_73251_h).size() == 0 && !net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.getDimension())){ ++ net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.getDimension()); ++ return false; + } + } diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch index 63fe3a7bb..887ba3bfd 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -1,17 +1,19 @@ --- ../src-base/minecraft/net/minecraft/world/gen/MapGenCaves.java +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java -@@ -138,7 +138,7 @@ +@@ -141,9 +141,7 @@ + { + if (l1 >= 0 && l1 < 256) { - IBlockState iblockstate = p_180702_5_.func_177856_a(j1, l1, k1); - +- IBlockState iblockstate = p_180702_5_.func_177856_a(j1, l1, k1); +- - if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) + if (isOceanBlock(p_180702_5_, j1, l1, k1, p_180702_3_, p_180702_4_)) { flag3 = true; } -@@ -176,33 +176,12 @@ +@@ -181,33 +179,12 @@ IBlockState iblockstate1 = p_180702_5_.func_177856_a(j3, j2, i2); - IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.func_177856_a(j3, j2 + 1, i2), Blocks.field_150350_a.func_176223_P()); + IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.func_177856_a(j3, j2 + 1, i2), field_186127_b); - if (iblockstate1.func_177230_c() == Blocks.field_150349_c || iblockstate1.func_177230_c() == Blocks.field_150391_bh) + if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_)) @@ -23,15 +25,15 @@ - { - if (j2 - 1 < 10) - { -- p_180702_5_.func_177855_a(j3, j2, i2, Blocks.field_150353_l.func_176223_P()); +- p_180702_5_.func_177855_a(j3, j2, i2, field_186126_a); - } - else - { -- p_180702_5_.func_177855_a(j3, j2, i2, Blocks.field_150350_a.func_176223_P()); +- p_180702_5_.func_177855_a(j3, j2, i2, field_186127_b); - - if (iblockstate2.func_177230_c() == Blocks.field_150354_m) - { -- p_180702_5_.func_177855_a(j3, j2 + 1, i2, iblockstate2.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? Blocks.field_180395_cM.func_176223_P() : Blocks.field_150322_A.func_176223_P()); +- p_180702_5_.func_177855_a(j3, j2 + 1, i2, iblockstate2.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? field_186129_d : field_186128_c); - } - - if (flag1 && p_180702_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) @@ -45,7 +47,7 @@ } } } -@@ -261,4 +240,71 @@ +@@ -266,4 +243,71 @@ } } } @@ -59,8 +61,8 @@ + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome) + { -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76787_r) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76769_d) return true; ++ if (biome == net.minecraft.init.Biomes.field_76787_r) return true; ++ if (biome == net.minecraft.init.Biomes.field_76769_d) return true; + return false; + } + @@ -96,17 +98,17 @@ + + if (this.func_175793_a(state, up) || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) + { -+ if (y < 10) ++ if (y - 1 < 10) + { -+ data.func_177855_a(x, y, z, Blocks.field_150353_l.func_176223_P()); ++ data.func_177855_a(x, y, z, field_186126_a); + } + else + { -+ data.func_177855_a(x, y, z, Blocks.field_150350_a.func_176223_P()); ++ data.func_177855_a(x, y, z, field_186127_b); + + if (up.func_177230_c() == Blocks.field_150354_m) + { -+ data.func_177855_a(x, y + 1, z, up.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? Blocks.field_180395_cM.func_176223_P() : Blocks.field_150322_A.func_176223_P()); ++ data.func_177855_a(x, y + 1, z, up.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? field_186129_d : field_186128_c); + } + + if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch index b5fc50da7..616b17a9a 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -1,18 +1,31 @@ --- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java -@@ -128,7 +128,7 @@ +@@ -128,9 +128,7 @@ + { + if (l1 >= 0 && l1 < 256) { - IBlockState iblockstate = p_180707_5_.func_177856_a(j1, l1, k1); - +- IBlockState iblockstate = p_180707_5_.func_177856_a(j1, l1, k1); +- - if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) + if (isOceanBlock(p_180707_5_, j1, l1, k1, p_180707_3_, p_180707_4_)) { flag2 = true; } -@@ -165,28 +165,12 @@ - { - IBlockState iblockstate1 = p_180707_5_.func_177856_a(j3, j2, i2); +@@ -146,8 +144,6 @@ + if (!flag2) + { +- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); +- + for (int j3 = k2; j3 < k; ++j3) + { + double d10 = ((double)(j3 + p_180707_3_ * 16) + 0.5D - p_180707_6_) / d9; +@@ -165,30 +161,12 @@ + + if ((d10 * d10 + d7 * d7) * (double)this.field_75046_d[j2 - 1] + d8 * d8 / 6.0D < 1.0D) + { +- IBlockState iblockstate1 = p_180707_5_.func_177856_a(j3, j2, i2); +- - if (iblockstate1.func_177230_c() == Blocks.field_150349_c) + if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_)) { @@ -23,11 +36,11 @@ - { - if (j2 - 1 < 10) - { -- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150356_k.func_176223_P()); +- p_180707_5_.func_177855_a(j3, j2, i2, field_186135_a); - } - else - { -- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150350_a.func_176223_P()); +- p_180707_5_.func_177855_a(j3, j2, i2, field_186136_b); - - if (flag && p_180707_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) - { @@ -40,7 +53,7 @@ } } } -@@ -221,4 +205,68 @@ +@@ -223,4 +201,68 @@ } } } @@ -53,10 +66,10 @@ + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome) + { -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76787_r) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76769_d) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76789_p) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76788_q) return true; ++ if (biome == net.minecraft.init.Biomes.field_76787_r) return true; ++ if (biome == net.minecraft.init.Biomes.field_76769_d) return true; ++ if (biome == net.minecraft.init.Biomes.field_76789_p) return true; ++ if (biome == net.minecraft.init.Biomes.field_76788_q) return true; + return false; + } + @@ -93,13 +106,13 @@ + + if (state.func_177230_c() == Blocks.field_150348_b || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) + { -+ if (y < 10) ++ if (y - 1 < 10) + { -+ data.func_177855_a(x, y, z, Blocks.field_150353_l.func_176223_P()); ++ data.func_177855_a(x, y, z, field_186135_a); + } + else + { -+ data.func_177855_a(x, y, z, Blocks.field_150350_a.func_176223_P()); ++ data.func_177855_a(x, y, z, field_186136_b); + + if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) + { 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 f23e6f318..773fd43ed 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -8,6 +8,6 @@ + public boolean isReplaceable(World world, BlockPos pos) + { + net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); -+ return state.func_177230_c().isAir(world, pos) || state.func_177230_c().isLeaves(world, pos) || state.func_177230_c().isWood(world, pos) || func_150523_a(state.func_177230_c()); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos) || state.func_177230_c().isWood(world, pos) || func_150523_a(state.func_177230_c()); + } } 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 2a98d8c83..2ee32167e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -1,33 +1,34 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java -@@ -54,7 +54,7 @@ +@@ -56,9 +56,9 @@ + { + if (j >= 0 && j < 256) { - Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c(); +- Material material = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_185904_a(); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)); -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) -+ if (!block.isAir(p_180709_1_, blockpos$mutableblockpos) && !block.isLeaves(p_180709_1_, blockpos$mutableblockpos)) +- if (material != Material.field_151579_a && material != Material.field_151584_j) ++ if (!state.func_177230_c().isAir(state, p_180709_1_, blockpos$mutableblockpos) && !state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos)) { flag = false; } -@@ -190,7 +190,7 @@ +@@ -193,8 +193,9 @@ + if (p_180709_3_.func_177956_o() >= p_180709_3_.func_177956_o() + i - 1 || blockhugemushroom$enumtype != BlockHugeMushroom.EnumType.ALL_INSIDE) { BlockPos blockpos = new BlockPos(l1, l2, i2); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); -- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) { - this.func_175903_a(p_180709_1_, blockpos, this.field_76523_a.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, blockhugemushroom$enumtype)); + this.func_175903_a(p_180709_1_, blockpos, block.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, blockhugemushroom$enumtype)); } -@@ -201,9 +201,10 @@ - - for (int i3 = 0; i3 < i; ++i3) +@@ -207,7 +208,7 @@ { -- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_177230_c(); -+ BlockPos upN = p_180709_3_.func_177981_b(i3); -+ net.minecraft.block.state.IBlockState state = p_180709_1_.func_180495_p(upN); + IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)); -- if (!block2.func_149730_j()) -+ if (state.func_177230_c().canBeReplacedByLeaves(p_180709_1_, upN)) +- if (!iblockstate.func_185913_b()) ++ if (iblockstate.func_177230_c().canBeReplacedByLeaves(iblockstate, p_180709_1_, p_180709_3_.func_177981_b(i3))) { - this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), this.field_76523_a.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, BlockHugeMushroom.EnumType.STEM)); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), block.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, BlockHugeMushroom.EnumType.STEM)); } 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 7fb88e1b7..9b5ed8239 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -4,11 +4,11 @@ if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_)) { BlockPos blockpos = p_181631_1_.func_177982_a(j, 0, k); -- Material material = this.field_175946_l.func_180495_p(blockpos).func_177230_c().func_149688_o(); -+ net.minecraft.block.state.IBlockState state = this.field_175946_l.func_180495_p(blockpos); +- Material material = this.field_175946_l.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = this.field_175946_l.func_180495_p(blockpos); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (state.func_177230_c().isAir(this.field_175946_l, blockpos) || state.func_177230_c().isLeaves(this.field_175946_l, blockpos)) ++ if (state.func_177230_c().isAir(state, field_175946_l, blockpos) || state.func_177230_c().isLeaves(state, field_175946_l, blockpos)) { this.func_175903_a(this.field_175946_l, blockpos, p_181631_3_); } @@ -43,7 +43,7 @@ - Block block = this.field_175946_l.func_180495_p(this.field_175947_m.func_177977_b()).func_177230_c(); + BlockPos down = this.field_175947_m.func_177977_b(); + net.minecraft.block.state.IBlockState state = this.field_175946_l.func_180495_p(down); -+ boolean isSoil = state.func_177230_c().canSustainPlant(this.field_175946_l, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, this.field_175946_l, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - if (block != Blocks.field_150346_d && block != Blocks.field_150349_c && block != Blocks.field_150458_ak) + if (!isSoil) diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch new file mode 100644 index 000000000..0dde48dc2 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch @@ -0,0 +1,64 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java +@@ -8,6 +8,7 @@ + import net.minecraft.block.material.Material; + import net.minecraft.block.state.IBlockState; + import net.minecraft.init.Blocks; ++import net.minecraft.util.EnumFacing; + import net.minecraft.util.math.BlockPos; + import net.minecraft.world.World; + +@@ -56,9 +57,9 @@ + { + for (int i1 = p_180709_3_.func_177952_p() - k; i1 <= p_180709_3_.func_177952_p() + k && flag; ++i1) + { +- if (j >= 0 && j < 256) ++ if (j >= 0 && j < p_180709_1_.func_72800_K()) + { +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) + { + flag = false; + } +@@ -77,11 +78,13 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); + + for (int i2 = p_180709_3_.func_177956_o() - 3 + i; i2 <= p_180709_3_.func_177956_o() + i; ++i2) + { +@@ -99,9 +102,9 @@ + if (Math.abs(j1) != l2 || Math.abs(l1) != l2 || p_180709_2_.nextInt(2) != 0 && k2 != 0) + { + BlockPos blockpos = new BlockPos(i3, i2, k1); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state2 = p_180709_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state2.func_177230_c().isAir(state2, p_180709_1_, blockpos) || state2.func_177230_c().isAir(state2, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, field_181630_b); + } +@@ -112,9 +115,10 @@ + + for (int j2 = 0; j2 < i; ++j2) + { +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j2)).func_185904_a(); ++ BlockPos upN = p_180709_3_.func_177981_b(j2); ++ IBlockState state2 = p_180709_1_.func_180495_p(upN); + +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (state2.func_177230_c().isAir(state2, p_180709_1_, upN) || state2.func_177230_c().isLeaves(state2, p_180709_1_, upN)) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j2), field_181629_a); + } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch new file mode 100644 index 000000000..ed54b4718 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java +@@ -20,7 +20,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_175623_d(blockpos) && (!p_180709_1_.field_73011_w.func_177495_o() || blockpos.func_177956_o() < 255) && this.field_175908_a.func_180671_f(p_180709_1_, blockpos, this.field_175908_a.func_176223_P())) ++ if (p_180709_1_.func_175623_d(blockpos) && (!p_180709_1_.field_73011_w.func_177495_o() || blockpos.func_177956_o() < p_180709_1_.func_72800_K() - 1) && this.field_175908_a.func_180671_f(p_180709_1_, blockpos, this.field_175908_a.func_176223_P())) + { + p_180709_1_.func_180501_a(blockpos, this.field_175908_a.func_176223_P(), 2); + } 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 6bc3eb814..61ebf130c 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -5,11 +5,11 @@ { BlockPos blockpos = p_180709_3_.func_177977_b(); - Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); -+ net.minecraft.block.state.IBlockState state = p_180709_1_.func_180495_p(blockpos); -+ boolean isSoil = state.func_177230_c().canSustainPlant(p_180709_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - if (block != Blocks.field_150349_c && block != Blocks.field_150346_d) -+ if (!(isSoil && p_180709_3_.func_177956_o() < 256 - i - 1)) ++ if (!(isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1)) { return false; } @@ -32,11 +32,11 @@ int k2 = k + j2; BlockPos blockpos1 = new BlockPos(k1, k2, l1); -- Material material = p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o(); +- Material material = p_180709_1_.func_180495_p(blockpos1).func_185904_a(); + state = p_180709_1_.func_180495_p(blockpos1); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (state.func_177230_c().isAir(p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(p_180709_1_, blockpos1)) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos1)) { this.func_181639_b(p_180709_1_, blockpos1); this.func_181639_b(p_180709_1_, blockpos1.func_177974_f()); @@ -49,15 +49,15 @@ { return false; } -@@ -209,11 +210,17 @@ +@@ -209,11 +210,18 @@ private void func_150526_a(World p_150526_1_, int p_150526_2_, int p_150526_3_, int p_150526_4_) { BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_); -- Block block = p_150526_1_.func_180495_p(blockpos).func_177230_c(); -+ net.minecraft.block.state.IBlockState state = p_150526_1_.func_180495_p(blockpos); +- Material material = p_150526_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_150526_1_.func_180495_p(blockpos); -- if (block.func_149688_o() == Material.field_151579_a) -+ if (state.func_177230_c().isAir(p_150526_1_, blockpos)) +- if (material == Material.field_151579_a) ++ if (state.func_177230_c().isAir(state, p_150526_1_, blockpos)) { this.func_175903_a(p_150526_1_, blockpos, field_181641_b); } @@ -66,6 +66,7 @@ + //Just a helper macro + private void onPlantGrow(World world, BlockPos pos, BlockPos source) + { -+ world.func_180495_p(pos).func_177230_c().onPlantGrow(world, pos, source); ++ IBlockState state = world.func_180495_p(pos); ++ state.func_177230_c().onPlantGrow(state, world, pos, source); + } } 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 61253bc64..6f023be26 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -1,14 +1,16 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java -@@ -13,10 +13,12 @@ +@@ -11,12 +11,12 @@ + { + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) { - Block block; - -- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) +- IBlockState iblockstate; +- +- while (((iblockstate = p_180709_1_.func_180495_p(p_180709_3_)).func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); -+ if (!block.isLeaves(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); ++ if (!state.func_177230_c().isAir(state, p_180709_1_, p_180709_3_) && !state.func_177230_c().isLeaves(state, p_180709_1_, p_180709_3_)) break; p_180709_3_ = p_180709_3_.func_177977_b(); - } + } while (p_180709_3_.func_177956_o() > 0); 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 dd91af336..098f8b475 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -1,30 +1,10 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java -@@ -123,12 +123,11 @@ - if (j3 == 1) - { - p_180709_1_.func_180501_a(blockpos2, Blocks.field_150486_ae.func_176458_f(p_180709_1_, blockpos2, Blocks.field_150486_ae.func_176223_P()), 2); -- List list = WeightedRandomChestContent.func_177629_a(field_175917_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_180709_2_)}); - TileEntity tileentity1 = p_180709_1_.func_175625_s(blockpos2); - - if (tileentity1 instanceof TileEntityChest) - { -- WeightedRandomChestContent.func_177630_a(p_180709_2_, list, (TileEntityChest)tileentity1, 8); -+ WeightedRandomChestContent.func_177630_a(p_180709_2_, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, p_180709_2_), (TileEntityChest)tileentity1, 8); - } - - break; -@@ -159,6 +158,12 @@ +@@ -154,6 +154,6 @@ private String func_76543_b(Random p_76543_1_) { - return field_175916_b[p_76543_1_.nextInt(field_175916_b.length)]; + return net.minecraftforge.common.DungeonHooks.getRandomDungeonMob(p_76543_1_); } -+ -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, field_175917_c, 8, 8); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 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 deleted file mode 100644 index 9eca24df4..000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java -@@ -58,7 +58,7 @@ - { - if (j >= 0 && j < 256) - { -- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) -+ if (!this.isReplaceable(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) - { - flag = false; - } -@@ -77,11 +77,13 @@ - } - else - { -- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); -+ BlockPos down = p_180709_3_.func_177977_b(); -+ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - -- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) -+ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) - { -- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); - - for (int i2 = p_180709_3_.func_177956_o() - 3 + i; i2 <= p_180709_3_.func_177956_o() + i; ++i2) - { -@@ -101,7 +103,7 @@ - BlockPos blockpos = new BlockPos(i3, i2, k1); - Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); - -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) -+ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos)) - { - this.func_175903_a(p_180709_1_, blockpos, field_181630_b); - } -@@ -112,9 +114,9 @@ - - for (int j2 = 0; j2 < i; ++j2) - { -- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j2)).func_177230_c(); -- -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) -+ BlockPos upN = p_180709_3_.func_177981_b(j2); -+ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); -+ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN)) - { - this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j2), field_181629_a); - } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch new file mode 100644 index 000000000..45ec43950 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java +@@ -27,7 +27,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), -p_180709_2_.nextInt(12), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a) ++ if (p_180709_1_.func_175623_d(blockpos)) + { + int j = 0; + diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch new file mode 100644 index 000000000..cec562cde --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java +@@ -27,7 +27,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), -p_180709_2_.nextInt(12), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a) ++ if (p_180709_1_.func_175623_d(blockpos)) + { + int j = 0; + diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch new file mode 100644 index 000000000..b8ef8082e --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java +@@ -24,7 +24,7 @@ + { + return false; + } +- else if (p_180709_1_.func_180495_p(p_180709_3_).func_185904_a() != Material.field_151579_a && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150424_aL) ++ else if (!p_180709_1_.func_175623_d(p_180709_3_) && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150424_aL) + { + return false; + } 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 16ea524eb..c0785697b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -9,11 +9,13 @@ { flag = false; } -@@ -79,13 +79,14 @@ +@@ -78,14 +78,15 @@ + private boolean func_175927_a(BlockPos p_175927_1_, World p_175927_2_) { BlockPos blockpos = p_175927_1_.func_177977_b(); - Block block = p_175927_2_.func_180495_p(blockpos).func_177230_c(); -+ boolean isSoil = block.canSustainPlant(p_175927_2_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); +- Block block = p_175927_2_.func_180495_p(blockpos).func_177230_c(); ++ IBlockState state = p_175927_2_.func_180495_p(blockpos); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_175927_2_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_175927_1_.func_177956_o() >= 2) + if (isSoil && p_175927_1_.func_177956_o() >= 2) @@ -33,11 +35,11 @@ if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i) { BlockPos blockpos = p_175925_2_.func_177982_a(j, 0, k); -- Material material = p_175925_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); -+ net.minecraft.block.state.IBlockState state = p_175925_1_.func_180495_p(blockpos); +- Material material = p_175925_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_175925_1_.func_180495_p(blockpos); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (state.func_177230_c().isAir(p_175925_1_, blockpos) || state.func_177230_c().isLeaves(p_175925_1_, blockpos)) ++ if (state.func_177230_c().isAir(state, p_175925_1_, blockpos) || state.func_177230_c().isLeaves(state, p_175925_1_, blockpos)) { this.func_175903_a(p_175925_1_, blockpos, this.field_76521_c); } @@ -45,15 +47,15 @@ if (j * j + k * k <= i) { BlockPos blockpos = p_175928_2_.func_177982_a(j, 0, k); -- Material material = p_175928_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); -+ Block block = p_175928_1_.func_180495_p(blockpos).func_177230_c(); +- Material material = p_175928_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_175928_1_.func_180495_p(blockpos); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (block.isAir(p_175928_1_, blockpos) || block.isLeaves(p_175928_1_, blockpos)) ++ if (state.func_177230_c().isAir(state, p_175928_1_, blockpos) || state.func_177230_c().isLeaves(state, p_175928_1_, blockpos)) { this.func_175903_a(p_175928_1_, blockpos, this.field_76521_c); } -@@ -145,4 +146,10 @@ +@@ -145,4 +146,11 @@ } } } @@ -61,6 +63,7 @@ + //Just a helper macro + private void onPlantGrow(World world, BlockPos pos, BlockPos source) + { -+ world.func_180495_p(pos).func_177230_c().onPlantGrow(world, pos, source); ++ IBlockState state = world.func_180495_p(pos); ++ state.func_177230_c().onPlantGrow(state, world, pos, source); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch new file mode 100644 index 000000000..1ac2953b8 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java +@@ -51,7 +51,7 @@ + IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(i1, k, j1)); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) ++ if (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_.func_177982_a(i1, k, j1)) || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(i1, k, j1), Blocks.field_150403_cj.func_176223_P()); + } +@@ -61,7 +61,7 @@ + iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(i1, -k, j1)); + block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) ++ if (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_.func_177982_a(i1, -k, j1)) || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(i1, -k, j1), Blocks.field_150403_cj.func_176223_P()); + } +@@ -99,7 +99,7 @@ + IBlockState iblockstate1 = p_180709_1_.func_180495_p(blockpos); + Block block1 = iblockstate1.func_177230_c(); + +- if (iblockstate1.func_185904_a() != Material.field_151579_a && block1 != Blocks.field_150346_d && block1 != Blocks.field_150433_aE && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) ++ if (!iblockstate1.func_177230_c().isAir(iblockstate1, p_180709_1_, blockpos) && block1 != Blocks.field_150346_d && block1 != Blocks.field_150433_aE && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) + { + break; + } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch new file mode 100644 index 000000000..223fdde14 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java +@@ -26,7 +26,7 @@ + { + return false; + } +- else if (p_180709_1_.func_180495_p(p_180709_3_).func_185904_a() != Material.field_151579_a && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150348_b) ++ else if (!p_180709_1_.func_175623_d(p_180709_3_) && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150348_b) + { + return false; + } 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 6856a6cfc..8964b67b1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -44,7 +44,7 @@ + //Helper macro + private boolean isAirLeaves(World world, BlockPos pos) + { -+ net.minecraft.block.Block block = world.func_180495_p(pos).func_177230_c(); -+ return block.isAir(world, pos) || block.isLeaves(world, pos); ++ IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos); + } } 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 f658ebfe6..70ea1b446 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -1,55 +1,52 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java -@@ -43,30 +43,24 @@ - { - Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j)).func_177230_c(); +@@ -41,32 +41,25 @@ -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) -+ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177981_b(j))) + for (int j = 0; j < i; ++j) + { +- IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j)); +- +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177981_b(j))) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j), this.field_76520_b); } if (j < i - 1) { -- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 0)).func_177230_c(); +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 0)); - -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) -+ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(1, j, 0))) +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(1, j, 0))) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 0), this.field_76520_b); } -- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 1)).func_177230_c(); +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 1)); - -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) -+ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(1, j, 1))) +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(1, j, 1))) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 1), this.field_76520_b); } -- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(0, j, 1)).func_177230_c(); -- -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) -+ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(0, j, 1))) +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(0, j, 1)); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(0, j, 1))) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(0, j, 1), this.field_76520_b); } -@@ -132,16 +126,23 @@ - BlockPos blockpos = p_175934_2_.func_177981_b(i); - Block block = p_175934_1_.func_180495_p(blockpos).func_177230_c(); +@@ -133,7 +126,7 @@ + IBlockState iblockstate = p_175934_1_.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); - if (block == Blocks.field_150349_c || block == Blocks.field_150346_d) -+ if (block.canSustainPlant(p_175934_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) ++ if (block.canSustainPlant(iblockstate, p_175934_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) { this.func_175903_a(p_175934_1_, blockpos, field_181635_g); break; - } - -- if (block.func_149688_o() != Material.field_151579_a && i < 0) -+ if (!block.isAir(p_175934_1_, blockpos) && i < 0) - { - break; +@@ -145,4 +138,11 @@ } } } @@ -57,7 +54,7 @@ + //Helper macro + private boolean isAirLeaves(World world, BlockPos pos) + { -+ net.minecraft.block.Block block = world.func_180495_p(pos).func_177230_c(); -+ return block.isAir(world, pos) || block.isLeaves(world, pos); ++ IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos); + } } 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 b3aef2aae..d7cc9310a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -1,11 +1,12 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java -@@ -73,7 +73,7 @@ +@@ -73,7 +73,8 @@ { BlockPos blockpos = new BlockPos(l1, i2, j2); - if (this.field_175919_c.apply(p_180709_1_.func_180495_p(blockpos))) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().isReplaceableOreGen(p_180709_1_, blockpos, this.field_175919_c)) ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); ++ if (state.func_177230_c().isReplaceableOreGen(state, p_180709_1_, blockpos, this.field_175919_c)) { p_180709_1_.func_180501_a(blockpos, this.field_175920_a, 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 105b15ca4..3a17a2173 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -15,14 +15,14 @@ { - Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); + BlockPos down = p_180709_3_.func_177977_b(); -+ Block block = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) -+ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) { - this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block.onPlantGrow(p_180709_1_, down, p_180709_3_); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180709_2_); int k2 = i - p_180709_2_.nextInt(4) - 1; int l2 = 3 - p_180709_2_.nextInt(3); @@ -30,11 +30,11 @@ } BlockPos blockpos = new BlockPos(i3, i2, j1); -- Material material = p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); -+ block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos)) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos)) { this.func_181642_b(p_180709_1_, blockpos); k1 = i2; @@ -42,11 +42,11 @@ i3 += enumfacing1.func_82601_c(); j1 += enumfacing1.func_82599_e(); BlockPos blockpos1 = new BlockPos(i3, j2, j1); -- Material material1 = p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o(); -+ block = p_180709_1_.func_180495_p(blockpos1).func_177230_c(); +- Material material1 = p_180709_1_.func_180495_p(blockpos1).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos1); - if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) -+ if (block.isAir(p_180709_1_, blockpos2) || block.isLeaves(p_180709_1_, blockpos2)) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos1)) { this.func_181642_b(p_180709_1_, blockpos1); k1 = j2; @@ -54,11 +54,11 @@ private void func_175924_b(World p_175924_1_, BlockPos p_175924_2_) { -- Material material = p_175924_1_.func_180495_p(p_175924_2_).func_177230_c().func_149688_o(); -+ Block block = p_175924_1_.func_180495_p(p_175924_2_).func_177230_c(); +- Material material = p_175924_1_.func_180495_p(p_175924_2_).func_185904_a(); ++ IBlockState state = p_175924_1_.func_180495_p(p_175924_2_); - if (material == Material.field_151579_a || material == Material.field_151584_j) -+ if (block.isAir(p_175924_1_, p_175924_2_) || block.isLeaves(p_175924_1_, p_175924_2_)) ++ if (state.func_177230_c().isAir(state, p_175924_1_, p_175924_2_) || state.func_177230_c().isLeaves(state, p_175924_1_, p_175924_2_)) { this.func_175903_a(p_175924_1_, p_175924_2_, field_181644_b); } 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 70f640f5f..399a3c447 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -1,31 +1,37 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java -@@ -24,14 +24,16 @@ - { - Block block; +@@ -22,16 +22,16 @@ -- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- IBlockState iblockstate; +- +- while (((iblockstate = p_180709_1_.func_180495_p(p_180709_3_)).func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); -+ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); ++ if (!state.func_177230_c().isLeaves(state, p_180709_1_, p_180709_3_) && !state.func_177230_c().isLeaves(state, p_180709_1_, p_180709_3_)) break; p_180709_3_ = p_180709_3_.func_177977_b(); - } + } while (p_180709_3_.func_177956_o() > 0); - Block block1 = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); +- Block block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); -- if (block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) -+ if (block1.canSustainPlant(p_180709_1_, p_180709_3_, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) +- if (block == Blocks.field_150346_d || block == Blocks.field_150349_c) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, p_180709_3_, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) { p_180709_3_ = p_180709_3_.func_177984_a(); this.func_175903_a(p_180709_1_, p_180709_3_, this.field_150527_b); -@@ -53,7 +55,7 @@ +@@ -52,9 +52,9 @@ + if (Math.abs(i1) != k || Math.abs(k1) != k || p_180709_2_.nextInt(2) != 0) { BlockPos blockpos = new BlockPos(l, i, j1); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); -- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) { this.func_175903_a(p_180709_1_, blockpos, 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 03b98a6c0..e24b76223 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -1,94 +1,98 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java -@@ -60,7 +60,7 @@ - { - Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c(); +@@ -61,7 +61,7 @@ + IBlockState iblockstate = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)); + Block block = iblockstate.func_177230_c(); -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) -+ if (!block.isAir(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !block.isLeaves(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) +- if (iblockstate.func_185904_a() != Material.field_151579_a && iblockstate.func_185904_a() != Material.field_151584_j) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) { if (block != Blocks.field_150355_j && block != Blocks.field_150358_i) { -@@ -86,11 +86,13 @@ +@@ -87,11 +87,13 @@ } else { - Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); + BlockPos down = p_180709_3_.func_177977_b(); -+ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); - if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) -+ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) { - this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block1.onPlantGrow(p_180709_1_, p_180709_3_.func_177977_b(),p_180709_3_); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, p_180709_3_.func_177977_b(),p_180709_3_); - for (int l1 = p_180709_3_.func_177956_o() - 3 + i; l1 <= p_180709_3_.func_177956_o() + i; ++l1) + for (int k1 = p_180709_3_.func_177956_o() - 3 + i; k1 <= p_180709_3_.func_177956_o() + i; ++k1) { -@@ -109,7 +111,7 @@ +@@ -109,8 +111,9 @@ + if (Math.abs(k3) != l2 || Math.abs(j1) != l2 || p_180709_2_.nextInt(2) != 0 && j2 != 0) { - BlockPos blockpos = new BlockPos(k3, l1, j1); + BlockPos blockpos = new BlockPos(j3, k1, i4); ++ state = p_180709_1_.func_180495_p(blockpos); -- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) { this.func_175903_a(p_180709_1_, blockpos, field_181649_b); } -@@ -120,9 +122,10 @@ +@@ -121,10 +124,11 @@ - for (int i2 = 0; i2 < i; ++i2) + for (int l1 = 0; l1 < i; ++l1) { -- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i2)).func_177230_c(); -+ BlockPos upN = p_180709_3_.func_177981_b(i2); -+ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); +- IBlockState iblockstate1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(l1)); ++ BlockPos upN = p_180709_3_.func_177981_b(l1); ++ IBlockState iblockstate1 = p_180709_1_.func_180495_p(upN); + Block block2 = iblockstate1.func_177230_c(); -- 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_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) +- if (iblockstate1.func_185904_a() == Material.field_151579_a || iblockstate1.func_185904_a() == Material.field_151584_j || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) ++ if (block2.isAir(iblockstate1, p_180709_1_, upN) || block2.isLeaves(iblockstate1, p_180709_1_, upN) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) { - this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i2), field_181648_a); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(l1), field_181648_a); } -@@ -140,29 +143,29 @@ - { - blockpos$mutableblockpos1.func_181079_c(i4, j2, j4); - -- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().func_149688_o() == Material.field_151584_j) -+ if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().isLeaves(p_180709_1_, blockpos$mutableblockpos1)) - { - BlockPos blockpos3 = blockpos$mutableblockpos1.func_177976_e(); - BlockPos blockpos4 = blockpos$mutableblockpos1.func_177974_f(); +@@ -149,22 +153,22 @@ BlockPos blockpos1 = blockpos$mutableblockpos1.func_177978_c(); BlockPos blockpos2 = blockpos$mutableblockpos1.func_177968_d(); -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().isAir(p_180709_1_,blockpos3)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && isAir(p_180709_1_, blockpos3)) { this.func_181647_a(p_180709_1_, blockpos3, BlockVine.field_176278_M); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().isAir(p_180709_1_,blockpos4)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && isAir(p_180709_1_, blockpos4)) { this.func_181647_a(p_180709_1_, blockpos4, BlockVine.field_176280_O); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().isAir(p_180709_1_,blockpos1)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && isAir(p_180709_1_, blockpos1)) { this.func_181647_a(p_180709_1_, blockpos1, BlockVine.field_176279_N); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().isAir(p_180709_1_,blockpos2)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && isAir(p_180709_1_, blockpos2)) { this.func_181647_a(p_180709_1_, blockpos2, BlockVine.field_176273_b); } -@@ -191,7 +194,7 @@ +@@ -193,10 +197,16 @@ this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate); int i = 4; -- for (p_181647_2_ = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(p_181647_2_).func_177230_c().func_149688_o() == Material.field_151579_a && i > 0; --i) -+ for (p_181647_2_ = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(p_181647_2_).func_177230_c().isAir(p_181647_1_,p_181647_2_) && i > 0; --i) +- for (p_181647_2_ = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(p_181647_2_).func_185904_a() == Material.field_151579_a && i > 0; --i) ++ for (p_181647_2_ = p_181647_2_.func_177977_b(); isAir(p_181647_1_, p_181647_2_) && i > 0; --i) { this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate); p_181647_2_ = p_181647_2_.func_177977_b(); + } + } ++ ++ private boolean isAir(World world, BlockPos pos) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos); ++ } + } 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 a8ca16188..c2f74f747 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -15,36 +15,38 @@ { - Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); + BlockPos down = p_180709_3_.func_177977_b(); -+ Block block = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); - if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) + if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { - this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block.onPlantGrow(p_180709_1_, down, p_180709_3_); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); int k2 = 0; for (int l2 = p_180709_3_.func_177956_o() + i; l2 >= p_180709_3_.func_177956_o() + j; --l2) -@@ -93,7 +95,7 @@ +@@ -92,8 +94,9 @@ + if (Math.abs(k3) != k2 || Math.abs(j2) != k2 || k2 <= 0) { BlockPos blockpos = new BlockPos(j3, l2, i2); ++ state = p_180709_1_.func_180495_p(blockpos); -- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) { this.func_175903_a(p_180709_1_, blockpos, field_181637_b); } -@@ -113,9 +115,10 @@ +@@ -113,9 +116,10 @@ for (int i3 = 0; i3 < i - 1; ++i3) { -- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_177230_c(); +- Material material = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_185904_a(); + BlockPos upN = p_180709_3_.func_177981_b(i3); -+ Block block1 = p_180709_1_.func_180495_p(upN).func_177230_c(); ++ state = p_180709_1_.func_180495_p(upN); -- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) -+ if (block1.isAir(p_180709_1_, upN) || block1.isLeaves(p_180709_1_, upN)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN)) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), field_181636_a); } 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 8f79b8462..611141161 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -1,37 +1,53 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java -@@ -55,7 +55,7 @@ - { - Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_177230_c(); +@@ -30,7 +30,7 @@ + int l = 2 + p_180709_2_.nextInt(2); + boolean flag = true; -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) -+ if (!block.isAir(p_180709_1_, blockpos$mutableblockpos) && !block.isLeaves(p_180709_1_, blockpos$mutableblockpos)) +- if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= 256) ++ if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= p_180709_1_.func_72800_K()) + { + for (int i1 = p_180709_3_.func_177956_o(); i1 <= p_180709_3_.func_177956_o() + 1 + i && flag; ++i1) + { +@@ -51,11 +51,11 @@ + { + for (int l1 = p_180709_3_.func_177952_p() - j1; l1 <= p_180709_3_.func_177952_p() + j1 && flag; ++l1) + { +- if (i1 >= 0 && i1 < 256) ++ if (i1 >= 0 && i1 < p_180709_1_.func_72800_K()) + { +- Material material = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_185904_a(); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)); + +- if (material != Material.field_151579_a && material != Material.field_151584_j) ++ if (!state.func_177230_c().isAir(state, p_180709_1_, blockpos$mutableblockpos.func_181079_c(k1, i1, l1)) && !state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos.func_181079_c(k1, i1, l1))) { flag = false; } -@@ -74,11 +74,13 @@ +@@ -74,11 +74,12 @@ } else { -- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); + BlockPos down = p_180709_3_.func_177977_b(); -+ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); ++ IBlockState state = p_180709_1_.func_180495_p(down); -- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) -+ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g) && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) { - this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); int i3 = p_180709_2_.nextInt(2); int j3 = 1; int k3 = 0; -@@ -99,7 +101,7 @@ +@@ -98,8 +99,9 @@ + if (Math.abs(j2) != i3 || Math.abs(l2) != i3 || i3 <= 0) { BlockPos blockpos = new BlockPos(i2, j4, k2); ++ state = p_180709_1_.func_180495_p(blockpos); -- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) -+ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) { this.func_175903_a(p_180709_1_, blockpos, field_181646_b); } @@ -39,12 +55,12 @@ for (int k4 = 0; k4 < i - i4; ++k4) { -- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(k4)).func_177230_c(); +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(k4)).func_185904_a(); + BlockPos upN = p_180709_3_.func_177981_b(k4); -+ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); ++ state = p_180709_1_.func_180495_p(upN); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) -+ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN)) +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN)) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(k4), field_181645_a); } 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 40233c4b2..c100cd6a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -1,14 +1,16 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java -@@ -22,10 +22,12 @@ - { - Block block; +@@ -19,12 +19,12 @@ -- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- IBlockState iblockstate; +- +- while (((iblockstate = p_180709_1_.func_180495_p(p_180709_3_)).func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); -+ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); ++ if (!state.func_177230_c().isAir(state, p_180709_1_, p_180709_3_) && !state.func_177230_c().isLeaves(state, p_180709_1_, p_180709_3_)) break; p_180709_3_ = p_180709_3_.func_177977_b(); - } + } while (p_180709_3_.func_177956_o() > 0); 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 74c9c1445..61034e3d1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -1,94 +1,105 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java -@@ -68,7 +68,7 @@ +@@ -44,7 +44,7 @@ + int i = p_180709_2_.nextInt(3) + this.field_76533_a; + boolean flag = true; + +- if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= 256) ++ if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= p_180709_1_.func_72800_K()) + { + for (int j = p_180709_3_.func_177956_o(); j <= p_180709_3_.func_177956_o() + 1 + i; ++j) + { +@@ -66,9 +66,9 @@ + { + for (int i1 = p_180709_3_.func_177952_p() - k; i1 <= p_180709_3_.func_177952_p() + k && flag; ++i1) { - if (j >= 0 && j < 256) +- if (j >= 0 && j < 256) ++ if (j >= 0 && j < p_180709_1_.func_72800_K()) { - if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) + if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(l, j, i1))) { flag = false; } -@@ -87,11 +87,13 @@ +@@ -87,9 +87,9 @@ } else { -- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); -+ BlockPos down = p_180709_3_.func_177977_b(); -+ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); -+ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()); -- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) -+ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, p_180709_3_.func_177977_b(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g) && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) { -- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); -+ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); + this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); int k2 = 3; - int l2 = 0; - -@@ -113,7 +115,7 @@ +@@ -111,9 +111,9 @@ + if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_180709_2_.nextInt(2) != 0 && i4 != 0) + { BlockPos blockpos = new BlockPos(k1, i3, i2); - Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j || block.func_149688_o() == Material.field_151582_l) -+ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos) || block.func_149688_o() == Material.field_151582_l) +- if (material == Material.field_151579_a || material == Material.field_151584_j || material == Material.field_151582_l) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos) || state.func_185904_a() == Material.field_151582_l) { this.func_175903_a(p_180709_1_, blockpos, this.field_76530_d); } -@@ -124,9 +126,10 @@ +@@ -124,9 +124,10 @@ for (int j3 = 0; j3 < i; ++j3) { -- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j3)).func_177230_c(); +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j3)).func_185904_a(); + BlockPos upN = p_180709_3_.func_177981_b(j3); -+ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); ++ state = p_180709_1_.func_180495_p(upN); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2.func_149688_o() == Material.field_151582_l) -+ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN) || block2.func_149688_o() == Material.field_151582_l) +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j || material1 == Material.field_151582_l) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN) || state.func_185904_a() == Material.field_151582_l) { this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j3), this.field_76532_c); -@@ -169,29 +172,29 @@ +@@ -169,29 +170,30 @@ { blockpos$mutableblockpos1.func_181079_c(l4, k3, i5); -- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().func_149688_o() == Material.field_151584_j) -+ if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().isLeaves(p_180709_1_,blockpos$mutableblockpos1)) +- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_185904_a() == Material.field_151584_j) ++ state = p_180709_1_.func_180495_p(blockpos$mutableblockpos1); ++ if (state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos1)) { BlockPos blockpos2 = blockpos$mutableblockpos1.func_177976_e(); BlockPos blockpos3 = blockpos$mutableblockpos1.func_177974_f(); BlockPos blockpos4 = blockpos$mutableblockpos1.func_177978_c(); BlockPos blockpos1 = blockpos$mutableblockpos1.func_177968_d(); -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().isAir(p_180709_1_,blockpos2)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos2)) { this.func_181650_b(p_180709_1_, blockpos2, BlockVine.field_176278_M); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().isAir(p_180709_1_,blockpos3)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos3)) { this.func_181650_b(p_180709_1_, blockpos3, BlockVine.field_176280_O); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().isAir(p_180709_1_,blockpos4)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos4)) { this.func_181650_b(p_180709_1_, blockpos4, BlockVine.field_176279_N); } -- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o() == Material.field_151579_a) -+ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().isAir(p_180709_1_,blockpos1)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos1)) { this.func_181650_b(p_180709_1_, blockpos1, BlockVine.field_176273_b); } -@@ -245,7 +248,7 @@ +@@ -245,7 +247,7 @@ this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); int i = 4; -- for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(p_181650_2_).func_177230_c().func_149688_o() == Material.field_151579_a && i > 0; --i) -+ for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(p_181650_2_).func_177230_c().isAir(p_181650_1_,p_181650_2_) && i > 0; --i) +- for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(p_181650_2_).func_185904_a() == Material.field_151579_a && i > 0; --i) ++ for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_175623_d(p_181650_2_) && i > 0; --i) { this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); p_181650_2_ = p_181650_2_.func_177977_b(); 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 79027d1db..3a95d326f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -1,17 +1,55 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java -@@ -26,10 +26,12 @@ +@@ -14,12 +14,12 @@ + { + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) { - Block block; - -- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 1) +- IBlockState iblockstate; +- +- while (((iblockstate = p_180709_1_.func_180495_p(p_180709_3_)).func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 1) + do { -+ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); -+ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); ++ if (!state.func_177230_c().isAir(state, p_180709_1_, p_180709_3_) && !state.func_177230_c().isLeaves(state, p_180709_1_, p_180709_3_)) break; p_180709_3_ = p_180709_3_.func_177977_b(); - } + } while (p_180709_3_.func_177956_o() > 0); if (p_180709_3_.func_177956_o() < 1) { +@@ -33,7 +33,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4), p_180709_2_.nextInt(3) - p_180709_2_.nextInt(3), p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4)); + +- if (p_180709_1_.func_175623_d(blockpos) && p_180709_1_.func_180495_p(blockpos.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos) && p_180709_1_.func_180495_p(blockpos.func_177977_b()).isSideSolid(p_180709_1_, blockpos.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos, Blocks.field_150486_ae.func_176223_P(), 2); + TileEntity tileentity = p_180709_1_.func_175625_s(blockpos); +@@ -48,22 +48,22 @@ + BlockPos blockpos3 = blockpos.func_177978_c(); + BlockPos blockpos4 = blockpos.func_177968_d(); + +- if (p_180709_1_.func_175623_d(blockpos2) && p_180709_1_.func_180495_p(blockpos2.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos2) && p_180709_1_.func_180495_p(blockpos2.func_177977_b()).isSideSolid(p_180709_1_, blockpos2.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos2, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos1) && p_180709_1_.func_180495_p(blockpos1.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos1) && p_180709_1_.func_180495_p(blockpos1.func_177977_b()).isSideSolid(p_180709_1_, blockpos1.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos1, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos3) && p_180709_1_.func_180495_p(blockpos3.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos3) && p_180709_1_.func_180495_p(blockpos3.func_177977_b()).isSideSolid(p_180709_1_, blockpos3.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos3, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos4) && p_180709_1_.func_180495_p(blockpos4.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos4) && p_180709_1_.func_180495_p(blockpos4.func_177977_b()).isSideSolid(p_180709_1_, blockpos4.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos4, Blocks.field_150478_aa.func_176223_P(), 2); + } 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 f1a5cfe3c..e48365a9f 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayer.java +++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayer.java -@@ -52,12 +52,12 @@ +@@ -49,12 +49,12 @@ i = 6; } @@ -16,16 +16,17 @@ GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, lvt_10_1_); GenLayer genlayer5 = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); genlayer5 = GenLayerZoom.func_75915_a(1000L, genlayer5, j); -@@ -191,7 +191,7 @@ +@@ -158,8 +158,7 @@ protected static boolean func_151618_b(int p_151618_0_) { -- return p_151618_0_ == BiomeGenBase.field_76771_b.field_76756_M || p_151618_0_ == BiomeGenBase.field_150575_M.field_76756_M || p_151618_0_ == BiomeGenBase.field_76776_l.field_76756_M; +- BiomeGenBase biomegenbase = BiomeGenBase.func_150568_d(p_151618_0_); +- return biomegenbase == Biomes.field_76771_b || biomegenbase == Biomes.field_150575_M || biomegenbase == Biomes.field_76776_l; + return net.minecraftforge.common.BiomeManager.oceanBiomes.contains(BiomeGenBase.func_150568_d(p_151618_0_)); } protected int func_151619_a(int... p_151619_1_) -@@ -203,4 +203,27 @@ +@@ -171,4 +170,27 @@ { 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_})))))))))); } diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch index 5e2daee96..e0009992d 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -1,20 +1,19 @@ --- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java +++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java -@@ -6,10 +6,9 @@ +@@ -7,10 +7,8 @@ public class GenLayerBiome extends GenLayer { -- private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_150588_X, BiomeGenBase.field_150588_X, BiomeGenBase.field_76772_c}; -- private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_150585_R, BiomeGenBase.field_76770_e, BiomeGenBase.field_76772_c, BiomeGenBase.field_150583_P, BiomeGenBase.field_76780_h}; -- private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76768_g, BiomeGenBase.field_76772_c}; -- private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_150584_S}; +- private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {Biomes.field_76769_d, Biomes.field_76769_d, Biomes.field_76769_d, Biomes.field_150588_X, Biomes.field_150588_X, Biomes.field_76772_c}; +- private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {Biomes.field_76767_f, Biomes.field_150585_R, Biomes.field_76770_e, Biomes.field_76772_c, Biomes.field_150583_P, Biomes.field_76780_h}; +- private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {Biomes.field_76767_f, Biomes.field_76770_e, Biomes.field_76768_g, Biomes.field_76772_c}; +- private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {Biomes.field_76774_n, Biomes.field_76774_n, Biomes.field_76774_n, Biomes.field_150584_S}; + @SuppressWarnings("unchecked") + private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; -+ private final ChunkProviderSettings field_175973_g; public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) -@@ -17,9 +16,30 @@ +@@ -18,9 +16,30 @@ super(p_i45560_1_); this.field_75909_a = p_i45560_3_; @@ -29,57 +28,57 @@ + + int desertIdx = net.minecraftforge.common.BiomeManager.BiomeType.DESERT.ordinal(); + -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76769_d, 30)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_150588_X, 20)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76772_c, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76769_d, 30)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_150588_X, 20)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); + if (p_i45560_4_ == WorldType.field_77136_e) { -- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g}; +- this.field_151623_c = new BiomeGenBase[] {Biomes.field_76769_d, Biomes.field_76767_f, Biomes.field_76770_e, Biomes.field_76780_h, Biomes.field_76772_c, Biomes.field_76768_g}; + biomes[desertIdx].clear(); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76769_d, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76767_f, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76770_e, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76780_h, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76772_c, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76768_g, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76769_d, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76767_f, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76770_e, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76780_h, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76768_g, 10)); this.field_175973_g = null; } else if (p_i45560_4_ == WorldType.field_180271_f) -@@ -73,7 +93,7 @@ +@@ -74,7 +93,7 @@ } else { -- aint1[j + i * p_75904_3_] = this.field_151623_c[this.func_75902_a(this.field_151623_c.length)].field_76756_M; -+ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome.field_76756_M; +- aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(this.field_151623_c[this.func_75902_a(this.field_151623_c.length)]); ++ aint1[k + i * p_75904_3_] = BiomeGenBase.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome); } } else if (k == 2) -@@ -84,7 +104,7 @@ +@@ -85,7 +104,7 @@ } else { -- aint1[j + i * p_75904_3_] = this.field_151621_d[this.func_75902_a(this.field_151621_d.length)].field_76756_M; -+ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome.field_76756_M; +- aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(this.field_151621_d[this.func_75902_a(this.field_151621_d.length)]); ++ aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome); } } else if (k == 3) -@@ -95,12 +115,12 @@ +@@ -96,12 +115,12 @@ } else { -- aint1[j + i * p_75904_3_] = this.field_151622_e[this.func_75902_a(this.field_151622_e.length)].field_76756_M; -+ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome.field_76756_M; +- aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(this.field_151622_e[this.func_75902_a(this.field_151622_e.length)]); ++ aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome); } } else if (k == 4) { -- aint1[j + i * p_75904_3_] = this.field_151620_f[this.func_75902_a(this.field_151620_f.length)].field_76756_M; -+ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome.field_76756_M; +- aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(this.field_151620_f[this.func_75902_a(this.field_151620_f.length)]); ++ aint1[j + i * p_75904_3_] = BiomeGenBase.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome); } else { -@@ -111,4 +131,12 @@ +@@ -112,4 +131,12 @@ return aint1; } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch deleted file mode 100644 index a1ba80289..000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java -@@ -40,6 +40,12 @@ - { - } - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, field_74941_i, 2, 7); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); -+ } -+ - public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) - { - super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); -@@ -258,7 +264,7 @@ - { - int l1 = enumfacing.func_82601_c() * 2; - int i2 = enumfacing.func_82599_e() * 2; -- this.field_74940_h[enumfacing.func_176736_b()] = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_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[enumfacing.func_176736_b()] = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_)); - } - } - -@@ -362,6 +368,13 @@ - private static final List field_175815_j = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151032_g, 0, 2, 7, 30)}); - private static ComponentScatteredFeaturePieces.JunglePyramid.Stones field_74942_n = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER, field_175815_j, 2, 2); -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST, field_175816_i, 2, 7); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); -+ } -+ - public JunglePyramid() - { - } -@@ -518,9 +531,12 @@ - this.func_175811_a(p_74875_1_, Blocks.field_150488_af.func_176223_P(), 4, -3, 1, p_74875_3_); - this.func_175811_a(p_74875_1_, Blocks.field_150341_Y.func_176223_P(), 3, -3, 1, p_74875_3_); - -+ net.minecraftforge.common.ChestGenHooks dispenser = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER); -+ net.minecraftforge.common.ChestGenHooks chest = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST); -+ - if (!this.field_74945_j) - { -- this.field_74945_j = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.func_176745_a(), field_175815_j, 2); -+ this.field_74945_j = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.func_176745_a(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); - } - - this.func_175811_a(p_74875_1_, Blocks.field_150395_bd.func_176203_a(15), 3, -2, 2, p_74875_3_); -@@ -537,7 +553,7 @@ - - if (!this.field_74946_k) - { -- this.field_74946_k = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.func_176745_a(), field_175815_j, 2); -+ this.field_74946_k = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.func_176745_a(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); - } - - this.func_175811_a(p_74875_1_, Blocks.field_150395_bd.func_176203_a(15), 8, -1, 3, p_74875_3_); -@@ -545,7 +561,7 @@ - - if (!this.field_74947_h) - { -- this.field_74947_h = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); -+ this.field_74947_h = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); - } - - this.func_175811_a(p_74875_1_, Blocks.field_150341_Y.func_176223_P(), 9, -3, 2, p_74875_3_); -@@ -578,7 +594,7 @@ - - if (!this.field_74948_i) - { -- this.field_74948_i = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); -+ this.field_74948_i = this.func_180778_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; 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 a296c5436..81289f936 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -1,15 +1,16 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java -@@ -28,11 +28,18 @@ +@@ -28,11 +28,19 @@ - for (BiomeGenBase biomegenbase : BiomeGenBase.func_150565_n()) + for (BiomeGenBase biomegenbase : BiomeGenBase.field_185377_q) { -- if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F) -+ if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) +- if (biomegenbase != null && biomegenbase.func_185355_j() > 0.0F) ++ if (biomegenbase != null && biomegenbase.func_185355_j() > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) { this.field_151546_e.add(biomegenbase); } } ++ + for (BiomeGenBase biome : net.minecraftforge.common.BiomeManager.strongHoldBiomes) + { + if (!this.field_151546_e.contains(biome)) 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 f97b0ccc3..628727ece 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java -@@ -217,12 +217,12 @@ +@@ -221,12 +221,12 @@ { if (this.field_143029_e == null) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch index 8c525a612..0d04563b4 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java -@@ -35,6 +35,10 @@ +@@ -38,6 +38,10 @@ - public NBTTagCompound func_143010_b() + public final NBTTagCompound func_143010_b() { + if (MapGenStructureIO.func_143036_a(this) == null) // Friendlier error then the Null String error below. + { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch deleted file mode 100644 index 3a37d8b4c..000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java -@@ -32,6 +32,12 @@ - MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs"); - } - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, field_175893_a, 8, 8); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); -+ } -+ - private static StructureComponent func_175892_a(List p_175892_0_, Random p_175892_1_, int p_175892_2_, int p_175892_3_, int p_175892_4_, EnumFacing p_175892_5_, int p_175892_6_) - { - int i = p_175892_1_.nextInt(100); -@@ -351,14 +357,15 @@ - this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 - 1, Blocks.field_150478_aa.func_176203_a(EnumFacing.UP.func_176745_a())); - this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 + 1, Blocks.field_150478_aa.func_176203_a(EnumFacing.UP.func_176745_a())); - -+ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR); - if (p_74875_2_.nextInt(100) == 0) - { -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); - } - - if (p_74875_2_.nextInt(100) == 0) - { -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); - } - - if (this.field_74956_b && !this.field_74957_c) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch deleted file mode 100644 index 8d9ab3d84..000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java -@@ -154,7 +154,7 @@ - if (this.field_111021_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(3, 3), this.func_74862_a(2), this.func_74873_b(3, 3)))) - { - this.field_111021_b = false; -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); - } - - this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); -@@ -225,7 +225,7 @@ - if (this.field_111020_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(1, 3), this.func_74862_a(2), this.func_74873_b(1, 3)))) - { - this.field_111020_b = false; -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); - } - - this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); -@@ -943,6 +943,7 @@ - abstract static class Piece extends StructureComponent - { - protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151045_i, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 5), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151010_B, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151171_ah, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151033_d, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151075_bm, 0, 3, 7, 5), new WeightedRandomChestContent(Items.field_151141_av, 0, 1, 1, 10), new WeightedRandomChestContent(Items.field_151136_bY, 0, 1, 1, 8), new WeightedRandomChestContent(Items.field_151138_bX, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151125_bZ, 0, 1, 1, 3), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150343_Z), 0, 2, 4, 2)}); -+ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); } - - public Piece() - { 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 7ff46ea18..c8db28dbb 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java -@@ -62,6 +62,10 @@ +@@ -63,6 +63,10 @@ public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) { @@ -11,7 +11,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); nbttagcompound.func_74768_a("ChunkX", p_143021_1_); -@@ -97,7 +101,8 @@ +@@ -98,7 +102,8 @@ for (int i = 0; i < nbttaglist.func_74745_c(); ++i) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch deleted file mode 100644 index 0d5ebc0bb..000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java -@@ -240,6 +240,12 @@ - { - } - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, field_75003_a, 2, 4); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); -+ } -+ - public ChestCorridor(int p_i45582_1_, Random p_i45582_2_, StructureBoundingBox p_i45582_3_, EnumFacing p_i45582_4_) - { - super(p_i45582_1_); -@@ -296,7 +302,7 @@ - if (!this.field_75002_c && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(3, 3), this.func_74862_a(2), this.func_74873_b(3, 3)))) - { - this.field_75002_c = true; -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_177629_a(field_75003_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(2)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_)); - } - - return true; -@@ -592,6 +598,12 @@ - private static final List field_75007_b = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151122_aG, 0, 1, 3, 20), new WeightedRandomChestContent(Items.field_151121_aF, 0, 2, 7, 20), new WeightedRandomChestContent(Items.field_151148_bJ, 0, 1, 1, 1), new WeightedRandomChestContent(Items.field_151111_aL, 0, 1, 1, 1)}); - private boolean field_75008_c; - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, field_75007_b, 1, 5); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 5, 2)); -+ } -+ - public Library() - { - } -@@ -736,12 +748,13 @@ - this.func_175811_a(p_74875_1_, Blocks.field_150478_aa.func_176223_P(), i1, 8, j1 + 1, p_74875_3_); - } - -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_177629_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)); -+ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY); -+ this.func_180778_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.field_75008_c) - { - this.func_175811_a(p_74875_1_, Blocks.field_150350_a.func_176223_P(), 12, 9, 1, p_74875_3_); -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_177629_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_180778_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; -@@ -1013,6 +1026,12 @@ - private static final List field_75014_c = Lists.newArrayList(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_151044_h, 0, 3, 8, 10), new WeightedRandomChestContent(Items.field_151025_P, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151034_e, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151035_b, 0, 1, 1, 1)}); - protected int field_75013_b; - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, field_75014_c, 1, 5); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); -+ } -+ - public RoomCrossing() - { - } -@@ -1151,7 +1170,7 @@ - this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 1, 3, p_74875_3_); - this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 2, 3, p_74875_3_); - this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 3, 3, p_74875_3_); -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_177629_a(field_75014_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 1 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.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 43cc68cb1..4af3d40bf 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java -@@ -57,6 +57,7 @@ +@@ -58,6 +58,7 @@ list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.func_76136_a(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.func_76136_a(p_75084_0_, 0, 1 + p_75084_1_))); list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.func_76136_a(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); @@ -8,7 +8,7 @@ Iterator iterator = list.iterator(); while (iterator.hasNext()) -@@ -129,6 +130,10 @@ +@@ -130,6 +131,10 @@ { structurevillagepieces$village = StructureVillagePieces.House3.func_175849_a(p_176065_0_, p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_); } @@ -19,28 +19,7 @@ return structurevillagepieces$village; } -@@ -833,6 +838,11 @@ - { - } - -+ static -+ { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, field_74918_a, 3, 8); -+ } -+ - public House2(StructureVillagePieces.Start p_i45563_1_, int p_i45563_2_, Random p_i45563_3_, StructureBoundingBox p_i45563_4_, EnumFacing p_i45563_5_) - { - super(p_i45563_1_, p_i45563_2_); -@@ -911,7 +921,7 @@ - if (!this.field_74917_c && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(5, 5), this.func_74862_a(1), this.func_74873_b(5, 5)))) - { - this.field_74917_c = true; -- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, field_74918_a, 3 + p_74875_2_.nextInt(6)); -+ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_)); - } - - for (int i = 6; i <= 8; ++i) -@@ -1403,6 +1413,7 @@ +@@ -1447,6 +1452,7 @@ public List field_74931_h; public List field_74932_i = Lists.newArrayList(); public List field_74930_j = Lists.newArrayList(); @@ -48,15 +27,15 @@ public Start() { -@@ -1416,6 +1427,7 @@ +@@ -1460,6 +1466,7 @@ this.field_74928_c = p_i2104_7_; - BiomeGenBase biomegenbase = p_i2104_1_.func_180300_a(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BiomeGenBase.field_180279_ad); - this.field_74927_b = biomegenbase == BiomeGenBase.field_76769_d || biomegenbase == BiomeGenBase.field_76786_s; + BiomeGenBase biomegenbase = p_i2104_1_.func_180300_a(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.field_180279_ad); + this.field_74927_b = biomegenbase == Biomes.field_76769_d || biomegenbase == Biomes.field_76786_s; + this.biome = biomegenbase; this.func_175846_a(this.field_74927_b); } -@@ -1477,6 +1489,7 @@ +@@ -1520,6 +1527,7 @@ protected int field_143015_k = -1; private int field_74896_a; private boolean field_143014_b; @@ -64,7 +43,7 @@ public Village() { -@@ -1489,6 +1502,7 @@ +@@ -1532,6 +1540,7 @@ if (p_i2107_1_ != null) { this.field_143014_b = p_i2107_1_.field_74927_b; @@ -72,7 +51,7 @@ } } -@@ -1613,6 +1627,9 @@ +@@ -1660,6 +1669,9 @@ protected IBlockState func_175847_a(IBlockState p_175847_1_) { diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index 4bddcf6da..4f6cfb714 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -6,10 +6,10 @@ public int field_76199_b; - public byte field_76200_c; + public int field_76200_c; //FML byte -> int + public boolean field_186210_e; public byte field_76197_d; public byte[] field_76198_e = new byte[16384]; - public List field_76196_g = Lists.newArrayList(); -@@ -44,7 +44,17 @@ +@@ -45,7 +45,17 @@ public void func_76184_a(NBTTagCompound p_76184_1_) { @@ -28,7 +28,7 @@ this.field_76201_a = p_76184_1_.func_74762_e("xCenter"); this.field_76199_b = p_76184_1_.func_74762_e("zCenter"); this.field_76197_d = p_76184_1_.func_74771_c("scale"); -@@ -85,7 +95,7 @@ +@@ -96,7 +106,7 @@ public void func_76187_b(NBTTagCompound p_76187_1_) { @@ -37,7 +37,7 @@ p_76187_1_.func_74768_a("xCenter", this.field_76201_a); p_76187_1_.func_74768_a("zCenter", this.field_76199_b); p_76187_1_.func_74774_a("scale", this.field_76197_d); -@@ -164,7 +174,7 @@ +@@ -176,7 +186,7 @@ p_82567_8_ = p_82567_8_ + (p_82567_8_ < 0.0D ? -8.0D : 8.0D); b2 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); diff --git a/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch new file mode 100644 index 000000000..5d70251ab --- /dev/null +++ b/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/SaveFormatOld.java ++++ ../src-work/minecraft/net/minecraft/world/storage/SaveFormatOld.java +@@ -106,6 +106,24 @@ + } + } + ++ //Forge: Special version of the above that runs during actual world loading and not metadata gathering. ++ public static WorldInfo loadAndFix(File file, DataFixer fixer, SaveHandler save) ++ { ++ try ++ { ++ NBTTagCompound nbt = CompressedStreamTools.func_74796_a(new FileInputStream(file)); ++ WorldInfo info = new WorldInfo(fixer.func_188257_a(FixTypes.LEVEL, nbt.func_74775_l("Data"))); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(save, info, nbt); ++ return info; ++ } ++ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) { throw e; } ++ catch (Exception exception) ++ { ++ field_151479_b.error((String)("Exception reading " + file), (Throwable)exception); ++ return null; ++ } ++ } ++ + @SideOnly(Side.CLIENT) + public void func_75806_a(String p_75806_1_, String p_75806_2_) + { diff --git a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch index 6f920a640..3cce351d0 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch @@ -1,52 +1,26 @@ --- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java +++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java -@@ -104,20 +104,29 @@ - { - File file1 = new File(this.field_75770_b, "level.dat"); +@@ -117,7 +117,7 @@ -+ WorldInfo worldInfo = null; -+ if (file1.exists()) { - try +- WorldInfo worldinfo = SaveFormatOld.func_186353_a(file1, this.field_186341_a); ++ WorldInfo worldinfo = SaveFormatOld.loadAndFix(file1, this.field_186341_a, this); + + if (worldinfo != null) { - NBTTagCompound nbttagcompound2 = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); - NBTTagCompound nbttagcompound3 = nbttagcompound2.func_74775_l("Data"); -- return new WorldInfo(nbttagcompound3); -+ worldInfo = new WorldInfo(nbttagcompound3); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound2); -+ return worldInfo; - } -+ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) -+ { -+ throw e; -+ } - catch (Exception exception1) - { - exception1.printStackTrace(); +@@ -125,8 +125,9 @@ } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this); file1 = new File(this.field_75770_b, "level.dat_old"); +- return file1.exists() ? SaveFormatOld.func_186353_a(file1, this.field_186341_a) : null; ++ return file1.exists() ? SaveFormatOld.loadAndFix(file1, this.field_186341_a, this) : null; + } - if (file1.exists()) -@@ -126,7 +135,13 @@ - { - NBTTagCompound nbttagcompound = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); - NBTTagCompound nbttagcompound1 = nbttagcompound.func_74775_l("Data"); -- return new WorldInfo(nbttagcompound1); -+ worldInfo = new WorldInfo(nbttagcompound1); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); -+ return worldInfo; -+ } -+ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) -+ { -+ throw e; - } - catch (Exception exception) - { -@@ -143,6 +158,8 @@ + public void func_75755_a(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) +@@ -135,6 +136,8 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.func_74782_a("Data", nbttagcompound); @@ -55,16 +29,7 @@ try { File file1 = new File(this.field_75770_b, "level.dat_new"); -@@ -181,6 +198,8 @@ - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.func_74782_a("Data", nbttagcompound); - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75761_1_, nbttagcompound1); -+ - try - { - File file1 = new File(this.field_75770_b, "level.dat_new"); -@@ -229,6 +248,7 @@ +@@ -188,6 +191,7 @@ } file1.renameTo(file2); @@ -72,17 +37,17 @@ } catch (Exception var5) { -@@ -259,6 +279,7 @@ - p_75752_1_.func_70020_e(nbttagcompound); +@@ -218,6 +222,7 @@ + p_75752_1_.func_70020_e(this.field_186341_a.func_188257_a(FixTypes.PLAYER, nbttagcompound)); } + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, field_75771_c, p_75752_1_.func_110124_au().toString()); return nbttagcompound; } -@@ -300,4 +321,22 @@ +@@ -259,4 +264,22 @@ { - return this.field_75767_f; + return this.field_186342_h; } + + public NBTTagCompound getPlayerNBT(net.minecraft.entity.player.EntityPlayerMP player) diff --git a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch index 808536451..5ffd902c3 100644 --- a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -1,18 +1,17 @@ --- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java +++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java -@@ -51,6 +51,7 @@ - private int field_176154_I = 5; +@@ -60,6 +60,7 @@ private int field_176155_J = 15; + private final Map field_186348_N = Maps.newEnumMap(DimensionType.class); private GameRules field_82577_x = new GameRules(); + private java.util.Map additionalProperties; protected WorldInfo() { -@@ -745,4 +746,24 @@ - } +@@ -785,6 +786,26 @@ }); } -+ + + /** + * Allow access to additional mod specific world based properties + * Used by FML to store mod list associated with a world, and maybe an id map @@ -32,4 +31,7 @@ + { + return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null; + } - } ++ + public NBTTagCompound func_186347_a(DimensionType p_186347_1_) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_186348_N.get(p_186347_1_);