Fixed break crash

This commit is contained in:
aidancbrady 2016-07-03 02:07:14 -04:00
parent 330756e5a7
commit fdc21d8de5
2 changed files with 10 additions and 4 deletions

View file

@ -1501,8 +1501,15 @@ public final class MekanismUtils
* @param player - player to check * @param player - player to check
* @return if the player has operator privileges * @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()); return general.opsBypassRestrictions && player.mcServer.getConfigurationManager().func_152596_g(player.getGameProfile());
} }

View file

@ -11,7 +11,6 @@ import mekanism.common.security.ISecurityTile.SecurityMode;
import mekanism.common.security.SecurityData; import mekanism.common.security.SecurityData;
import mekanism.common.security.SecurityFrequency; import mekanism.common.security.SecurityFrequency;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
@ -35,7 +34,7 @@ public final class SecurityUtils
ISecurityItem security = (ISecurityItem)stack.getItem(); ISecurityItem security = (ISecurityItem)stack.getItem();
if(MekanismUtils.isOp((EntityPlayerMP)player)) if(MekanismUtils.isOp(player))
{ {
return true; return true;
} }
@ -52,7 +51,7 @@ public final class SecurityUtils
ISecurityTile security = (ISecurityTile)tile; ISecurityTile security = (ISecurityTile)tile;
if(MekanismUtils.isOp((EntityPlayerMP)player)) if(MekanismUtils.isOp(player))
{ {
return true; return true;
} }