From 599ef8aa44615f427e031b50968b894fa4ca2a1d Mon Sep 17 00:00:00 2001 From: mindw0rm Date: Thu, 10 Oct 2019 01:33:37 +0200 Subject: [PATCH 1/2] Bugfix for #2524 (place flag) --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index f2e8f363a..f5856ed4d 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2046,6 +2046,7 @@ import java.util.regex.Pattern; location = BukkitUtil .getLocation(block.getRelative(event.getBlockFace()).getLocation()); eventType = PlayerBlockEventType.PLACE_BLOCK; + lb = new BukkitLazyBlock(new StringPlotBlock(type.toString())); break; } lb = new BukkitLazyBlock(PlotBlock.get(type.toString())); From 1f4f78a1793b3ee8a4ecc0b6e281af55b91c8c31 Mon Sep 17 00:00:00 2001 From: mindw0rm Date: Thu, 10 Oct 2019 01:53:27 +0200 Subject: [PATCH 2/2] this can be done more elegantly --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index f5856ed4d..d02159dd9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2042,14 +2042,14 @@ import java.util.regex.Pattern; if (type == Material.AIR) { type = offType; } + // in the following, lb needs to have the material of the item in hand i.e. type + lb = new BukkitLazyBlock(PlotBlock.get(type.toString())); if (type.isBlock()) { location = BukkitUtil .getLocation(block.getRelative(event.getBlockFace()).getLocation()); eventType = PlayerBlockEventType.PLACE_BLOCK; - lb = new BukkitLazyBlock(new StringPlotBlock(type.toString())); break; } - lb = new BukkitLazyBlock(PlotBlock.get(type.toString())); if (type.toString().toLowerCase().endsWith("egg")) { eventType = PlayerBlockEventType.SPAWN_MOB; } else {