From b54c7ce62f26e024253d1e1a501d10c695ec0fba Mon Sep 17 00:00:00 2001 From: Drakia Date: Sun, 24 Apr 2011 21:52:10 -0700 Subject: [PATCH] Gates can not be created on existing gates --- README | 7 +++++++ src/net/TheDgtl/Stargate/Portal.java | 7 +++++++ src/plugin.yml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README b/README index 29a7381..4d10509 100644 --- a/README +++ b/README @@ -126,6 +126,13 @@ toowner - Whether the money from gate-use goes to the owner or nobody ============= Changes ============= +[Version 0.4.2] + - Gates can't be created on existing gate blocks +[Version 0.4.1] + - Sign option permissions + - Per-gate iconomy target + - /sg reload command + - Other misc fixes [Version 0.4.0] - Carts with no player can now go through gates. - You can set gates to send their cost to their owner. diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index 2ac991e..12592bb 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -556,6 +556,7 @@ public class Portal { Block idParent = id.getParent(); if (idParent == null) return null; if (Gate.getGatesByControlBlock(idParent).length == 0) return null; + if (Portal.getByBlock(idParent) != null) return null; Blox parent = new Blox(player.getWorld(), idParent.getX(), idParent.getY(), idParent.getZ()); Blox topleft = null; @@ -650,6 +651,12 @@ public class Portal { return null; } + // Bleh, gotta check to make sure none of this gate belongs to another gate. Boo slow. + for (RelativeBlockVector v : gate.getBorder()) { + Blox b = topleft.modRelative(v.getRight(), v.getDepth(), v.getDistance(), modX, 1, modZ); + if (Portal.getByBlock(b.getBlock()) != null) return null; + } + if (iConomyHandler.useiConomy() && !Stargate.hasPerm(player, "stargate.free.create", player.isOp())) { if (!iConomyHandler.chargePlayer(player.getName(), null, gate.getCreateCost())) { if (!iConomyHandler.inFundMsg.isEmpty()) { diff --git a/src/plugin.yml b/src/plugin.yml index 733c907..08f993c 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.4.1 +version: 0.4.2 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net