diff --git a/src/main/java/com/massivecraft/massivecore/collections/WorldExceptionSet.java b/src/main/java/com/massivecraft/massivecore/collections/WorldExceptionSet.java new file mode 100644 index 00000000..662c29cb --- /dev/null +++ b/src/main/java/com/massivecraft/massivecore/collections/WorldExceptionSet.java @@ -0,0 +1,32 @@ +package com.massivecraft.massivecore.collections; + +import org.bukkit.World; + +import com.massivecraft.massivecore.CaseInsensitiveComparator; + +public class WorldExceptionSet +{ + // -------------------------------------------- // + // FIELDS + // -------------------------------------------- // + + public boolean standard = true; + + public MassiveTreeSet exceptions = new MassiveTreeSet(CaseInsensitiveComparator.get()); + + // -------------------------------------------- // + // CONTAINS + // -------------------------------------------- // + + public boolean contains(String world) + { + if (this.exceptions.contains(world)) return !this.standard; + return this.standard; + } + + public boolean contains(World world) + { + return this.contains(world.getName()); + } + +}