Update Paper

This commit is contained in:
Telesphoreo 2024-02-10 19:15:15 -06:00
parent f00572a121
commit e7b13dc764
No known key found for this signature in database
GPG Key ID: 9D1991811E093C02
9 changed files with 40 additions and 40 deletions

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20.4-R0.1-SNAPSHOT version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4 mcVersion=1.20.4
paperRef=c5d168cef92148a6799141832fdb5f95732c1a38 paperRef=cde5587e58f08ce2d8875bb9d13a4be56825e353
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View File

@ -426,7 +426,7 @@ index 61840cfd64caba6595dfc99c91c76a195638d4ee..9acd9ecac6d72701835e04a17fddade7
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 6de6dad36203479677a29ad61e21bc369d4e5513..2aed9abbcb2526a2535099fe8d345d25ec099faa 100644 index 2ecf79086e9e8069f43120e9146e98962a75eca8..5d3c324fd3224944639a3cfa808e89a8a8519b8d 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 6de6dad36203479677a29ad61e21bc369d4e5513..2aed9abbcb2526a2535099fe8d345d25
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 0cc658b701a406dd6683a5107b67aea8c18a22ba..5b100731794e63d7b51d6cd49e66f0997761a015 100644 index cc96cc142f37c5aa6ce8a1ce5e84e81ec33b78e1..66f1b9006cce0ea699e866d41eda5b40a5914438 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
@@ -1036,6 +1036,7 @@ public final class CraftServer implements Server { @@ -1041,6 +1041,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 0cc658b701a406dd6683a5107b67aea8c18a22ba..5b100731794e63d7b51d6cd49e66f099
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
@@ -1067,6 +1068,7 @@ public final class CraftServer implements Server { @@ -1072,6 +1073,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 0cc658b701a406dd6683a5107b67aea8c18a22ba..5b100731794e63d7b51d6cd49e66f099
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");
@@ -2996,6 +2998,14 @@ public final class CraftServer implements Server { @@ -3001,6 +3003,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 2562ea3b63b055319a775c12ff327d127f8039c3..ad85b716f861a38192d51fc2f9725d48255d5f7c 100644 index a7e40f72a3b56916620a7f089410ec3a6db0cffc..912e3474b476fc09a23cc61644bc4c91be95c511 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 2562ea3b63b055319a775c12ff327d127f8039c3..ad85b716f861a38192d51fc2f9725d48
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;
@@ -2018,6 +2019,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2037,6 +2038,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 ad85b716f861a38192d51fc2f9725d48255d5f7c..9f0a66d21ccac4b22f1fc7a632170ef16d0b82c5 100644 index 912e3474b476fc09a23cc61644bc4c91be95c511..6b51a768e395ef49bc482769c91011f6b95c763b 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
@@ -29,6 +29,7 @@ import java.util.function.UnaryOperator; @@ -29,6 +29,7 @@ import java.util.function.UnaryOperator;
@ -16,7 +16,7 @@ index ad85b716f861a38192d51fc2f9725d48255d5f7c..9f0a66d21ccac4b22f1fc7a632170ef1
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import net.minecraft.Util; import net.minecraft.Util;
@@ -2879,6 +2880,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2898,6 +2899,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 9f0a66d21ccac4b22f1fc7a632170ef16d0b82c5..62c4470308ebcca9c5b6850065906a33879c0016 100644 index 6b51a768e395ef49bc482769c91011f6b95c763b..b5a7d005924113baab431797f8729e5c768a2ef1 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
@@ -1263,7 +1263,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1282,7 +1282,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 9f0a66d21ccac4b22f1fc7a632170ef16d0b82c5..62c4470308ebcca9c5b6850065906a33
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));
@@ -1295,7 +1295,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1314,7 +1314,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

@ -62,7 +62,7 @@ index ba12919c3f9aec34a9e64993b143ae92be5eb172..bdfa4a7f5b50e80195e79a6dd1204cb7
} }
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 62c4470308ebcca9c5b6850065906a33879c0016..3eae4d979400b1e206abfcee676653ce7966155e 100644 index b5a7d005924113baab431797f8729e5c768a2ef1..0a73b464d696b85d94b9a4a0ee155d5b395cf590 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 @@
@ -72,7 +72,7 @@ index 62c4470308ebcca9c5b6850065906a33879c0016..3eae4d979400b1e206abfcee676653ce
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;
@@ -2228,7 +2229,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2247,7 +2248,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) { private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
@ -81,7 +81,7 @@ index 62c4470308ebcca9c5b6850065906a33879c0016..3eae4d979400b1e206abfcee676653ce
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));
@@ -2276,6 +2277,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2295,6 +2296,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()) {
@ -89,7 +89,7 @@ index 62c4470308ebcca9c5b6850065906a33879c0016..3eae4d979400b1e206abfcee676653ce
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
} }
@@ -2474,6 +2476,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2493,6 +2495,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) { synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) { if (!this.lastSeenMessages.applyOffset(packet.offset())) {
@ -97,7 +97,7 @@ index 62c4470308ebcca9c5b6850065906a33879c0016..3eae4d979400b1e206abfcee676653ce
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
} }
@@ -3441,6 +3444,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3460,6 +3463,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 3eae4d979400b1e206abfcee676653ce7966155e..60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8 100644 index 0a73b464d696b85d94b9a4a0ee155d5b395cf590..eb0316f0825ab0304b872507e7b3cf6a4ef86ae1 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 3eae4d979400b1e206abfcee676653ce7966155e..60360cc52bbd61ae4e8b8b2f5f94b107
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -890,6 +895,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -909,6 +914,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 3eae4d979400b1e206abfcee676653ce7966155e..60360cc52bbd61ae4e8b8b2f5f94b107
commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.setCommand(s);
commandblocklistenerabstract.setTrackOutput(flag); commandblocklistenerabstract.setTrackOutput(flag);
if (!flag) { if (!flag) {
@@ -921,7 +936,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -940,7 +955,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,13 +5,13 @@ Subject: [PATCH] Add depth limit to SNBT
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9e28c64ca 100644 index 9ecd0b7ddaa8376f3c1448f810f7757c9ba1b90a..817f7f8400122da9881adcf530f379bfb69910d8 100644
--- a/src/main/java/net/minecraft/nbt/TagParser.java --- a/src/main/java/net/minecraft/nbt/TagParser.java
+++ b/src/main/java/net/minecraft/nbt/TagParser.java +++ b/src/main/java/net/minecraft/nbt/TagParser.java
@@ -179,9 +179,56 @@ public class TagParser { @@ -182,9 +182,56 @@ public class TagParser {
}
this.expect('}'); this.expect('}');
this.depth--; // Paper
- return compoundTag; - return compoundTag;
+ return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag; // Scissors - Add depth limit to SNBT + return exceedsDepthLimit(compoundTag) ? new CompoundTag() : compoundTag; // Scissors - Add depth limit to SNBT
} }
@ -66,16 +66,16 @@ index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9
private Tag readListTag() throws CommandSyntaxException { private Tag readListTag() throws CommandSyntaxException {
this.expect('['); this.expect('[');
this.reader.skipWhitespace(); this.reader.skipWhitespace();
@@ -213,7 +260,7 @@ public class TagParser { @@ -218,7 +265,7 @@ public class TagParser {
}
this.expect(']'); this.expect(']');
this.depth--; // Paper
- return listTag; - return listTag;
+ return exceedsDepthLimit(listTag) ? new ListTag() : listTag; // Scissors - Add depth limit to SNBT + return exceedsDepthLimit(listTag) ? new ListTag() : listTag; // Scissors - Add depth limit to SNBT
} }
} }
@@ -238,7 +285,7 @@ public class TagParser { @@ -243,7 +290,7 @@ public class TagParser {
} }
private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException { private <T extends Number> List<T> readArray(TagType<?> arrayTypeReader, TagType<?> typeReader) throws CommandSyntaxException {
@ -84,22 +84,22 @@ index 5bec54239a2b185284c10d58854e5a13e33daae5..f112d82b0a9e5513395fa7c1b05d1fe9
while(true) { while(true) {
if (this.reader.peek() != ']') { if (this.reader.peek() != ']') {
@@ -251,11 +298,11 @@ public class TagParser { @@ -256,11 +303,11 @@ public class TagParser {
} }
if (typeReader == ByteTag.TYPE) { if (typeReader == ByteTag.TYPE) {
- list.add((T)((NumericTag)tag).getAsByte()); - list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix
+ list.add(((NumericTag)tag).getAsByte()); // Scissors - Remove (T) cast + list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast
} else if (typeReader == LongTag.TYPE) { } else if (typeReader == LongTag.TYPE) {
- list.add((T)((NumericTag)tag).getAsLong()); - list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix
+ list.add(((NumericTag)tag).getAsLong()); // Scissors - Remove (T) cast + list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast
} else { } else {
- list.add((T)((NumericTag)tag).getAsInt()); - list.add((T)((NumericTag)tag).getAsNumber()); // Paper - decompile fix
+ list.add(((NumericTag)tag).getAsInt()); // Scissors - Remove (T) cast + list.add(((NumericTag)tag).getAsNumber()); // Scissors - Remove (T) cast
} }
if (this.hasElementSeparator()) { if (this.hasElementSeparator()) {
@@ -267,7 +314,7 @@ public class TagParser { @@ -272,7 +319,7 @@ public class TagParser {
} }
this.expect(']'); this.expect(']');

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 60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8..b42258c6d4d465a86e9e01464d99d72e1e70a82b 100644 index eb0316f0825ab0304b872507e7b3cf6a4ef86ae1..63dddf503ed035f9c49d9f008c40373acbc16c1a 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
@@ -855,7 +855,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -874,7 +874,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 60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8..b42258c6d4d465a86e9e01464d99d72e
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 @@ -1043,7 +1043,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 60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8..b42258c6d4d465a86e9e01464d99d72e
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 @@ -1101,7 +1101,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 60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8..b42258c6d4d465a86e9e01464d99d72e
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);
@@ -1107,7 +1107,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1126,7 +1126,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());