mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-03 10:36:41 +00:00
Add depth limit to Component deserialization (#145)
This commit is contained in:
@ -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
|
||||
index 51e5742e265d4d624eda119e199d6bc0f528b835..1865e5219bfb1930b2d01e03c04718b64617522f 100644
|
||||
index 60360cc52bbd61ae4e8b8b2f5f94b107aa0c88c8..b42258c6d4d465a86e9e01464d99d72e1e70a82b 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -856,7 +856,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -855,7 +855,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
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
|
||||
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
|
||||
@ -17,7 +17,7 @@ index 51e5742e265d4d624eda119e199d6bc0f528b835..1865e5219bfb1930b2d01e03c04718b6
|
||||
BaseCommandBlock commandblocklistenerabstract = null;
|
||||
CommandBlockEntity tileentitycommand = null;
|
||||
BlockPos blockposition = packet.getPos();
|
||||
@@ -1025,7 +1025,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1024,7 +1024,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -26,7 +26,7 @@ index 51e5742e265d4d624eda119e199d6bc0f528b835..1865e5219bfb1930b2d01e03c04718b6
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||
@@ -1083,7 +1083,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1082,7 +1082,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -35,7 +35,7 @@ index 51e5742e265d4d624eda119e199d6bc0f528b835..1865e5219bfb1930b2d01e03c04718b6
|
||||
BlockPos blockposition = packet.getPos();
|
||||
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
||||
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||
@@ -1108,7 +1108,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1107,7 +1107,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
|
Reference in New Issue
Block a user