Skip to content

Commit

Permalink
fix: crash when camera not yet present
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jul 22, 2022
1 parent bc6da9b commit 6f0cf6a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private void updateDisplayInfo(CallbackInfo ci) {
if (MendedMinecartsMod.DISPLAY_CART_DATA.isEnabled() &&
MinecraftClient.getInstance().player != null &&
MinecraftClient.getInstance().player.hasPermissionLevel(2) &&
MinecraftClient.getInstance().getEntityRenderDispatcher().getSquaredDistanceToCamera(this) < MendedMinecartsMod.DATA_RENDER_DISTANCE_SQ) {
MinecraftClient.getInstance().player.getPos().squaredDistanceTo(this.getPos()) < MendedMinecartsMod.DATA_RENDER_DISTANCE_SQ) {
MinecraftClient.getInstance().player.networkHandler.getDataQueryHandler().queryEntityNbt(this.getId(), nbt -> {
try {
this.displayData = MinecartDisplayData.fromNBT(this, nbt);
Expand Down

0 comments on commit 6f0cf6a

Please sign in to comment.