1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-19 21:11:25 +02:00

Fix: Blocks can't be broken.

This commit is contained in:
snowleo
2011-06-30 22:50:22 +02:00
parent 40dbb4f421
commit 22230a0557
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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;
}
}