diff options
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/ChunkMesh.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/ChunkMesh.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java index 9d6241f..8fac2db 100644 --- a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java +++ b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java @@ -27,6 +27,7 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByteArray; import net.minecraft.nbt.NBTTagCompound; @@ -350,6 +351,14 @@ public class ChunkMesh extends Mesh { return ((IWorldRenderer)wr).getChunkMeshes(); } + public double distSq(Entity player) { + int centerX = x * 16 + 8; + int centerY = y * 16 + 8; + int centerZ = z * 16 + 8; + + return player.getDistanceSq(centerX, centerY, centerZ); + } + public static class Flags { boolean hasTexture; boolean hasBrightness; |