StructureHemp blockstate mishandling
pau101 opened this issue ยท 0 comments
Hello,
Currently StructureHemp does not ensure successful placement of its hemp block before trying to modify its properties. This causes IllegalArgumentExceptions when placement does not succeed as seen in the crash from this issue we recieved BobMowzie/MowziesMobs#155
The erroring code seen here:
The preferred solution is to directly set the desired blockstate using withProperty, however alternatively it is possible to guard the setState like so:
if (world.setBlockState(posNew, CampingMod.OBJ.hemp.getDefaultState)) {
CampingMod.OBJ.hemp.setState(world, posNew, Definitions.Hemp.STATE_AGE, age)
}Thank you for your time