Fix shouldRefresh not to be so over-eager about modded TEs. Should fix Packet21 causing a TE reset.
This commit is contained in:
parent
7b92a27908
commit
66895a520a
1 changed files with 5 additions and 5 deletions
|
@ -93,18 +93,18 @@
|
||||||
+
|
+
|
||||||
+ private boolean isVanilla = getClass().getName().startsWith("net.minecraft.");
|
+ 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.
|
+ * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly.
|
||||||
+ *
|
+ *
|
||||||
+ * @param world Current world
|
+ * @param world Current world
|
||||||
+ * @param pos Tile's world position
|
+ * @param pos Tile's world position
|
||||||
+ * @param oldID The old ID of the block
|
+ * @param oldState The old ID of the block
|
||||||
+ * @param newID The new ID of the block (May be the same)
|
+ * @param newState 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}
|
+ * @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)
|
+ 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)
|
+ public boolean shouldRenderInPass(int pass)
|
||||||
|
|
Loading…
Reference in a new issue