Paper/Spigot-Server-Patches/0195-MC-111699-Ignore-Improper-Anvil-Item-Name-Packets.patch
Shane Freeder ffb572ce9a
Remove Ignore invalid Marker Icon ID's in maps
Spigot has patched this issue inside MapIcon, meaning that we no longer need to maintain this patch; Spigots patch also fixes #668 in that it will verify the length of the array, as well as protect against a negative type value being fetched from the array. Only real change is that Spigots patch returns a MapIcon.Type.PLAYER, instead of the RED_MARKER as originally PR'd by Aikar.
2017-04-22 15:52:56 +01:00

29 lines
1.3 KiB
Diff

From c36f506b1200efce56cc66a11e2930dcc4803de1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 2 Jan 2017 02:07:24 -0500
Subject: [PATCH] MC-111699: Ignore Improper Anvil Item Name Packets
The client is improperly sending Item Name Packets to the server BEFORE
the click event. This causes the server to reset before the click event is processed
This breaks the ability to rename more than 1 item at a time.
See: https://bugs.mojang.com/browse/MC-111699
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7c2d43ac..cbe5d36d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2449,7 +2449,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
String s4 = SharedConstants.a(packetplayincustompayload.b().e(32767));
if (s4.length() <= 30) {
- containeranvil.a(s4);
+ if (!s4.isEmpty() || containeranvil.getSlot(2).getItem().isEmpty()) containeranvil.a(s4); // Paper - Hack Fix for MC-111699
}
} else {
containeranvil.a("");
--
2.12.2