From 84eb9343cea626bb2336cf592180696ed742ce12 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 19 Nov 2010 00:14:08 -0800 Subject: [PATCH] Improved water/bucket fix by having it set back the original block. Unfortunately this doesn't do anything about setting water buckets into lava (creating obsidian). --- src/WorldGuardListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/WorldGuardListener.java b/src/WorldGuardListener.java index 537914a1..61f21af5 100644 --- a/src/WorldGuardListener.java +++ b/src/WorldGuardListener.java @@ -236,13 +236,14 @@ public boolean onBlockCreate(Player player, Block blockPlaced, Block blockClicke final int x = blockPlaced.getX(); final int y = blockPlaced.getY(); final int z = blockPlaced.getZ(); - + final int existingID = etc.getServer().getBlockIdAt(x, y, z); + // This is REALLY BAD, but there's no other choice // at the moment that is as reliable timer.schedule(new TimerTask() { public void run() { try { - etc.getServer().setBlockAt(0, x, y, z); + etc.getServer().setBlockAt(existingID, x, y, z); } catch (Throwable t) {} } }, 200); // Just in case