From 8d7fbd0b532e4b58edb9f9f733dc174cfa8fa5f2 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 31 May 2024 20:26:52 +0200 Subject: [PATCH] fix Select again --- .../com/baseband/client/feature/world/Select.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Client/src/main/java/com/baseband/client/feature/world/Select.java b/Client/src/main/java/com/baseband/client/feature/world/Select.java index 32f6aea..cfaa353 100644 --- a/Client/src/main/java/com/baseband/client/feature/world/Select.java +++ b/Client/src/main/java/com/baseband/client/feature/world/Select.java @@ -15,19 +15,17 @@ public class Select extends Feature { public static Selection selection; public static void select(BlockPos b) { - if(begin != null) { - end = b; - BaseBand.notify("Position 2: " + b.getX() + " " + b.getY() + " " + b.getZ()); - BaseBand.publish(new SelectEvent(new Selection(begin, end))); - return; - } - else { + if(end != null || begin == null) { begin = b; end = null; BaseBand.notify("Selection reset."); BaseBand.notify("Position 1: " + b.getX() + " " + b.getY() + " " + b.getZ()); BaseBand.publish(new SelectEvent(null)); + return; } + end = b; + BaseBand.notify("Position 2: " + b.getX() + " " + b.getY() + " " + b.getZ()); + BaseBand.publish(new SelectEvent(new Selection(begin, end))); } @Priority(Integer.MAX_VALUE)