From 5308e6328285a753e7b1d498900f06d691b6c836 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 19 Apr 2016 16:57:53 +0200 Subject: [PATCH] PS utility method --- src/com/massivecraft/massivecore/ps/PS.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/massivecore/ps/PS.java b/src/com/massivecraft/massivecore/ps/PS.java index 86de8d3b..248f63a0 100644 --- a/src/com/massivecraft/massivecore/ps/PS.java +++ b/src/com/massivecraft/massivecore/ps/PS.java @@ -862,7 +862,7 @@ public final class PS implements Cloneable, Serializable, Comparable public static Set getDistinctChunks(Collection pss) { - Set ret = new LinkedHashSet(); + Set ret = new LinkedHashSet<>(); for (PS ps : pss) { ret.add(ps.getChunk(true)); @@ -870,6 +870,16 @@ public final class PS implements Cloneable, Serializable, Comparable return ret; } + public static Set getDistinctWorlds(Collection pss) + { + Set ret = new LinkedHashSet<>(); + for (PS ps : pss) + { + ret.add(ps.getWorld()); + } + return ret; + } + // -------------------------------------------- // // HASHCODE (CACHED) // -------------------------------------------- //