From a03bb67d8528176e0048cfea0243fe668465ea05 Mon Sep 17 00:00:00 2001 From: jomo Date: Mon, 14 Jul 2014 06:01:21 +0200 Subject: [PATCH] check if player can build --- damnspam.py | 7 +++++++ 1 file changed, 7 insertions(+) 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()