From 571e441502ce800262c5ca9d427ad9c7332c3fa1 Mon Sep 17 00:00:00 2001 From: LexManos Date: Wed, 7 Aug 2013 18:24:50 -0700 Subject: [PATCH] Only refresh vanilla tile entities when IDs change. --- .../renderer/entity/RendererLivingEntity.java.patch | 8 ++++---- .../net/minecraft/tileentity/TileEntity.java.patch | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch index 9df5e61cf4..9c507d2c27 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -10,16 +10,16 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -@@ -28,6 +31,9 @@ - +@@ -29,6 +32,9 @@ /** The model to be used during the render passes. */ protected ModelBase renderPassModel; -+ + + public static float NAME_TAG_RANGE = 64.0f; + public static float NAME_TAG_RANGE_SNEAK = 32.0f; - ++ public RendererLivingEntity(ModelBase par1ModelBase, float par2) { + this.mainModel = par1ModelBase; @@ -68,6 +74,7 @@ public void func_130000_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 12f2d86b8c..fab68f5aef 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -12,7 +12,7 @@ import net.minecraft.world.World; public class TileEntity -@@ -311,4 +314,93 @@ +@@ -311,4 +314,94 @@ addMapping(TileEntityHopper.class, "Hopper"); addMapping(TileEntityComparator.class, "Comparator"); } @@ -47,6 +47,7 @@ + { + } + ++ private boolean isVanilla = getClass().getName().startsWith("net.minecraft.tileentity"); + /** + * Called from Chunk.setBlockIDWithMetadata, 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. @@ -63,7 +64,7 @@ + */ + public boolean shouldRefresh(int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z) + { -+ return true; ++ return !isVanilla || (oldID != newID); + } + + public boolean shouldRenderInPass(int pass)