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.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
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.util.VisualizeUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;

View File

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

View File

@ -1,8 +1,7 @@
package com.massivecraft.factions.util;
import org.bukkit.ChatColor;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import java.util.ArrayList;
@ -31,10 +30,18 @@ public class AsciiCompass {
}
public String getTranslation() {
if(this==N) return TL.COMPASS_SHORT_NORTH.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();
if (this == N) {
return TL.COMPASS_SHORT_NORTH.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();
}

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import org.bukkit.entity.Creature;
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.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
import org.bukkit.ChatColor;
public class RelationUtil {

View File

@ -7,13 +7,12 @@ import com.massivecraft.factions.zcore.util.TL;
public class WarmUpUtil {
/**
*
* @param player The player to notify.
* @param translationKey The translation key used for notifying.
* @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 delay The time used, in seconds, for the delay.
*
* <p/>
* note: for translations: %s = action, %d = 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;
/**
* Link between config and in-game messages<br>
* Changes based on faction / player<br>
* Interfaces the config lists with {} variables to plugin
* Link between config and in-game messages<br> Changes based on faction / player<br> Interfaces the config lists with
* {} variables to plugin
*/
public enum TagReplacer {
@ -123,6 +122,7 @@ 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) {
@ -211,6 +211,7 @@ public enum TagReplacer {
* Returns a list of all the variables we can use for this type<br>
*
* @param type the type we want
*
* @return a list of all the variables with this type
*/
protected static List<TagReplacer> getByType(TagType type) {
@ -230,6 +231,7 @@ 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) {
@ -238,6 +240,7 @@ public enum TagReplacer {
/**
* @param toSearch raw line with variables
*
* @return if the raw line contains this enums variable
*/
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.Factions;
import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.util.MiscUtil;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
@ -24,6 +23,7 @@ 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,6 +40,7 @@ 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) {
@ -61,6 +62,7 @@ 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) {
@ -78,6 +80,7 @@ public class TagUtil {
* @param faction for faction (viewers faction)
* @param fme for player (viewer)
* @param line fancy message prefix
*
* @return
*/
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
*
* @param line raw line from config with variables
*
* @return if the line has fancy variables
*/
public static boolean hasFancy(String line) {
@ -111,6 +115,7 @@ 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<FancyMessage> getFancy(Faction target, FPlayer fme, TagReplacer type, String prefix) {
@ -193,11 +198,10 @@ public class TagUtil {
}
/**
* Parses tooltip variables from config
* <br>
* Supports variables for factions only (type 2)
* Parses tooltip variables from config <br> Supports variables for factions only (type 2)
*
* @param faction faction to tooltip for
*
* @return list of tooltips for a fancy message
*/
private static List<String> tipFaction(Faction faction) {
@ -209,11 +213,10 @@ public class TagUtil {
}
/**
* Parses tooltip variables from config
* <br>
* Supports variables for players and factions (types 1 and 2)
* Parses tooltip variables from config <br> 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<String> tipPlayer(FPlayer fplayer) {