From 9729c137f14b69a013a74e05ca996c4a047b1a4f Mon Sep 17 00:00:00 2001 From: Bob Dole Date: Mon, 19 Oct 2020 18:40:59 -0400 Subject: [PATCH] Fix Bell contraptions and Schematic usage - Bell contraptions no longer causes a NullPointerException when they are stopped - Schematic usage shouldn't require a player to not be sneaking, and changes the key to CTRL to match tool tips --- .../components/actors/BellMovementBehaviour.java | 5 +++-- .../create/content/schematics/client/SchematicHandler.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BellMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BellMovementBehaviour.java index e5b89a27d..cc14b1ffc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BellMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BellMovementBehaviour.java @@ -25,7 +25,8 @@ public class BellMovementBehaviour extends MovementBehaviour { @Override public void stopMoving(MovementContext context) { - context.world.playSound(null, new BlockPos(context.position), SoundEvents.BLOCK_BELL_USE, SoundCategory.BLOCKS, - 2.0F, 1.0F); + if (context.position != null) + context.world.playSound(null, new BlockPos(context.position), SoundEvents.BLOCK_BELL_USE, SoundCategory.BLOCKS, + 2.0F, 1.0F); } } diff --git a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java index 632108933..31fe3496e 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/SchematicHandler.java @@ -221,14 +221,14 @@ public class SchematicHandler { } public boolean mouseScrolled(double delta) { - if (!active || Minecraft.getInstance().player.isSneaking()) + if (!active) return false; if (selectionScreen.focused) { selectionScreen.cycle((int) delta); return true; } - if (AllKeys.ACTIVATE_TOOL.isPressed()) + if (!AllKeys.ctrlDown()) return currentTool.getTool() .handleMouseWheel(delta); return false;