From 327632b4d049e749d49959ad04ceaf8589fc203f Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 19 Oct 2010 20:56:20 -0700 Subject: [PATCH] Added //bedrock permission that allows super pick axe users to destroy bedrock. --- src/SMWorldEditListener.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SMWorldEditListener.java b/src/SMWorldEditListener.java index 52c11f7bc..9382e72b9 100644 --- a/src/SMWorldEditListener.java +++ b/src/SMWorldEditListener.java @@ -80,8 +80,7 @@ public class SMWorldEditListener extends PluginListener { @Override public boolean onBlockDestroy(Player modPlayer, Block blockClicked) { if (!canUseCommand(modPlayer, "/editpos1") - && !canUseCommand(modPlayer, "//") - && !canUseCommand(modPlayer, "/worldedit")) { return false; } + && !canUseCommand(modPlayer, "//")) { return false; } WorldEdit worldEdit = WorldEdit.getInstance(); WorldEditPlayer player = new SMWorldEditPlayer(modPlayer); @@ -113,8 +112,16 @@ public class SMWorldEditListener extends PluginListener { } } else if (player.isHoldingPickAxe()) { if (session.hasSuperPickAxe()) { - return etc.getMCServer().e.d(blockClicked.getX(), - blockClicked.getY(), blockClicked.getZ(), 0); + Vector pos = new Vector(blockClicked.getX(), + blockClicked.getY(), blockClicked.getZ()); + if (WorldEdit.getServer().getBlockType(pos) == 7 + && !canUseCommand(modPlayer, "//bedrock")) { + return true; + } + + WorldEdit.getServer().setBlockType(pos, 0); + + return true; } }