From 559d907118e7c86b26a3a24769c6210f4d21fd8f Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 19 Dec 2014 11:54:20 +0100 Subject: [PATCH] Move WorldExceptionSet from Faction to MassiveCore. Closes MassiveCraft/MassiveCore#197. --- .../collections/WorldExceptionSet.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/massivecraft/massivecore/collections/WorldExceptionSet.java 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()); + } + +}