From 62cf58bd556ce225eceeb2e6f12b6c122e49390a Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sat, 29 Aug 2015 13:56:26 -0700 Subject: [PATCH] Fix a bug where claiming a new land would display that land as neutral --- Plugins/.idea/compiler.xml | 1 - .../src/mineplex/game/clans/clans/ClanInfo.java | 6 ++++++ .../src/mineplex/game/clans/clans/ClansDataAccessLayer.java | 1 + .../src/mineplex/game/clans/clans/ClansUtility.java | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml index 438bdb117..f1153fde6 100644 --- a/Plugins/.idea/compiler.xml +++ b/Plugins/.idea/compiler.xml @@ -5,7 +5,6 @@ - diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java index 174bae42b..2c042ed8b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanInfo.java @@ -594,6 +594,12 @@ public class ClanInfo if (p != null) playerOffline(p); } + @Override + public String toString() + { + return _id + "," + _name; + } + public void playerOffline(Player player) { _onlinePlayers.remove(player.getUniqueId()); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java index b0c75e4d4..d8b33aca2 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java @@ -456,6 +456,7 @@ public class ClansDataAccessLayer ClanTerritory claim = new ClanTerritory(); claim.Owner = name; claim.Safe = safe; + claim.Chunk = chunk; clan.getClaimSet().add(chunk); _manager.getClaimMap().put(chunk, claim); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java index 92a696d1d..61b6ce377 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java @@ -6,6 +6,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.Location; @@ -449,7 +450,7 @@ public class ClansUtility public ClanRelation rel(ClanInfo cA, ClanInfo cB) { - if (cA == null || cB == null) + if (cA == null || cB == null) return ClanRelation.NEUTRAL; //Self