Update Paper

This commit is contained in:
Telesphoreo 2023-11-12 19:35:20 -06:00
parent c454da9e1a
commit b17300cb6b
10 changed files with 32 additions and 32 deletions

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20.2-R0.1-SNAPSHOT version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2 mcVersion=1.20.2
paperRef=274e54ba58383e352ee631ed2934858e77c887ea paperRef=f186318a91cbd3b2a2259d39cb88576989a496b8
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add Scissors configuration file
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..9fd0d55bac867322e8c72dcf4a17bd18f7aa423c 100644 index d0c634629aa0b6bac0da93655dd86ad3aea0ce30..5729362a327f6cc67e86d4ebf5328fc60ed710f7 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -2121,6 +2121,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -2190,6 +2190,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
} }
// Paper end // Paper end

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index a79461457ea19339f47572c70705d655ebc55276..1ac1484fa13e1aadf6dfc964e7797534e2231950 100644 index 79beac737c17412913983614bd478d33e3c6ed58..6c396296c3ff8b5559b7bf69af76459117de4e85 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { @@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@ -95,7 +95,7 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166
.completer(new ConsoleCommandCompleter(this.server)) .completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true); .option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 97745f0bab8d82d397c6c2a5775aed92bca0a034..2f511b9c5f48773c17a659c00a94ba3df82edf93 100644 index 8f31413c939cc2b0454ad3d9a1b618dbae449d00..96c2044c66db2b2aef644e19ecd289cf870ab62a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -108,10 +108,10 @@ index 97745f0bab8d82d397c6c2a5775aed92bca0a034..2f511b9c5f48773c17a659c00a94ba3d
public SystemReport fillSystemReport(SystemReport details) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b7e7e6ed60f55d2ab5e4fcefb3638ad1768c3b7f..f7c3b65e0d6c76189aea00232b33722c4363d7dd 100644 index 9c08303de2891de92e06de8a939a618b7a6f7321..43e331f2946faaf3e7e66e4a81a6b34604647c3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -267,7 +267,7 @@ import javax.annotation.Nullable; // Paper @@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server { public final class CraftServer implements Server {

View File

