From 7adf7a1cb4ff4ac3a96593c66bdf8c68b6e7141a Mon Sep 17 00:00:00 2001 From: Dieu Date: Wed, 7 Feb 2024 11:38:13 +0100 Subject: [PATCH 1/2] Fix NPE: [LogBlock] Could not parse BlockState for PLAYER_HEAD java.lang.NullPointerException: Cannot invoke "java.util.UUID.toString()" because the return value of "org.bukkit.profile.PlayerProfile.getUniqueId()" is null at de.diddiz.LogBlock.blockstate.BlockStateCodecSkull.getChangesAsComponent(BlockStateCodecSkull.java:77) ~[LogBlock.jar:?] at de.diddiz.LogBlock.blockstate.BlockStateCodecs.getChangesAsComponent(BlockStateCodecs.java:57) ~[LogBlock.jar:?] at de.diddiz.LogBlock.BlockChange.getTypeDetails(BlockChange.java:95) ~[LogBlock.jar:?] at de.diddiz.LogBlock.BlockChange.getTypeDetails(BlockChange.java:87) ~[LogBlock.jar:?] at de.diddiz.LogBlock.BlockChange.getLogMessage(BlockChange.java:135) ~[LogBlock.jar:?] at de.diddiz.LogBlock.CommandsHandler.showPage(CommandsHandler.java:446) ~[LogBlock.jar:?] at de.diddiz.LogBlock.CommandsHandler.showPage(CommandsHandler.java:428) ~[LogBlock.jar:?] at de.diddiz.LogBlock.CommandsHandler$CommandLookup.run(CommandsHandler.java:578) ~[LogBlock.jar:?] at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-"9e171ef"] at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-"9e171ef"] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) ~[?:?] --- .../de/diddiz/LogBlock/blockstate/BlockStateCodecSkull.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/diddiz/LogBlock/blockstate/BlockStateCodecSkull.java b/src/main/java/de/diddiz/LogBlock/blockstate/BlockStateCodecSkull.java index 0f21426..310a72e 100644 --- a/src/main/java/de/diddiz/LogBlock/blockstate/BlockStateCodecSkull.java +++ b/src/main/java/de/diddiz/LogBlock/blockstate/BlockStateCodecSkull.java @@ -73,7 +73,7 @@ public class BlockStateCodecSkull implements BlockStateCodec { PlayerProfile profile = (PlayerProfile) conf.get("profile"); if (profile != null) { TextComponent tc = new TextComponent("[" + (profile.getName() != null ? profile.getName() : (profile.getUniqueId() != null ? profile.getUniqueId().toString() : "~unknown~")) + "]"); - if (profile.getName() != null) { + if (profile.getName() != null && profile.getUniqueId() != null) { tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("UUID: " + profile.getUniqueId().toString()))); } return tc; From 626ba83b185201531e2b94c31f4443599613fb3f Mon Sep 17 00:00:00 2001 From: Dieu Date: Wed, 7 Feb 2024 11:44:31 +0100 Subject: [PATCH 2/2] Update dependencies --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 89ef2ba..d9ca630 100644 --- a/pom.xml +++ b/pom.xml @@ -62,13 +62,13 @@ junit junit - 4.11 + 4.13.2 test com.zaxxer HikariCP - 5.0.1 + 5.1.0 compile @@ -125,7 +125,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.12.1 17 @@ -133,7 +133,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.5.0 regex-property @@ -153,7 +153,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0 + 3.5.1