better loading / importing of modules

This commit is contained in:
jomo
2014-06-09 23:52:11 +02:00
parent dddbcd7684
commit 9927935074
3 changed files with 28 additions and 48 deletions

View File

@@ -1,4 +1,5 @@
import org.bukkit as bukkit
import bukkit.event.block.BlockPlaceEvent as BlockPlaceEvent
from helpers import *
tilehelpers = [ # Front Right Back Left Down Up
@@ -7,15 +8,16 @@ tilehelpers = [
@hook.event("block.BlockPlaceEvent", "high")
def onPlaceBlock(event):
player = event.getPlayer()
block = event.getBlockPlaced()
for th in tilehelpers:
area = th.get("area")
if th.get("owner") == str(player.getUniqueId()) and str(block.getWorld().getUID()) == th.get("world") and block.getX() in range(area[0][0], area[0][1]+1) and block.getY() in range(area[1][0], area[1][1]+1) and block.getZ() in range(area[2][0], area[2][1]+1) and event.canBuild():
# stack block in directions
msg(player, "&ayus")
# server.getPluginManager().callEvent(event);
if not event.isCancelled():
player = event.getPlayer()
block = event.getBlockPlaced()
for th in tilehelpers:
area = th.get("area")
if th.get("owner") == str(player.getUniqueId()) and str(block.getWorld().getUID()) == th.get("world") and block.getX() in range(area[0][0], area[0][1]+1) and block.getY() in range(area[1][0], area[1][1]+1) and block.getZ() in range(area[2][0], area[2][1]+1) and event.canBuild():
# stack block in directions
msg(player, "&ayus")
event = BlockPlaceEvent(block, block.getState(), event.getBlockAgainst(), event.getItemInHand(), player, event.canBuild())
# server.getPluginManager().callEvent(event);