Only refresh vanilla tile entities when IDs change.
This commit is contained in:
parent
18c8ac0b31
commit
571e441502
2 changed files with 7 additions and 6 deletions
|
@ -10,16 +10,16 @@
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
@@ -28,6 +31,9 @@
|
@@ -29,6 +32,9 @@
|
||||||
|
|
||||||
/** The model to be used during the render passes. */
|
/** The model to be used during the render passes. */
|
||||||
protected ModelBase renderPassModel;
|
protected ModelBase renderPassModel;
|
||||||
+
|
|
||||||
+ public static float NAME_TAG_RANGE = 64.0f;
|
+ public static float NAME_TAG_RANGE = 64.0f;
|
||||||
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
|
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
|
||||||
|
+
|
||||||
public RendererLivingEntity(ModelBase par1ModelBase, float par2)
|
public RendererLivingEntity(ModelBase par1ModelBase, float par2)
|
||||||
{
|
{
|
||||||
|
this.mainModel = par1ModelBase;
|
||||||
@@ -68,6 +74,7 @@
|
@@ -68,6 +74,7 @@
|
||||||
|
|
||||||
public void func_130000_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
|
public void func_130000_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class TileEntity
|
public class TileEntity
|
||||||
@@ -311,4 +314,93 @@
|
@@ -311,4 +314,94 @@
|
||||||
addMapping(TileEntityHopper.class, "Hopper");
|
addMapping(TileEntityHopper.class, "Hopper");
|
||||||
addMapping(TileEntityComparator.class, "Comparator");
|
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.
|
+ * 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.
|
+ * 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)
|
+ 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)
|
+ public boolean shouldRenderInPass(int pass)
|
||||||
|
|
Loading…
Reference in a new issue