Fixed crash when Destructor tries to break secured network block

This commit is contained in:
raoulvdberge
2017-02-14 22:50:46 +01:00
parent e623a76d60
commit 3807832ab4
2 changed files with 8 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
- Fixed "Clear" and "Create Pattern" buttons not working correctly when using Grid Filter tabs (raoulvdberge)
- Fixed Wrench in Dismantling Mode voiding Storage Block contents (raoulvdberge)
- Fixed OPs not having global permissions on secured storage systems (raoulvdberge)
- Fixed crash when Destructor tries to break secured network block (raoulvdberge)
### 1.4
- Added Security Manager (raoulvdberge)

View File

@@ -327,6 +327,13 @@ public final class RSUtils {
}
public static void sendNoPermissionMessage(EntityPlayer player) {
// When a fake player isn't allowed to do something, we can't send a no permission message because there is no connection associated to the fake player.
// For example when a Destructor is attempting to break a network block on a secured network with the fake player.
// So, we first check if there is a connection.
if (player instanceof EntityPlayerMP && ((EntityPlayerMP) player).connection == null) {
return;
}
player.sendMessage(new TextComponentTranslation("misc.refinedstorage:security.no_permission").setStyle(new Style().setColor(TextFormatting.RED)));
}