Waila Harvestability

Waila Harvestability

55M Downloads

Camouflaged blocks give an <Error>

Darkhax opened this issue ยท 2 comments

commented

My mod Dark Utilities has several blocks which can be camouflaged to look like other blocks. To help maintain the illusion while Waila is installed, I override the getWailaStack method to return the held camouflage block. When Waila Harvestability is installed, this will cause the mod to throw an exception which is caught by Waila. The following is the exception that is caught.

[19:57:59] [Client thread/WARN] [Waila]: net.minecraft.block.state.BlockState$StateImplementation.getValue:137
[19:57:59] [Client thread/WARN] [Waila]: net.minecraft.block.BlockStone.getMetaFromState:89
[19:57:59] [Client thread/WARN] [Waila]: net.minecraft.block.Block.getHarvestTool:2300
[19:57:59] [Client thread/WARN] [Waila]: net.minecraftforge.common.ForgeHooks.canHarvestBlock:136
[19:57:59] [Client thread/WARN] [Waila]: squeek.wailaharvestability.WailaHandler.getHarvestability:123
[19:57:59] [Client thread/WARN] [Waila]: Catched unhandled exception : [class squeek.wailaharvestability.WailaHandler] java.lang.IllegalArgumentException: Cannot get property PropertyEnum{name=variant, clazz=class net.minecraft.block.BlockStone$EnumType, values=[stone, granite, smooth_granite, diorite, smooth_diorite, andesite, smooth_andesite]} as it does not exist in ExtendedBlockState{block=darkutils:sneaky_ghost, properties=[]}
commented

Hmm... looks like ForgeHooks.canHarvestBlock is weird in 1.8.9, since it now takes the position rather than meta and does a weird mixture of using the passed in Block and the world.getBlockState(pos).getBlock(). Would probably be worth sending a PR to Forge for an overloaded ForgeHooks.canHarvestBlock method that takes an IBlockState rather than IBlockAccess/BlockPos.

commented

Closed by e626a16