From 9d347715d52ae556e80a475ef2a33abb1fced673 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 11 Apr 2013 07:01:30 +0200 Subject: [PATCH] Rename Board --> BoardOld --- .../factions/{Board.java => BoardOld.java} | 2 +- src/com/massivecraft/factions/FPerm.java | 2 +- src/com/massivecraft/factions/FPlayer.java | 20 +++++++++---------- src/com/massivecraft/factions/Faction.java | 8 ++++---- .../massivecraft/factions/FactionColl.java | 2 +- src/com/massivecraft/factions/Factions.java | 9 ++++----- .../factions/cmd/CmdFactionsAccess.java | 4 ++-- .../factions/cmd/CmdFactionsHome.java | 4 ++-- .../factions/cmd/CmdFactionsMap.java | 4 ++-- .../factions/cmd/CmdFactionsReload.java | 6 +++--- .../factions/cmd/CmdFactionsSaveAll.java | 4 ++-- .../factions/cmd/CmdFactionsSethome.java | 4 ++-- .../factions/cmd/CmdFactionsUnclaim.java | 6 +++--- .../factions/cmd/CmdFactionsUnclaimall.java | 4 ++-- .../integration/SpoutMainListener.java | 6 +++--- .../listeners/FactionsBlockListener.java | 16 +++++++-------- .../listeners/FactionsEntityListener.java | 18 ++++++++--------- .../listeners/FactionsPlayerListener.java | 10 +++++----- 18 files changed, 64 insertions(+), 65 deletions(-) rename src/com/massivecraft/factions/{Board.java => BoardOld.java} (99%) diff --git a/src/com/massivecraft/factions/Board.java b/src/com/massivecraft/factions/BoardOld.java similarity index 99% rename from src/com/massivecraft/factions/Board.java rename to src/com/massivecraft/factions/BoardOld.java index 1148d3c1..72540259 100644 --- a/src/com/massivecraft/factions/Board.java +++ b/src/com/massivecraft/factions/BoardOld.java @@ -21,7 +21,7 @@ import com.massivecraft.factions.iface.RelationParticipator; import com.massivecraft.factions.util.AsciiCompass; -public class Board +public class BoardOld { private static transient File file = new File(Factions.get().getDataFolder(), "board.json"); private static transient HashMap flocationIds = new HashMap(); diff --git a/src/com/massivecraft/factions/FPerm.java b/src/com/massivecraft/factions/FPerm.java index a90cc76e..c7e83901 100644 --- a/src/com/massivecraft/factions/FPerm.java +++ b/src/com/massivecraft/factions/FPerm.java @@ -173,7 +173,7 @@ public enum FPerm } public boolean has(Object testSubject, FLocation floc, boolean informIfNot) { - TerritoryAccess access = Board.getTerritoryAccessAt(floc); + TerritoryAccess access = BoardOld.getTerritoryAccessAt(floc); if (this.isTerritoryPerm()) { if (access.subjectHasAccess(testSubject)) return true; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 8df18b98..046e8883 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -299,7 +299,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public Rel getRelationToLocation() { - return Board.getFactionAt(new FLocation(this)).getRelationTo(this); + return BoardOld.getFactionAt(new FLocation(this)).getRelationTo(this); } @Override @@ -420,7 +420,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator //----------------------------------------------// public boolean isInOwnTerritory() { - return Board.getFactionAt(new FLocation(this)) == this.getFaction(); + return BoardOld.getFactionAt(new FLocation(this)) == this.getFaction(); } /*public boolean isInOthersTerritory() @@ -441,7 +441,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public boolean isInEnemyTerritory() { - return Board.getFactionAt(new FLocation(this)).getRelationTo(this) == Rel.ENEMY; + return BoardOld.getFactionAt(new FLocation(this)).getRelationTo(this) == Rel.ENEMY; } public void sendFactionHereMessage() @@ -450,7 +450,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { return; } - Faction factionHere = Board.getFactionAt(this.getLastStoodAt()); + Faction factionHere = BoardOld.getFactionAt(this.getLastStoodAt()); String msg = Txt.parse("")+" ~ "+factionHere.getTag(this); if (factionHere.getDescription().length() > 0) { @@ -538,7 +538,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator String error = null; FLocation flocation = new FLocation(location); Faction myFaction = getFaction(); - Faction currentFaction = Board.getFactionAt(flocation); + Faction currentFaction = BoardOld.getFactionAt(flocation); int ownedLand = forFaction.getLandRounded(); if (ConfServer.worldGuardChecking && Worldguard.checkForRegionsInChunk(location)) @@ -587,7 +587,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator ConfServer.claimsMustBeConnected && ! this.hasAdminMode() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 - && !Board.isConnectedLocation(flocation, myFaction) + && !BoardOld.isConnectedLocation(flocation, myFaction) && (!ConfServer.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal()) ) { @@ -603,7 +603,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator // TODO more messages WARN current faction most importantly error = Txt.parse("%s owns this land and is strong enough to keep it.", currentFaction.getTag(this)); } - else if ( ! Board.isBorderLocation(flocation)) + else if ( ! BoardOld.isBorderLocation(flocation)) { error = Txt.parse("You must start claiming land at the border of the territory."); } @@ -622,7 +622,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator // return value is false on failure, true on success FLocation flocation = new FLocation(location); - Faction currentFaction = Board.getFactionAt(flocation); + Faction currentFaction = BoardOld.getFactionAt(flocation); int ownedLand = forFaction.getLandRounded(); @@ -637,7 +637,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); - if (ConfServer.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, forFaction)) + if (ConfServer.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !BoardOld.isConnectedLocation(flocation, forFaction)) cost += ConfServer.econClaimUnconnectedFee; if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts && this.hasFaction()) @@ -667,7 +667,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator fp.msg("%s claimed land for %s from %s.", this.describeTo(fp, true), forFaction.describeTo(fp), currentFaction.describeTo(fp)); } - Board.setFactionAt(forFaction, flocation); + BoardOld.setFactionAt(forFaction, flocation); SpoutFeatures.updateTerritoryDisplayLoc(flocation); if (ConfServer.logLandClaims) diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index c6a4eef6..db529940 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -74,7 +74,7 @@ public class Faction extends Entity implements EconomyParticipator } public void confirmValidHome() { - if (!ConfServer.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getFactionAt(new FLocation(this.home.getLocation())) == this)) + if (!ConfServer.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && BoardOld.getFactionAt(new FLocation(this.home.getLocation())) == this)) return; msg("Your faction home has been un-set since it is no longer in your territory."); @@ -349,12 +349,12 @@ public class Faction extends Entity implements EconomyParticipator } public int getLandRounded() { - return Board.getFactionCoordCount(this); + return BoardOld.getFactionCoordCount(this); } public int getLandRoundedInWorld(String worldName) { - return Board.getFactionCoordCountInWorld(this, worldName); + return BoardOld.getFactionCoordCountInWorld(this, worldName); } public boolean hasLandInflation() @@ -548,7 +548,7 @@ public class Faction extends Entity implements EconomyParticipator } // Clean the board - Board.clean(); + BoardOld.clean(); // Clean the fplayers FPlayerColl.i.clean(); diff --git a/src/com/massivecraft/factions/FactionColl.java b/src/com/massivecraft/factions/FactionColl.java index 086f9b34..20048ed3 100644 --- a/src/com/massivecraft/factions/FactionColl.java +++ b/src/com/massivecraft/factions/FactionColl.java @@ -188,7 +188,7 @@ public class FactionColl extends EntityCollection if ( ! this.exists(id)) { Factions.get().log(Level.WARNING, "Non existing factionId "+id+" requested! Issuing cleaning!"); - Board.clean(); + BoardOld.clean(); FPlayerColl.i.clean(); } diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 8ae87fb1..329ac037 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -81,7 +81,7 @@ public class Factions extends MPlugin // Load Conf from disk FPlayerColl.i.loadFromDisc(); FactionColl.i.loadFromDisc(); - Board.load(); + BoardOld.load(); // Add Base Commands this.cmdAutoHelp = new CmdFactionsAutoHelp(); @@ -146,7 +146,7 @@ public class Factions extends MPlugin // only save data if plugin actually completely loaded successfully if (this.loadSuccessful) { - Board.save(); + BoardOld.save(); } EssentialsFeatures.unhookChat(); if (AutoLeaveTask != null) @@ -156,9 +156,8 @@ public class Factions extends MPlugin } super.onDisable(); } - - + // public void startAutoLeaveTask(boolean restartIfRunning) { @@ -195,7 +194,7 @@ public class Factions extends MPlugin @Override public void postAutoSave() { - Board.save(); + BoardOld.save(); } @Override diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index ce3d29ab..34030284 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FLocation; @@ -38,7 +38,7 @@ public class CmdFactionsAccess extends FCommand type = (type == null) ? "" : type.toLowerCase(); FLocation loc = new FLocation(me.getLocation()); - TerritoryAccess territory = Board.getTerritoryAccessAt(loc); + TerritoryAccess territory = BoardOld.getTerritoryAccessAt(loc); Faction locFaction = territory.getHostFaction(); boolean accessAny = Perm.ACCESS_ANY.has(sender, false); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index efa8de34..9fc6e1af 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -7,7 +7,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FFlag; import com.massivecraft.factions.FLocation; @@ -75,7 +75,7 @@ public class CmdFactionsHome extends FCommand return; } - Faction faction = Board.getFactionAt(new FLocation(me.getLocation())); + Faction faction = BoardOld.getFactionAt(new FLocation(me.getLocation())); Location loc = me.getLocation().clone(); // if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java index 1113523d..fb49b094 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Perm; @@ -61,7 +61,7 @@ public class CmdFactionsMap extends FCommand public void showMap() { - sendMessage(Board.getMap(myFaction, new FLocation(fme), fme.getPlayer().getLocation().getYaw())); + sendMessage(BoardOld.getMap(myFaction, new FLocation(fme), fme.getPlayer().getLocation().getYaw())); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsReload.java b/src/com/massivecraft/factions/cmd/CmdFactionsReload.java index bf499d2b..1790b855 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsReload.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsReload.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; @@ -36,7 +36,7 @@ public class CmdFactionsReload extends FCommand if (file.startsWith("b")) { - Board.load(); + BoardOld.load(); fileName = "board.json"; } else if (file.startsWith("f")) @@ -54,7 +54,7 @@ public class CmdFactionsReload extends FCommand fileName = "all"; FPlayerColl.i.loadFromDisc(); FactionColl.i.loadFromDisc(); - Board.load(); + BoardOld.load(); } else { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSaveAll.java b/src/com/massivecraft/factions/cmd/CmdFactionsSaveAll.java index 0225c5cc..576e9c94 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSaveAll.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSaveAll.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -31,7 +31,7 @@ public class CmdFactionsSaveAll extends FCommand { FPlayerColl.i.saveToDisc(); FactionColl.i.saveToDisc(); - Board.save(); + BoardOld.save(); msg("Factions saved to disk!"); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 5ffef154..4c5fd84f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPerm; @@ -47,7 +47,7 @@ public class CmdFactionsSethome extends FCommand && ConfServer.homesMustBeInClaimedTerritory && - Board.getFactionAt(new FLocation(me)) != faction + BoardOld.getFactionAt(new FLocation(me)) != faction ) { fme.msg("Sorry, your faction home can only be set inside your own claimed territory."); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java index 06e41824..068e9c17 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.event.LandUnclaimEvent; import com.massivecraft.factions.integration.Econ; @@ -36,7 +36,7 @@ public class CmdFactionsUnclaim extends FCommand public void perform() { FLocation flocation = new FLocation(fme); - Faction otherFaction = Board.getFactionAt(flocation); + Faction otherFaction = BoardOld.getFactionAt(flocation); if ( ! FPerm.TERRITORY.has(sender, otherFaction, true)) return; @@ -59,7 +59,7 @@ public class CmdFactionsUnclaim extends FCommand } } - Board.removeAt(flocation); + BoardOld.removeAt(flocation); SpoutFeatures.updateTerritoryDisplayLoc(flocation); myFaction.msg("%s unclaimed some land.", fme.describeTo(myFaction, true)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java index 7a97c251..07d8b6b0 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; @@ -49,7 +49,7 @@ public class CmdFactionsUnclaimall extends FCommand Bukkit.getServer().getPluginManager().callEvent(unclaimAllEvent); // this event cannot be cancelled - Board.unclaimAll(myFaction.getId()); + BoardOld.unclaimAll(myFaction.getId()); myFaction.msg("%s unclaimed ALL of your faction's land.", fme.describeTo(myFaction, true)); SpoutFeatures.updateTerritoryDisplayLoc(null); diff --git a/src/com/massivecraft/factions/integration/SpoutMainListener.java b/src/com/massivecraft/factions/integration/SpoutMainListener.java index 2e1aa0fc..21984128 100644 --- a/src/com/massivecraft/factions/integration/SpoutMainListener.java +++ b/src/com/massivecraft/factions/integration/SpoutMainListener.java @@ -8,7 +8,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; @@ -90,7 +90,7 @@ public class SpoutMainListener implements Listener private void doLabels(FPlayer player, SpoutPlayer sPlayer, boolean notify) { FLocation here = player.getLastStoodAt(); - Faction factionHere = Board.getFactionAt(here); + Faction factionHere = BoardOld.getFactionAt(here); String tag = factionHere.getColorTo(player).toString() + factionHere.getTag(); // ---------------------- @@ -177,7 +177,7 @@ public class SpoutMainListener implements Listener } String msg = ""; - TerritoryAccess access = Board.getTerritoryAccessAt(here); + TerritoryAccess access = BoardOld.getTerritoryAccessAt(here); if ( ! access.isDefault()) { diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index aab4d112..4fb9cc41 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -14,7 +14,7 @@ import org.bukkit.event.block.BlockPistonExtendEvent; import org.bukkit.event.block.BlockPistonRetractEvent; import org.bukkit.event.block.BlockSpreadEvent; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FFlag; import com.massivecraft.factions.FLocation; @@ -31,7 +31,7 @@ public class FactionsBlockListener implements Listener { if (event.isCancelled()) return; if (event.getSource().getTypeId() != 51) return; // Must be Fire - Faction faction = Board.getFactionAt(event.getBlock()); + Faction faction = BoardOld.getFactionAt(event.getBlock()); if (faction.getFlag(FFlag.FIRESPREAD) == false) { event.setCancelled(true); @@ -42,7 +42,7 @@ public class FactionsBlockListener implements Listener public void onBlockBurn(BlockBurnEvent event) { if (event.isCancelled()) return; - Faction faction = Board.getFactionAt(event.getBlock()); + Faction faction = BoardOld.getFactionAt(event.getBlock()); if (faction.getFlag(FFlag.FIRESPREAD) == false) { event.setCancelled(true); @@ -63,7 +63,7 @@ public class FactionsBlockListener implements Listener if (me.hasAdminMode()) return true; FLocation loc = new FLocation(location); - Faction factionHere = Board.getFactionAt(loc); + Faction factionHere = BoardOld.getFactionAt(loc); if ( ! FPerm.BUILD.has(me, location) && FPerm.PAINBUILD.has(me, location)) { @@ -117,13 +117,13 @@ public class FactionsBlockListener implements Listener if (event.isCancelled()) return; if ( ! ConfServer.pistonProtectionThroughDenyBuild) return; - Faction pistonFaction = Board.getFactionAt(new FLocation(event.getBlock())); + Faction pistonFaction = BoardOld.getFactionAt(new FLocation(event.getBlock())); // target end-of-the-line empty (air) block which is being pushed into, including if piston itself would extend into air Block targetBlock = event.getBlock().getRelative(event.getDirection(), event.getLength() + 1); // members of faction might not have build rights in their own territory, but pistons should still work regardless; so, address that corner case - Faction targetFaction = Board.getFactionAt(new FLocation(targetBlock)); + Faction targetFaction = BoardOld.getFactionAt(new FLocation(targetBlock)); if (targetFaction == pistonFaction) return; // if potentially pushing into air/water/lava in another territory, we need to check it out @@ -150,10 +150,10 @@ public class FactionsBlockListener implements Listener // if potentially retracted block is just air/water/lava, no worries if (targetLoc.getBlock().isEmpty() || targetLoc.getBlock().isLiquid()) return; - Faction pistonFaction = Board.getFactionAt(new FLocation(event.getBlock())); + Faction pistonFaction = BoardOld.getFactionAt(new FLocation(event.getBlock())); // members of faction might not have build rights in their own territory, but pistons should still work regardless; so, address that corner case - Faction targetFaction = Board.getFactionAt(new FLocation(targetLoc)); + Faction targetFaction = BoardOld.getFactionAt(new FLocation(targetLoc)); if (targetFaction == pistonFaction) return; if ( ! FPerm.BUILD.has(pistonFaction, targetLoc)) diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index a73ae868..43935d8e 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -38,7 +38,7 @@ import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Const; import com.massivecraft.factions.FFlag; @@ -61,7 +61,7 @@ public class FactionsEntityListener implements Listener Player player = (Player) entity; FPlayer fplayer = FPlayerColl.i.get(player); - Faction faction = Board.getFactionAt(new FLocation(player.getLocation())); + Faction faction = BoardOld.getFactionAt(new FLocation(player.getLocation())); PowerLossEvent powerLossEvent = new PowerLossEvent(faction,fplayer); // Check for no power loss conditions @@ -129,7 +129,7 @@ public class FactionsEntityListener implements Listener } for (FLocation loc : explosionLocs) { - Faction faction = Board.getFactionAt(loc); + Faction faction = BoardOld.getFactionAt(loc); if (faction.getFlag(FFlag.EXPLOSIONS) == false) { // faction has explosions disabled @@ -231,7 +231,7 @@ public class FactionsEntityListener implements Listener Location defenderLoc = defender.getPlayer().getLocation(); - Faction defLocFaction = Board.getFactionAt(new FLocation(defenderLoc)); + Faction defLocFaction = BoardOld.getFactionAt(new FLocation(defenderLoc)); // for damage caused by projectiles, getDamager() returns the projectile... what we need to know is the source if (damager instanceof Projectile) @@ -272,7 +272,7 @@ public class FactionsEntityListener implements Listener return false; } - Faction locFaction = Board.getFactionAt(new FLocation(attacker)); + Faction locFaction = BoardOld.getFactionAt(new FLocation(attacker)); // so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be? if (locFaction.getFlag(FFlag.PVP) == false) @@ -351,7 +351,7 @@ public class FactionsEntityListener implements Listener if (event.getLocation() == null) return; FLocation floc = new FLocation(event.getLocation()); - Faction faction = Board.getFactionAt(floc); + Faction faction = BoardOld.getFactionAt(floc); if (faction.getFlag(FFlag.MONSTERS)) return; if ( ! Const.ENTITY_TYPES_MONSTERS.contains(event.getEntityType())) return; @@ -374,7 +374,7 @@ public class FactionsEntityListener implements Listener if ( ! Const.ENTITY_TYPES_MONSTERS.contains(event.getEntity().getType())) return; FLocation floc = new FLocation(target.getLocation()); - Faction faction = Board.getFactionAt(floc); + Faction faction = BoardOld.getFactionAt(floc); if (faction.getFlag(FFlag.MONSTERS)) return; @@ -388,7 +388,7 @@ public class FactionsEntityListener implements Listener if (event.getCause() == RemoveCause.EXPLOSION) { - Faction faction = Board.getFactionAt(new FLocation(event.getEntity().getLocation())); + Faction faction = BoardOld.getFactionAt(new FLocation(event.getEntity().getLocation())); if (faction.getFlag(FFlag.EXPLOSIONS) == false) { // faction has explosions disabled event.setCancelled(true); @@ -435,7 +435,7 @@ public class FactionsEntityListener implements Listener if (!(entity instanceof Enderman) && !(entity instanceof Wither)) return; FLocation floc = new FLocation(event.getBlock()); - Faction faction = Board.getFactionAt(floc); + Faction faction = BoardOld.getFactionAt(floc); if (entity instanceof Enderman) { diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 46e4e528..af9a7cb7 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -24,7 +24,7 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.util.NumberConversions; -import com.massivecraft.factions.Board; +import com.massivecraft.factions.BoardOld; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Const; import com.massivecraft.factions.FFlag; @@ -96,17 +96,17 @@ public class FactionsPlayerListener implements Listener // Yes we did change coord (: me.setLastStoodAt(to); - TerritoryAccess access = Board.getTerritoryAccessAt(to); + TerritoryAccess access = BoardOld.getTerritoryAccessAt(to); // Did we change "host"(faction)? - boolean changedFaction = (Board.getFactionAt(from) != access.getHostFaction()); + boolean changedFaction = (BoardOld.getFactionAt(from) != access.getHostFaction()); // let Spout handle most of this if it's available boolean handledBySpout = changedFaction && SpoutFeatures.updateTerritoryDisplay(me); if (me.isMapAutoUpdating()) { - me.sendMessage(Board.getMap(me.getFaction(), to, player.getLocation().getYaw())); + me.sendMessage(BoardOld.getMap(me.getFaction(), to, player.getLocation().getYaw())); } else if (changedFaction && ! handledBySpout) { @@ -303,7 +303,7 @@ public class FactionsPlayerListener implements Listener } Rel rel = me.getRelationToLocation(); - if (Board.getFactionAt(me.getLastStoodAt()).isNone()) return; + if (BoardOld.getFactionAt(me.getLastStoodAt()).isNone()) return; if (rel == Rel.NEUTRAL && isCommandInList(fullCmd, ConfServer.territoryNeutralDenyCommands)) {