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

More more more more work

Dieser Commit ist enthalten in:
Nassim Jahnke 2022-07-27 23:19:52 +02:00
Ursprung aab40382a5
Commit c7304035b6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
123 geänderte Dateien mit 257 neuen und 265 gelöschten Zeilen

Datei anzeigen

@ -14,7 +14,7 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fda4d570ef04e91c4e6c29c52221c04937dc4fbc..e9999a52a0f54c47e973bc22fa91465e8e993b1c 100644
index fda4d570ef04e91c4e6c29c52221c04937dc4fbc..350128dc1c4c2c1597ad19d8b24193bc94c90d81 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2041,6 +2041,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -29,7 +29,7 @@ index fda4d570ef04e91c4e6c29c52221c04937dc4fbc..e9999a52a0f54c47e973bc22fa91465e
+ Waitable wait = new Waitable() {
+ @Override
+ protected Object evaluate() {
+ chat(fCommandLine, false);
+ chat(fCommandLine, original, false);
+ return null;
+ }
+ };

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7fb4e1cf4eb21dd19a581b082caf9825cdaa4ad9..78662c29e9771ddead43dc243fb5f7d802d6d40d 100644
index 795bd69354dc59ea3fc59daa7239e5e8fa110e8c..4471a220b66cdb055b5e4c32b5d7859685ea4666 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3218,9 +3218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -13,7 +13,7 @@ index 7fb4e1cf4eb21dd19a581b082caf9825cdaa4ad9..78662c29e9771ddead43dc243fb5f7d8
if (this.player.isTextFilteringEnabled()) {
- lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty())); // Paper - adventure
+ lines.add(SharedConstants.filterText(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty()))); // Paper - adventure
+ lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterText(filteredtext.filteredOrEmpty()))); // Paper - adventure
} else {
- lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw())); // Paper - adventure
+ lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterText(filteredtext.raw()))); // Paper - adventure

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7abd31f1f18624cc69262fedb072008d9ff43af1..de2d10a57b8146bd8d039577b8d48889a2c96d93 100644
index acb7c80fa01689098962d170df91aa79c2472dd1..cc1225f7c1e4d47f509c55609066fba084331a4d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1763,6 +1763,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1829,6 +1829,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ItemStack itemstack = this.player.getItemInHand(enumhand);
BlockHitResult movingobjectpositionblock = packet.getHitResult();
Vec3 vec3d = movingobjectpositionblock.getLocation();

Datei anzeigen

@ -272,10 +272,10 @@ index ce4aed84d751a48dcd2a8409190db4a22d78f77b..0a843e0afbcb1af8e2641515eb244b79
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, generatorOptions, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ddb096b0532e50f19d6d81095b1a708ba92b336..c4f76705c0aae300abf8e4c7b06b6db791f14071 100644
index cefa833408ff95890dc5c831276f259022bd95a3..fdf08831a9d1b27c8050432e958f7133f3d10e1e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -543,11 +543,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -545,11 +545,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worlddata = new PrimaryLevelData(worldsettings, generatorsettings, Lifecycle.stable());
}
worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
@ -288,7 +288,7 @@ index 7ddb096b0532e50f19d6d81095b1a708ba92b336..c4f76705c0aae300abf8e4c7b06b6db7
PrimaryLevelData iworlddataserver = worlddata;
WorldGenSettings generatorsettings = worlddata.worldGenSettings();
@@ -562,6 +558,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -564,6 +560,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
}

Datei anzeigen

