diff options
author | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-05-31 08:35:06 -0400 |
---|---|---|
committer | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-05-31 08:35:06 -0400 |
commit | 1ba51fac41ae736b589857436a0a0361bcbe0d52 (patch) | |
tree | 79db6dafc910148ddf7848f8aa95a15af55ed98e /spark-forge1710 | |
parent | 32ab78c71c5be97da7329a4f7c4035289a3490b1 (diff) | |
download | spark-1ba51fac41ae736b589857436a0a0361bcbe0d52.tar.gz spark-1ba51fac41ae736b589857436a0a0361bcbe0d52.tar.bz2 spark-1ba51fac41ae736b589857436a0a0361bcbe0d52.zip |
Fix permissions in singleplayer
Diffstat (limited to 'spark-forge1710')
-rw-r--r-- | spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java | 6 |
1 files changed, 4 insertions, 2 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 1e99a3f..303739f 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 @@ -28,6 +28,7 @@ import me.lucko.spark.common.tick.TickReporter; import me.lucko.spark.forge.*; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import java.util.List; @@ -54,8 +55,9 @@ public class Forge1710ServerSparkPlugin extends Forge1710SparkPlugin { @Override public boolean hasPermission(ICommandSender sender, String permission) { - if (sender instanceof EntityPlayer) { - return isOp((EntityPlayer) sender); + if (sender instanceof EntityPlayerMP) { + EntityPlayerMP player = (EntityPlayerMP)sender; + return isOp(player) || player.mcServer.getServerOwner().equals(player.getGameProfile().getName()); } else { return true; } |