From 0c8e84c20ddfe0e4e98ce12078fbe86c075a4bae Mon Sep 17 00:00:00 2001 From: thelooter Date: Sat, 16 Sep 2023 23:18:51 +0200 Subject: [PATCH] Enforce sign line nullability when setting line with Adventure Method (#9689) --- patches/server/0010-Adventure.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 6881aaa95..3358622f9 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -3279,10 +3279,10 @@ index bd43440fcbcf461fb8ca94b96cd256f392efeb84..5af30bff1bfdf09daa585071f2ec1fe0 Component[] components = new Component[4]; diff --git a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java -index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..1317cdd48c1c27c9e5152da5403237b1bb15ac52 100644 +index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..4747d77fd5fd12116ef40d897a08c7baca60a399 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java +++ b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java -@@ -12,37 +12,69 @@ import org.jetbrains.annotations.Nullable; +@@ -12,37 +12,70 @@ import org.jetbrains.annotations.Nullable; public class CraftSignSide implements SignSide { // Lazily initialized only if requested: @@ -3313,6 +3313,7 @@ index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..1317cdd48c1c27c9e5152da5403237b1 + + @Override + public void line(final int index, final net.kyori.adventure.text.@NotNull Component line) throws IndexOutOfBoundsException { ++ com.google.common.base.Preconditions.checkArgument(line != null, "Line cannot be null"); + this.loadLines(); + this.lines.set(index, line); + } @@ -3365,7 +3366,7 @@ index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..1317cdd48c1c27c9e5152da5403237b1 } @Override -@@ -68,13 +100,16 @@ public class CraftSignSide implements SignSide { +@@ -68,13 +101,16 @@ public class CraftSignSide implements SignSide { public SignText applyLegacyStringToSignSide() { if (this.lines != null) {