Paper/Spigot-Server-Patches/0334-Fix-sign-edit-memory-leak.patch
Aikar c0d07c1b67
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
f009c3dd SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
e677c370 Update ECJ version
5058a35d SPIGOT-5860: Item.setItemStack should be NotNull

CraftBukkit Changes:
d77f4d9b SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
53c95627 SPIGOT-5865: Piglin does not trigger EntityPickupItemEvent
2ab04d24 Update ECJ version
7884e079 SPIGOT-5868: Blocks do not tick in custom nether / end
2a848286 SPIGOT-5863: Don't check colour in scoreboard length validation
f2cbce30 SPIGOT-5866: Beehive unknown TargetReason

Spigot Changes:
ad703da0 SPIGOT-5870: /plugins "website" field shows "version"
1a27cfd8 #98: Improve output of /plugins command using text components
732d5bab Disable checkstyle in Spigot blocks
0199a9a6 #97: Add Memory Usage to Ticks Per Second Command.
33ea98fc SPIGOT-5858: NPE: Joining the server with an invalid dimension
2020-06-27 21:54:05 -04:00

45 Zeilen
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 28 Feb 2019 00:15:28 -0500
Subject: [PATCH] Fix sign edit memory leak
when a player edits a sign, a reference to their Entity is never cleand up.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index b7612fb450063e48a81ca95e7dedebb7f6e7789c..22a185c298f4738669708c8c6ef8ef9aeff0acc1 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2587,7 +2587,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
TileEntitySign tileentitysign = (TileEntitySign) tileentity;
- if (!tileentitysign.d() || tileentitysign.f() != this.player) {
+ if (!tileentitysign.d() || tileentitysign.signEditor == null || !tileentitysign.signEditor.equals(this.player.getUniqueID())) {
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getDisplayName().getString());
this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit
return;
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 8e77c662f7d970d8ff86f6c5b9bccc598442594d..2746cb4d4950b303f4d6b4822223d26b51ebe5a4 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -11,6 +11,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
private EntityHuman c;
private final IChatFormatted[] g;
private EnumColor color;
+ public java.util.UUID signEditor; // Paper
public TileEntitySign() {
super(TileEntityTypes.SIGN);
@@ -112,7 +113,10 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
}
public void a(EntityHuman entityhuman) {
- this.c = entityhuman;
+ // Paper start
+ //this.c = entityhuman;
+ signEditor = entityhuman != null ? entityhuman.getUniqueID() : null;
+ // Paper end
}
public EntityHuman f() {