From 20f34ecc89320c9ea1f3005e5c3e5033013a673c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 3 Oct 2016 16:50:36 +0200 Subject: [PATCH] Move this check up to actually be done when it's needed Closes #269 --- .../actuallyadditions/mod/gen/WorldGenLushCaves.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java index 01c87bdb7..b44652792 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java @@ -103,18 +103,18 @@ public class WorldGenLushCaves extends WorldGenerator{ } private boolean checkIndestructable(World world, BlockPos pos){ + //If this isn't checked, the game crashes because it tries to destroy a chest that doesn't have any loot yet :v + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof ILootContainer){ + return true; + } + IBlockState state = world.getBlockState(pos); if(state != null){ Block block = state.getBlock(); if(block != null && (block.isAir(state, world, pos) || block.getHarvestLevel(state) >= 0F)){ return false; } - - //If this isn't checked, the game crashes because it tries to destroy a chest that doesn't have any loot yet :v - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof ILootContainer){ - return true; - } } return true; }