diff options
author | jomo <github@jomo.tv> | 2014-07-14 06:01:21 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-07-14 06:01:21 +0200 |
commit | 4f13e417e9bc2a3e8837dafaeecf17c48bda60aa (patch) | |
tree | 86fed423ff99b71756ff2a256a3c8a348d38898a /damnspam.py | |
parent | 4df5a18831d301539aca5f1c3f30beb5a3c1e1ef (diff) |
check if player can build
Diffstat (limited to 'damnspam.py')
-rw-r--r-- | damnspam.py | 7 |
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() |