check if player can build
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user