3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-17 05:20:05 +01:00
Paper/CraftBukkit-Patches/0124-Cap-villagers-window-name-to-prevent-client-disconne.patch
2014-03-23 18:16:32 +00:00

22 Zeilen
1.1 KiB
Diff

From 03fb61c80cb0e990d94dce744ab2cc8899231ea3 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Sun, 23 Mar 2014 10:53:48 +0000
Subject: [PATCH] Cap villagers' window name to prevent client disconnects
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 787c764..5788872 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -756,6 +756,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.activeContainer.addSlotListener(this);
InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).getMerchantInventory();
+ if (s.length() > 32) s = s.substring( 0, 32 ); // Spigot - Cap window name to prevent client disconnects
this.playerConnection.sendPacket(new PacketPlayOutOpenWindow(this.containerCounter, 6, s == null ? "" : s, inventorymerchant.getSize(), s != null));
MerchantRecipeList merchantrecipelist = imerchant.getOffers(this);
--
1.8.5.2.msysgit.0