From fdc21d8de5459111b98ab9ed53ba6c5b5cf153d0 Mon Sep 17 00:00:00 2001 From: aidancbrady Date: Sun, 3 Jul 2016 02:07:14 -0400 Subject: [PATCH] Fixed break crash --- src/main/java/mekanism/common/util/MekanismUtils.java | 9 ++++++++- src/main/java/mekanism/common/util/SecurityUtils.java | 5 ++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/common/util/MekanismUtils.java b/src/main/java/mekanism/common/util/MekanismUtils.java index 7540d655c..c1eff4ca5 100644 --- a/src/main/java/mekanism/common/util/MekanismUtils.java +++ b/src/main/java/mekanism/common/util/MekanismUtils.java @@ -1501,8 +1501,15 @@ public final class MekanismUtils * @param player - player to check * @return if the player has operator privileges */ - public static boolean isOp(EntityPlayerMP player) + public static boolean isOp(EntityPlayer p) { + if(!(p instanceof EntityPlayerMP)) + { + return false; + } + + EntityPlayerMP player = (EntityPlayerMP)p; + return general.opsBypassRestrictions && player.mcServer.getConfigurationManager().func_152596_g(player.getGameProfile()); } diff --git a/src/main/java/mekanism/common/util/SecurityUtils.java b/src/main/java/mekanism/common/util/SecurityUtils.java index b21952741..b96d5e60e 100644 --- a/src/main/java/mekanism/common/util/SecurityUtils.java +++ b/src/main/java/mekanism/common/util/SecurityUtils.java @@ -11,7 +11,6 @@ import mekanism.common.security.ISecurityTile.SecurityMode; import mekanism.common.security.SecurityData; import mekanism.common.security.SecurityFrequency; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; @@ -35,7 +34,7 @@ public final class SecurityUtils ISecurityItem security = (ISecurityItem)stack.getItem(); - if(MekanismUtils.isOp((EntityPlayerMP)player)) + if(MekanismUtils.isOp(player)) { return true; } @@ -52,7 +51,7 @@ public final class SecurityUtils ISecurityTile security = (ISecurityTile)tile; - if(MekanismUtils.isOp((EntityPlayerMP)player)) + if(MekanismUtils.isOp(player)) { return true; }