3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Use 4787c23dce0f5ac856d8d398225828971a93a3ff Guava patch for onlinePlayers

This change improves the quality of life for plugin developers using
iterator iteration with side-effects. In the specified Guava patch, the
internal iterator no longer relies on the AbstractList iterator which
iterates by index, and will instead wrap the provided iterator in a
transformer given the Function.
Dieser Commit ist enthalten in:
Wesley Wolfe 2014-07-01 00:47:39 -05:00
Ursprung b602b5efa4
Commit a8628fd645

Datei anzeigen

@ -186,9 +186,7 @@ import com.avaje.ebean.config.DataSourceConfig;
import com.avaje.ebean.config.ServerConfig; import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.config.dbplatform.SQLitePlatform; import com.avaje.ebean.config.dbplatform.SQLitePlatform;
import com.avaje.ebeaninternal.server.lib.sql.TransactionIsolation; import com.avaje.ebeaninternal.server.lib.sql.TransactionIsolation;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.MapMaker; import com.google.common.collect.MapMaker;
import jline.console.ConsoleReader; import jline.console.ConsoleReader;
@ -246,7 +244,7 @@ public final class CraftServer implements Server {
public CraftServer(MinecraftServer console, PlayerList playerList) { public CraftServer(MinecraftServer console, PlayerList playerList) {
this.console = console; this.console = console;
this.playerList = (DedicatedPlayerList) playerList; this.playerList = (DedicatedPlayerList) playerList;
this.playerView = Collections.unmodifiableList(Lists.transform(playerList.players, new Function<EntityPlayer, CraftPlayer>() { this.playerView = Collections.unmodifiableList(net.minecraft.util.com.google.common.collect.Lists.transform(playerList.players, new net.minecraft.util.com.google.common.base.Function<EntityPlayer, CraftPlayer>() {
@Override @Override
public CraftPlayer apply(EntityPlayer player) { public CraftPlayer apply(EntityPlayer player) {
return player.getBukkitEntity(); return player.getBukkitEntity();