From d70aa91fd3949279474fcedaf35a3679ef2eb596 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 4 Mar 2019 23:35:10 -0500 Subject: don't check convert signs boolean every sign save that lookup isn't "cheap", and synchronizes so cache it to a boolean instead --- ...heck-ConvertSigns-boolean-every-sign-save.patch | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Spigot-Server-Patches/0376-Don-t-check-ConvertSigns-boolean-every-sign-save.patch diff --git a/Spigot-Server-Patches/0376-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/0376-Don-t-check-ConvertSigns-boolean-every-sign-save.patch new file mode 100644 index 0000000000..7773986c31 --- /dev/null +++ b/Spigot-Server-Patches/0376-Don-t-check-ConvertSigns-boolean-every-sign-save.patch @@ -0,0 +1,32 @@ +From 1c6d78c9728258f137fab6a15efaf16a01429b73 Mon Sep 17 00:00:00 2001 +From: Aikar +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 4ff2c8480..95de8b055 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySign.java ++++ b/src/main/java/net/minecraft/server/TileEntitySign.java +@@ -10,6 +10,7 @@ public class TileEntitySign extends TileEntity { + private EntityHuman h; + private final CommandObjectiveExecutor i = new CommandObjectiveExecutor(); + public static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper ++ private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); + public java.util.UUID signEditor; // Paper + + public TileEntitySign() {} +@@ -24,7 +25,7 @@ public class TileEntitySign extends TileEntity { + } + + // CraftBukkit start +- if (Boolean.getBoolean("convertLegacySigns")) { ++ if (CONVERT_LEGACY_SIGNS) { // Paper + nbttagcompound.setBoolean("Bukkit.isConverted", true); + } + // CraftBukkit end +-- +2.21.0 + -- cgit v1.2.3