aboutsummaryrefslogtreecommitdiff
path: root/spark-forge1710/src/main/java/me/lucko
diff options
context:
space:
mode:
authorembeddedt <42941056+embeddedt@users.noreply.github.com>2022-12-26 18:50:18 -0500
committerembeddedt <42941056+embeddedt@users.noreply.github.com>2022-12-26 18:50:18 -0500
commitd9550259c1995d21fc345c58f2e531fdecf75acd (patch)
tree81365fd0c0581b68e472b2e6c5278657f779b35e /spark-forge1710/src/main/java/me/lucko
parent077889c3f80c954ff97dc347f75da3b436e2ba38 (diff)
downloadspark-d9550259c1995d21fc345c58f2e531fdecf75acd.tar.gz
spark-d9550259c1995d21fc345c58f2e531fdecf75acd.tar.bz2
spark-d9550259c1995d21fc345c58f2e531fdecf75acd.zip
Attempt to fix NPE when running profiler
Diffstat (limited to 'spark-forge1710/src/main/java/me/lucko')
-rw-r--r--spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
index 3fde91e..db9f299 100644
--- a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
+++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
@@ -88,7 +88,15 @@ public class Forge1710ServerSparkPlugin extends Forge1710SparkPlugin {
public boolean hasPermission(ICommandSender sender, String permission) {
if (sender instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP)sender;
- return isOp(player) || player.mcServer.getServerOwner().equals(player.getGameProfile().getName());
+ if(isOp(player))
+ return true;
+ else {
+ String serverOwner = MinecraftServer.getServer().getServerOwner();
+ if(player.getGameProfile().getName() != null && serverOwner != null)
+ return serverOwner.equals(player.getGameProfile().getName());
+ else
+ return false;
+ }
} else {
return true;
}