diff options
Diffstat (limited to 'spark-forge1710')
4 files changed, 12 insertions, 10 deletions
diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710PlatformInfo.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710PlatformInfo.java index 7d7fea5..d9c8351 100644 --- a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710PlatformInfo.java +++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710PlatformInfo.java @@ -20,10 +20,10 @@ package me.lucko.spark.forge; -import me.lucko.spark.common.platform.AbstractPlatformInfo; +import me.lucko.spark.common.platform.PlatformInfo; import net.minecraftforge.common.ForgeVersion; -public class Forge1710PlatformInfo extends AbstractPlatformInfo { +public class Forge1710PlatformInfo implements PlatformInfo { private final Type type; public Forge1710PlatformInfo(Type type) { diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickHook.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickHook.java index 3914224..44cb11a 100644 --- a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickHook.java +++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickHook.java @@ -20,11 +20,11 @@ package me.lucko.spark.forge; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import me.lucko.spark.common.tick.AbstractTickHook; import me.lucko.spark.common.tick.TickHook; -import net.minecraftforge.common.MinecraftForge; public class Forge1710TickHook extends AbstractTickHook implements TickHook { private final TickEvent.Type type; @@ -48,12 +48,12 @@ public class Forge1710TickHook extends AbstractTickHook implements TickHook { @Override public void start() { - MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); } @Override public void close() { - MinecraftForge.EVENT_BUS.unregister(this); + FMLCommonHandler.instance().bus().unregister(this); } } diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickReporter.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickReporter.java index f507637..d46c4d6 100644 --- a/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickReporter.java +++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/Forge1710TickReporter.java @@ -20,11 +20,11 @@ package me.lucko.spark.forge; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import me.lucko.spark.common.tick.SimpleTickReporter; import me.lucko.spark.common.tick.TickReporter; -import net.minecraftforge.common.MinecraftForge; public class Forge1710TickReporter extends SimpleTickReporter implements TickReporter { private final TickEvent.Type type; @@ -53,12 +53,12 @@ public class Forge1710TickReporter extends SimpleTickReporter implements TickRep @Override public void start() { - MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); } @Override public void close() { - MinecraftForge.EVENT_BUS.unregister(this); + FMLCommonHandler.instance().bus().unregister(this); super.close(); } 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; } |