more 1.14 stuffs yay!

This commit is contained in:
William Blake Galbreath
2019-05-05 06:12:32 -05:00
parent 3f43b7abe8
commit 8cfdd708e9
20 changed files with 241 additions and 268 deletions

View File

@@ -20,12 +20,12 @@ think of no reason to use it.
Fixes GH-1571
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 458d1561d0..c2bcbbbab9 100644
index 9de03a24c..4165c6d11 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
private EntityHuman g;
private final String[] h = new String[4];
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
private final String[] k = new String[4];
private EnumColor l;
+ // Paper start - Strip invalid unicode from signs on load
+ private static final boolean keepInvalidUnicode = Boolean.getBoolean("Paper.keepInvalidUnicode"); // Allow people to keep their bad unicode if they really want it
@@ -34,11 +34,12 @@ index 458d1561d0..c2bcbbbab9 100644
+
public TileEntitySign() {
super(TileEntityTypes.SIGN);
}
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
}
this.l = EnumColor.BLACK;
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
// CraftBukkit end
nbttagcompound.setString("Color", this.l.b());
+
+ // Paper start - Only remove private area unicode once
+ if (this.privateUnicodeRemoved) {
+ nbttagcompound.setBoolean("Paper.RemovedPrivateUnicode", true);
@@ -48,9 +49,9 @@ index 458d1561d0..c2bcbbbab9 100644
return nbttagcompound;
}
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
this.isEditable = false;
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
super.load(nbttagcompound);
this.l = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
+ // Paper start - Keep track, only do it once per sign
+ this.privateUnicodeRemoved = nbttagcompound.getBoolean("Paper.RemovedPrivateUnicode");
@@ -60,7 +61,7 @@ index 458d1561d0..c2bcbbbab9 100644
// 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
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
s = "\"\"";
}
@@ -80,8 +81,8 @@ index 458d1561d0..c2bcbbbab9 100644
try {
//IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s); // Paper - move down - the old format might throw a json error
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener {
this.h[i] = null;
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
this.k[i] = null;
}
+ if (ranUnicodeRemoval) this.privateUnicodeRemoved = true; // Paper - Flag to write NBT