diff --git a/src/main/java/com/massivecraft/massivecore/MassiveCore.java b/src/main/java/com/massivecraft/massivecore/MassiveCore.java index 6ac9a0f1..0b28d727 100644 --- a/src/main/java/com/massivecraft/massivecore/MassiveCore.java +++ b/src/main/java/com/massivecraft/massivecore/MassiveCore.java @@ -34,6 +34,7 @@ import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.ExamineThread; import com.massivecraft.massivecore.teleport.EngineScheduledTeleport; import com.massivecraft.massivecore.util.IdUtil; +import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.PlayerUtil; import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.xlib.gson.Gson; @@ -52,6 +53,11 @@ public class MassiveCore extends MassivePlugin public final static String INSTANCE = "instance"; public final static String DEFAULT = "default"; + public final static Set NOTHING = MUtil.treeset("", "none", "null", "nothing"); + public final static Set REMOVE = MUtil.treeset("clear", "c", "delete", "del", "d", "erase", "e", "remove", "rem", "r", "reset", "res"); + public final static Set NOTHING_REMOVE = MUtil.treeset("", "none", "null", "nothing", "clear", "c", "delete", "del", "d", "erase", "e", "remove", "rem", "r", "reset", "res"); + + // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // diff --git a/src/main/java/com/massivecraft/massivecore/util/MUtil.java b/src/main/java/com/massivecraft/massivecore/util/MUtil.java index a635ece7..84335008 100644 --- a/src/main/java/com/massivecraft/massivecore/util/MUtil.java +++ b/src/main/java/com/massivecraft/massivecore/util/MUtil.java @@ -602,6 +602,23 @@ public class MUtil return new LinkedHashSet(Arrays.asList(items)); } + @SuppressWarnings("unchecked") + @SafeVarargs + public static Set treeset(T... items) + { + Set ret; + if (items[0] instanceof String) + { + ret = (Set) new TreeSet(String.CASE_INSENSITIVE_ORDER); + } + else + { + ret = new TreeSet(); + } + ret.addAll(Arrays.asList(items)); + return ret; + } + @SuppressWarnings("unchecked") public static Map map(K key1, V value1, Object... objects) {