From 8100667da5854104a78aaef896747231e44ed341 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 15:49:34 +0100 Subject: [PATCH] Fix some rotate behaviour Signed-off-by: yoyosource --- .../features/smartplace/behaviour/BlockPlaceBehaviour.java | 2 +- .../smartplace/behaviour/BlockRotatingBehaviour.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockPlaceBehaviour.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockPlaceBehaviour.java index 97b93b94..bfe5accd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockPlaceBehaviour.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockPlaceBehaviour.java @@ -54,7 +54,7 @@ public class BlockPlaceBehaviour implements SmartPlaceBehaviour { smartPlaceResult = SmartPlaceResult.APPLIED; } else if (blockData instanceof Rotatable) { Rotatable rotatable = (Rotatable) blockData; - rotatable.setRotation(rotatable.getRotation()); + rotatable.setRotation(rotatable.getRotation().getOppositeFace()); smartPlaceResult = SmartPlaceResult.APPLIED; } block.setBlockData(blockData); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockRotatingBehaviour.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockRotatingBehaviour.java index eed4df5a..fc266d0e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockRotatingBehaviour.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/behaviour/BlockRotatingBehaviour.java @@ -72,7 +72,11 @@ public class BlockRotatingBehaviour implements SmartPlaceBehaviour { directional.setFacing(blockFace); } } else if (blockData instanceof Rotatable) { - ((Rotatable) blockData).setRotation(blockFace); + try { + ((Rotatable) blockData).setRotation(blockFace); + } catch (Exception e) { + // Ignore + } } block.setBlockData(blockData); return SmartPlaceResult.APPLIED;