From a266061933f2ad85abcb3fcd2a2059ecd8e14c05 Mon Sep 17 00:00:00 2001 From: chrommob Date: Wed, 18 Dec 2024 12:15:59 +0100 Subject: [PATCH] 1.4.2 update: fix minor issue with checking permission too soon --- build.gradle | 2 +- .../java/me/chrommob/baritoneremover/data/PlayerData.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 7946ca6..6edb99a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group = 'me.chrommob' -version = '1.4.1' +version = '1.4.2' repositories { mavenCentral() diff --git a/src/main/java/me/chrommob/baritoneremover/data/PlayerData.java b/src/main/java/me/chrommob/baritoneremover/data/PlayerData.java index f2b791d..46ab0dc 100644 --- a/src/main/java/me/chrommob/baritoneremover/data/PlayerData.java +++ b/src/main/java/me/chrommob/baritoneremover/data/PlayerData.java @@ -9,6 +9,7 @@ import me.chrommob.baritoneremover.data.types.PositionData; import me.chrommob.baritoneremover.data.types.RotationData; import org.bukkit.Bukkit; +import org.bukkit.entity.Player; import javax.print.attribute.standard.Severity; import java.util.HashSet; @@ -97,7 +98,8 @@ public void runChecks(CheckType updateType) { return; } if (TPS.get()) return; - if (Bukkit.getPlayer(name).hasPermission("br.bypass")) { + Player player = Bukkit.getPlayer(name); + if (player != null && player.hasPermission("br.bypass")) { return; } checks.forEach(check -> {