From 66895a520a9823ce2bba4aa233edd5f0b74125b9 Mon Sep 17 00:00:00 2001 From: cpw Date: Sat, 16 Jan 2016 16:10:59 -0500 Subject: [PATCH] Fix shouldRefresh not to be so over-eager about modded TEs. Should fix Packet21 causing a TE reset. --- .../net/minecraft/tileentity/TileEntity.java.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 8f49c7b049..5955478737 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -93,18 +93,18 @@ + + private boolean isVanilla = getClass().getName().startsWith("net.minecraft."); + /** -+ * Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes. ++ * Called from Chunk.setBlockIDWithMetadata and Chunk.fillChunk, determines if this tile entity should be re-created when the ID, or Metadata changes. + * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly. + * + * @param world Current world + * @param pos Tile's world position -+ * @param oldID The old ID of the block -+ * @param newID The new ID of the block (May be the same) -+ * @return True to remove the old tile entity, false to keep it in tact {and create a new one if the new values specify to} ++ * @param oldState The old ID of the block ++ * @param newState The new ID of the block (May be the same) ++ * @return true forcing the invalidation of the existing TE, false not to invalidate the existing TE + */ + public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) + { -+ return !isVanilla || (oldState.func_177230_c() != newSate.func_177230_c()); ++ return isVanilla ? (oldState.func_177230_c() != newSate.func_177230_c()) : oldState != newSate; + } + + public boolean shouldRenderInPass(int pass)