From 5c2abb34deebb3ae84ec547c16e09e7b7b570291 Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Thu, 4 Jan 2018 17:40:27 -0800 Subject: [PATCH] Format. Haven't done this in awhile. Just sneak it in. --- .../java/com/massivecraft/factions/Conf.java | 26 +++---- .../com/massivecraft/factions/FLocation.java | 3 +- .../java/com/massivecraft/factions/P.java | 2 +- .../factions/event/FactionRenameEvent.java | 2 - .../factions/event/LandClaimEvent.java | 3 - .../factions/event/LandUnclaimAllEvent.java | 3 - .../factions/event/LandUnclaimEvent.java | 3 - .../factions/event/PowerLossEvent.java | 3 - .../factions/integration/Worldguard.java | 20 ++--- .../integration/dynmap/EngineDynmap.java | 6 +- .../integration/dynmap/TempAreaMarker.java | 4 +- .../listeners/FactionsBlockListener.java | 8 +- .../listeners/FactionsEntityListener.java | 40 +++++----- .../listeners/FactionsPlayerListener.java | 14 ++-- .../massivecraft/factions/struct/Role.java | 5 +- .../factions/util/PlaceholderAPIManager.java | 5 +- .../factions/util/SpiralTask.java | 6 +- .../factions/zcore/fperms/Access.java | 1 + .../factions/zcore/fperms/Action.java | 1 + .../factions/zcore/persist/MemoryBoard.java | 77 +++++++++---------- .../factions/zcore/persist/MemoryFPlayer.java | 4 +- .../massivecraft/factions/zcore/util/TL.java | 2 +- .../factions/zcore/util/TagReplacer.java | 4 - .../factions/zcore/util/TagUtil.java | 8 -- 24 files changed, 113 insertions(+), 137 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index 8eb6148f..eb9d6b33 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -287,19 +287,19 @@ public class Conf { // Format for popup - substitute values for macros public static String dynmapDescription = - "
\n" - + "%name%
\n" - + "%description%
" - + "
\n" - + "Leader: %players.leader%
\n" - + "Admins: %players.admins.count%
\n" - + "Moderators: %players.moderators.count%
\n" - + "Members: %players.normals.count%
\n" - + "TOTAL: %players.count%
\n" - + "
\n" - + "Bank: %money%
\n" - + "
\n" - + "
"; + "
\n" + + "%name%
\n" + + "%description%
" + + "
\n" + + "Leader: %players.leader%
\n" + + "Admins: %players.admins.count%
\n" + + "Moderators: %players.moderators.count%
\n" + + "Members: %players.normals.count%
\n" + + "TOTAL: %players.count%
\n" + + "
\n" + + "Bank: %money%
\n" + + "
\n" + + "
"; // Enable the %money% macro. Only do this if you know your economy manager is thread-safe. public static boolean dynmapDescriptionMoney = false; diff --git a/src/main/java/com/massivecraft/factions/FLocation.java b/src/main/java/com/massivecraft/factions/FLocation.java index cfc3c55a..97a96a8f 100644 --- a/src/main/java/com/massivecraft/factions/FLocation.java +++ b/src/main/java/com/massivecraft/factions/FLocation.java @@ -22,7 +22,8 @@ public class FLocation implements Serializable { try { Class.forName("org.bukkit.WorldBorder"); worldBorderClassPresent = true; - } catch (ClassNotFoundException ignored) {} + } catch (ClassNotFoundException ignored) { + } worldBorderSupport = worldBorderClassPresent; } diff --git a/src/main/java/com/massivecraft/factions/P.java b/src/main/java/com/massivecraft/factions/P.java index 513415c5..f23868e3 100644 --- a/src/main/java/com/massivecraft/factions/P.java +++ b/src/main/java/com/massivecraft/factions/P.java @@ -138,7 +138,7 @@ public class P extends MPlugin { try { RegisteredServiceProvider rsp = getServer().getServicesManager().getRegistration(Permission.class); if (rsp != null) { - perms = rsp.getProvider(); + perms = rsp.getProvider(); } } catch (NoClassDefFoundError ex) { return false; diff --git a/src/main/java/com/massivecraft/factions/event/FactionRenameEvent.java b/src/main/java/com/massivecraft/factions/event/FactionRenameEvent.java index 702f9b06..8dc8f022 100644 --- a/src/main/java/com/massivecraft/factions/event/FactionRenameEvent.java +++ b/src/main/java/com/massivecraft/factions/event/FactionRenameEvent.java @@ -18,7 +18,6 @@ public class FactionRenameEvent extends FactionPlayerEvent implements Cancellabl * Get the player involved in the event. * * @return Player involved in the event. - * * @deprecated use getfPlayer().getPlayer() instead. */ @Deprecated @@ -30,7 +29,6 @@ public class FactionRenameEvent extends FactionPlayerEvent implements Cancellabl * Get the faction tag before it was renamed. * * @return old faction tag. - * * @deprecated use getFaction().getTag() instead. */ @Deprecated diff --git a/src/main/java/com/massivecraft/factions/event/LandClaimEvent.java b/src/main/java/com/massivecraft/factions/event/LandClaimEvent.java index a41a5eb9..8bef95f0 100644 --- a/src/main/java/com/massivecraft/factions/event/LandClaimEvent.java +++ b/src/main/java/com/massivecraft/factions/event/LandClaimEvent.java @@ -33,7 +33,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable { * Get the id of the faction. * * @return id of faction as String - * * @deprecated use getFaction().getId() instead. */ @Deprecated @@ -45,7 +44,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable { * Get the tag of the faction. * * @return tag of faction as String - * * @deprecated use getFaction().getTag() instead. */ @Deprecated @@ -57,7 +55,6 @@ public class LandClaimEvent extends FactionPlayerEvent implements Cancellable { * Get the Player involved in this event. * * @return player from FPlayer. - * * @deprecated use getfPlayer().getPlayer() instead. */ @Deprecated diff --git a/src/main/java/com/massivecraft/factions/event/LandUnclaimAllEvent.java b/src/main/java/com/massivecraft/factions/event/LandUnclaimAllEvent.java index 6c52b93b..5b807bfd 100644 --- a/src/main/java/com/massivecraft/factions/event/LandUnclaimAllEvent.java +++ b/src/main/java/com/massivecraft/factions/event/LandUnclaimAllEvent.java @@ -16,7 +16,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab * Get the id of the faction. * * @return id of faction as String - * * @deprecated use getFaction().getId() instead. */ @Deprecated @@ -28,7 +27,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab * Get the tag of the faction. * * @return tag of faction as String - * * @deprecated use getFaction().getTag() instead. */ @Deprecated @@ -40,7 +38,6 @@ public class LandUnclaimAllEvent extends FactionPlayerEvent implements Cancellab * Get the Player involved in the event. * * @return Player from FPlayer. - * * @deprecated use getfPlayer().getPlayer() instead. */ @Deprecated diff --git a/src/main/java/com/massivecraft/factions/event/LandUnclaimEvent.java b/src/main/java/com/massivecraft/factions/event/LandUnclaimEvent.java index c7321ebe..402f50e3 100644 --- a/src/main/java/com/massivecraft/factions/event/LandUnclaimEvent.java +++ b/src/main/java/com/massivecraft/factions/event/LandUnclaimEvent.java @@ -28,7 +28,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable * Get the id of the faction. * * @return id of faction as String - * * @deprecated use getFaction().getId() instead. */ @Deprecated @@ -40,7 +39,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable * Get the tag of the faction. * * @return tag of faction as String - * * @deprecated use getFaction().getTag() instead. */ @Deprecated @@ -52,7 +50,6 @@ public class LandUnclaimEvent extends FactionPlayerEvent implements Cancellable * Get the Player involved in the event. * * @return Player from FPlayer. - * * @deprecated use getfPlayer().getPlayer() instead. */ @Deprecated diff --git a/src/main/java/com/massivecraft/factions/event/PowerLossEvent.java b/src/main/java/com/massivecraft/factions/event/PowerLossEvent.java index 681ba619..d568900a 100644 --- a/src/main/java/com/massivecraft/factions/event/PowerLossEvent.java +++ b/src/main/java/com/massivecraft/factions/event/PowerLossEvent.java @@ -21,7 +21,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable { * Get the id of the faction. * * @return id of faction as String - * * @deprecated use getFaction().getId() instead. */ @Deprecated @@ -33,7 +32,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable { * Get the tag of the faction. * * @return tag of faction as String - * * @deprecated use getFaction().getTag() instead. */ @Deprecated @@ -45,7 +43,6 @@ public class PowerLossEvent extends FactionPlayerEvent implements Cancellable { * Get the Player involved in the event. * * @return Player from FPlayer. - * * @deprecated use getfPlayer().getPlayer() instead. */ @Deprecated diff --git a/src/main/java/com/massivecraft/factions/integration/Worldguard.java b/src/main/java/com/massivecraft/factions/integration/Worldguard.java index fcace7a3..0edf1dba 100644 --- a/src/main/java/com/massivecraft/factions/integration/Worldguard.java +++ b/src/main/java/com/massivecraft/factions/integration/Worldguard.java @@ -89,19 +89,19 @@ public class Worldguard { // Returns: // True: Regions found within chunk // False: No regions found within chunk - + public static boolean checkForRegionsInChunk(FLocation floc) { - Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ()); - - return checkForRegionsInChunk(chunk); - } - - public static boolean checkForRegionsInChunk(Location loc) { - Chunk chunk = loc.getWorld().getChunkAt(loc); - + Chunk chunk = floc.getWorld().getChunkAt((int) floc.getX(), (int) floc.getZ()); + return checkForRegionsInChunk(chunk); } - + + public static boolean checkForRegionsInChunk(Location loc) { + Chunk chunk = loc.getWorld().getChunkAt(loc); + + return checkForRegionsInChunk(chunk); + } + public static boolean checkForRegionsInChunk(Chunk chunk) { if (!enabled) { // No WG hooks so we'll always bypass this check. diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java index fa24e17c..b6923777 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java @@ -574,9 +574,9 @@ public class EngineDynmap { PlayerSet set = this.markerApi.getPlayerSet(setId); if (set == null) { set = this.markerApi.createPlayerSet(setId, // id - true, // symmetric - playerIds, // players - false // persistent + true, // symmetric + playerIds, // players + false // persistent ); } if (set == null) { diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java b/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java index f03dff6a..ff98ba45 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java @@ -72,8 +72,8 @@ public class TempAreaMarker { // Line Style if (marker.getLineWeight() != this.lineWeight || - marker.getLineOpacity() != this.lineOpacity || - marker.getLineColor() != this.lineColor) { + marker.getLineOpacity() != this.lineOpacity || + marker.getLineColor() != this.lineColor) { marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor); } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index 9b60b67a..521948e0 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -95,11 +95,11 @@ public class FactionsBlockListener implements Listener { event.setCancelled(true); } - /* + /* * note that I originally was testing the territory of each affected block, but since I found that pistons can only push - * up to 12 blocks and the width of any territory is 16 blocks, it should be safe (and much more lightweight) to test - * only the final target block as done above - */ + * up to 12 blocks and the width of any territory is 16 blocks, it should be safe (and much more lightweight) to test + * only the final target block as done above + */ } @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java index a1c4a4b9..3ce02f35 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -151,23 +151,23 @@ public class FactionsEntityListener implements Listener { //TODO: :( if (boomer instanceof Creeper && ((faction.isWilderness() && Conf.wildernessBlockCreepers && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || - (faction.isNormal() && (online ? Conf.territoryBlockCreepers : Conf.territoryBlockCreepersWhenOffline)) || - (faction.isWarZone() && Conf.warZoneBlockCreepers) || - faction.isSafeZone())) { + (faction.isNormal() && (online ? Conf.territoryBlockCreepers : Conf.territoryBlockCreepersWhenOffline)) || + (faction.isWarZone() && Conf.warZoneBlockCreepers) || + faction.isSafeZone())) { // creeper which needs prevention event.setCancelled(true); } else if ( // it's a bit crude just using fireball protection for Wither boss too, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever - (boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || - (faction.isNormal() && (online ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || - (faction.isWarZone() && Conf.warZoneBlockFireballs) || - faction.isSafeZone())) { + (boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || + (faction.isNormal() && (online ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || + (faction.isWarZone() && Conf.warZoneBlockFireballs) || + faction.isSafeZone())) { // ghast fireball which needs prevention event.setCancelled(true); } else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && ((faction.isWilderness() && Conf.wildernessBlockTNT && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || - (faction.isNormal() && (online ? Conf.territoryBlockTNT : Conf.territoryBlockTNTWhenOffline)) || - (faction.isWarZone() && Conf.warZoneBlockTNT) || - (faction.isSafeZone() && Conf.safeZoneBlockTNT))) { + (faction.isNormal() && (online ? Conf.territoryBlockTNT : Conf.territoryBlockTNTWhenOffline)) || + (faction.isWarZone() && Conf.warZoneBlockTNT) || + (faction.isSafeZone() && Conf.safeZoneBlockTNT))) { // TNT which needs prevention event.setCancelled(true); } else if ((boomer instanceof TNTPrimed || boomer instanceof ExplosiveMinecart) && Conf.handleExploitTNTWaterlog) { @@ -464,9 +464,9 @@ public class FactionsEntityListener implements Listener { boolean online = faction.hasPlayersOnline(); if ((faction.isWilderness() && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()) && (Conf.wildernessBlockCreepers || Conf.wildernessBlockFireballs || Conf.wildernessBlockTNT)) || - (faction.isNormal() && (online ? (Conf.territoryBlockCreepers || Conf.territoryBlockFireballs || Conf.territoryBlockTNT) : (Conf.territoryBlockCreepersWhenOffline || Conf.territoryBlockFireballsWhenOffline || Conf.territoryBlockTNTWhenOffline))) || - (faction.isWarZone() && (Conf.warZoneBlockCreepers || Conf.warZoneBlockFireballs || Conf.warZoneBlockTNT)) || - faction.isSafeZone()) { + (faction.isNormal() && (online ? (Conf.territoryBlockCreepers || Conf.territoryBlockFireballs || Conf.territoryBlockTNT) : (Conf.territoryBlockCreepersWhenOffline || Conf.territoryBlockFireballsWhenOffline || Conf.territoryBlockTNTWhenOffline))) || + (faction.isWarZone() && (Conf.warZoneBlockCreepers || Conf.warZoneBlockFireballs || Conf.warZoneBlockTNT)) || + faction.isSafeZone()) { // explosion which needs prevention event.setCancelled(true); } @@ -512,9 +512,9 @@ public class FactionsEntityListener implements Listener { Faction faction = Board.getInstance().getFactionAt(new FLocation(loc)); // it's a bit crude just using fireball protection, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever if ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || - (faction.isNormal() && (faction.hasPlayersOnline() ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || - (faction.isWarZone() && Conf.warZoneBlockFireballs) || - faction.isSafeZone()) { + (faction.isNormal() && (faction.hasPlayersOnline() ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || + (faction.isWarZone() && Conf.warZoneBlockFireballs) || + faction.isSafeZone()) { event.setCancelled(true); } } @@ -554,10 +554,10 @@ public class FactionsEntityListener implements Listener { } // quick check to see if all Enderman deny options are enabled; if so, no need to check location if (Conf.wildernessDenyEndermanBlocks && - Conf.territoryDenyEndermanBlocks && - Conf.territoryDenyEndermanBlocksWhenOffline && - Conf.safeZoneDenyEndermanBlocks && - Conf.warZoneDenyEndermanBlocks) { + Conf.territoryDenyEndermanBlocks && + Conf.territoryDenyEndermanBlocksWhenOffline && + Conf.safeZoneDenyEndermanBlocks && + Conf.warZoneDenyEndermanBlocks) { return true; } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index ba53fc52..96504b44 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -468,9 +468,9 @@ public class FactionsPlayerListener implements Listener { Location home = me.getFaction().getHome(); if (Conf.homesEnabled && - Conf.homesTeleportToOnDeath && - home != null && - (Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) { + Conf.homesTeleportToOnDeath && + home != null && + (Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) { event.setRespawnLocation(home); } } @@ -515,10 +515,10 @@ public class FactionsPlayerListener implements Listener { } if (me.hasFaction() && - !me.isAdminBypassing() && - !Conf.permanentFactionMemberDenyCommands.isEmpty() && - me.getFaction().isPermanent() && - isCommandInList(fullCmd, shortCmd, Conf.permanentFactionMemberDenyCommands.iterator())) { + !me.isAdminBypassing() && + !Conf.permanentFactionMemberDenyCommands.isEmpty() && + me.getFaction().isPermanent() && + isCommandInList(fullCmd, shortCmd, Conf.permanentFactionMemberDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_PERMANENT, fullCmd); return true; } diff --git a/src/main/java/com/massivecraft/factions/struct/Role.java b/src/main/java/com/massivecraft/factions/struct/Role.java index fb48e2b9..ee97bb38 100644 --- a/src/main/java/com/massivecraft/factions/struct/Role.java +++ b/src/main/java/com/massivecraft/factions/struct/Role.java @@ -39,7 +39,8 @@ public enum Role { return NORMAL; case 2: return MODERATOR; - case 3: return ADMIN; + case 3: + return ADMIN; } return null; @@ -68,7 +69,7 @@ public enum Role { return this.nicename; } - public TL getTranslation(){ + public TL getTranslation() { return translation; } diff --git a/src/main/java/com/massivecraft/factions/util/PlaceholderAPIManager.java b/src/main/java/com/massivecraft/factions/util/PlaceholderAPIManager.java index 812b89be..40198303 100644 --- a/src/main/java/com/massivecraft/factions/util/PlaceholderAPIManager.java +++ b/src/main/java/com/massivecraft/factions/util/PlaceholderAPIManager.java @@ -4,7 +4,6 @@ import com.massivecraft.factions.*; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.zcore.util.TL; -import com.massivecraft.factions.zcore.util.TagUtil; import me.clip.placeholderapi.external.EZPlaceholderHook; import org.apache.commons.lang.time.DurationFormatUtils; import org.bukkit.Bukkit; @@ -21,7 +20,7 @@ public class PlaceholderAPIManager extends EZPlaceholderHook { @Override public String onPlaceholderRequest(Player player, String placeholder) { - if(player == null || placeholder == null) { + if (player == null || placeholder == null) { return ""; } @@ -46,7 +45,7 @@ public class PlaceholderAPIManager extends EZPlaceholderHook { return String.valueOf(fPlayer.getKills()); case "player_deaths": return String.valueOf(fPlayer.getDeaths()); - // Then Faction stuff + // Then Faction stuff case "faction_name": return faction.getTag(); case "faction_power": diff --git a/src/main/java/com/massivecraft/factions/util/SpiralTask.java b/src/main/java/com/massivecraft/factions/util/SpiralTask.java index 85afa1d7..866f09b6 100644 --- a/src/main/java/com/massivecraft/factions/util/SpiralTask.java +++ b/src/main/java/com/massivecraft/factions/util/SpiralTask.java @@ -94,9 +94,9 @@ public abstract class SpiralTask implements Runnable { -/* - * Below are the guts of the class, which you normally wouldn't need to mess with. - */ + /* + * Below are the guts of the class, which you normally wouldn't need to mess with. + */ public final void setTaskID(int ID) { if (ID == -1) { diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/Access.java b/src/main/java/com/massivecraft/factions/zcore/fperms/Access.java index dc60e880..8c1d38ab 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/Access.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/Access.java @@ -7,6 +7,7 @@ public enum Access { /** * Case insensitive check for access. + * * @param check * @return */ diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/Action.java b/src/main/java/com/massivecraft/factions/zcore/fperms/Action.java index 8b380b27..2ba0c6e8 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/Action.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/Action.java @@ -37,6 +37,7 @@ public enum Action { /** * Case insensitive check for action. + * * @param check * @return */ diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java index 2c91d245..0775d3b5 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java @@ -14,54 +14,54 @@ import java.util.Map.Entry; public abstract class MemoryBoard extends Board { - + public class MemoryBoardMap extends HashMap { private static final long serialVersionUID = -6689617828610585368L; Multimap factionToLandMap = HashMultimap.create(); - @Override - public String put(FLocation floc, String factionId) { - String previousValue = super.put(floc, factionId); - if (previousValue != null) { - factionToLandMap.remove(previousValue, floc); - } + @Override + public String put(FLocation floc, String factionId) { + String previousValue = super.put(floc, factionId); + if (previousValue != null) { + factionToLandMap.remove(previousValue, floc); + } - factionToLandMap.put(factionId, floc); - return previousValue; - } + factionToLandMap.put(factionId, floc); + return previousValue; + } - @Override - public String remove(Object key) { - String result = super.remove(key); - if (result != null) { - FLocation floc = (FLocation) key; - factionToLandMap.remove(result, floc); - } + @Override + public String remove(Object key) { + String result = super.remove(key); + if (result != null) { + FLocation floc = (FLocation) key; + factionToLandMap.remove(result, floc); + } - return result; - } + return result; + } - @Override - public void clear() { - super.clear(); - factionToLandMap.clear(); - } + @Override + public void clear() { + super.clear(); + factionToLandMap.clear(); + } - public int getOwnedLandCount(String factionId) { - return factionToLandMap.get(factionId).size(); - } + public int getOwnedLandCount(String factionId) { + return factionToLandMap.get(factionId).size(); + } - public void removeFaction(String factionId) { - Collection flocations = factionToLandMap.removeAll(factionId); - for (FLocation floc : flocations) { - super.remove(floc); - } - } + public void removeFaction(String factionId) { + Collection flocations = factionToLandMap.removeAll(factionId); + for (FLocation floc : flocations) { + super.remove(floc); + } + } } public MemoryBoardMap flocationIds = new MemoryBoardMap(); - + //----------------------------------------------// // Get and Set //----------------------------------------------// @@ -173,7 +173,6 @@ public abstract class MemoryBoard extends Board { * @param flocation - center location. * @param faction - faction checking for. * @param radius - chunk radius to check. - * * @return true if another Faction is within the radius, otherwise false. */ public boolean hasFactionWithin(FLocation flocation, Faction faction, int radius) { @@ -277,10 +276,10 @@ public abstract class MemoryBoard extends Board { } else if (factionHere.isWarZone()) { row.append(ChatColor.DARK_RED + "+"); } else if (factionHere == faction || - factionHere == factionLoc || - relation.isAtLeast(Relation.ALLY) || - (Conf.showNeutralFactionsOnMap && relation.equals(Relation.NEUTRAL)) || - (Conf.showEnemyFactionsOnMap && relation.equals(Relation.ENEMY))) { + factionHere == factionLoc || + relation.isAtLeast(Relation.ALLY) || + (Conf.showNeutralFactionsOnMap && relation.equals(Relation.NEUTRAL)) || + (Conf.showEnemyFactionsOnMap && relation.equals(Relation.ENEMY))) { if (!fList.containsKey(factionHere.getTag())) { fList.put(factionHere.getTag(), Conf.mapKeyChrs[Math.min(chrIdx++, Conf.mapKeyChrs.length - 1)]); } diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index cdb7eeda..28af05ef 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -591,7 +591,6 @@ public abstract class MemoryFPlayer implements FPlayer { * Check if the scoreboard should be shown. Simple method to be used by above method. * * @param toShow Faction to be shown. - * * @return true if should show, otherwise false. */ public boolean showInfoBoard(Faction toShow) { @@ -686,9 +685,10 @@ public abstract class MemoryFPlayer implements FPlayer { public boolean canClaimForFaction(Faction forFaction) { return this.isAdminBypassing() || !forFaction.isWilderness() && (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR)) || (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) || (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer())); } + public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure) { FLocation flocation = new FLocation(location); - + return canClaimForFactionAtLocation(forFaction, flocation, notifyFailure); } diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 021566b5..cc2bd427 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2013 drtshock * * This program is free software: you can redistribute it and/or modify diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java b/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java index a05c9244..8b76ef6e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java @@ -128,7 +128,6 @@ public enum TagReplacer { * * @param fac Target faction * @param fp Target player (can be null) - * * @return the value for this enum! */ protected String getValue(Faction fac, FPlayer fp) { @@ -232,7 +231,6 @@ public enum TagReplacer { * Returns a list of all the variables we can use for this type
* * @param type the type we want - * * @return a list of all the variables with this type */ protected static List getByType(TagType type) { @@ -252,7 +250,6 @@ public enum TagReplacer { /** * @param original raw line with variables * @param value what to replace var in raw line with - * * @return the string with the new value */ public String replace(String original, String value) { @@ -261,7 +258,6 @@ public enum TagReplacer { /** * @param toSearch raw line with variables - * * @return if the raw line contains this enums variable */ public boolean contains(String toSearch) { diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java index 45d7c13e..c18e5ded 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java @@ -23,7 +23,6 @@ public class TagUtil { * * @param faction for faction * @param line raw line from config with variables to replace for - * * @return clean line */ public static String parsePlain(Faction faction, String line) { @@ -40,7 +39,6 @@ public class TagUtil { * * @param fplayer for player * @param line raw line from config with variables to replace for - * * @return clean line */ public static String parsePlain(FPlayer fplayer, String line) { @@ -62,7 +60,6 @@ public class TagUtil { * @param faction for faction * @param fplayer from player * @param line raw line from config with variables to replace for - * * @return clean line */ public static String parsePlain(Faction faction, FPlayer fplayer, String line) { @@ -85,7 +82,6 @@ public class TagUtil { * @param faction for faction (viewers faction) * @param fme for player (viewer) * @param line fancy message prefix - * * @return */ public static List parseFancy(Faction faction, FPlayer fme, String line) { @@ -102,7 +98,6 @@ public class TagUtil { * Checks if a line has fancy variables * * @param line raw line from config with variables - * * @return if the line has fancy variables */ public static boolean hasFancy(String line) { @@ -120,7 +115,6 @@ public class TagUtil { * @param target Faction to get relate from * @param fme Player to relate to * @param prefix First part of the fancy message - * * @return list of fancy messages to send */ protected static List getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) { @@ -208,7 +202,6 @@ public class TagUtil { * Parses tooltip variables from config
Supports variables for factions only (type 2) * * @param faction faction to tooltip for - * * @return list of tooltips for a fancy message */ private static List tipFaction(Faction faction) { @@ -223,7 +216,6 @@ public class TagUtil { * Parses tooltip variables from config
Supports variables for players and factions (types 1 and 2) * * @param fplayer player to tooltip for - * * @return list of tooltips for a fancy message */ private static List tipPlayer(FPlayer fplayer) {