From cb464a0b3a9430255e0ed926da59d9d89d56d1f8 Mon Sep 17 00:00:00 2001 From: Video Date: Mon, 11 Jul 2022 15:31:22 -0600 Subject: [PATCH] Removes patch that broke container clicking --- ...ot-attempt-to-cast-items-to-recipes.patch} | 0 ...037-Prevent-invalid-container-events.patch | 39 ------------------- ...=> 0038-Add-Scissors-config-command.patch} | 0 ...unning-commands-in-books-by-default.patch} | 0 ...te-block-entity-tag-query-positions.patch} | 0 5 files changed, 39 deletions(-) rename patches/server/{0038-Do-not-attempt-to-cast-items-to-recipes.patch => 0037-Do-not-attempt-to-cast-items-to-recipes.patch} (100%) delete mode 100644 patches/server/0037-Prevent-invalid-container-events.patch rename patches/server/{0039-Add-Scissors-config-command.patch => 0038-Add-Scissors-config-command.patch} (100%) rename patches/server/{0040-Disable-running-commands-in-books-by-default.patch => 0039-Disable-running-commands-in-books-by-default.patch} (100%) rename patches/server/{0041-Validate-block-entity-tag-query-positions.patch => 0040-Validate-block-entity-tag-query-positions.patch} (100%) diff --git a/patches/server/0038-Do-not-attempt-to-cast-items-to-recipes.patch b/patches/server/0037-Do-not-attempt-to-cast-items-to-recipes.patch similarity index 100% rename from patches/server/0038-Do-not-attempt-to-cast-items-to-recipes.patch rename to patches/server/0037-Do-not-attempt-to-cast-items-to-recipes.patch diff --git a/patches/server/0037-Prevent-invalid-container-events.patch b/patches/server/0037-Prevent-invalid-container-events.patch deleted file mode 100644 index 7e867bf..0000000 --- a/patches/server/0037-Prevent-invalid-container-events.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Allink -Date: Sun, 10 Jul 2022 02:20:16 +0100 -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 -index ca595abe940463a62da033c7082c868c4c4b28d8..d6aa46443b0ec9b02259222d8ee9a7ff0cec4ae7 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -24,6 +24,8 @@ import java.util.function.UnaryOperator; - import java.util.stream.Collectors; - import java.util.stream.Stream; - import javax.annotation.Nullable; -+ -+import net.kyori.adventure.text.format.NamedTextColor; - import net.minecraft.ChatFormatting; - import net.minecraft.CrashReport; - import net.minecraft.CrashReportCategory; -@@ -2593,6 +2595,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - public void handleContainerClick(ServerboundContainerClickPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); - if (this.player.isImmobile()) return; // CraftBukkit -+ -+ // Scissors start - Do not call events when the slot/button number is invalid -+ final int sentSlotNum = packet.getSlotNum(); -+ if(Mth.clamp(sentSlotNum, 0, 45) != sentSlotNum) -+ { -+ this.getCraftPlayer().kick( -+ net.kyori.adventure.text.Component.text("Invalid container click slot (Hacking?)") -+ .color(NamedTextColor.RED) -+ ); -+ return; -+ } -+ // Scissors end -+ - this.player.resetLastActionTime(); - if (this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu.stillValid(this.player)) { // CraftBukkit - boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if diff --git a/patches/server/0039-Add-Scissors-config-command.patch b/patches/server/0038-Add-Scissors-config-command.patch similarity index 100% rename from patches/server/0039-Add-Scissors-config-command.patch rename to patches/server/0038-Add-Scissors-config-command.patch diff --git a/patches/server/0040-Disable-running-commands-in-books-by-default.patch b/patches/server/0039-Disable-running-commands-in-books-by-default.patch similarity index 100% rename from patches/server/0040-Disable-running-commands-in-books-by-default.patch rename to patches/server/0039-Disable-running-commands-in-books-by-default.patch diff --git a/patches/server/0041-Validate-block-entity-tag-query-positions.patch b/patches/server/0040-Validate-block-entity-tag-query-positions.patch similarity index 100% rename from patches/server/0041-Validate-block-entity-tag-query-positions.patch rename to patches/server/0040-Validate-block-entity-tag-query-positions.patch