From a7ea1934a34693cbe37ae291148c76fdf453bf26 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 31 May 2024 20:23:34 +0200 Subject: [PATCH] fix Select --- .../java/com/baseband/client/event/events/SelectEvent.java | 2 ++ .../main/java/com/baseband/client/feature/world/Select.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/src/main/java/com/baseband/client/event/events/SelectEvent.java b/Client/src/main/java/com/baseband/client/event/events/SelectEvent.java index cfd3a47..75071e1 100644 --- a/Client/src/main/java/com/baseband/client/event/events/SelectEvent.java +++ b/Client/src/main/java/com/baseband/client/event/events/SelectEvent.java @@ -16,6 +16,8 @@ public class SelectEvent extends RemoteEvent { } public Selection getMySelection() { + if(selection == null) + return null; if(BaseBand.remoteEventManager.isConnected()) { RemoteEventManager manager = BaseBand.remoteEventManager; Selection[] splitSelection = BlockUtils.splitSelection1D(selection, manager.getPeers()); 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 a5cbb79..32f6aea 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 @@ -21,12 +21,12 @@ public class Select extends Feature { BaseBand.publish(new SelectEvent(new Selection(begin, end))); return; } - if(end != null) { + else { begin = b; + end = null; BaseBand.notify("Selection reset."); BaseBand.notify("Position 1: " + b.getX() + " " + b.getY() + " " + b.getZ()); BaseBand.publish(new SelectEvent(null)); - return; } }