diff options
author | snowleo <schneeleo@gmail.com> | 2011-06-30 22:50:22 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-06-30 22:50:22 +0200 |
commit | 995f18bb0f051c24ac7fdbf19a57729f06e48973 (patch) | |
tree | 5cf92bedf22f19071ad3615cbfbc5023b2542138 | |
parent | a720bf33ce1e51ab8d8b9a83774aafd3c2abf41d (diff) | |
download | Essentials-995f18bb0f051c24ac7fdbf19a57729f06e48973.tar Essentials-995f18bb0f051c24ac7fdbf19a57729f06e48973.tar.gz Essentials-995f18bb0f051c24ac7fdbf19a57729f06e48973.tar.lz Essentials-995f18bb0f051c24ac7fdbf19a57729f06e48973.tar.xz Essentials-995f18bb0f051c24ac7fdbf19a57729f06e48973.zip |
Fix: Blocks can't be broken.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java | 6 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java index f46f82e87..ecd2aedb4 100644 --- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -194,7 +194,7 @@ public class EssentialsSign { if (block.getFace(BlockFace.UP).getType() == Material.SIGN_POST) { - return false; + return true; } final BlockFace[] directions = new BlockFace[] { @@ -211,11 +211,11 @@ public class EssentialsSign final org.bukkit.material.Sign sign = (org.bukkit.material.Sign)signblock.getState().getData(); if (sign.getFacing() == blockFace) { - return false; + return true; } } } - return true; + return false; } protected boolean onBlockPlace(final Block block, final User player, final String username, final IEssentials ess) throws SignException, ChargeException diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index b7a47de14..2212bb104 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -1,6 +1,8 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; +import java.util.logging.Level; +import java.util.logging.Logger; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -17,6 +19,7 @@ import org.bukkit.event.block.SignChangeEvent; public class SignBlockListener extends BlockListener { private final transient IEssentials ess; + private final static Logger LOGGER = Logger.getLogger("Minecraft"); public SignBlockListener(IEssentials ess) { @@ -58,6 +61,7 @@ public class SignBlockListener extends BlockListener // prevent any signs be broken by destroying the block they are attached to if (EssentialsSign.checkIfBlockBreaksSigns(block)) { + LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign."); return true; } for (Signs signs : Signs.values()) @@ -66,6 +70,7 @@ public class SignBlockListener extends BlockListener if (sign.getBlocks().contains(block.getType()) && !sign.onBlockBreak(block, player, ess)) { + LOGGER.log(Level.INFO, "A block was protected by a sign."); return true; } } |