Use the Massive collections some more
This commit is contained in:
		@@ -338,7 +338,7 @@ public class BoardColl extends Coll<Board> implements BoardInterface
 | 
			
		||||
		psChunk = psChunk.getChunk(true);
 | 
			
		||||
		
 | 
			
		||||
		// Create
 | 
			
		||||
		Set<PS> ret = new LinkedHashSet<>();
 | 
			
		||||
		Set<PS> ret = new MassiveSet<>();
 | 
			
		||||
		if (distance < 0) return ret;
 | 
			
		||||
		
 | 
			
		||||
		// Fill
 | 
			
		||||
@@ -369,7 +369,7 @@ public class BoardColl extends Coll<Board> implements BoardInterface
 | 
			
		||||
		if (chunks == null) throw new NullPointerException("chunks");
 | 
			
		||||
		
 | 
			
		||||
		// Create
 | 
			
		||||
		Set<PS> ret = new LinkedHashSet<>();
 | 
			
		||||
		Set<PS> ret = new MassiveSet<>();
 | 
			
		||||
		
 | 
			
		||||
		if (distance < 0) return ret;
 | 
			
		||||
		
 | 
			
		||||
@@ -389,7 +389,7 @@ public class BoardColl extends Coll<Board> implements BoardInterface
 | 
			
		||||
		if (chunks == null) throw new NullPointerException("chunks");
 | 
			
		||||
		
 | 
			
		||||
		// Create
 | 
			
		||||
		Set<Faction> ret = new LinkedHashSet<>();
 | 
			
		||||
		Set<Faction> ret = new MassiveSet<>();
 | 
			
		||||
		
 | 
			
		||||
		// Fill
 | 
			
		||||
		for (PS chunk : chunks)
 | 
			
		||||