@ -11,10 +11,10 @@ Tested-by: Mariell Hoversholm <proximyst@proximyst.com>
Reviewed-by: Mariell Hoversholm <proximyst@proximyst.com>
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 91cf0a6b5061bf4731731fdd69beb80fb30c6b51..45598a94524519257c5ffb03800f0b081f4d7a78 100644
index 023c564248adb2c5c4b679be9075ca88cb2d5b62..ca6b12b61874913f6d4abac97a3df67d0053cd8f 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -629,6 +629,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -641,6 +641,11 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
// Spigot Start
public SocketAddress getRawAddress()
{
@ -27,7 +27,7 @@ index 91cf0a6b5061bf4731731fdd69beb80fb30c6b51..45598a94524519257c5ffb03800f0b08
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index f99c616006d49d91922abf5283146bc6f4fb5493..9f3165178e744751343df98568113250578c6d2f 100644
index 2c215e2080f00d6c875fbde92fd2c1c051d0cf98..2d01a1d4b2f7fdd38a6b1022f2476ba68b663171 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -224,6 +224,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -69,10 +69,10 @@ index f99c616006d49d91922abf5283146bc6f4fb5493..9f3165178e744751343df98568113250
DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!");
DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString());
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 076c1d5fb69a4a30b3e412e85b17db09fd9a1def..9e7154c9df96d5a0577886d43a98a73626a8f189 100644
index 83af90fb0dcb4b1a5a68f655cf66d101b472e8e7..b80aedd2002959b4026c27ce76b3ed17f0acfb5b 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -79,7 +79,12 @@ public class ServerConnectionListener {
@@ -80,7 +80,12 @@ public class ServerConnectionListener {
this.running = true;
}
@ -85,7 +85,7 @@ index 076c1d5fb69a4a30b3e412e85b17db09fd9a1def..9e7154c9df96d5a0577886d43a98a736
List list = this.channels;
synchronized (this.channels) {
@@ -87,7 +92,11 @@ public class ServerConnectionListener {
@@ -88,7 +93,11 @@ public class ServerConnectionListener {
LazyLoadedValue lazyinitvar;
if (Epoll.isAvailable() && this.server.isEpollEnabled()) {
@ -97,7 +97,7 @@ index 076c1d5fb69a4a30b3e412e85b17db09fd9a1def..9e7154c9df96d5a0577886d43a98a736
lazyinitvar = ServerConnectionListener.SERVER_EPOLL_EVENT_GROUP;
ServerConnectionListener.LOGGER.info("Using epoll channel type");
} else {
@@ -115,7 +124,7 @@ public class ServerConnectionListener {
@@ -116,7 +125,7 @@ public class ServerConnectionListener {
((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Attributes API for item defaults
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 57b7fedcccbb9a0c1cc56eb6be48a18e2fbadc7f..5345ab40f18437fc60080f9feff4ee0d59a9ed6d 100644
index 44b922c9e6f022c1a9282c0cb686bbd8a8d1c675..c98c5e070349e5c9356a3dec2344a135ad8f0b56 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -545,6 +545,19 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a5199e0a95e1bb85c06de612ed7a54bec215deae..a19be39c5b4552ebfa74634c0cc004f9de0a9eff 100644
index 3bb1fe9e6f5e8f7dc6dc07f83c5b0793760882e8..428272c1cace3a87fbcade90b5f9ee9236532418 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -493,8 +493,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -494,8 +494,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration);
@ -19,7 +19,7 @@ index a5199e0a95e1bb85c06de612ed7a54bec215deae..a19be39c5b4552ebfa74634c0cc004f9
}
@Override
@@ -886,8 +886,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -887,8 +887,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i);
@ -30,7 +30,7 @@ index a5199e0a95e1bb85c06de612ed7a54bec215deae..a19be39c5b4552ebfa74634c0cc004f9
}
this.oThunderLevel = this.thunderLevel;
@@ -953,14 +953,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -954,14 +954,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
private void resetWeatherCycle() {
// CraftBukkit start

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c4f76705c0aae300abf8e4c7b06b6db791f14071..c4a2fd7a2104ad94c4835981b08ebb4ce2529629 100644
index fdf08831a9d1b27c8050432e958f7133f3d10e1e..d605c4355674644e47ea5ea9e979f7806aed1607 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2101,7 +2101,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -57,10 +57,10 @@ index 65637a33ba171a4b598f70cd943d24b0ee44a69f..57a9146bf2dee7a60aab16716e25348f
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a65939065403b6580a 100644
index cc1225f7c1e4d47f509c55609066fba084331a4d..a768e09c5ce6718435b50f1502c5ace773fff470 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -344,7 +344,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -372,7 +372,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@ -69,7 +69,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
} else {
@@ -363,7 +363,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -391,7 +391,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
@ -78,7 +78,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
} else {
@@ -385,7 +385,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -413,7 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@ -87,7 +87,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
} else {
if (elapsedTime >= 15000L) { // 15 seconds
@@ -415,7 +415,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -443,7 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60)) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
@ -96,7 +96,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
this.chatPreviewThrottler.tick();
@@ -441,14 +441,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -469,14 +469,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void disconnect(String s) {
// Paper start
@ -122,8 +122,8 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
// Paper end
// CraftBukkit start - fire PlayerKickEvent
if (this.processedDisconnect) {
@@ -456,7 +464,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
@@ -505,7 +513,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure
- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - Adventure
@ -131,7 +131,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
@@ -533,7 +541,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -575,7 +583,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) {
@ -140,7 +140,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
} else {
Entity entity = this.player.getRootVehicle();
@@ -784,13 +792,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -826,13 +834,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
// CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
@ -156,7 +156,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
// Paper end
@@ -943,7 +951,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -985,7 +993,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start - validate pick item position
if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -165,7 +165,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -1108,7 +1116,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1172,7 +1180,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@ -174,7 +174,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
byteTotal += byteLength;
@@ -1131,14 +1139,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1195,14 +1203,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@ -191,7 +191,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
this.lastBookTick = MinecraftServer.currentTick;
@@ -1260,7 +1268,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1326,7 +1334,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
@ -200,7 +200,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
} else {
ServerLevel worldserver = this.player.getLevel();
@@ -1687,7 +1695,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1753,7 +1761,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@ -209,7 +209,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
}
@@ -1895,7 +1903,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1961,7 +1969,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
@ -218,7 +218,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
@@ -2008,7 +2016,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2074,7 +2082,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.resetLastActionTime();
} else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -227,34 +227,25 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
}
@@ -2021,7 +2029,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2087,7 +2095,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.getMessage())) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
} else {
if (this.tryHandleChat(packet.getMessage(), packet.getTimeStamp())) {
// CraftBukkit start
@@ -2304,7 +2312,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
Waitable waitable = new Waitable() {
@Override
protected Object evaluate() {
- ServerGamePacketListenerImpl.this.disconnect(Component.translatable("disconnect.spam"));
+ ServerGamePacketListenerImpl.this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
return null;
}
};
@@ -2319,7 +2327,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
throw new RuntimeException(e);
}
} else {
- this.disconnect(Component.translatable("disconnect.spam"));
+ this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
}
if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) {
// this.server.submit(() -> { // CraftBukkit - async chat
@@ -2478,7 +2486,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
// CraftBukkit end
- this.disconnect(Component.translatable("disconnect.spam"));
+ this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
}
@@ -2537,7 +2545,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
@@ -2740,7 +2748,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@ -263,7 +254,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
// Spigot End
@@ -2630,7 +2638,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2833,7 +2841,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// CraftBukkit end
} else {
@ -272,7 +263,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
}
@@ -3036,7 +3044,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3241,7 +3249,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -281,7 +272,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
return;
}
}
@@ -3227,7 +3235,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3444,7 +3452,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else if (!this.isSingleplayerOwner()) {
// Paper start - This needs to be handled on the main thread for plugins
server.submit(() -> {
@ -290,7 +281,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
});
// Paper end
}
@@ -3273,7 +3281,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3490,7 +3498,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
@ -299,7 +290,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
} else if (packet.identifier.equals(CUSTOM_UNREGISTER)) {
try {
@@ -3283,7 +3291,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3500,7 +3508,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
@ -308,7 +299,7 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
} else {
try {
@@ -3301,7 +3309,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3518,7 +3526,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
@ -318,10 +309,10 @@ index de2d10a57b8146bd8d039577b8d48889a2c96d93..00f78ce251301217317698a659390654
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a4278a4ca0b41813b8f88d01dcc8d75b4f458908..be163c1cc4c8982b89be86c004299cdcb8ba7387 100644
index 3e8934a141bc8c650549afaef7b4f8b02371f9ab..9dece3470d617be02248f41847ebf77ed083653a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -719,7 +719,7 @@ public abstract class PlayerList {
@@ -723,7 +723,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@ -330,7 +321,7 @@ index a4278a4ca0b41813b8f88d01dcc8d75b4f458908..be163c1cc4c8982b89be86c004299cdc
}
// Instead of kicking then returning, we need to store the kick reason
@@ -1350,8 +1350,8 @@ public abstract class PlayerList {
@@ -1354,8 +1354,8 @@ public abstract class PlayerList {
// Paper end
// CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) {
@ -342,7 +333,7 @@ index a4278a4ca0b41813b8f88d01dcc8d75b4f458908..be163c1cc4c8982b89be86c004299cdc
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8c07b6e92a7329d72ccf1adf9f788322a4e9b28c..3ca8adc4b8cd76b5d2ec827a439cb47564c0b028 100644
index cacadcbffdc9629e693dfea6185009ebca2740f6..8ffef2843d8d4fa6ddfc0fb1403c6eacdafa63a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -516,7 +516,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -14,7 +14,7 @@ contention situations.
And this is extremely a low contention situation.
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index c36de77b3124a519b3f324c5a187337884fe9e28..0c309a2f10ca75dc90076156b2d666deb37f72ba 100644
index 723608946947fa2792c7284fa5faa85ab9507897..e77b516995666402cc8814ac78a6c11077108b2e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -32,14 +32,14 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
@ -84,8 +84,8 @@ index c36de77b3124a519b3f324c5a187337884fe9e28..0c309a2f10ca75dc90076156b2d666de
}
@Override
- public PalettedContainerRO.PackedData<T> pack(IdMap<T> idMap, PalettedContainer.Strategy strategy) {
+ public synchronized PalettedContainerRO.PackedData<T> pack(IdMap<T> idMap, PalettedContainer.Strategy strategy) { // Paper - synchronize
- public PalettedContainerRO.PackedData<T> pack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider) {
+ public synchronized PalettedContainerRO.PackedData<T> pack(IdMap<T> idList, PalettedContainer.Strategy paletteProvider) { // Paper - synchronize
this.acquire();
PalettedContainerRO.PackedData var12;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to fix items merging through walls
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index b491186d66609046016370e56b96e2c09e7d3a32..ae4b251e10babb07055d031ff48ac7dd5d4be4a0 100644
index 7e293167e73238f42fc213ee29d89aa775cf9e60..30c417c3169c1df43662fd77ac6816db64a42802 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -247,6 +247,14 @@ public class ItemEntity extends Entity {
@@ -245,6 +245,14 @@ public class ItemEntity extends Entity {
ItemEntity entityitem = (ItemEntity) iterator.next();
if (entityitem.isMergable()) {

Datei anzeigen

@ -11,7 +11,7 @@ Move the tick logic into the post tick, where portaling was
designed to happen in the first place.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 12d067202cbd861362d782c21c924a5641471b11..7c239cf6a05ac427cbd1bee0ae05709632538bc8 100644
index bfac12f0e89c4c7d48321ea608363518742304af..4888873a5efa026a1082c9f216eecc950b6f2471 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -459,6 +459,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -51,7 +51,7 @@ index 12d067202cbd861362d782c21c924a5641471b11..7c239cf6a05ac427cbd1bee0ae057096
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -2624,6 +2654,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2621,6 +2651,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
this.processPortalCooldown();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 85a0a295ce7739e340ada69e5a970b742dd95004..ca484fdd712a0815fc44521e42550b1529dc3edb 100644
index 644d71c024103c39d7532559c810038d687106e5..2694f7af35deff5c94929350589b2564f7bbdeff 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3481,7 +3481,8 @@ public abstract class LivingEntity extends Entity {
@@ -3484,7 +3484,8 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3c50ec169546a9e6e071e5c54ad3c77eb495f1d8..84501f85bea47056cf16c06ad275dfc9d853351e 100644
index 607a44d2db927e579d8be7c52021d7bb205a379c..6e53214042ab515d9c66fb24f6aa1c07d6c3539d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2207,7 +2207,7 @@ public class ServerPlayer extends Player {
@@ -2196,7 +2196,7 @@ public class ServerPlayer extends Player {
if (retainOwnership) {
if (!itemstack1.isEmpty()) {
@ -18,10 +18,10 @@ index 3c50ec169546a9e6e071e5c54ad3c77eb495f1d8..84501f85bea47056cf16c06ad275dfc9
this.awardStat(Stats.DROP);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 2c65305037583d55fa20783d0f264382467f8c3f..494ecf80d856bb3030aaf3892a5b175d8827aeff 100644
index a6bd94ed379ef1ab0ffe71183aef3cf3061fd092..92a5aadef076cb905962dab86f32d4ff253fef93 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -722,6 +722,11 @@ public abstract class Player extends LivingEntity {
@@ -723,6 +723,11 @@ public abstract class Player extends LivingEntity {
}
double d0 = this.getEyeY() - 0.30000001192092896D;

Datei anzeigen

@ -119,7 +119,7 @@ index 1f3506d38894fea224f3b2f125b45c3b68d705c7..bb2cb17e4e5ce142eeec18951c8948e3
protected boolean shouldDespawnInPeaceful() {
return true;
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index b75c0ff18aa7adb673fbb2b5ada7775dd8ac1e29..05cf30e6572c9bb7e11d71de1cd79df987bf062a 100644
index e93a2634cd80cd4f1caf6bd60e569783bc6b577c..fb0a77b4cf1ba47c73c00993bd9b7454240fe5d6 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -197,6 +197,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 00f78ce251301217317698a65939065403b6580a..9331bd6d74feea033ce78a3a708ceaa0042f00e1 100644
index a768e09c5ce6718435b50f1502c5ace773fff470..dfe1966bfb30b3d2e60e6b88d0a7c2331b02e9a4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1146,7 +1146,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1210,7 +1210,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper end
// CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {

Datei anzeigen

@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a19be39c5b4552ebfa74634c0cc004f9de0a9eff..8c61dc53f4874ab7013938abdf5d65a608369474 100644
index 428272c1cace3a87fbcade90b5f9ee9236532418..4bebe9bc9dea53d57543e65d7300f50b0f907017 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,7 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -222,7 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
@ -20,7 +20,7 @@ index a19be39c5b4552ebfa74634c0cc004f9de0a9eff..8c61dc53f4874ab7013938abdf5d65a6
}
@Override
@@ -1436,7 +1436,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1437,7 +1437,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (int l1 = j; l1 <= i1; ++l1) {
for (int i2 = l; i2 <= k1; ++i2) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9331bd6d74feea033ce78a3a708ceaa0042f00e1..d44a60ba363b2e24e96c72dc950c6a4a0959b307 100644
index dfe1966bfb30b3d2e60e6b88d0a7c2331b02e9a4..4d3874b5f44d0162e245a73b5543c9f2cc75c9ce 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2437,7 +2437,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2617,7 +2617,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Arm swing animation

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fixes kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 84501f85bea47056cf16c06ad275dfc9d853351e..1c745fe2c1ef75a1270108d1a88d6c220bd1643a 100644
index 6e53214042ab515d9c66fb24f6aa1c07d6c3539d..7670c02dca163d360e64a1491f2efe69aaaab411 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -259,7 +259,6 @@ public class ServerPlayer extends Player {
@@ -260,7 +260,6 @@ public class ServerPlayer extends Player {
public boolean supressTrackerForLogin = false; // Paper
public boolean didPlayerJoinEvent = false; // Paper
public Integer clientViewDistance;
@ -17,10 +17,10 @@ index 84501f85bea47056cf16c06ad275dfc9d853351e..1c745fe2c1ef75a1270108d1a88d6c22
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d44a60ba363b2e24e96c72dc950c6a4a0959b307..8d7da9affb98f3d660e049685139a6e53cc0faa1 100644
index 4d3874b5f44d0162e245a73b5543c9f2cc75c9ce..e1993c9f08b73e4366f60369e7f147c9c8bda958 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -474,7 +474,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -523,7 +523,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Do not kick the player
return;
}
@ -28,16 +28,16 @@ index d44a60ba363b2e24e96c72dc950c6a4a0959b307..8d7da9affb98f3d660e049685139a6e5
// Send the possibly modified leave message
final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure
// CraftBukkit end
@@ -483,7 +482,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
@@ -532,7 +531,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> {
this.connection.disconnect(ichatbasecomponent);
});
}));
- this.onDisconnect(ichatbasecomponent); // CraftBukkit - fire quit instantly
+ this.onDisconnect(ichatbasecomponent, event.leaveMessage()); // CraftBukkit - fire quit instantly // Paper - use kick event leave message
this.connection.setReadOnly();
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
@@ -1928,6 +1927,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1994,6 +1993,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void onDisconnect(Component reason) {
@ -49,20 +49,20 @@ index d44a60ba363b2e24e96c72dc950c6a4a0959b307..8d7da9affb98f3d660e049685139a6e5
// CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) {
return;
@@ -1944,7 +1948,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2010,7 +2014,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.disconnect();
// Paper start - Adventure
- net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().remove(this.player);
+ quitMessage = quitMessage == null ? this.server.getPlayerList().remove(this.player) : this.server.getPlayerList().remove(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used
if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM);
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index be163c1cc4c8982b89be86c004299cdcb8ba7387..56c9dc2bf76204cd40775d9f47a9ba20919bc04f 100644
index 9dece3470d617be02248f41847ebf77ed083653a..1a48a03e70b282847dba1da796e5b8211debb603 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -591,6 +591,11 @@ public abstract class PlayerList {
@@ -595,6 +595,11 @@ public abstract class PlayerList {
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // Paper - return Component
@ -74,7 +74,7 @@ index be163c1cc4c8982b89be86c004299cdcb8ba7387..56c9dc2bf76204cd40775d9f47a9ba20
ServerLevel worldserver = entityplayer.getLevel();
entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -601,7 +606,7 @@ public abstract class PlayerList {
@@ -605,7 +610,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add config for mobs immune to default effects
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ca484fdd712a0815fc44521e42550b1529dc3edb..7f39a4955b4819e8a908f4cbf951d707c34fa4a8 100644
index 2694f7af35deff5c94929350589b2564f7bbdeff..b0f38933d25397773ac8668f9d1e759d6b43884d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1153,7 +1153,7 @@ public abstract class LivingEntity extends Entity {

Datei anzeigen

@ -11,10 +11,10 @@ It does not make a lot of sense to damage players if they get crammed,
For those who really want it a config option is provided.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 1c745fe2c1ef75a1270108d1a88d6c220bd1643a..99bac7e1975559165653df973e6eef79450b1254 100644
index 7670c02dca163d360e64a1491f2efe69aaaab411..f523311e822af9cbef571338fd8fef177b9fc73d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1448,7 +1448,7 @@ public class ServerPlayer extends Player {
@@ -1446,7 +1446,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Improve boat collision performance
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 67567eb58beddc06eae4d8e7af3b3c0962405512..206c6ce227ba19620185ac835af28d67caa76c40 100644
index 4fce18c52c8144460ebf0c1e336dce712d796cc6..384ddb03af26ae360fd22e2e231d9d14d6ad0865 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -110,6 +110,7 @@ public class Util {
@@ -112,6 +112,7 @@ public class Util {
}).findFirst().orElseThrow(() -> {
return new IllegalStateException("No jar file system provider found");
});
@ -17,7 +17,7 @@ index 67567eb58beddc06eae4d8e7af3b3c0962405512..206c6ce227ba19620185ac835af28d67
};
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7f39a4955b4819e8a908f4cbf951d707c34fa4a8..b6af4e6b146cc6ceb769a0d1e0d253f0b0f844d2 100644
index b0f38933d25397773ac8668f9d1e759d6b43884d..bc01742e3e762fbb5b7eb712a9211e4a8d411e03 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1341,7 +1341,7 @@ public abstract class LivingEntity extends Entity {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent AFK kick while watching end credits.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8d7da9affb98f3d660e049685139a6e53cc0faa1..6ec86b033063066b231462b75c4b1190cc452cdd 100644
index e1993c9f08b73e4366f60369e7f147c9c8bda958..e8cd8adad14c6bcab3ccef7fcc458b38d90592c3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -413,7 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -441,7 +441,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
--this.dropSpamTickCount;
}

Datei anzeigen

@ -32,10 +32,10 @@ index ce1c7512cc368e196ae94ee22c6a228c975b4980..1e41de9523c5fa3b9cfced798a5c35a2
String string = resourceKey.location().toString();
if (targets.size() == 1) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 99bac7e1975559165653df973e6eef79450b1254..2e205bd42101889097c08a1ffa1103c3e838240c 100644
index f523311e822af9cbef571338fd8fef177b9fc73d..ec713ffb7c4cba53dc983ebde5596e4749107493 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1289,7 +1289,7 @@ public class ServerPlayer extends Player {
@@ -1287,7 +1287,7 @@ public class ServerPlayer extends Player {
} else if (this.bedBlocked(blockposition, enumdirection)) {
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
} else {
@ -44,7 +44,7 @@ index 99bac7e1975559165653df973e6eef79450b1254..2e205bd42101889097c08a1ffa1103c3
if (this.level.isDay()) {
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
@@ -2134,12 +2134,33 @@ public class ServerPlayer extends Player {
@@ -2123,12 +2123,33 @@ public class ServerPlayer extends Player {
return this.respawnForced;
}
@ -80,7 +80,7 @@ index 99bac7e1975559165653df973e6eef79450b1254..2e205bd42101889097c08a1ffa1103c3
}
this.respawnPosition = pos;
@@ -2153,6 +2174,7 @@ public class ServerPlayer extends Player {
@@ -2142,6 +2163,7 @@ public class ServerPlayer extends Player {
this.respawnForced = false;
}
@ -89,10 +89,10 @@ index 99bac7e1975559165653df973e6eef79450b1254..2e205bd42101889097c08a1ffa1103c3
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 56c9dc2bf76204cd40775d9f47a9ba20919bc04f..bf2888b678567ace5959d989e5dd119c65a9500d 100644
index 1a48a03e70b282847dba1da796e5b8211debb603..dda357b4f52030435c012f10b11f1ccb3f6688be 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -895,13 +895,13 @@ public abstract class PlayerList {
@@ -899,13 +899,13 @@ public abstract class PlayerList {
f1 = (float) Mth.wrapDegrees(Mth.atan2(vec3d1.z, vec3d1.x) * 57.2957763671875D - 90.0D);
}
@ -129,7 +129,7 @@ index c3e49a781f838e6a46cb89744f3f1846de182275..c2f3d3a09327e7cb7d3167609eb3ce68
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3ca8adc4b8cd76b5d2ec827a439cb47564c0b028..89d30891defdf3b1ee71f31e7fd06a87e13a25d2 100644
index 8ffef2843d8d4fa6ddfc0fb1403c6eacdafa63a9..0d7da68faa8c3401dcc12c67ae9edd977c436e55 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1204,9 +1204,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Added EntityDamageItemEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 494a39cfafa5a632ccb61b196b0ec4e5772aa180..c8943bbd72d7ea12298af710d465983cdaa394e8 100644
index b4ad1610d30396be344a04f5f3a565ae2b8f2265..5c987e863a6ef257caebf8321fa3048dfc7a93c5 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -547,7 +547,7 @@ public final class ItemStack {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7c239cf6a05ac427cbd1bee0ae05709632538bc8..b756f333d8a016d277bc8a2767d7639b7ab12d36 100644
index 4888873a5efa026a1082c9f216eecc950b6f2471..460b51374e41c3d88e1c3641fb9f2f0205399b54 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3599,26 +3599,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3596,26 +3596,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
private Stream<Entity> getIndirectPassengersStream() {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Fix block drops position losing precision millions of blocks
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index d63c320051b9d58c3503d268c7913673679c79dd..718c67c630f7799c20df9850d9c2056a7218c220 100644
index cb11cef117fc896ddcb40993ddb852a2e717c2ad..2db7b9f145b53df5ef79ae235a0de7ccff50db7e 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -346,9 +346,11 @@ public class Block extends BlockBehaviour implements ItemLike {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockBreakBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 718c67c630f7799c20df9850d9c2056a7218c220..224ce424b9a22548212ac157ec273c6dd80d6cfb 100644
index 2db7b9f145b53df5ef79ae235a0de7ccff50db7e..2e65b44f10aeb44fd524a58e7eb815a566c1ad61 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -333,6 +333,23 @@ public class Block extends BlockBehaviour implements ItemLike {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b756f333d8a016d277bc8a2767d7639b7ab12d36..9b2445319daa55a7e818d8ee3985a3101254a097 100644
index 460b51374e41c3d88e1c3641fb9f2f0205399b54..3f4436a2257376f604926ff35c8589ba59c859e2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3101,6 +3101,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3098,6 +3098,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} else {
// CraftBukkit start
worldserver = shapedetectorshape.world;
@ -32,7 +32,7 @@ index b756f333d8a016d277bc8a2767d7639b7ab12d36..9b2445319daa55a7e818d8ee3985a310
if (worldserver == this.level) {
// SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in
this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot);
@@ -3120,8 +3137,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3117,8 +3134,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (entity != null) {
entity.restoreFrom(this);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8c61dc53f4874ab7013938abdf5d65a608369474..9b9653e2a88e63932884cfd392ac372a1b0da12b 100644
index 4bebe9bc9dea53d57543e65d7300f50b0f907017..8c95d537c7bf5cc9b63f0e412c9ad67f5e6fe51e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -775,6 +775,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -776,6 +776,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
protected BlockPos findLightningTargetAround(BlockPos pos) {
@ -20,7 +20,7 @@ index 8c61dc53f4874ab7013938abdf5d65a608369474..9b9653e2a88e63932884cfd392ac372a
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
Optional<BlockPos> optional = this.findLightningRod(blockposition1);
@@ -789,6 +794,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -790,6 +795,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!list.isEmpty()) {
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
} else {

Datei anzeigen

@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..4ecba0b02c2813a890aecc5586987879
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 5345ab40f18437fc60080f9feff4ee0d59a9ed6d..23c0a1cbff74067bb1700ec443f14ee441085b3c 100644
index c98c5e070349e5c9356a3dec2344a135ad8f0b56..7e024b0f0a5201b4e9e7fcd7a160b146d7f12b52 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -562,6 +562,18 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -29,10 +29,10 @@ index 752f9f11227a47b7bed675b93e95af89c6732f63..67bce77093dcc126098731047447da20
public static DamageSource sting(LivingEntity attacker) {
return new EntityDamageSource("sting", attacker);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 494ecf80d856bb3030aaf3892a5b175d8827aeff..d6458ad451c9c7665f5ff0101962af4469029e2c 100644
index 92a5aadef076cb905962dab86f32d4ff253fef93..5451b1d61ae2ee4fa461c2a334bfe8f794868030 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1273,7 +1273,7 @@ public abstract class Player extends LivingEntity {
@@ -1274,7 +1274,7 @@ public abstract class Player extends LivingEntity {
flag1 = true;
}
@ -41,7 +41,7 @@ index 494ecf80d856bb3030aaf3892a5b175d8827aeff..d6458ad451c9c7665f5ff0101962af44
flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper
flag2 = flag2 && !this.isSprinting();
@@ -1313,7 +1313,7 @@ public abstract class Player extends LivingEntity {
@@ -1314,7 +1314,7 @@ public abstract class Player extends LivingEntity {
}
Vec3 vec3d = target.getDeltaMovement();
@ -50,7 +50,7 @@ index 494ecf80d856bb3030aaf3892a5b175d8827aeff..d6458ad451c9c7665f5ff0101962af44
if (flag5) {
if (i > 0) {
@@ -1341,7 +1341,7 @@ public abstract class Player extends LivingEntity {
@@ -1342,7 +1342,7 @@ public abstract class Player extends LivingEntity {
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
// CraftBukkit start - Only apply knockback if the damage hits

Datei anzeigen

@ -37,7 +37,7 @@ index 7b9e943b391c061782fccd2b8d705ceec8db50fe..966ac60daebb7bb211ab8096fc0c5f33
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 23c0a1cbff74067bb1700ec443f14ee441085b3c..142451a2aa0ba9e9eae6e62294e2cbdfd5361ca2 100644
index 7e024b0f0a5201b4e9e7fcd7a160b146d7f12b52..c3ac503bd2c04a94bc3c172b2c6bfe1308da29aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -574,6 +574,12 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9b2445319daa55a7e818d8ee3985a3101254a097..e8d9f41334e0de72672f01276fe86568f7528d89 100644
index 3f4436a2257376f604926ff35c8589ba59c859e2..6f3147713b5bec3b2771e1ec52917fd4aee681bc 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1926,6 +1926,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1921,6 +1921,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}
@ -45,7 +45,7 @@ index b8e5205c165bcba5b8383334f3d0d1daf9d0a8cd..ff8562821ebb363c755e9d316679226d
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 142451a2aa0ba9e9eae6e62294e2cbdfd5361ca2..e8787c6d674178be3beadf3391e77948d9460b0c 100644
index c3ac503bd2c04a94bc3c172b2c6bfe1308da29aa..1f491d48b591281e3a054c33683ac4cf76ada802 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -457,6 +457,30 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -30,10 +30,10 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..f875507241ac6769545e91cd3285232b
private RedirectModifier<S> modifier = null;
private boolean forks;
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index f34e8f5b6837473b5aef96fea89ec7564a86f430..af00f7dcbc1c4fb8da25128d5603b3ef041db7da 100644
index edf980cf8992ddfe003ced279fe1324fc2364e5a..e70e5af7e49e4ccf332d9ce44e1a106344b35490 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -210,7 +210,13 @@ public class Commands {
@@ -213,7 +213,13 @@ public class Commands {
if (environment.includeIntegrated) {
PublishCommand.register(this.dispatcher);
}

Datei anzeigen

@ -10,10 +10,10 @@ schedules. Effectively, use the callback executor as a tool of
finding issues rather than hiding these issues.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 13c4bfa296c854b5dbbffc495a029c6822131529..ddfb27d71ad6472760ac23fd31cf10780408525b 100644
index b659a058a0b6eb6b1827aacbd703e15fcbb1609c..2418f1c0dc050d224bb866e62f414a55900d9652 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -168,17 +168,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -165,17 +165,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable {

Datei anzeigen

@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9b9653e2a88e63932884cfd392ac372a1b0da12b..9d871a9dfeca169db3b598fe2ad5a23bfc88dd6f 100644
index 8c95d537c7bf5cc9b63f0e412c9ad67f5e6fe51e..2634eba0537648c0e013455e813e25897ea71ff0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1333,9 +1333,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1334,9 +1334,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
@ -28,10 +28,10 @@ index 9b9653e2a88e63932884cfd392ac372a1b0da12b..9d871a9dfeca169db3b598fe2ad5a23b
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2e205bd42101889097c08a1ffa1103c3e838240c..c5f0bb56844f54ac7a5f248e1d05f9609847ca56 100644
index ec713ffb7c4cba53dc983ebde5596e4749107493..62f2c9645a3bf5b2bfd9fe99d3e6ec08c7dafa9a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1590,6 +1590,18 @@ public class ServerPlayer extends Player {
@@ -1588,6 +1588,18 @@ public class ServerPlayer extends Player {
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
this.doCloseContainer();
}
@ -51,10 +51,10 @@ index 2e205bd42101889097c08a1ffa1103c3e838240c..c5f0bb56844f54ac7a5f248e1d05f960
public void doCloseContainer() {
this.containerMenu.removed(this);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index d6458ad451c9c7665f5ff0101962af4469029e2c..cd9cbfa5ef94994b3f7f2ecdde843620e7e6c071 100644
index 5451b1d61ae2ee4fa461c2a334bfe8f794868030..9b131f0a827413e9f5d6d0f7491c5481576cb8b1 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -505,6 +505,11 @@ public abstract class Player extends LivingEntity {
@@ -506,6 +506,11 @@ public abstract class Player extends LivingEntity {
this.containerMenu = this.inventoryMenu;
}
// Paper end

Datei anzeigen

@ -7,7 +7,7 @@ Separate lookup and state access locks prevent lookups
from stalling simple state access/write calls
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 2347c7b44793aabe431b57bb1b44935fefbda6fe..4dff88bdf14675718572e4b3720c0250ce6e730e 100644
index 5e3bc0590e59770490b1c6c818d99be054214a8a..84bdf4a849b09a90da6c22f4080386e85a53f6b3 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -62,6 +62,11 @@ public class GameProfileCache {

Datei anzeigen

@ -10,10 +10,10 @@ chunk future to complete. We can simply schedule to the immediate
executor to get this effect, rather than the main mailbox.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ddfb27d71ad6472760ac23fd31cf10780408525b..da22b189483075b4439538dbfd6185001ca41e64 100644
index 2418f1c0dc050d224bb866e62f414a55900d9652..f29d77572a3cd977fc492ada8ffc8b77467fabc5 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1331,9 +1331,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1328,9 +1328,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunk;
});

Datei anzeigen

@ -8,10 +8,10 @@ Sync loading the chunk at this stage would cause it to load
older data, as well as screwing our region state.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index da22b189483075b4439538dbfd6185001ca41e64..d9d9f2c6bf56a89ba92856caadf9f52bc9f5d931 100644
index f29d77572a3cd977fc492ada8ffc8b77467fabc5..ae0d7295c88005749f13dd230136f4a39d0a578e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -317,6 +317,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -314,6 +314,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// Paper end
@ -19,7 +19,7 @@ index da22b189483075b4439538dbfd6185001ca41e64..d9d9f2c6bf56a89ba92856caadf9f52b
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone();
@@ -728,6 +729,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -725,6 +726,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
ChunkHolder updateChunkScheduling(long pos, int level, @Nullable ChunkHolder holder, int k) {
@ -27,7 +27,7 @@ index da22b189483075b4439538dbfd6185001ca41e64..d9d9f2c6bf56a89ba92856caadf9f52b
if (k > ChunkMap.MAX_CHUNK_DISTANCE && level > ChunkMap.MAX_CHUNK_DISTANCE) {
return holder;
} else {
@@ -931,6 +933,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -928,6 +930,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder);
} else {
@ -40,7 +40,7 @@ index da22b189483075b4439538dbfd6185001ca41e64..d9d9f2c6bf56a89ba92856caadf9f52b
// Paper start
boolean removed;
if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) {
@@ -968,6 +976,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -965,6 +973,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
}
} // Paper end

Datei anzeigen

@ -9,10 +9,10 @@ This patch will be used to optimise out flush calls in later
patches.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 45598a94524519257c5ffb03800f0b081f4d7a78..0ace0209dd21b708ccf5afa7ef3f53d9dea8d521 100644
index ca6b12b61874913f6d4abac97a3df67d0053cd8f..2195024a7b2626f4e6844db56071130226cf1364 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -103,6 +103,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -99,6 +99,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
public ConnectionProtocol protocol;
// Paper end
@ -52,23 +52,23 @@ index 45598a94524519257c5ffb03800f0b081f4d7a78..0ace0209dd21b708ccf5afa7ef3f53d9
public Connection(PacketFlow side) {
this.receiving = side;
}
@@ -268,7 +301,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -264,7 +297,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() &&
(packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty())
))) {
- this.sendPacket(packet, callback);
+ this.writePacket(packet, callback, null); // Paper
- this.sendPacket(packet, packetsendlistener);
+ this.sendPacket(packet, packetsendlistener, null); // Paper
return;
}
// write the packets to the queue, then flush - antixray hooks there already
@@ -292,6 +325,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -288,6 +321,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
private void sendPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback) {
private void sendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) {
+ // Paper start - add flush parameter
+ this.writePacket(packet, callback, Boolean.TRUE);
+ this.sendPacket(packet, packetsendlistener, Boolean.TRUE);
+ }
+ private void writePacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback, Boolean flushConditional) {
+ private void sendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, Boolean flushConditional) {
+ this.packetWrites.getAndIncrement(); // must be befeore using canFlush
+ boolean effectiveFlush = flushConditional == null ? this.canFlush : flushConditional.booleanValue();
+ final boolean flush = effectiveFlush || packet instanceof net.minecraft.network.protocol.game.ClientboundKeepAlivePacket || packet instanceof ClientboundDisconnectPacket; // no delay for certain packets
@ -76,40 +76,40 @@ index 45598a94524519257c5ffb03800f0b081f4d7a78..0ace0209dd21b708ccf5afa7ef3f53d9
ConnectionProtocol enumprotocol = ConnectionProtocol.getProtocolForPacket(packet);
ConnectionProtocol enumprotocol1 = this.getCurrentProtocol();
@@ -302,16 +343,21 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -298,16 +339,21 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
if (this.channel.eventLoop().inEventLoop()) {
- this.doSendPacket(packet, callback, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, callback, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter
- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter
} else {
this.channel.eventLoop().execute(() -> {
- this.doSendPacket(packet, callback, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, callback, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter
- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter
});
}
}
private void doSendPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback, ConnectionProtocol packetState, ConnectionProtocol currentState) {
private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, ConnectionProtocol packetState, ConnectionProtocol currentState) {
+ // Paper start - add flush parameter
+ this.doSendPacket(packet, callback, packetState, currentState, true);
+ this.doSendPacket(packet, packetsendlistener, packetState, currentState, true);
+ }
+ private void doSendPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback, ConnectionProtocol packetState, ConnectionProtocol currentState, boolean flush) {
+ private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, ConnectionProtocol packetState, ConnectionProtocol currentState, boolean flush) {
+ // Paper end - add flush parameter
if (packetState != currentState) {
this.setProtocol(packetState);
}
@@ -325,7 +371,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -321,7 +367,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
try {
// Paper end
- ChannelFuture channelfuture = this.channel.writeAndFlush(packet);
+ ChannelFuture channelfuture = flush ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Paper - add flush parameter
if (callback != null) {
channelfuture.addListener(callback);
@@ -367,6 +413,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (packetsendlistener != null) {
channelfuture.addListener((future) -> {
@@ -376,6 +422,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
private boolean processQueue() {
if (this.queue.isEmpty()) return true;
@ -120,7 +120,7 @@ index 45598a94524519257c5ffb03800f0b081f4d7a78..0ace0209dd21b708ccf5afa7ef3f53d9
// If we are on main, we are safe here in that nothing else should be processing queue off main anymore
// But if we are not on main due to login/status, the parent is synchronized on packetQueue
java.util.Iterator<PacketHolder> iterator = this.queue.iterator();
@@ -374,16 +424,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -383,16 +433,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
PacketHolder queued = iterator.next(); // poll -> peek
// Fix NPE (Spigot bug caused by handleDisconnection())

Datei anzeigen

@ -914,10 +914,10 @@ index 0000000000000000000000000000000000000000..3ba094e640d7fe7803e2bbdab8ff3beb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9d871a9dfeca169db3b598fe2ad5a23bfc88dd6f..dc00bbc9642c9c112f930e669e84c11de7375414 100644
index 2634eba0537648c0e013455e813e25897ea71ff0..306e40f7fa6435cfb3c2da7382daf71a51b58e18 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -449,7 +449,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -450,7 +450,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
DataFixer datafixer = minecraftserver.getFixerUpper();
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);
@ -927,10 +927,10 @@ index 9d871a9dfeca169db3b598fe2ad5a23bfc88dd6f..dc00bbc9642c9c112f930e669e84c11d
int j = this.spigotConfig.viewDistance; // Spigot
int k = this.spigotConfig.simulationDistance; // Spigot
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index ba3023c7dd5b3bcf66f829fe5dc9757f96d16b45..05ff7bcc79e617904903cf082f6687d24e587547 100644
index 32d6e4b194c3c4eca7009059f8d185896b5ae556..51d3150e732f95be13f5f54d994dab1fa89ed3f2 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -497,4 +497,21 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -498,4 +498,21 @@ public class WorldGenRegion implements WorldGenLevel {
public long nextSubTickCount() {
return this.subTickCount.getAndIncrement();
}
@ -953,7 +953,7 @@ index ba3023c7dd5b3bcf66f829fe5dc9757f96d16b45..05ff7bcc79e617904903cf082f6687d2
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e8d9f41334e0de72672f01276fe86568f7528d89..43bbf654d97bbf4009e5ea59c756926a05089f68 100644
index 6f3147713b5bec3b2771e1ec52917fd4aee681bc..9567822f314cd3978ed63bb867e57b610d76228e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -490,6 +490,56 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -1013,7 +1013,7 @@ index e8d9f41334e0de72672f01276fe86568f7528d89..43bbf654d97bbf4009e5ea59c756926a
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
this.passengers = ImmutableList.of();
@@ -2361,11 +2411,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2358,11 +2408,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return InteractionResult.PASS;
}

Datei anzeigen

@ -70,10 +70,10 @@ index b75b3c4d274252a3a5c53059b9702728eeada389..8bea90cb57f38f33e8b3162e24e35399
int i = 0;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d9d9f2c6bf56a89ba92856caadf9f52bc9f5d931..0110a63e96a22bc179f5e2451d5c67927fd10ee5 100644
index ae0d7295c88005749f13dd230136f4a39d0a578e..1bbb15354e457a6056d380f9ef318a4661f460e3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -163,6 +163,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -160,6 +160,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private final Queue<Runnable> unloadQueue;
int viewDistance;
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobDistanceMap; // Paper

Datei anzeigen

@ -19,7 +19,7 @@ index 23e564b05ba438924180c91f9b19a60731eedd1b..5ec241d49ff5e3a161a39006f05823a5
private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c4a2fd7a2104ad94c4835981b08ebb4ce2529629..ec269017109b062db6f73702f36319829c8feaf6 100644
index d605c4355674644e47ea5ea9e979f7806aed1607..421872f7cc1a3cbb4dc596d0e0fa0f9b63602a8a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1303,6 +1303,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -30,7 +30,7 @@ index c4a2fd7a2104ad94c4835981b08ebb4ce2529629..ec269017109b062db6f73702f3631982
return true;
} else {
if (this.haveTime()) {
@@ -2641,4 +2642,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2665,4 +2666,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end
@ -126,10 +126,10 @@ index 438406936633b9c67d21b26527c3d1654118c744..2de322ffc2eedae9efe39f9b771c447d
}
// Paper start - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index dc00bbc9642c9c112f930e669e84c11de7375414..a82c81f8a4178fc049ffaa2e5a837836ef5b42a6 100644
index 306e40f7fa6435cfb3c2da7382daf71a51b58e18..53105ca96f5056adbba6a97ac428587e7c3b683a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -210,6 +210,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -211,6 +211,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final StructureManager structureManager;
private final StructureCheck structureCheck;
private final boolean tickTime;
@ -137,7 +137,7 @@ index dc00bbc9642c9c112f930e669e84c11de7375414..a82c81f8a4178fc049ffaa2e5a837836
// CraftBukkit start
public final LevelStorageSource.LevelStorageAccess convertable;
@@ -986,6 +987,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -987,6 +988,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (fluid1.is(fluid)) {
fluid1.tick(this, pos);
}
@ -145,7 +145,7 @@ index dc00bbc9642c9c112f930e669e84c11de7375414..a82c81f8a4178fc049ffaa2e5a837836
}
@@ -995,6 +997,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -996,6 +998,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (iblockdata.is(block)) {
iblockdata.tick(this, pos, this.random);
}

Datei anzeigen

@ -35,10 +35,10 @@ index 613988c9ea892ab15516e1c8b4f376d52415ae34..1eb71004a19866590a3d27fa6e728429
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
List<ServerPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b16543621 100644
index 1bbb15354e457a6056d380f9ef318a4661f460e3..b3dc2e71230304ab42b9dd935025f0bd3117bd01 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -126,9 +126,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -123,9 +123,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private static final int MIN_VIEW_DISTANCE = 3;
public static final int MAX_VIEW_DISTANCE = 33;
public static final int MAX_CHUNK_DISTANCE = 33 + ChunkStatus.maxDistance();
@ -52,7 +52,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
private final Long2ObjectLinkedOpenHashMap<ChunkHolder> pendingUnloads;
public final LongSet entitiesInLevel;
public final ServerLevel level;
@@ -321,7 +323,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -318,7 +320,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
boolean unloadingPlayerChunk = false; // Paper - do not allow ticket level changes while unloading chunks
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
@ -61,7 +61,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
this.pendingUnloads = new Long2ObjectLinkedOpenHashMap();
this.entitiesInLevel = new LongOpenHashSet();
this.toDrop = new LongOpenHashSet();
@@ -562,12 +564,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -559,12 +561,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
public ChunkHolder getUpdatingChunkIfPresent(long pos) {
@ -81,7 +81,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
}
protected IntSupplier getChunkQueueLevel(long pos) {
@@ -707,9 +714,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -704,9 +711,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
stringbuilder.append("Updating:").append(System.lineSeparator());
@ -93,7 +93,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading");
@@ -760,7 +767,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -757,7 +764,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
}
@ -102,7 +102,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
this.modified = true;
}
@@ -840,7 +847,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -837,7 +844,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void saveAllChunks(boolean flush) {
if (flush) {
@ -111,7 +111,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
MutableBoolean mutableboolean = new MutableBoolean();
do {
@@ -871,7 +878,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -868,7 +875,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
//this.flushWorker(); // Paper - nuke IOWorker
this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour
} else {
@ -120,7 +120,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
}
}
@@ -894,14 +901,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -891,14 +898,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public boolean hasWork() {
@ -137,7 +137,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
if (playerchunk != null) {
playerchunk.onChunkRemove(); // Paper
@@ -996,7 +1003,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -993,7 +1000,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!this.modified) {
return false;
} else {
@ -151,7 +151,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
this.modified = false;
return true;
}
@@ -1496,7 +1508,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1493,7 +1505,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.viewDistance = j;
this.distanceManager.updatePlayerTickets(this.viewDistance + 1);
@ -160,7 +160,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
while (objectiterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) objectiterator.next();
@@ -1539,7 +1551,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1536,7 +1548,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public int size() {
@ -169,7 +169,7 @@ index 0110a63e96a22bc179f5e2451d5c67927fd10ee5..f5b22082aabc30235ca0c1633273e15b
}
public DistanceManager getDistanceManager() {
@@ -1547,13 +1559,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1544,13 +1556,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected Iterable<ChunkHolder> getChunks() {

Datei anzeigen

@ -7,18 +7,19 @@ Subject: [PATCH] Detail more information in watchdog dumps
- Dump player name, player uuid, position, and world for packet handling
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 0ace0209dd21b708ccf5afa7ef3f53d9dea8d521..363829a3bce2803e234ff81ae4b0cba3072fd5f9 100644
index 2195024a7b2626f4e6844db56071130226cf1364..92b36499c7b655b1b7d866fe116486962aef1803 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -465,7 +465,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
@@ -475,9 +475,15 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
PacketListener packetlistener = this.packetListener;
if (this.packetListener instanceof ServerGamePacketListenerImpl) {
if (packetlistener instanceof TickablePacketListener) {
+ // Paper start - detailed watchdog information
+ net.minecraft.network.protocol.PacketUtils.packetProcessing.push(this.packetListener);
+ try {
+ // Paper end - detailed watchdog information
((ServerGamePacketListenerImpl) this.packetListener).tick();
+ try { // Paper end - detailed watchdog information
TickablePacketListener tickablepacketlistener = (TickablePacketListener) packetlistener;
tickablepacketlistener.tick();
+ } finally { // Paper start - detailed watchdog information
+ net.minecraft.network.protocol.PacketUtils.packetProcessing.pop();
+ } // Paper start - detailed watchdog information
@ -77,10 +78,10 @@ index a34f22cadc09e53ea4de787b04d050b99dddbcac..c8012de68b997d6270ba4a5d79bc93c0
});
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a82c81f8a4178fc049ffaa2e5a837836ef5b42a6..9ab6f7df04b56012413f2485dd5a8785f95390dc 100644
index 53105ca96f5056adbba6a97ac428587e7c3b683a..a9b23308c89aef277394821cb883540a0c9e7056 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1001,7 +1001,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1002,7 +1002,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@ -107,7 +108,7 @@ index a82c81f8a4178fc049ffaa2e5a837836ef5b42a6..9ab6f7df04b56012413f2485dd5a8785
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
@@ -1041,7 +1060,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1042,7 +1061,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
// } finally { timer.stopTiming(); } // Paper - timings - move up
@ -123,7 +124,7 @@ index a82c81f8a4178fc049ffaa2e5a837836ef5b42a6..9ab6f7df04b56012413f2485dd5a8785
private void tickPassenger(Entity vehicle, Entity passenger) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 43bbf654d97bbf4009e5ea59c756926a05089f68..a325b145be3efda4c3521871c6b1cffddbd68c00 100644
index 9567822f314cd3978ed63bb867e57b610d76228e..37123198bdf0188f59f289a31570663938fdc3c1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -971,7 +971,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -183,7 +184,7 @@ index 43bbf654d97bbf4009e5ea59c756926a05089f68..a325b145be3efda4c3521871c6b1cffd
}
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) {
@@ -3951,7 +3993,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3948,7 +3990,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public void setDeltaMovement(Vec3 velocity) {
@ -193,7 +194,7 @@ index 43bbf654d97bbf4009e5ea59c756926a05089f68..a325b145be3efda4c3521871c6b1cffd
}
public void setDeltaMovement(double x, double y, double z) {
@@ -4027,7 +4071,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4024,7 +4068,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
// Paper end - fix MC-4
if (this.position.x != x || this.position.y != y || this.position.z != z) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen