aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrgnter <[email protected]>2022-05-21 11:27:12 +0200
committerShane Freeder <[email protected]>2022-05-24 05:27:24 +0100
commitd8108b5416ff5482546c380d2cf5eae9cfda9eed (patch)
tree735c9c1702a8113dcd13a2d9c31cea70cf00195c
parent123cad5d3ea5d87746d36caff38fbff9f3823de1 (diff)
downloadPaper-d8108b5416ff5482546c380d2cf5eae9cfda9eed.tar.gz
Paper-d8108b5416ff5482546c380d2cf5eae9cfda9eed.zip
team color parameter may be null, causing NPE
-rw-r--r--patches/server/0008-Adventure.patch7
-rw-r--r--patches/server/0493-Fix-CraftTeam-null-check.patch4
-rw-r--r--patches/server/0817-Improve-scoreboard-entries.patch4
-rw-r--r--patches/server/0834-Multiple-Entries-with-Scoreboards.patch6
4 files changed, 11 insertions, 10 deletions
diff --git a/patches/server/0008-Adventure.patch b/patches/server/0008-Adventure.patch
index 4d51d90abc..a2809c9cfd 100644
--- a/patches/server/0008-Adventure.patch
+++ b/patches/server/0008-Adventure.patch
@@ -3387,10 +3387,10 @@ index afc059755ae3e7b1c0a4cf3c6b8f32ce13cc458d..5f2af880619e01a03e05258ae1f9fa58
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-index 81f16dc1ed6e102af298600db75cab21a09bc00f..df1288e2e89716bba5ef73d2cdeb9a567f46a297 100644
+index 81f16dc1ed6e102af298600db75cab21a09bc00f..18d5a26c34c848241c306241b3ad9825b5a0b9a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-@@ -28,6 +28,62 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
+@@ -28,6 +28,63 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
return this.team.getName();
}
@@ -3446,8 +3446,9 @@ index 81f16dc1ed6e102af298600db75cab21a09bc00f..df1288e2e89716bba5ef73d2cdeb9a56
+ CraftScoreboard scoreboard = checkState();
+ if (color == null) {
+ this.team.setColor(net.minecraft.ChatFormatting.RESET);
++ } else {
++ this.team.setColor(io.papermc.paper.adventure.PaperAdventure.asVanilla(color));
+ }
-+ team.setColor(io.papermc.paper.adventure.PaperAdventure.asVanilla(color));
+ }
+ // Paper end
diff --git a/patches/server/0493-Fix-CraftTeam-null-check.patch b/patches/server/0493-Fix-CraftTeam-null-check.patch
index a86676f8a2..2772e3f4bc 100644
--- a/patches/server/0493-Fix-CraftTeam-null-check.patch
+++ b/patches/server/0493-Fix-CraftTeam-null-check.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix CraftTeam null check
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-index df1288e2e89716bba5ef73d2cdeb9a567f46a297..af4ab4be3722d3349f7f71da062dee493cd2aafe 100644
+index 8aa74d3d04efc88f48b79b677d63d464e1fef89e..0e1fbecfc3062ceac425607507caa54b0d007130 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-@@ -260,7 +260,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
+@@ -261,7 +261,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
@Override
public boolean hasEntry(String entry) throws IllegalArgumentException, IllegalStateException {
diff --git a/patches/server/0817-Improve-scoreboard-entries.patch b/patches/server/0817-Improve-scoreboard-entries.patch
index 4db7c1f77b..82f0da6dde 100644
--- a/patches/server/0817-Improve-scoreboard-entries.patch
+++ b/patches/server/0817-Improve-scoreboard-entries.patch
@@ -52,10 +52,10 @@ index 944080939ceaf2db8bcd7d3c01f4b97440e35cc1..0102c475b6e49777c1e24c32e5eff299
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-index af4ab4be3722d3349f7f71da062dee493cd2aafe..d1844550bafa381a6dd88702dabef6de39be0907 100644
+index 0e1fbecfc3062ceac425607507caa54b0d007130..32a160ca2e53cc76a31cb401d1509c5e643041dd 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-@@ -309,6 +309,26 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
+@@ -310,6 +310,26 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
}
}
diff --git a/patches/server/0834-Multiple-Entries-with-Scoreboards.patch b/patches/server/0834-Multiple-Entries-with-Scoreboards.patch
index 21fc65abbd..1aaf48cd04 100644
--- a/patches/server/0834-Multiple-Entries-with-Scoreboards.patch
+++ b/patches/server/0834-Multiple-Entries-with-Scoreboards.patch
@@ -70,10 +70,10 @@ index 610d312b9c8f6c8d1f102e8ba2fe9fc2cc3e98c5..3a4a0727ad44322e3ba85512cd077808
public void onObjectiveAdded(Objective objective) {
super.onObjectiveAdded(objective);
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-index d1844550bafa381a6dd88702dabef6de39be0907..d3d9641862f4746469bca946ef6d89a88f15698b 100644
+index 32a160ca2e53cc76a31cb401d1509c5e643041dd..29c49cf0e6e7f523e362730f0aa17fc4b18aceb9 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
-@@ -233,6 +233,21 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
+@@ -234,6 +234,21 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
scoreboard.board.addPlayerToTeam(entry, team);
}
@@ -95,7 +95,7 @@ index d1844550bafa381a6dd88702dabef6de39be0907..d3d9641862f4746469bca946ef6d89a8
@Override
public boolean removePlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException {
Validate.notNull(player, "OfflinePlayer cannot be null");
-@@ -252,6 +267,28 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
+@@ -253,6 +268,28 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
return true;
}