Java 7 and make intellij happy
This commit is contained in:
@@ -20,7 +20,7 @@ public class AsciiCompass {
|
||||
|
||||
public final char asciiChar;
|
||||
|
||||
private Point(final char asciiChar) {
|
||||
Point(final char asciiChar) {
|
||||
this.asciiChar = asciiChar;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class AsciiCompass {
|
||||
}
|
||||
|
||||
public static ArrayList<String> getAsciiCompass(Point point, ChatColor colorActive, String colorDefault) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
ArrayList<String> ret = new ArrayList<>();
|
||||
String row;
|
||||
|
||||
row = "";
|
||||
|
||||
@@ -15,8 +15,8 @@ import java.util.Map;
|
||||
|
||||
public final class EnumTypeAdapter<T extends Enum<T>> extends TypeAdapter<T> {
|
||||
|
||||
private final Map<String, T> nameToConstant = new HashMap<String, T>();
|
||||
private final Map<T, String> constantToName = new HashMap<T, String>();
|
||||
private final Map<String, T> nameToConstant = new HashMap<>();
|
||||
private final Map<T, String> constantToName = new HashMap<>();
|
||||
|
||||
public EnumTypeAdapter(Class<T> classOfT) {
|
||||
try {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<FLocation, Set<String>> locationMap = new ConcurrentHashMap<FLocation, Set<String>>();
|
||||
Map<FLocation, Set<String>> locationMap = new ConcurrentHashMap<>();
|
||||
Set<String> nameSet;
|
||||
Iterator<JsonElement> iter;
|
||||
String worldName;
|
||||
@@ -38,7 +38,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
|
||||
x = Integer.parseInt(coords[0]);
|
||||
z = Integer.parseInt(coords[1]);
|
||||
|
||||
nameSet = new HashSet<String>();
|
||||
nameSet = new HashSet<>();
|
||||
iter = entry2.getValue().getAsJsonArray().iterator();
|
||||
while (iter.hasNext()) {
|
||||
nameSet.add(iter.next().getAsString());
|
||||
|
||||
@@ -45,24 +45,24 @@ public class MiscUtil {
|
||||
}
|
||||
|
||||
/// TODO create tag whitelist!!
|
||||
public static HashSet<String> substanceChars = new HashSet<String>(Arrays.asList(new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}));
|
||||
public static HashSet<String> substanceChars = new HashSet<>(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"));
|
||||
|
||||
public static String getComparisonString(String str) {
|
||||
String ret = "";
|
||||
StringBuilder ret = new StringBuilder();
|
||||
|
||||
str = ChatColor.stripColor(str);
|
||||
str = str.toLowerCase();
|
||||
|
||||
for (char c : str.toCharArray()) {
|
||||
if (substanceChars.contains(String.valueOf(c))) {
|
||||
ret += c;
|
||||
ret.append(c);
|
||||
}
|
||||
}
|
||||
return ret.toLowerCase();
|
||||
return ret.toString().toLowerCase();
|
||||
}
|
||||
|
||||
public static ArrayList<String> validateTag(String str) {
|
||||
ArrayList<String> errors = new ArrayList<String>();
|
||||
ArrayList<String> errors = new ArrayList<>();
|
||||
|
||||
if (getComparisonString(str).length() < Conf.factionTagLengthMin) {
|
||||
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
|
||||
@@ -82,9 +82,9 @@ public class MiscUtil {
|
||||
}
|
||||
|
||||
public static Iterable<FPlayer> rankOrder(Iterable<FPlayer> players) {
|
||||
List<FPlayer> admins = new ArrayList<FPlayer>();
|
||||
List<FPlayer> moderators = new ArrayList<FPlayer>();
|
||||
List<FPlayer> normal = new ArrayList<FPlayer>();
|
||||
List<FPlayer> admins = new ArrayList<>();
|
||||
List<FPlayer> moderators = new ArrayList<>();
|
||||
List<FPlayer> normal = new ArrayList<>();
|
||||
|
||||
for (FPlayer player : players) {
|
||||
switch (player.getRole()) {
|
||||
@@ -102,7 +102,7 @@ public class MiscUtil {
|
||||
}
|
||||
}
|
||||
|
||||
List<FPlayer> ret = new ArrayList<FPlayer>();
|
||||
List<FPlayer> ret = new ArrayList<>();
|
||||
ret.addAll(admins);
|
||||
ret.addAll(moderators);
|
||||
ret.addAll(normal);
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Map.Entry;
|
||||
|
||||
public class VisualizeUtil {
|
||||
|
||||
protected static Map<UUID, Set<Location>> playerLocations = new HashMap<UUID, Set<Location>>();
|
||||
protected static Map<UUID, Set<Location>> playerLocations = new HashMap<>();
|
||||
|
||||
public static Set<Location> getPlayerLocations(Player player) {
|
||||
return getPlayerLocations(player.getUniqueId());
|
||||
@@ -18,7 +18,7 @@ public class VisualizeUtil {
|
||||
public static Set<Location> getPlayerLocations(UUID uuid) {
|
||||
Set<Location> ret = playerLocations.get(uuid);
|
||||
if (ret == null) {
|
||||
ret = new HashSet<Location>();
|
||||
ret = new HashSet<>();
|
||||
playerLocations.put(uuid, ret);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user