Fixed a WAILA exploit with the password-protected chests
@@ -78,13 +78,13 @@ public class KeypadChestBlock extends ChestBlock implements IPasswordConvertible
if(entity instanceof PlayerEntity)
MinecraftForge.EVENT_BUS.post(new OwnershipEvent(world, pos, (PlayerEntity)entity));
- if( world.getTileEntity(pos.east()) instanceof KeypadChestTileEntity)
+ if(world.getTileEntity(pos.east()) instanceof KeypadChestTileEntity && ((KeypadChestTileEntity) world.getTileEntity(pos.east())).getOwner().isOwner((PlayerEntity) entity))
((KeypadChestTileEntity)(world.getTileEntity(pos))).setPassword(((KeypadChestTileEntity) world.getTileEntity(pos.east())).getPassword());
- else if(world.getTileEntity(pos.west()) instanceof KeypadChestTileEntity)
+ else if(world.getTileEntity(pos.west()) instanceof KeypadChestTileEntity && ((KeypadChestTileEntity) world.getTileEntity(pos.west())).getOwner().isOwner((PlayerEntity) entity))
((KeypadChestTileEntity)(world.getTileEntity(pos))).setPassword(((KeypadChestTileEntity) world.getTileEntity(pos.west())).getPassword());
- else if(world.getTileEntity(pos.south()) instanceof KeypadChestTileEntity)
+ else if(world.getTileEntity(pos.south()) instanceof KeypadChestTileEntity && ((KeypadChestTileEntity) world.getTileEntity(pos.south())).getOwner().isOwner((PlayerEntity) entity))
((KeypadChestTileEntity)(world.getTileEntity(pos))).setPassword(((KeypadChestTileEntity) world.getTileEntity(pos.south())).getPassword());
- else if(world.getTileEntity(pos.north()) instanceof KeypadChestTileEntity)
+ else if(world.getTileEntity(pos.north()) instanceof KeypadChestTileEntity && ((KeypadChestTileEntity) world.getTileEntity(pos.north())).getOwner().isOwner((PlayerEntity) entity))
((KeypadChestTileEntity)(world.getTileEntity(pos))).setPassword(((KeypadChestTileEntity) world.getTileEntity(pos.north())).getPassword());
}
