mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-10-31 20:27:10 +00:00
47 lines
3.3 KiB
Diff
47 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
Date: Tue, 4 Jul 2023 18:49:34 -0300
|
|
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 adbb1036913ba6299f2093c84480e4147a36b344..b2971440e73dcce2beee936313568cbb06d32312 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -864,7 +864,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"));
|
|
- } else {
|
|
+ } else if (this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
|
BaseCommandBlock commandblocklistenerabstract = null;
|
|
CommandBlockEntity tileentitycommand = null;
|
|
BlockPos blockposition = packet.getPos();
|
|
@@ -1012,7 +1012,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
@Override
|
|
public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) {
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
|
- if (this.player.canUseGameMasterBlocks()) {
|
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
|
BlockPos blockposition = packet.getPos();
|
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
|
@@ -1070,7 +1070,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
@Override
|
|
public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) {
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
|
- if (this.player.canUseGameMasterBlocks()) {
|
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
|
BlockPos blockposition = packet.getPos();
|
|
BlockState iblockdata = this.player.level().getBlockState(blockposition);
|
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
|
@@ -1095,7 +1095,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
@Override
|
|
public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) {
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
|
- if (this.player.canUseGameMasterBlocks()) {
|
|
+ if (this.player.canUseGameMasterBlocks() && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors
|
|
BlockPos blockposition = packet.getPos();
|
|
BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
|
|