From a5ce9abbe9d6e353ac628d0e3cbea6d34c993449 Mon Sep 17 00:00:00 2001 From: SFort Date: Fri, 20 Oct 2023 18:55:14 +0200 Subject: [PATCH] Use appropriate method for sneaky players --- .../actors/psi/PortableStorageInterfaceBlock.java | 2 +- .../contraptions/actors/trainControls/ControlsBlock.java | 2 +- .../content/contraptions/glue/SuperGlueSelectionHandler.java | 4 ++-- .../create/content/decoration/copycat/CopycatBlock.java | 2 +- .../create/content/decoration/girder/GirderBlock.java | 2 +- .../content/decoration/girder/GirderWrenchBehavior.java | 2 +- .../create/content/decoration/palettes/LayeredBlock.java | 2 +- .../create/content/equipment/clipboard/ClipboardBlock.java | 2 +- .../content/equipment/clipboard/ClipboardBlockItem.java | 2 +- .../equipment/clipboard/ClipboardValueSettingsHandler.java | 2 +- .../com/simibubi/create/content/fluids/pump/PumpBlock.java | 2 +- .../create/content/kinetics/crank/ValveHandleBlock.java | 4 ++-- .../create/content/logistics/vault/ItemVaultBlock.java | 2 +- .../create/content/logistics/vault/ItemVaultItem.java | 2 +- .../create/content/materials/ExperienceNuggetItem.java | 2 +- .../create/content/redstone/displayLink/DisplayLinkBlock.java | 2 +- .../content/redstone/displayLink/DisplayLinkBlockItem.java | 2 +- .../content/redstone/smartObserver/SmartObserverBlock.java | 2 +- .../redstone/thresholdSwitch/ThresholdSwitchBlock.java | 2 +- .../simibubi/create/content/trains/entity/TrainRelocator.java | 2 +- .../simibubi/create/content/trains/station/StationBlock.java | 2 +- .../create/content/trains/track/CurvedTrackInteraction.java | 2 +- .../content/trains/track/CurvedTrackSelectionPacket.java | 2 +- .../simibubi/create/content/trains/track/TrackBlockItem.java | 2 +- .../create/content/trains/track/TrackTargetingBlockItem.java | 2 +- 25 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/psi/PortableStorageInterfaceBlock.java b/src/main/java/com/simibubi/create/content/contraptions/actors/psi/PortableStorageInterfaceBlock.java index 9faee84b6..297a9827a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/psi/PortableStorageInterfaceBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/psi/PortableStorageInterfaceBlock.java @@ -58,7 +58,7 @@ public class PortableStorageInterfaceBlock extends WrenchableDirectionalBlock public BlockState getStateForPlacement(BlockPlaceContext context) { Direction direction = context.getNearestLookingDirection(); if (context.getPlayer() != null && context.getPlayer() - .isSteppingCarefully()) + .isShiftKeyDown()) direction = direction.getOpposite(); return defaultBlockState().setValue(FACING, direction.getOpposite()); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/trainControls/ControlsBlock.java b/src/main/java/com/simibubi/create/content/contraptions/actors/trainControls/ControlsBlock.java index e299b3616..c9d13fb8d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/trainControls/ControlsBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/trainControls/ControlsBlock.java @@ -56,7 +56,7 @@ public class ControlsBlock extends HorizontalDirectionalBlock implements IWrench Player player = pContext.getPlayer(); state = state.setValue(FACING, horizontalDirection.getOpposite()); - if (player != null && player.isSteppingCarefully()) + if (player != null && player.isShiftKeyDown()) state = state.setValue(FACING, horizontalDirection); return state; diff --git a/src/main/java/com/simibubi/create/content/contraptions/glue/SuperGlueSelectionHandler.java b/src/main/java/com/simibubi/create/content/contraptions/glue/SuperGlueSelectionHandler.java index 7bcf184b2..6cee3961d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/glue/SuperGlueSelectionHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/glue/SuperGlueSelectionHandler.java @@ -121,7 +121,7 @@ public class SuperGlueSelectionHandler { return; } - boolean cancel = player.isSteppingCarefully(); + boolean cancel = player.isShiftKeyDown(); if (cancel && firstPos == null) return; @@ -201,7 +201,7 @@ public class SuperGlueSelectionHandler { return true; } - if (player.isSteppingCarefully()) { + if (player.isShiftKeyDown()) { if (firstPos != null) { discard(); return true; diff --git a/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java b/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java index e46439049..d94fc8711 100644 --- a/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java +++ b/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java @@ -316,7 +316,7 @@ public abstract class CopycatBlock extends Block implements IBE (hcbe instanceof ValveHandleBlockEntity vhbe) && vhbe.activate(player.isSteppingCarefully()) + hcbe -> (hcbe instanceof ValveHandleBlockEntity vhbe) && vhbe.activate(player.isShiftKeyDown()) ? InteractionResult.SUCCESS : InteractionResult.PASS); return true; diff --git a/src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlock.java b/src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlock.java index 134d6f0e0..034aa029f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlock.java @@ -53,7 +53,7 @@ public class ItemVaultBlock extends Block implements IWrenchable, IBE () -> withBlockEntityDo(pLevel, pPos, be -> this.displayScreen(be, pPlayer))); diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlockItem.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlockItem.java index b43be0763..d5460c13c 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlockItem.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlockItem.java @@ -57,7 +57,7 @@ public class DisplayLinkBlockItem extends BlockItem { if (player == null) return InteractionResult.FAIL; - if (player.isSteppingCarefully() && stack.hasTag()) { + if (player.isShiftKeyDown() && stack.hasTag()) { if (level.isClientSide) return InteractionResult.SUCCESS; player.displayClientMessage(Lang.translateDirect("display_link.clear"), true); diff --git a/src/main/java/com/simibubi/create/content/redstone/smartObserver/SmartObserverBlock.java b/src/main/java/com/simibubi/create/content/redstone/smartObserver/SmartObserverBlock.java index 94b4db68b..e0636c1bf 100644 --- a/src/main/java/com/simibubi/create/content/redstone/smartObserver/SmartObserverBlock.java +++ b/src/main/java/com/simibubi/create/content/redstone/smartObserver/SmartObserverBlock.java @@ -85,7 +85,7 @@ public class SmartObserverBlock extends DirectedDirectionalBlock implements IBE< if (preferredFacing == null) { Direction facing = context.getNearestLookingDirection(); preferredFacing = context.getPlayer() != null && context.getPlayer() - .isSteppingCarefully() ? facing : facing.getOpposite(); + .isShiftKeyDown() ? facing : facing.getOpposite(); } if (preferredFacing.getAxis() == Axis.Y) { diff --git a/src/main/java/com/simibubi/create/content/redstone/thresholdSwitch/ThresholdSwitchBlock.java b/src/main/java/com/simibubi/create/content/redstone/thresholdSwitch/ThresholdSwitchBlock.java index ac8d2429e..ac4df4530 100644 --- a/src/main/java/com/simibubi/create/content/redstone/thresholdSwitch/ThresholdSwitchBlock.java +++ b/src/main/java/com/simibubi/create/content/redstone/thresholdSwitch/ThresholdSwitchBlock.java @@ -123,7 +123,7 @@ public class ThresholdSwitchBlock extends DirectedDirectionalBlock implements IB if (preferredFacing == null) { Direction facing = context.getNearestLookingDirection(); preferredFacing = context.getPlayer() != null && context.getPlayer() - .isSteppingCarefully() ? facing : facing.getOpposite(); + .isShiftKeyDown() ? facing : facing.getOpposite(); } if (preferredFacing.getAxis() == Axis.Y) { diff --git a/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java b/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java index 9f21d6ab3..ee806f9f9 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java @@ -83,7 +83,7 @@ public class TrainRelocator { return; if (!player.position() - .closerThan(relocatingOrigin, 24) || player.isSteppingCarefully()) { + .closerThan(relocatingOrigin, 24) || player.isShiftKeyDown()) { relocatingTrain = null; player.displayClientMessage(Lang.translateDirect("train.relocate.abort") .withStyle(ChatFormatting.RED), true); diff --git a/src/main/java/com/simibubi/create/content/trains/station/StationBlock.java b/src/main/java/com/simibubi/create/content/trains/station/StationBlock.java index 162deff9c..dbcd1ff01 100644 --- a/src/main/java/com/simibubi/create/content/trains/station/StationBlock.java +++ b/src/main/java/com/simibubi/create/content/trains/station/StationBlock.java @@ -113,7 +113,7 @@ public class StationBlock extends Block implements IBE, IWre public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHit) { - if (pPlayer == null || pPlayer.isSteppingCarefully()) + if (pPlayer == null || pPlayer.isShiftKeyDown()) return InteractionResult.PASS; ItemStack itemInHand = pPlayer.getItemInHand(pHand); if (AllItems.WRENCH.isIn(itemInHand)) diff --git a/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackInteraction.java b/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackInteraction.java index 9e0d6ee06..7f0e24010 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackInteraction.java +++ b/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackInteraction.java @@ -126,7 +126,7 @@ public class CurvedTrackInteraction { player.swing(InteractionHand.MAIN_HAND); return true; } - if (AllItems.WRENCH.isIn(heldItem) && player.isSteppingCarefully()) { + if (AllItems.WRENCH.isIn(heldItem) && player.isShiftKeyDown()) { AllPackets.getChannel().sendToServer(new CurvedTrackDestroyPacket(result.blockEntity() .getBlockPos(), result.loc() diff --git a/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackSelectionPacket.java b/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackSelectionPacket.java index b8d5aac03..4755b3fcf 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackSelectionPacket.java +++ b/src/main/java/com/simibubi/create/content/trains/track/CurvedTrackSelectionPacket.java @@ -60,7 +60,7 @@ public class CurvedTrackSelectionPacket extends BlockEntityConfigurationPacket