Updated op code

This commit is contained in:
Sekwah 2018-07-23 01:14:36 +01:00
parent a9b9c89422
commit 339e12dd0c
1 changed files with 12 additions and 12 deletions

View File

@ -24,19 +24,19 @@ public class ForgeCommandSenderContainer implements CommandSenderContainer {
public boolean isOp() { public boolean isOp() {
if(this.sender.getCommandSenderEntity() instanceof EntityPlayer) { if(this.sender.getCommandSenderEntity() instanceof EntityPlayer) {
if(!FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().canSendCommands(((EntityPlayer) this.sender).getGameProfile())) { if(!FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().canSendCommands(((EntityPlayer) this.sender).getGameProfile())) {
return false; return false;
} }
else { else {
UserListOpsEntry userlistopsentry = FMLCommonHandler.instance().getMinecraftServerInstance() UserListOpsEntry userlistopsentry = FMLCommonHandler.instance().getMinecraftServerInstance()
.getPlayerList().getOppedPlayers().getEntry(((EntityPlayer) this.sender).getGameProfile()); .getPlayerList().getOppedPlayers().getEntry(((EntityPlayer) this.sender).getGameProfile());
if (userlistopsentry != null) { // Intellij may say this will always be true but it isn't
return userlistopsentry.getPermissionLevel() >= 2; if (userlistopsentry != null) {
} else { return userlistopsentry.getPermissionLevel() >= 2;
return FMLCommonHandler.instance().getMinecraftServerInstance().getOpPermissionLevel() } else {
>= 2; return FMLCommonHandler.instance().getMinecraftServerInstance().getOpPermissionLevel() >= 2;
}
} }
}
} }
else { else {