@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -93,6 +93,26 @@
|
||||
@@ -95,6 +95,26 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
public abstract class PlayerList {
|
||||
|
||||
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
||||
@@ -103,14 +123,16 @@
|
||||
@@ -105,14 +125,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 IRegistryCustom.Dimension registryHolder;
|
||||
@@ -120,13 +142,23 @@
|
||||
@@ -122,13 +144,23 @@
|
||||
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
||||
private int sendAllPlayerInfoIn;
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
this.server = minecraftserver;
|
||||
this.registryHolder = iregistrycustom_dimension;
|
||||
this.maxPlayers = i;
|
||||
@@ -142,6 +174,12 @@
|
||||
@@ -144,6 +176,12 @@
|
||||
usercache.a(gameprofile);
|
||||
NBTTagCompound nbttagcompound = this.a(entityplayer);
|
||||
ResourceKey resourcekey;
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension")));
|
||||
@@ -171,7 +209,8 @@
|
||||
@@ -173,7 +211,8 @@
|
||||
s1 = networkmanager.getSocketAddress().toString();
|
||||
}
|
||||
|
||||
@@ -96,15 +96,15 @@
|
||||
WorldData worlddata = worldserver1.getWorldData();
|
||||
|
||||
entityplayer.c(nbttagcompound);
|
||||
@@ -181,6 +220,7 @@
|
||||
@@ -183,6 +222,7 @@
|
||||
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||
|
||||
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.gameMode.getGameMode(), entityplayer.gameMode.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.G(), this.registryHolder, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
|
||||
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.gameMode.getGameMode(), entityplayer.gameMode.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.registryHolder, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
|
||||
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.BRAND, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
||||
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.getAbilities()));
|
||||
@@ -199,19 +239,66 @@
|
||||
@@ -201,19 +241,66 @@
|
||||
} else {
|
||||
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s});
|
||||
}
|
||||
@@ -175,8 +175,8 @@
|
||||
+ // CraftBukkit end
|
||||
this.a(entityplayer, worldserver1);
|
||||
if (!this.server.getResourcePack().isEmpty()) {
|
||||
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.aY(), this.server.bb());
|
||||
@@ -227,8 +314,11 @@
|
||||
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.aX(), this.server.ba());
|
||||
@@ -229,8 +316,11 @@
|
||||
|
||||
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
|
||||
@@ -190,7 +190,7 @@
|
||||
});
|
||||
|
||||
if (entity != null) {
|
||||
@@ -271,6 +361,8 @@
|
||||
@@ -273,6 +363,8 @@
|
||||
}
|
||||
|
||||
entityplayer.syncInventory();
|
||||
@@ -199,7 +199,7 @@
|
||||
}
|
||||
|
||||
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
||||
@@ -303,30 +395,31 @@
|
||||
@@ -305,30 +397,31 @@
|
||||
}
|
||||
|
||||
public void setPlayerFileData(WorldServer worldserver) {
|
||||
@@ -236,7 +236,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,14 +447,15 @@
|
||||
@@ -356,14 +449,15 @@
|
||||
}
|
||||
|
||||
protected void savePlayerFile(EntityPlayer entityplayer) {
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
if (advancementdataplayer != null) {
|
||||
advancementdataplayer.b();
|
||||
@@ -369,10 +463,24 @@
|
||||
@@ -371,10 +465,24 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
this.savePlayerFile(entityplayer);
|
||||
if (entityplayer.isPassenger()) {
|
||||
Entity entity = entityplayer.getRootVehicle();
|
||||
@@ -396,18 +504,66 @@
|
||||
@@ -398,18 +506,66 @@
|
||||
|
||||
if (entityplayer1 == entityplayer) {
|
||||
this.playersByUUID.remove(uuid);
|
||||
@@ -353,7 +353,7 @@
|
||||
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.bans.get(gameprofile);
|
||||
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
|
||||
@@ -415,10 +571,12 @@
|
||||
@@ -417,10 +573,12 @@
|
||||
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(gameprofilebanentry.getExpires())}));
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
IpBanEntry ipbanentry = this.ipBans.get(socketaddress);
|
||||
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
|
||||
@@ -426,13 +584,25 @@
|
||||
@@ -428,13 +586,25 @@
|
||||
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(ipbanentry.getExpires())}));
|
||||
}
|
||||
|
||||
@@ -398,10 +398,10 @@
|
||||
UUID uuid = EntityHuman.a(gameprofile);
|
||||
List<EntityPlayer> list = Lists.newArrayList();
|
||||
|
||||
@@ -459,14 +629,24 @@
|
||||
@@ -461,14 +631,24 @@
|
||||
}
|
||||
|
||||
return new EntityPlayer(this.server, this.server.F(), gameprofile);
|
||||
return new EntityPlayer(this.server, this.server.E(), gameprofile);
|
||||
+ */
|
||||
+ return player;
|
||||
+ // CraftBukkit end
|
||||
@@ -423,9 +423,9 @@
|
||||
WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension());
|
||||
Optional optional;
|
||||
|
||||
@@ -478,6 +658,11 @@
|
||||
@@ -480,6 +660,11 @@
|
||||
|
||||
WorldServer worldserver1 = worldserver != null && optional.isPresent() ? worldserver : this.server.F();
|
||||
WorldServer worldserver1 = worldserver != null && optional.isPresent() ? worldserver : this.server.E();
|
||||
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile());
|
||||
+ // */
|
||||
+ EntityPlayer entityplayer1 = entityplayer;
|
||||
@@ -435,7 +435,7 @@
|
||||
|
||||
entityplayer1.connection = entityplayer.connection;
|
||||
entityplayer1.copyFrom(entityplayer, flag);
|
||||
@@ -493,49 +678,110 @@
|
||||
@@ -495,49 +680,110 @@
|
||||
|
||||
boolean flag2 = false;
|
||||
|
||||
@@ -570,7 +570,7 @@
|
||||
return entityplayer1;
|
||||
}
|
||||
|
||||
@@ -548,7 +794,18 @@
|
||||
@@ -550,7 +796,18 @@
|
||||
|
||||
public void tick() {
|
||||
if (++this.sendAllPlayerInfoIn > 600) {
|
||||
@@ -590,7 +590,7 @@
|
||||
this.sendAllPlayerInfoIn = 0;
|
||||
}
|
||||
|
||||
@@ -565,6 +822,25 @@
|
||||
@@ -567,6 +824,25 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@
|
||||
public void a(Packet<?> packet, ResourceKey<World> resourcekey) {
|
||||
Iterator iterator = this.players.iterator();
|
||||
|
||||
@@ -667,6 +943,7 @@
|
||||
@@ -669,6 +945,7 @@
|
||||
entityplayer.connection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@
|
||||
this.server.getCommandDispatcher().a(entityplayer);
|
||||
}
|
||||
|
||||
@@ -699,6 +976,12 @@
|
||||
@@ -701,6 +978,12 @@
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
|
||||
|
||||
@@ -637,11 +637,11 @@
|
||||
if (entityplayer != entityhuman && entityplayer.level.getDimensionKey() == resourcekey) {
|
||||
double d4 = d0 - entityplayer.locX();
|
||||
double d5 = d1 - entityplayer.locY();
|
||||
@@ -738,23 +1021,34 @@
|
||||
@@ -740,23 +1023,34 @@
|
||||
public void reloadWhitelist() {}
|
||||
|
||||
public void a(EntityPlayer entityplayer, WorldServer worldserver) {
|
||||
- WorldBorder worldborder = this.server.F().getWorldBorder();
|
||||
- WorldBorder worldborder = this.server.E().getWorldBorder();
|
||||
+ WorldBorder worldborder = entityplayer.level.getWorldBorder(); // CraftBukkit
|
||||
|
||||
entityplayer.connection.sendPacket(new ClientboundInitializeBorderPacket(worldborder));
|
||||
@@ -677,7 +677,7 @@
|
||||
}
|
||||
|
||||
public int getPlayerCount() {
|
||||
@@ -805,12 +1099,22 @@
|
||||
@@ -807,12 +1101,22 @@
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
@@ -702,7 +702,7 @@
|
||||
public void sendMessage(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) {
|
||||
this.server.sendMessage(ichatbasecomponent, uuid);
|
||||
Iterator iterator = this.players.iterator();
|
||||
@@ -838,24 +1142,32 @@
|
||||
@@ -840,16 +1144,23 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -727,12 +727,10 @@
|
||||
if (!file1.exists()) {
|
||||
- File file2 = new File(file, entityhuman.getDisplayName().getString() + ".json");
|
||||
+ File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
||||
+ java.nio.file.Path path = file2.toPath();
|
||||
Path path = file2.toPath();
|
||||
|
||||
- if (file2.exists() && file2.isFile()) {
|
||||
+ if (net.minecraft.FileUtils.a(path) && net.minecraft.FileUtils.b(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
||||
file2.renameTo(file1);
|
||||
}
|
||||
if (FileUtils.a(path) && FileUtils.b(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
||||
@@ -858,7 +1169,7 @@
|
||||
}
|
||||
|
||||
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
|
||||
@@ -741,7 +739,7 @@
|
||||
}
|
||||
|
||||
return serverstatisticmanager;
|
||||
@@ -863,14 +1175,14 @@
|
||||
@@ -866,14 +1177,14 @@
|
||||
|
||||
public AdvancementDataPlayer f(EntityPlayer entityplayer) {
|
||||
UUID uuid = entityplayer.getUniqueID();
|
||||
@@ -758,7 +756,7 @@
|
||||
}
|
||||
|
||||
advancementdataplayer.a(entityplayer);
|
||||
@@ -906,13 +1218,20 @@
|
||||
@@ -909,13 +1220,20 @@
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
||||
Reference in New Issue
Block a user