aboutsummaryrefslogtreecommitdiff
path: root/spark-forge1710
diff options
context:
space:
mode:
authorembeddedt <42941056+embeddedt@users.noreply.github.com>2022-05-31 08:35:06 -0400
committerembeddedt <42941056+embeddedt@users.noreply.github.com>2022-05-31 08:35:06 -0400
commit1ba51fac41ae736b589857436a0a0361bcbe0d52 (patch)
tree79db6dafc910148ddf7848f8aa95a15af55ed98e /spark-forge1710
parent32ab78c71c5be97da7329a4f7c4035289a3490b1 (diff)
downloadspark-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.java6
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;
}