@ -426,7 +426,7 @@ index ec268189b19b6fa5c4521f96ce211a531db35ec5..343cb72710ef100cf7e4de1e081cfdc2
if (optionset.has("initSettings")) { // CraftBukkit if (optionset.has("initSettings")) { // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 2b5d82fbf4e7ec32d0c53dd3e8207b1dba708bbd..84102c09874e6fc070050fb8b89b99fb28578af0 100644 index cf605aa56adf7f80d3b409f60a92a5ca7ae8fd07..3cf76862c8b2f14f8e8dc8ece4d4c69e0244db32 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -222,6 +222,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -447,10 +447,10 @@ index 2b5d82fbf4e7ec32d0c53dd3e8207b1dba708bbd..84102c09874e6fc070050fb8b89b99fb
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd); this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2c3dbeb929c9ec110aee390299f13006f0a4ec66..3708b9c68300694a377001fa17b87d6cf5c59779 100644 index 43e331f2946faaf3e7e66e4a81a6b34604647c3b..9da067c62f28e08d90e1469ab08d616e704ea068 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1038,6 +1038,7 @@ public final class CraftServer implements Server { @@ -1040,6 +1040,7 @@ public final class CraftServer implements Server {
} }
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
@ -458,7 +458,7 @@ index 2c3dbeb929c9ec110aee390299f13006f0a4ec66..3708b9c68300694a377001fa17b87d6c
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
for (ServerLevel world : this.console.getAllLevels()) { for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
@@ -1069,6 +1070,7 @@ public final class CraftServer implements Server { @@ -1071,6 +1072,7 @@ public final class CraftServer implements Server {
this.reloadData(); this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
@ -466,7 +466,7 @@ index 2c3dbeb929c9ec110aee390299f13006f0a4ec66..3708b9c68300694a377001fa17b87d6c
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2915,6 +2917,14 @@ public final class CraftServer implements Server { @@ -2978,6 +2980,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add spectator teleport event
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 34fcdeb0f4039f1fc6c4c8c593cc615560af1ba2..40166e794ad1f2d2555bd47a442771db5bee79f9 100644 index 65bb221993147a558995b36fb835f7b82e0eb4bd..4ea2c551d924f976a8de9e2ae521544f323fbec4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 34fcdeb0f4039f1fc6c4c8c593cc615560af1ba2..40166e794ad1f2d2555bd47a442771db
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.primitives.Floats; import com.google.common.primitives.Floats;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
@@ -2005,6 +2006,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2006,6 +2007,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Entity entity = packet.getEntity(worldserver); Entity entity = packet.getEntity(worldserver);
if (entity != null) { if (entity != null) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent invalid container events
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 40166e794ad1f2d2555bd47a442771db5bee79f9..0c878b99574b0e27f1463069f66d24bdecb01647 100644 index 4ea2c551d924f976a8de9e2ae521544f323fbec4..83ae366b4f52261e2e2b65a4183d7ca823edd315 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -30,6 +30,7 @@ import java.util.function.UnaryOperator; @@ -30,6 +30,7 @@ import java.util.function.UnaryOperator;
@ -16,7 +16,7 @@ index 40166e794ad1f2d2555bd47a442771db5bee79f9..0c878b99574b0e27f1463069f66d24bd
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import net.minecraft.Util; import net.minecraft.Util;
@@ -2899,6 +2900,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2900,6 +2901,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return; return;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Validate block entity/entity tag query positions
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0c878b99574b0e27f1463069f66d24bdecb01647..51331ad3f295b55631adcb6f47e34d0b03bd148a 100644 index 83ae366b4f52261e2e2b65a4183d7ca823edd315..67b5447ffcf54c54b2087df456690a9bed98fbd3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1261,7 +1261,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1262,7 +1262,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.player.hasPermissions(2)) { if (this.player.hasPermissions(2)) {
Entity entity = this.player.level().getEntity(packet.getEntityId()); Entity entity = this.player.level().getEntity(packet.getEntityId());
@ -17,7 +17,7 @@ index 0c878b99574b0e27f1463069f66d24bdecb01647..51331ad3f295b55631adcb6f47e34d0b
CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag()); CompoundTag nbttagcompound = entity.saveWithoutId(new CompoundTag());
this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound)); this.player.connection.send(new ClientboundTagQueryPacket(packet.getTransactionId(), nbttagcompound));
@@ -1273,7 +1273,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1274,7 +1274,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -60,7 +60,7 @@ index c0a80824a0307ea673805015119cc834b268f0dc..9f28f86b1b56ea55ab39f6ac988c1f47
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 250d2383d7df9584e52a9600b0ac89f96ba7002d..cecd2bafc30650d4b7720571bcd127c943214a4f 100644 index 67b5447ffcf54c54b2087df456690a9bed98fbd3..94cc122aad0e48687ea9f25cd810f07dc893acc6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -70,7 +70,7 @@ index 250d2383d7df9584e52a9600b0ac89f96ba7002d..cecd2bafc30650d4b7720571bcd127c9
import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors import me.totalfreedom.scissors.event.player.SpectatorTeleportEvent; // Scissors
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.primitives.Floats; import com.google.common.primitives.Floats;
@@ -2219,7 +2220,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2220,7 +2221,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
@ -79,7 +79,7 @@ index 250d2383d7df9584e52a9600b0ac89f96ba7002d..cecd2bafc30650d4b7720571bcd127c9
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
} else { } else {
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED)); this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
@@ -2275,6 +2276,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2276,6 +2277,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment); Optional<LastSeenMessages> optional = this.lastSeenMessages.applyUpdate(acknowledgment);
if (optional.isEmpty()) { if (optional.isEmpty()) {
@ -87,7 +87,7 @@ index 250d2383d7df9584e52a9600b0ac89f96ba7002d..cecd2bafc30650d4b7720571bcd127c9
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
} }
@@ -2483,6 +2485,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2484,6 +2486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) { synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) { if (!this.lastSeenMessages.applyOffset(packet.offset())) {
@ -95,7 +95,7 @@ index 250d2383d7df9584e52a9600b0ac89f96ba7002d..cecd2bafc30650d4b7720571bcd127c9
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes this.disconnect(ServerGamePacketListenerImpl.CHAT_VALIDATION_FAILED, org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED); // Paper - kick event causes
} }
@@ -3461,6 +3464,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3462,6 +3465,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) { public void handleChatSessionUpdate(ServerboundChatSessionUpdatePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -18,7 +18,7 @@ index c99fc118013cb3d4043638e2001a8297e79ddf9c..cdaa81e1f2167b29ec01cc25e51a8400
private final boolean trackOutput; private final boolean trackOutput;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 19f573a1f62280bd9b67a4027962fcb7de6d2514..f5cdac55c8cbe334b96c5a0b2c34f216109120d3 100644 index 94cc122aad0e48687ea9f25cd810f07dc893acc6..bcb195b1e40f562d0cd5ecca236ebba87150d236 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
@ -47,7 +47,7 @@ index 19f573a1f62280bd9b67a4027962fcb7de6d2514..f5cdac55c8cbe334b96c5a0b2c34f216
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -892,6 +897,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -893,6 +898,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity); this.player.level().getChunkAt(blockposition).setBlockEntity(tileentity);
} }
@ -64,7 +64,7 @@ index 19f573a1f62280bd9b67a4027962fcb7de6d2514..f5cdac55c8cbe334b96c5a0b2c34f216
commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setCommand(s);
commandblocklistenerabstract.setTrackOutput(flag); commandblocklistenerabstract.setTrackOutput(flag);
if (!flag) { if (!flag) {
@@ -923,7 +938,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -924,7 +939,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level()); BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
if (commandblocklistenerabstract != null) { if (commandblocklistenerabstract != null) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix packet-related lag exploits
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f5cdac55c8cbe334b96c5a0b2c34f216109120d3..78f9e0587f35ed8034fd2c275e0e06abae90e0e6 100644 index bcb195b1e40f562d0cd5ecca236ebba87150d236..fee0a88c6ccecd71ebf63651655dec2d5097f894 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -857,7 +857,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -858,7 +858,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
} else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission } else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
@ -17,7 +17,7 @@ index f5cdac55c8cbe334b96c5a0b2c34f216109120d3..78f9e0587f35ed8034fd2c275e0e06ab
BaseCommandBlock commandblocklistenerabstract = null; BaseCommandBlock commandblocklistenerabstract = null;
CommandBlockEntity tileentitycommand = null; CommandBlockEntity tileentitycommand = null;
BlockPos blockposition = packet.getPos(); BlockPos blockposition = packet.getPos();
@@ -1024,7 +1024,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1025,7 +1025,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) { public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
@ -26,7 +26,7 @@ index f5cdac55c8cbe334b96c5a0b2c34f216109120d3..78f9e0587f35ed8034fd2c275e0e06ab
BlockPos blockposition = packet.getPos(); BlockPos blockposition = packet.getPos();
BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockState iblockdata = this.player.level().getBlockState(blockposition);
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
@@ -1082,7 +1082,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1083,7 +1083,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) { public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
@ -35,7 +35,7 @@ index f5cdac55c8cbe334b96c5a0b2c34f216109120d3..78f9e0587f35ed8034fd2c275e0e06ab
BlockPos blockposition = packet.getPos(); BlockPos blockposition = packet.getPos();
BlockState iblockdata = this.player.level().getBlockState(blockposition); BlockState iblockdata = this.player.level().getBlockState(blockposition);
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
@@ -1105,7 +1105,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1106,7 +1106,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) { public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());