Code/net/minecraft/server/players/ServerOpList.java

31 lines
1010 B
Java
Raw Permalink Normal View History

2025-07-01 06:20:03 +00:00
package net.minecraft.server.players;
import com.google.gson.JsonObject;
import com.mojang.authlib.GameProfile;
import java.io.File;
import java.util.Objects;
public class ServerOpList extends StoredUserList<GameProfile, ServerOpListEntry> {
public ServerOpList(File p_11345_) {
super(p_11345_);
}
@Override
protected StoredUserEntry<GameProfile> createEntry(JsonObject p_11348_) {
return new ServerOpListEntry(p_11348_);
}
@Override
public String[] getUserList() {
return this.getEntries().stream().map(StoredUserEntry::getUser).filter(Objects::nonNull).map(GameProfile::getName).toArray(String[]::new);
}
public boolean canBypassPlayerLimit(GameProfile p_11352_) {
ServerOpListEntry serveroplistentry = this.get(p_11352_);
return serveroplistentry != null ? serveroplistentry.getBypassesPlayerLimit() : false;
}
protected String getKeyForUser(GameProfile p_11354_) {
return p_11354_.getId().toString();
}
}