summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-05-15 08:25:53 +1000
committermd_5 <git@md-5.net>2017-05-15 08:25:53 +1000
commit743252dbe56e69e7c75aeacb5ecb768c52c6bee7 (patch)
tree5ce4f912d561af84331ee3fce954d629672ae968 /src/main
parent5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5 (diff)
downloadcraftbukkit-743252dbe56e69e7c75aeacb5ecb768c52c6bee7.tar
craftbukkit-743252dbe56e69e7c75aeacb5ecb768c52c6bee7.tar.gz
craftbukkit-743252dbe56e69e7c75aeacb5ecb768c52c6bee7.tar.lz
craftbukkit-743252dbe56e69e7c75aeacb5ecb768c52c6bee7.tar.xz
craftbukkit-743252dbe56e69e7c75aeacb5ecb768c52c6bee7.zip
SPIGOT-3238: Add Server.advancementIterator
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b7f0ef94..fc92b912 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -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() {