summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-30 11:23:45 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-11-30 11:23:45 +0000
commitc8adfecee310d6f0a0197ade1e13769f9a30ee25 (patch)
tree60ef9bac070c9e2552e1fe47ff6a3dacf2bfa404 /nms-patches
parent20207a012418a83ce2c9c0cba06281fd782b4943 (diff)
downloadcraftbukkit-c8adfecee310d6f0a0197ade1e13769f9a30ee25.tar
craftbukkit-c8adfecee310d6f0a0197ade1e13769f9a30ee25.tar.gz
craftbukkit-c8adfecee310d6f0a0197ade1e13769f9a30ee25.tar.lz
craftbukkit-c8adfecee310d6f0a0197ade1e13769f9a30ee25.tar.xz
craftbukkit-c8adfecee310d6f0a0197ade1e13769f9a30ee25.zip
Add a flag to correctly convert signs to 1.8
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/TileEntitySign.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/nms-patches/TileEntitySign.patch b/nms-patches/TileEntitySign.patch
new file mode 100644
index 00000000..ce9d878f
--- /dev/null
+++ b/nms-patches/TileEntitySign.patch
@@ -0,0 +1,43 @@
+--- ../work/decompile-8eb82bde//net/minecraft/server/TileEntitySign.java 2014-11-30 11:23:30.317220028 +0000
++++ src/main/java/net/minecraft/server/TileEntitySign.java 2014-11-30 11:22:37.521221199 +0000
+@@ -20,6 +20,12 @@
+
+ nbttagcompound.setString("Text" + (i + 1), s);
+ }
++
++ // CraftBukkit start
++ if (Boolean.getBoolean("convertLegacySigns")) {
++ nbttagcompound.setBoolean("Bukkit.isConverted", true);
++ }
++ // CraftBukkit end
+
+ this.i.b(nbttagcompound);
+ }
+@@ -29,14 +35,27 @@
+ super.a(nbttagcompound);
+ TileEntitySignCommandListener tileentitysigncommandlistener = new TileEntitySignCommandListener(this);
+
++ // CraftBukkit start - Add an option to convert signs correctly
++ // This is done with a flag instead of all the time because
++ // we have no way to tell whether a sign is from 1.7.10 or 1.8
++
++ boolean oldSign = Boolean.getBoolean("convertLegacySigns") && !nbttagcompound.getBoolean("Bukkit.isConverted");
++
+ for (int i = 0; i < 4; ++i) {
+ String s = nbttagcompound.getString("Text" + (i + 1));
++
++ if (oldSign) {
++ lines[i] = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(s)[0];
++ continue;
++ }
++ // CraftBukkit end
+
+ try {
+ IChatBaseComponent ichatbasecomponent = ChatSerializer.a(s);
+
+ try {
+ this.lines[i] = ChatComponentUtils.filterForDisplay(tileentitysigncommandlistener, ichatbasecomponent, (Entity) null);
++ if (false) throw new CommandException(null, null); // CraftBukkit - fix decompile error
+ } catch (CommandException commandexception) {
+ this.lines[i] = ichatbasecomponent;
+ }