Move patches around
This commit is contained in:
44
patches/server-remapped/Fix-sign-edit-memory-leak.patch
Normal file
44
patches/server-remapped/Fix-sign-edit-memory-leak.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
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/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
|
||||
|
||||
SignBlockEntity tileentitysign = (SignBlockEntity) tileentity;
|
||||
|
||||
- if (!tileentitysign.isEditable() || tileentitysign.getPlayerWhoMayEdit() != this.player) {
|
||||
+ if (!tileentitysign.isEditable() || tileentitysign.signEditor == null || !tileentitysign.signEditor.equals(this.player.getUUID())) {
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
|
||||
this.send(tileentity.getUpdatePacket()); // CraftBukkit
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
private Player playerWhoMayEdit;
|
||||
private final FormattedCharSequence[] renderMessages;
|
||||
private DyeColor color;
|
||||
+ public java.util.UUID signEditor; // Paper
|
||||
|
||||
public SignBlockEntity() {
|
||||
super(BlockEntityType.SIGN);
|
||||
@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
}
|
||||
|
||||
public void setAllowedPlayerEditor(Player player) {
|
||||
- this.playerWhoMayEdit = player;
|
||||
+ // Paper start
|
||||
+ //this.c = entityhuman;
|
||||
+ signEditor = player != null ? player.getUUID() : null;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public Player getPlayerWhoMayEdit() {
|
||||
Reference in New Issue
Block a user