mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 03:07:34 +00:00
flip boolean logic so it's more readable3
This commit is contained in:
1 parent
7e06be509d
commit
db751c462c
1 file changed
+4
-4
@@ -62,7 +62,7 @@ public final class TileEntitySavePacket extends AbstractPacket {
|
||||
|
||||
NBTTagCompound incomingCompound = ByteBufUtils.readNBT(in);
|
||||
|
||||
if (isCorrectPermission(incomingCompound, player))
|
||||
if (!isCorrectPermission(incomingCompound, player))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(packetName, player, EnumItemPacketType.WAND, EnumItemPacketType.BLOCK))
|
||||
@@ -78,17 +78,17 @@ public final class TileEntitySavePacket extends AbstractPacket {
|
||||
TileEntity tile = player.worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if (tile == null)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
boolean validatesPacket = tile instanceof ITilePermission;
|
||||
if (!validatesPacket) {
|
||||
LogWriter.error(String.format("%s tried to use TileEntitySavePacket on %s -- should this class implement ITileValidityChecker??", player.getCommandSenderName(), tile));
|
||||
return true; // Assume packet is not meant for this entity from the get-go as there is no checking process.
|
||||
return false; // Assume packet is not meant for this entity from the get-go as there is no checking process.
|
||||
}
|
||||
|
||||
ITilePermission validityChecker = (ITilePermission) tile;
|
||||
CustomNpcsPermissions.Permission perm = validityChecker.getPermission();
|
||||
|
||||
return !CustomNpcsPermissions.hasPermission(player, perm);
|
||||
return CustomNpcsPermissions.hasPermission(player, perm);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user