SPIGOT-3238: Add Server.advancementIterator

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2017-05-15 08:25:53 +10:00
parent 40c8954e17
commit ea922d07c1

View file

@ -118,6 +118,7 @@ import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.MapMaker;
import com.mojang.authlib.GameProfile;
@ -1661,6 +1662,16 @@ public final class CraftServer implements Server {
return (advancement == null) ? null : advancement.bukkit;
}
@Override
public Iterator<org.bukkit.advancement.Advancement> advancementIterator() {
return Iterators.unmodifiableIterator(Iterators.transform(console.getAdvancementData().c().iterator(), new Function<Advancement, org.bukkit.advancement.Advancement>() { // PAIL: rename
@Override
public org.bukkit.advancement.Advancement apply(Advancement advancement) {
return advancement.bukkit;
}
}));
}
@Deprecated
@Override
public UnsafeValues getUnsafe() {