summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--damnspam.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/damnspam.py b/damnspam.py
index 9f8698e..be8afbc 100644
--- a/damnspam.py
+++ b/damnspam.py
@@ -1,6 +1,7 @@
#pylint: disable=F0401
from helpers import *
from time import time as now
+import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent
import json
spam_filename = "plugins/redstoner-utils.py.dir/files/damnspam.json"
@@ -81,6 +82,12 @@ def onDammnspamCommand(sender, args):
msg(sender, "&cPlease look at a button or lever while executing this command!")
return True
+ test_event = BlockBreakEvent(target, sender)
+ server.getPluginManager().callEvent(test_event)
+ if test_event.isCancelled():
+ msg(sender, "&cYou are not allowed to modify this button")
+ return True
+
# add block to inputs
add_input(sender, target, timeout_off, timeout_on)
saveInputs()