Skip to content

Commit

Permalink
fix NPE when teleporting player
Browse files Browse the repository at this point in the history
  • Loading branch information
octarine-noise committed May 5, 2015
1 parent 0c5ed65 commit 803ce69
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -623,6 +623,7 @@ public boolean renderStandardBlock(Block p_147784_1_, int p_147784_2_, int p_147

protected int getCameraDistance(int x, int y, int z) {
EntityLivingBase camera = Minecraft.getMinecraft().renderViewEntity;
if (camera == null) return 0;
int result = Math.abs(x - MathHelper.floor_double(camera.posX));
result += Math.abs(y - MathHelper.floor_double(camera.posY));
result += Math.abs(z - MathHelper.floor_double(camera.posZ));
Expand Down

0 comments on commit 803ce69

Please sign in to comment.