summaryrefslogtreecommitdiff
path: root/tilehelper.py
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2014-06-10 00:30:54 +0200
committerjomo <github@jomo.tv>2014-06-10 00:30:54 +0200
commitaad5cbe07d204f01074b865c3201dec892a09368 (patch)
treeb7dcec1db022acf5fee61b7175d32e8d6785da8e /tilehelper.py
parent0f07ad4b27acc6ef528cc603d17dc3b15a0b98f1 (diff)
fix endless loop
Diffstat (limited to 'tilehelper.py')
-rw-r--r--tilehelper.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tilehelper.py b/tilehelper.py
index 7a9a1a1..7000578 100644
--- a/tilehelper.py
+++ b/tilehelper.py
@@ -15,6 +15,9 @@ dirmap = {
"d": [0, -1, 0]
}
+# FIXME: disallow multiple regions by single person.
+# FIXME: could lead to two regions updating each other forever -> server freezes
+
@hook.event("block.BlockPlaceEvent", "high")
def onPlaceBlock(event):
if not event.isCancelled():
@@ -29,7 +32,7 @@ def onPlaceBlock(event):
for direction in th.get("directions"):
directions = dirmap[direction]
- size = [area[0][1] - area[0][0], area[1][1] - area[1][0], area[2][1] - area[2][0]]
+ size = [1 + area[0][1] - area[0][0], 1 + area[1][1] - area[1][0], 1 + area[2][1] - area[2][0]]
oldplaced = event.getBlockAgainst()
newblock = block.getWorld().getBlockAt(block.getX() + size[0] * directions[0], block.getY() + size[1] * directions[1], block.getZ() + size[2] * directions[2])