mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Add render distance property to TileEntity.
This commit is contained in:
1 parent
4967683c9c
commit
06aaa9e9a4
2 files changed
+22
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
--- ../src_base/common/net/minecraft/src/TileEntity.java
|
||||
+++ ../src_work/common/net/minecraft/src/TileEntity.java
|
||||
@@ -250,4 +250,33 @@
|
||||
@@ -250,4 +250,41 @@
|
||||
addMapping(TileEntityEnchantmentTable.class, "EnchantTable");
|
||||
addMapping(TileEntityEndPortal.class, "Airportal");
|
||||
}
|
||||
@@ -32,5 +32,13 @@
|
||||
+ */
|
||||
+ public void onChunkUnload()
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return The maximum distance between the player and the TileEntity at which the TileEntitySpecialRenderer will be called
|
||||
+ */
|
||||
+ public double getRenderDistance()
|
||||
+ {
|
||||
+ return 64;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/TileEntityRenderer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/src/TileEntityRenderer.java
|
||||
@@ -123,7 +123,9 @@
|
||||
*/
|
||||
public void renderTileEntity(TileEntity par1TileEntity, float par2)
|
||||
{
|
||||
- if (par1TileEntity.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < 4096.0D)
|
||||
+ double dist = par1TileEntity.getRenderDistance();
|
||||
+ dist *= dist;
|
||||
+ if (par1TileEntity.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < dist)
|
||||
{
|
||||
int var3 = this.worldObj.getLightBrightnessForSkyBlocks(par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord, 0);
|
||||
int var4 = var3 % 65536;
|
||||
Reference in new issue
Block a user