Fix sign lazy initialisation

Fixes PaperMC/Paper#4975
This commit is contained in:
Mariell Hoversholm 2021-01-01 14:35:38 +01:00 committed by Mariell
parent 9f61759d90
commit f1317386dc

View file

@ -130,23 +130,6 @@ index 26cc40e57f5b73b9c32859bff37c4a3d94904c56..feeae1a9eb309ae4101783b191bb2bff
} }
private T createSnapshot(T tileEntity) { private T createSnapshot(T tileEntity) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
index 81f6bf5533288ed90e2f1f4d421d54195d9650c7..4a266b95afea5c3853774752f94e287234fa5726 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
@@ -18,10 +18,12 @@ public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements
public CraftSign(final Block block) {
super(block, TileEntitySign.class);
+ if (lines == null) { lines = new String[]{"", "", "", ""}; } // Paper
}
public CraftSign(final Material material, final TileEntitySign te) {
super(material, te);
+ if (lines == null) { lines = new String[]{"", "", "", ""}; } // Paper
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java
index 58e2db5da178af6a8c30f563353fefe720ff9781..b704f550de290e0bc1235bf7e68c7eb347162c69 100644 index 58e2db5da178af6a8c30f563353fefe720ff9781..b704f550de290e0bc1235bf7e68c7eb347162c69 100644
--- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java