Reformat.

This commit is contained in:
drtshock 2015-05-12 23:17:22 -05:00
parent 5f6e83872d
commit f37e38b011
19 changed files with 58 additions and 48 deletions

View File

@ -3,7 +3,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.VisualizeUtil; import com.massivecraft.factions.util.VisualizeUtil;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;

View File

@ -119,7 +119,9 @@ public class FactionsEntityListener implements Listener {
} }
public void cancelFStuckTeleport(Player player) { public void cancelFStuckTeleport(Player player) {
if (player == null) return; if (player == null) {
return;
}
UUID uuid = player.getUniqueId(); UUID uuid = player.getUniqueId();
if (P.p.getStuckMap().containsKey(uuid)) { if (P.p.getStuckMap().containsKey(uuid)) {
FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED); FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED);

View File

@ -1,8 +1,7 @@
package com.massivecraft.factions.util; package com.massivecraft.factions.util;
import org.bukkit.ChatColor;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,10 +30,18 @@ public class AsciiCompass {
} }
public String getTranslation() { public String getTranslation() {
if(this==N) return TL.COMPASS_SHORT_NORTH.toString(); if (this == N) {
if(this==E) return TL.COMPASS_SHORT_EAST.toString(); return TL.COMPASS_SHORT_NORTH.toString();
if(this==S) return TL.COMPASS_SHORT_SOUTH.toString(); }
if(this==W) return TL.COMPASS_SHORT_WEST.toString(); if (this == E) {
return TL.COMPASS_SHORT_EAST.toString();
}
if (this == S) {
return TL.COMPASS_SHORT_SOUTH.toString();
}
if (this == W) {
return TL.COMPASS_SHORT_WEST.toString();
}
return toString(); return toString();
} }

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P; import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Creature; import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil; import com.massivecraft.factions.zcore.util.TextUtil;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
public class RelationUtil { public class RelationUtil {

View File

@ -7,13 +7,12 @@ import com.massivecraft.factions.zcore.util.TL;
public class WarmUpUtil { public class WarmUpUtil {
/** /**
*
* @param player The player to notify. * @param player The player to notify.
* @param translationKey The translation key used for notifying. * @param translationKey The translation key used for notifying.
* @param action The action, inserted into the notification message. * @param action The action, inserted into the notification message.
* @param runnable The task to run after the delay. If the delay is 0, the task is instantly ran. * @param runnable The task to run after the delay. If the delay is 0, the task is instantly ran.
* @param delay The time used, in seconds, for the delay. * @param delay The time used, in seconds, for the delay.
* * <p/>
* note: for translations: %s = action, %d = delay * note: for translations: %s = action, %d = delay
*/ */
public static void process(FPlayer player, TL translationKey, String action, Runnable runnable, long delay) { public static void process(FPlayer player, TL translationKey, String action, Runnable runnable, long delay) {

View File

@ -12,9 +12,8 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
* Link between config and in-game messages<br> * Link between config and in-game messages<br> Changes based on faction / player<br> Interfaces the config lists with
* Changes based on faction / player<br> * {} variables to plugin
* Interfaces the config lists with {} variables to plugin
*/ */
public enum TagReplacer { public enum TagReplacer {
@ -123,6 +122,7 @@ public enum TagReplacer {
* *
* @param fac Target faction * @param fac Target faction
* @param fp Target player (can be null) * @param fp Target player (can be null)
*
* @return the value for this enum! * @return the value for this enum!
*/ */
protected String getValue(Faction fac, FPlayer fp) { protected String getValue(Faction fac, FPlayer fp) {
@ -211,6 +211,7 @@ public enum TagReplacer {
* Returns a list of all the variables we can use for this type<br> * Returns a list of all the variables we can use for this type<br>
* *
* @param type the type we want * @param type the type we want
*
* @return a list of all the variables with this type * @return a list of all the variables with this type
*/ */
protected static List<TagReplacer> getByType(TagType type) { protected static List<TagReplacer> getByType(TagType type) {
@ -230,6 +231,7 @@ public enum TagReplacer {
/** /**
* @param original raw line with variables * @param original raw line with variables
* @param value what to replace var in raw line with * @param value what to replace var in raw line with
*
* @return the string with the new value * @return the string with the new value
*/ */
public String replace(String original, String value) { public String replace(String original, String value) {
@ -238,6 +240,7 @@ public enum TagReplacer {
/** /**
* @param toSearch raw line with variables * @param toSearch raw line with variables
*
* @return if the raw line contains this enums variable * @return if the raw line contains this enums variable
*/ */
public boolean contains(String toSearch) { public boolean contains(String toSearch) {

View File

@ -5,7 +5,6 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.P; import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.factions.util.MiscUtil;
import mkremins.fanciful.FancyMessage; import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -24,6 +23,7 @@ public class TagUtil {
* *
* @param faction for faction * @param faction for faction
* @param line raw line from config with variables to replace for * @param line raw line from config with variables to replace for
*
* @return clean line * @return clean line
*/ */
public static String parsePlain(Faction faction, String line) { public static String parsePlain(Faction faction, String line) {
@ -40,6 +40,7 @@ public class TagUtil {
* *
* @param fplayer for player * @param fplayer for player
* @param line raw line from config with variables to replace for * @param line raw line from config with variables to replace for
*
* @return clean line * @return clean line
*/ */
public static String parsePlain(FPlayer fplayer, String line) { public static String parsePlain(FPlayer fplayer, String line) {
@ -61,6 +62,7 @@ public class TagUtil {
* @param faction for faction * @param faction for faction
* @param fplayer from player * @param fplayer from player
* @param line raw line from config with variables to replace for * @param line raw line from config with variables to replace for
*
* @return clean line * @return clean line
*/ */
public static String parsePlain(Faction faction, FPlayer fplayer, String line) { public static String parsePlain(Faction faction, FPlayer fplayer, String line) {
@ -78,6 +80,7 @@ public class TagUtil {
* @param faction for faction (viewers faction) * @param faction for faction (viewers faction)
* @param fme for player (viewer) * @param fme for player (viewer)
* @param line fancy message prefix * @param line fancy message prefix
*
* @return * @return
*/ */
public static List<FancyMessage> parseFancy(Faction faction, FPlayer fme, String line) { public static List<FancyMessage> parseFancy(Faction faction, FPlayer fme, String line) {
@ -94,6 +97,7 @@ public class TagUtil {
* Checks if a line has fancy variables * Checks if a line has fancy variables
* *
* @param line raw line from config with variables * @param line raw line from config with variables
*
* @return if the line has fancy variables * @return if the line has fancy variables
*/ */
public static boolean hasFancy(String line) { public static boolean hasFancy(String line) {
@ -111,6 +115,7 @@ public class TagUtil {
* @param target Faction to get relate from * @param target Faction to get relate from
* @param fme Player to relate to * @param fme Player to relate to
* @param prefix First part of the fancy message * @param prefix First part of the fancy message
*
* @return list of fancy messages to send * @return list of fancy messages to send
*/ */
protected static List<FancyMessage> getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) { protected static List<FancyMessage> getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) {
@ -193,11 +198,10 @@ public class TagUtil {
} }
/** /**
* Parses tooltip variables from config * Parses tooltip variables from config <br> Supports variables for factions only (type 2)
* <br>
* Supports variables for factions only (type 2)
* *
* @param faction faction to tooltip for * @param faction faction to tooltip for
*
* @return list of tooltips for a fancy message * @return list of tooltips for a fancy message
*/ */
private static List<String> tipFaction(Faction faction) { private static List<String> tipFaction(Faction faction) {
@ -209,11 +213,10 @@ public class TagUtil {
} }
/** /**
* Parses tooltip variables from config * Parses tooltip variables from config <br> Supports variables for players and factions (types 1 and 2)
* <br>
* Supports variables for players and factions (types 1 and 2)
* *
* @param fplayer player to tooltip for * @param fplayer player to tooltip for
*
* @return list of tooltips for a fancy message * @return list of tooltips for a fancy message
*/ */
private static List<String> tipPlayer(FPlayer fplayer) { private static List<String> tipPlayer(FPlayer fplayer) {