don't check convert signs boolean every sign save

that lookup isn't "cheap", and synchronizes so cache it to a boolean instead
This commit is contained in:
Aikar 2019-03-02 15:29:09 -05:00
parent 58398da145
commit 420ce3aaed
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE

View File

@ -0,0 +1,32 @@
From a32e8aa75982020a347efc307017e3f03b81c1c0 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 2 Mar 2019 11:11:29 -0500
Subject: [PATCH] Don't check ConvertSigns boolean every sign save
property lookups arent super cheap. they synchronize, validate
and check security managers.
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index fdb771317a..d0a91f6755 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -15,6 +15,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
private static final boolean keepInvalidUnicode = Boolean.getBoolean("Paper.keepInvalidUnicode"); // Allow people to keep their bad unicode if they really want it
private boolean privateUnicodeRemoved = false;
public java.util.UUID signEditor;
+ private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns");
// Paper end
public TileEntitySign() {
@@ -31,7 +32,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
}
// CraftBukkit start
- if (Boolean.getBoolean("convertLegacySigns")) {
+ if (CONVERT_LEGACY_SIGNS) { // Paper
nbttagcompound.setBoolean("Bukkit.isConverted", true);
}
// CraftBukkit end
--
2.20.1