From 1ba51fac41ae736b589857436a0a0361bcbe0d52 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Tue, 31 May 2022 08:35:06 -0400 Subject: Fix permissions in singleplayer --- .../me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spark-forge1710') 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; } -- cgit