diff --git a/gradle.properties b/gradle.properties index d6af13c..5971e2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel = true # Mod Properties -version = 0.1.6 +version = 0.1.7 # Notes: when debugging, use rc's, so it would become: 0.X.X-rc.X maven_group = dev.renoux archives_base_name = enderrelay diff --git a/src/main/java/dev/renoux/enderrelay/blocks/EnderRelayBlock.java b/src/main/java/dev/renoux/enderrelay/blocks/EnderRelayBlock.java index 973f950..4b1bdbe 100644 --- a/src/main/java/dev/renoux/enderrelay/blocks/EnderRelayBlock.java +++ b/src/main/java/dev/renoux/enderrelay/blocks/EnderRelayBlock.java @@ -122,8 +122,10 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player } else { ServerPlayer serverPlayer = (ServerPlayer) player; EnderRelayBlockEntity blentity = (EnderRelayBlockEntity) world.getBlockEntity(pos); + if (blentity == null) + return InteractionResult.FAIL; if (serverPlayer.isCrouching()) { - if (!blentity.getName().equals(Component.literal("null"))) + if (blentity.getName() == null || !blentity.getName().equals(Component.literal("null"))) serverPlayer.displayClientMessage(Component.translatable("block.enderrelay.teleport_to", blentity.getName()), true); else serverPlayer.displayClientMessage(Component.translatable("block.enderrelay.nowhere"), true);