aboutsummaryrefslogtreecommitdiff
path: root/spark-forge1710/src/main/java/me/lucko
diff options
context:
space:
mode:
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;
}