@Override
public boolean onDefend(IInterdictionMatrix interdictionMatrix, EntityLivingBase entityLiving)
{
if (entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entityLiving;
IBiometricIdentifier biometricIdentifier = interdictionMatrix.getBiometricIdentifier();
if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(player.username, Permission.DEFENSE_STATION_CONFISCATION))
{
return false;
}
}
Set<ItemStack> controlledStacks = interdictionMatrix.getFilteredItems();
int confiscationCount = 0;
IInventory inventory = null;
if (entityLiving instanceof EntityPlayer)
{
IBiometricIdentifier biometricIdentifier = interdictionMatrix.getBiometricIdentifier();
if (biometricIdentifier != null && biometricIdentifier.isAccessGranted(((EntityPlayer) entityLiving).username, Permission.BYPASS_INTERDICTION_MATRIX))
{
return false;
}
EntityPlayer player = (EntityPlayer) entityLiving;
inventory = player.inventory;
}
else if (entityLiving instanceof IInventory)
{
inventory = (IInventory) entityLiving;