From afbfb64442db7c0fdcea6c59f54c5c3250a6be3d Mon Sep 17 00:00:00 2001 From: FirstMegaGame4 <84094287+FirstMegaGame4@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:57:02 +0200 Subject: [PATCH] Fix Ball Registration Table Locks Bump Version --- gradle.properties | 2 +- .../extravaganza/block/BallPoolRegistrationTableBlock.java | 6 +++--- .../com/mmodding/extravaganza/item/WrenchAganzaItem.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index b8c04fb1..5289960c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.21+build.1 loader_version=0.15.11 # Mod Properties -mod_version=0.1.7-beta +mod_version=0.1.8-beta maven_group=com.mmodding.extravaganza archives_base_name=extravaganza diff --git a/src/main/java/com/mmodding/extravaganza/block/BallPoolRegistrationTableBlock.java b/src/main/java/com/mmodding/extravaganza/block/BallPoolRegistrationTableBlock.java index fd741961..cd93a740 100644 --- a/src/main/java/com/mmodding/extravaganza/block/BallPoolRegistrationTableBlock.java +++ b/src/main/java/com/mmodding/extravaganza/block/BallPoolRegistrationTableBlock.java @@ -87,8 +87,8 @@ protected ItemActionResult onUseWithItem(ItemStack stack, BlockState state, Worl @Override protected void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) { - if (world.getBlockEntity(pos) instanceof BallPoolRegistrationTableBlockEntity bpitbe && !world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SCAN)) { - if (!player.isSneaking() || world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SETTINGS)) { + if (world.getBlockEntity(pos) instanceof BallPoolRegistrationTableBlockEntity bpitbe) { + if (!player.isSneaking() && !world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SCAN)) { bpitbe.switchSelectionMode(); if (!world.isClient()) { Object object; @@ -100,7 +100,7 @@ protected void onBlockBreakStart(BlockState state, World world, BlockPos pos, Pl player.sendMessage(Text.literal(bpitbe.getSelectionMode().asString() + ": " + object), true); } } - else { + else if (!world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SETTINGS)) { if (bpitbe.getPoolSettings().power < 15) { bpitbe.getPoolSettings().power = MathHelper.clamp(bpitbe.getPoolSettings().power + 1, 1, 15); } diff --git a/src/main/java/com/mmodding/extravaganza/item/WrenchAganzaItem.java b/src/main/java/com/mmodding/extravaganza/item/WrenchAganzaItem.java index 6eed514b..ceb18c41 100644 --- a/src/main/java/com/mmodding/extravaganza/item/WrenchAganzaItem.java +++ b/src/main/java/com/mmodding/extravaganza/item/WrenchAganzaItem.java @@ -23,8 +23,8 @@ public WrenchAganzaItem(Settings settings) { @Override public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) { - if (world.getBlockEntity(pos) instanceof BallPoolRegistrationTableBlockEntity bpitbe && !world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SCAN)) { - if (!miner.isSneaking() || world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SETTINGS)) { + if (world.getBlockEntity(pos) instanceof BallPoolRegistrationTableBlockEntity bpitbe) { + if (!miner.isSneaking() && !world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SCAN)) { bpitbe.switchSelectionMode(); if (!world.isClient()) { Object object; @@ -36,7 +36,7 @@ public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner.sendMessage(Text.literal(bpitbe.getSelectionMode().asString() + ": " + object), true); } } - else { + else if (!world.getBlockState(pos).get(BallPoolRegistrationTableBlock.LOCK_SETTINGS)) { if (bpitbe.getPoolSettings().power < 15) { bpitbe.getPoolSettings().power = MathHelper.clamp(bpitbe.getPoolSettings().power + 1, 1, 15); }