![The Camping Mod](https://media.forgecdn.net/avatars/thumbnails/15/112/256/256/635614882535953065.jpeg)
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 IllegalArgumentException
s 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