check if player can build

This commit is contained in:
jomo
2014-07-14 06:01:21 +02:00
parent fb5a61b8d4
commit a03bb67d85

View File

@@ -1,6 +1,7 @@
#pylint: disable=F0401 #pylint: disable=F0401
from helpers import * from helpers import *
from time import time as now from time import time as now
import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent
import json import json
spam_filename = "plugins/redstoner-utils.py.dir/files/damnspam.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!") msg(sender, "&cPlease look at a button or lever while executing this command!")
return True 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 block to inputs
add_input(sender, target, timeout_off, timeout_on) add_input(sender, target, timeout_off, timeout_on)
saveInputs() saveInputs()