PS utility method

This commit is contained in:
BuildTools 2016-04-19 16:57:53 +02:00 committed by Olof Larsson
parent a4acf15094
commit 5308e63282
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474

View File

@ -862,7 +862,7 @@ public final class PS implements Cloneable, Serializable, Comparable<PS>
public static Set<PS> getDistinctChunks(Collection<PS> pss)
{
Set<PS> ret = new LinkedHashSet<PS>();
Set<PS> ret = new LinkedHashSet<>();
for (PS ps : pss)
{
ret.add(ps.getChunk(true));
@ -870,6 +870,16 @@ public final class PS implements Cloneable, Serializable, Comparable<PS>
return ret;
}
public static Set<String> getDistinctWorlds(Collection<PS> pss)
{
Set<String> ret = new LinkedHashSet<>();
for (PS ps : pss)
{
ret.add(ps.getWorld());
}
return ret;
}
// -------------------------------------------- //
// HASHCODE (CACHED)
// -------------------------------------------- //