@@ -406,7 +406,7 @@ public class BoardColl extends Coll<Board> implements BoardInterface
 | 
			
		||||
	public static Map<PS, Faction> getChunkFaction(Collection<PS> chunks)
 | 
			
		||||
	{
 | 
			
		||||
		// Create
 | 
			
		||||
		Map<PS, Faction> ret = new LinkedHashMap<>();
 | 
			
		||||
		Map<PS, Faction> ret = new MassiveMap<>();
 | 
			
		||||
		
 | 
			
		||||
		// Fill
 | 
			
		||||
		Faction none = FactionColl.get().getNone();
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ import com.massivecraft.factions.Factions;
 | 
			
		||||
import com.massivecraft.factions.Rel;
 | 
			
		||||
import com.massivecraft.factions.integration.Econ;
 | 
			
		||||
import com.massivecraft.factions.util.MiscUtil;
 | 
			
		||||
import com.massivecraft.massivecore.collections.MassiveMap;
 | 
			
		||||
import com.massivecraft.massivecore.store.Coll;
 | 
			
		||||
import com.massivecraft.massivecore.util.Txt;
 | 
			
		||||
 | 
			
		||||
@@ -228,7 +229,7 @@ public class FactionColl extends Coll<Faction>
 | 
			
		||||
	public Map<Rel, List<String>> getRelationNames(Faction faction, Set<Rel> rels)
 | 
			
		||||
	{
 | 
			
		||||
		// Create
 | 
			
		||||
		Map<Rel, List<String>> ret = new LinkedHashMap<>();
 | 
			
		||||
		Map<Rel, List<String>> ret = new MassiveMap<>();
 | 
			
		||||
		MFlag flagPeaceful = MFlag.getFlagPeaceful();
 | 
			
		||||
		boolean peaceful = faction.getFlag(flagPeaceful);
 | 
			
		||||
		for (Rel rel : rels)
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ import com.massivecraft.factions.Rel;
 | 
			
		||||
import com.massivecraft.factions.engine.EngineChat;
 | 
			
		||||
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
 | 
			
		||||
import com.massivecraft.massivecore.collections.BackstringSet;
 | 
			
		||||
import com.massivecraft.massivecore.collections.MassiveSet;
 | 
			
		||||
import com.massivecraft.massivecore.collections.WorldExceptionSet;
 | 
			
		||||
import com.massivecraft.massivecore.command.editor.annotation.EditorName;
 | 
			
		||||
import com.massivecraft.massivecore.command.editor.annotation.EditorType;
 | 
			
		||||
@@ -89,7 +90,7 @@ public class MConf extends Entity<MConf>
 | 
			
		||||
	// Add player names here who should bypass all protections.
 | 
			
		||||
	// Should /not/ be used for admins. There is "/f adminmode" for that.
 | 
			
		||||
	// This is for other plugins/mods that use a fake player to take actions, which shouldn't be subject to our protections.
 | 
			
		||||
	public Set<String> playersWhoBypassAllProtection = new LinkedHashSet<>();
 | 
			
		||||
	public Set<String> playersWhoBypassAllProtection = new MassiveSet<>();
 | 
			
		||||
	
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// TASKS
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@ import com.massivecraft.factions.event.EventFactionsCreatePerms;
 | 
			
		||||
import com.massivecraft.massivecore.Named;
 | 
			
		||||
import com.massivecraft.massivecore.Prioritized;
 | 
			
		||||
import com.massivecraft.massivecore.Registerable;
 | 
			
		||||
import com.massivecraft.massivecore.collections.MassiveSet;
 | 
			
		||||
import com.massivecraft.massivecore.comparator.ComparatorSmart;
 | 
			
		||||
import com.massivecraft.massivecore.predicate.PredicateIsRegistered;
 | 
			
		||||
import com.massivecraft.massivecore.ps.PS;
 | 
			
		||||
@@ -132,7 +133,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, N
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public static MPerm getPermBuild() { return getCreative(PRIORITY_BUILD, ID_BUILD, ID_BUILD, "edit the terrain", MUtil.set(Rel.LEADER, Rel.OFFICER, Rel.MEMBER), true, true, true); }
 | 
			
		||||
	public static MPerm getPermPainbuild() { return getCreative(PRIORITY_PAINBUILD, ID_PAINBUILD, ID_PAINBUILD, "edit, take damage", new LinkedHashSet<Rel>(), true, true, true); }
 | 
			
		||||
	public static MPerm getPermPainbuild() { return getCreative(PRIORITY_PAINBUILD, ID_PAINBUILD, ID_PAINBUILD, "edit, take damage", new MassiveSet<Rel>(), true, true, true); }
 | 
			
		||||
	public static MPerm getPermDoor() { return getCreative(PRIORITY_DOOR, ID_DOOR, ID_DOOR, "use doors", MUtil.set(Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY), true, true, true); }
 | 
			
		||||
	public static MPerm getPermButton() { return getCreative(PRIORITY_BUTTON, ID_BUTTON, ID_BUTTON, "use stone buttons", MUtil.set(Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY), true, true, true); }
 | 
			
		||||
	public static MPerm getPermLever() { return getCreative(PRIORITY_LEVER, ID_LEVER, ID_LEVER, "use levers", MUtil.set(Rel.LEADER, Rel.OFFICER, Rel.MEMBER, Rel.RECRUIT, Rel.ALLY), true, true, true); }
 | 
			
		||||
@@ -232,7 +233,7 @@ public class MPerm extends Entity<MPerm> implements Prioritized, Registerable, N
 | 
			
		||||
	// What is the standard (aka default) perm value?
 | 
			
		||||
	// This value will be set for factions from the beginning.
 | 
			
		||||
	// Example: ... set of relations ...
 | 
			
		||||
	private Set<Rel> standard = new LinkedHashSet<>();
 | 
			
		||||
	private Set<Rel> standard = new MassiveSet<>();
 | 
			
		||||
	public Set<Rel> getStandard() { return this.standard; }
 | 
			
		||||
	public MPerm setStandard(Set<Rel> standard) { this.standard = standard; this.changed(); return this; }
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user