|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
--- a/net/minecraft/server/players/PlayerList.java
|
|
|
|
|
+++ b/net/minecraft/server/players/PlayerList.java
|
|
|
|
|
@@ -102,6 +102,26 @@
|
|
|
|
|
import net.minecraft.world.scores.ScoreboardTeamBase;
|
|
|
|
|
@@ -101,6 +101,26 @@
|
|
|
|
|
import net.minecraft.world.scores.ScoreboardTeam;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
|
@@ -27,7 +27,7 @@
|
|
|
|
|
public abstract class PlayerList {
|
|
|
|
|
|
|
|
|
|
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
|
|
|
|
@@ -114,14 +134,16 @@
|
|
|
|
|
@@ -113,14 +133,16 @@
|
|
|
|
|
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
|
|
|
|
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
|
|
|
|
private final MinecraftServer server;
|
|
|
|
|
@@ -47,7 +47,7 @@
|
|
|
|
|
public final WorldNBTStorage playerIo;
|
|
|
|
|
private boolean doWhiteList;
|
|
|
|
|
private final LayeredRegistryAccess<RegistryLayer> registries;
|
|
|
|
|
@@ -132,13 +154,23 @@
|
|
|
|
|
@@ -131,13 +153,23 @@
|
|
|
|
|
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
|
|
|
|
private int sendAllPlayerInfoIn;
|
|
|
|
|
|
|
|
|
|
@@ -73,7 +73,7 @@
|
|
|
|
|
this.server = minecraftserver;
|
|
|
|
|
this.registries = layeredregistryaccess;
|
|
|
|
|
this.maxPlayers = i;
|
|
|
|
|
@@ -161,15 +193,21 @@
|
|
|
|
|
@@ -160,15 +192,21 @@
|
|
|
|
|
|
|
|
|
|
NBTTagCompound nbttagcompound = this.load(entityplayer);
|
|
|
|
|
ResourceKey resourcekey;
|
|
|
|
|
@@ -98,7 +98,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ResourceKey<World> resourcekey1 = resourcekey;
|
|
|
|
|
@@ -186,7 +224,8 @@
|
|
|
|
|
@@ -185,7 +223,8 @@
|
|
|
|
|
entityplayer.setServerLevel(worldserver1);
|
|
|
|
|
String s1 = networkmanager.getLoggableAddress(this.server.logIPs());
|
|
|
|
|
|
|
|
|
|
@@ -108,7 +108,7 @@
|
|
|
|
|
WorldData worlddata = worldserver1.getLevelData();
|
|
|
|
|
|
|
|
|
|
entityplayer.loadGameTypes(nbttagcompound);
|
|
|
|
|
@@ -197,6 +236,7 @@
|
|
|
|
|
@@ -196,6 +235,7 @@
|
|
|
|
|
boolean flag2 = gamerules.getBoolean(GameRules.RULE_LIMITED_CRAFTING);
|
|
|
|
|
|
|
|
|
|
playerconnection.send(new PacketPlayOutLogin(entityplayer.getId(), worlddata.isHardcore(), this.server.levelKeys(), this.getMaxPlayers(), this.viewDistance, this.simulationDistance, flag1, !flag, flag2, entityplayer.createCommonSpawnInfo(worldserver1)));
|
|
|
|
|
@@ -116,7 +116,7 @@
|
|
|
|
|
playerconnection.send(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
|
|
|
|
playerconnection.send(new PacketPlayOutAbilities(entityplayer.getAbilities()));
|
|
|
|
|
playerconnection.send(new PacketPlayOutHeldItemSlot(entityplayer.getInventory().selected));
|
|
|
|
|
@@ -213,8 +253,10 @@
|
|
|
|
|
@@ -212,8 +252,10 @@
|
|
|
|
|
} else {
|
|
|
|
|
ichatmutablecomponent = IChatBaseComponent.translatable("multiplayer.player.joined.renamed", entityplayer.getDisplayName(), s);
|
|
|
|
|
}
|
|
|
|
|
@@ -128,7 +128,7 @@
|
|
|
|
|
playerconnection.teleport(entityplayer.getX(), entityplayer.getY(), entityplayer.getZ(), entityplayer.getYRot(), entityplayer.getXRot());
|
|
|
|
|
ServerPing serverping = this.server.getStatus();
|
|
|
|
|
|
|
|
|
|
@@ -222,13 +264,64 @@
|
|
|
|
|
@@ -221,13 +263,64 @@
|
|
|
|
|
entityplayer.sendServerStatus(serverping);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -197,7 +197,7 @@
|
|
|
|
|
Iterator iterator = entityplayer.getActiveEffects().iterator();
|
|
|
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
@@ -239,8 +332,11 @@
|
|
|
|
|
@@ -238,8 +331,11 @@
|
|
|
|
|
|
|
|
|
|
if (nbttagcompound != null && nbttagcompound.contains("RootVehicle", 10)) {
|
|
|
|
|
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
|
|
|
|
|
@@ -211,7 +211,7 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
@@ -283,6 +379,8 @@
|
|
|
|
|
@@ -282,6 +378,8 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entityplayer.initInventoryMenu();
|
|
|
|
|
@@ -220,7 +220,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void updateEntireScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
|
|
|
|
@@ -319,30 +417,31 @@
|
|
|
|
|
@@ -318,30 +416,31 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addWorldborderListener(WorldServer worldserver) {
|
|
|
|
|
@@ -257,7 +257,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@@ -370,14 +469,15 @@
|
|
|
|
|
@@ -369,14 +468,15 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void save(EntityPlayer entityplayer) {
|
|
|
|
|
@@ -275,7 +275,7 @@
|
|
|
|
|
|
|
|
|
|
if (advancementdataplayer != null) {
|
|
|
|
|
advancementdataplayer.save();
|
|
|
|
|
@@ -385,10 +485,24 @@
|
|
|
|
|
@@ -384,10 +484,24 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -301,7 +301,7 @@
|
|
|
|
|
this.save(entityplayer);
|
|
|
|
|
if (entityplayer.isPassenger()) {
|
|
|
|
|
Entity entity = entityplayer.getRootVehicle();
|
|
|
|
|
@@ -412,18 +526,66 @@
|
|
|
|
|
@@ -411,18 +525,66 @@
|
|
|
|
|
|
|
|
|
|
if (entityplayer1 == entityplayer) {
|
|
|
|
|
this.playersByUUID.remove(uuid);
|
|
|
|
|
@@ -374,7 +374,7 @@
|
|
|
|
|
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.bans.get(gameprofile);
|
|
|
|
|
|
|
|
|
|
ichatmutablecomponent = IChatBaseComponent.translatable("multiplayer.disconnect.banned.reason", gameprofilebanentry.getReason());
|
|
|
|
|
@@ -431,10 +593,12 @@
|
|
|
|
|
@@ -430,10 +592,12 @@
|
|
|
|
|
ichatmutablecomponent.append((IChatBaseComponent) IChatBaseComponent.translatable("multiplayer.disconnect.banned.expiration", PlayerList.BAN_DATE_FORMAT.format(gameprofilebanentry.getExpires())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -390,7 +390,7 @@
|
|
|
|
|
IpBanEntry ipbanentry = this.ipBans.get(socketaddress);
|
|
|
|
|
|
|
|
|
|
ichatmutablecomponent = IChatBaseComponent.translatable("multiplayer.disconnect.banned_ip.reason", ipbanentry.getReason());
|
|
|
|
|
@@ -442,17 +606,32 @@
|
|
|
|
|
@@ -441,17 +605,32 @@
|
|
|
|
|
ichatmutablecomponent.append((IChatBaseComponent) IChatBaseComponent.translatable("multiplayer.disconnect.banned_ip.expiration", PlayerList.BAN_DATE_FORMAT.format(ipbanentry.getExpires())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -428,7 +428,7 @@
|
|
|
|
|
UUID uuid = gameprofile.getId();
|
|
|
|
|
Set<EntityPlayer> set = Sets.newIdentityHashSet();
|
|
|
|
|
Iterator iterator = this.players.iterator();
|
|
|
|
|
@@ -480,14 +659,24 @@
|
|
|
|
|
@@ -479,14 +658,24 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return !set.isEmpty();
|
|
|
|
|
@@ -454,7 +454,7 @@
|
|
|
|
|
WorldServer worldserver = this.server.getLevel(entityplayer.getRespawnDimension());
|
|
|
|
|
Optional optional;
|
|
|
|
|
|
|
|
|
|
@@ -499,6 +688,11 @@
|
|
|
|
|
@@ -498,6 +687,11 @@
|
|
|
|
|
|
|
|
|
|
WorldServer worldserver1 = worldserver != null && optional.isPresent() ? worldserver : this.server.overworld();
|
|
|
|
|
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getGameProfile(), entityplayer.clientInformation());
|
|
|
|
|
@@ -466,7 +466,7 @@
|
|
|
|
|
|
|
|
|
|
entityplayer1.connection = entityplayer.connection;
|
|
|
|
|
entityplayer1.restoreFrom(entityplayer, flag);
|
|
|
|
|
@@ -514,28 +708,66 @@
|
|
|
|
|
@@ -513,28 +707,66 @@
|
|
|
|
|
|
|
|
|
|
boolean flag2 = false;
|
|
|
|
|
|
|
|
|
|
@@ -549,7 +549,7 @@
|
|
|
|
|
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -544,21 +776,43 @@
|
|
|
|
|
@@ -543,21 +775,43 @@
|
|
|
|
|
WorldData worlddata = worldserver2.getLevelData();
|
|
|
|
|
|
|
|
|
|
entityplayer1.connection.send(new PacketPlayOutRespawn(entityplayer1.createCommonSpawnInfo(worldserver2), (byte) i));
|
|
|
|
|
@@ -598,7 +598,7 @@
|
|
|
|
|
return entityplayer1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -571,7 +825,18 @@
|
|
|
|
|
@@ -570,7 +824,18 @@
|
|
|
|
|
|
|
|
|
|
public void tick() {
|
|
|
|
|
if (++this.sendAllPlayerInfoIn > 600) {
|
|
|
|
|
@@ -618,7 +618,7 @@
|
|
|
|
|
this.sendAllPlayerInfoIn = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -588,6 +853,25 @@
|
|
|
|
|
@@ -587,6 +852,25 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -644,7 +644,7 @@
|
|
|
|
|
public void broadcastAll(Packet<?> packet, ResourceKey<World> resourcekey) {
|
|
|
|
|
Iterator iterator = this.players.iterator();
|
|
|
|
|
|
|
|
|
|
@@ -666,7 +950,7 @@
|
|
|
|
|
@@ -665,7 +949,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void deop(GameProfile gameprofile) {
|
|
|
|
|
@@ -653,7 +653,7 @@
|
|
|
|
|
EntityPlayer entityplayer = this.getPlayer(gameprofile.getId());
|
|
|
|
|
|
|
|
|
|
if (entityplayer != null) {
|
|
|
|
|
@@ -690,6 +974,7 @@
|
|
|
|
|
@@ -689,6 +973,7 @@
|
|
|
|
|
entityplayer.connection.send(new PacketPlayOutEntityStatus(entityplayer, b0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -661,7 +661,7 @@
|
|
|
|
|
this.server.getCommands().sendCommands(entityplayer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -722,6 +1007,12 @@
|
|
|
|
|
@@ -719,6 +1004,12 @@
|
|
|
|
|
for (int i = 0; i < this.players.size(); ++i) {
|
|
|
|
|
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
|
|
|
|
|
|
|
|
|
|
@@ -674,7 +674,7 @@
|
|
|
|
|
if (entityplayer != entityhuman && entityplayer.level().dimension() == resourcekey) {
|
|
|
|
|
double d4 = d0 - entityplayer.getX();
|
|
|
|
|
double d5 = d1 - entityplayer.getY();
|
|
|
|
|
@@ -761,23 +1052,35 @@
|
|
|
|
|
@@ -758,15 +1049,19 @@
|
|
|
|
|
public void reloadWhiteList() {}
|
|
|
|
|
|
|
|
|
|
public void sendLevelInfo(EntityPlayer entityplayer, WorldServer worldserver) {
|
|
|
|
|
@@ -697,7 +697,8 @@
|
|
|
|
|
+ // CraftBukkit end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
entityplayer.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.LEVEL_CHUNKS_LOAD_START, 0.0F));
|
|
|
|
|
@@ -775,8 +1070,16 @@
|
|
|
|
|
|
|
|
|
|
public void sendAllPlayerInfo(EntityPlayer entityplayer) {
|
|
|
|
|
entityplayer.inventoryMenu.sendAllDataToRemote();
|
|
|
|
|
@@ -715,7 +716,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getPlayerCount() {
|
|
|
|
|
@@ -833,12 +1136,22 @@
|
|
|
|
|
@@ -832,12 +1135,22 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void removeAll() {
|
|
|
|
|
@@ -740,7 +741,7 @@
|
|
|
|
|
public void broadcastSystemMessage(IChatBaseComponent ichatbasecomponent, boolean flag) {
|
|
|
|
|
this.broadcastSystemMessage(ichatbasecomponent, (entityplayer) -> {
|
|
|
|
|
return ichatbasecomponent;
|
|
|
|
|
@@ -896,16 +1209,23 @@
|
|
|
|
|
@@ -895,16 +1208,23 @@
|
|
|
|
|
return playerchatmessage.hasSignature() && !playerchatmessage.hasExpiredServer(Instant.now());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -768,7 +769,7 @@
|
|
|
|
|
Path path = file2.toPath();
|
|
|
|
|
|
|
|
|
|
if (FileUtils.isPathNormalized(path) && FileUtils.isPathPortable(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
|
|
|
|
@@ -914,7 +1234,7 @@
|
|
|
|
|
@@ -913,7 +1233,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
|
|
|
|
|
@@ -777,7 +778,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return serverstatisticmanager;
|
|
|
|
|
@@ -922,13 +1242,13 @@
|
|
|
|
|
@@ -921,13 +1241,13 @@
|
|
|
|
|
|
|
|
|
|
public AdvancementDataPlayer getPlayerAdvancements(EntityPlayer entityplayer) {
|
|
|
|
|
UUID uuid = entityplayer.getUUID();
|
|
|
|
|
@@ -793,7 +794,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
advancementdataplayer.setPlayer(entityplayer);
|
|
|
|
|
@@ -979,13 +1299,20 @@
|
|
|
|
|
@@ -978,13 +1298,20 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void reloadResources() {
|
|
|
|
|
|