From fa090ee6bfbac1648865b9208859601b8d2b6274 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 18 Jun 2016 11:13:06 +1000 Subject: [PATCH] Fixes #135 (superpickaxe) --- core/src/main/java/com/sk89q/worldedit/LocalSession.java | 4 +++- .../sk89q/worldedit/extension/platform/PlatformManager.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/LocalSession.java b/core/src/main/java/com/sk89q/worldedit/LocalSession.java index 0f5d8607..6a4f3cb0 100644 --- a/core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -206,7 +206,9 @@ public class LocalSession { MAX_HISTORY_SIZE = Integer.MAX_VALUE; } // Don't store anything if no changes were made - if (editSession.size() == 0 || editSession.hasFastMode()) return; + if (editSession.size() == 0 || editSession.hasFastMode()) { + return; + } // Destroy any sessions after this undo point if (append) { diff --git a/core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index e9e42933..bfcd65ad 100644 --- a/core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -342,7 +342,7 @@ public class PlatformManager { // At this time, only handle interaction from players if (actor instanceof Player) { - final Player player = (Player) actor; + final Player player = PlayerWrapper.wrap((Player) actor); final LocalSession session = worldEdit.getSessionManager().get(actor); if (event.getType() == Interaction.HIT) { @@ -374,6 +374,7 @@ public class PlatformManager { superPickaxe.actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); } }); + event.setCancelled(true); return; } }