diff options
Diffstat (limited to 'helpers.py')
-rw-r--r-- | helpers.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -6,6 +6,7 @@ import org.bukkit as bukkit import org.bukkit.Location as Location import org.bukkit.entity.Player as Player import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause as TeleportCause +import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent import org.bukkit.block as bblock import org.bukkit.event.entity as entity import org.bukkit.command.ConsoleCommandSender @@ -143,6 +144,15 @@ def is_player(obj): return (isinstance(obj, Player)) +def can_build(player, block): + """ + return True if the player can change/build at the location of given block + """ + event = BlockBreakEvent(block, player) + server.getPluginManager().callEvent(event) + return not event.isCancelled() + + def checkargs(sender, args, amin, amax): """ check if a command has a valid amount of args, otherwise notify the sender |