Crash when trying to retrieve a non-existant EnumProperty (WorldEdit "incompatibility")
IchHabeHunger54 opened this issue ยท 0 comments
Problem
Log: https://gist.github.com/IchHabeHunger54/a2b52009e4162d810b8b719edfd21dc4
I've been building with DO and Worldedit, and replaced some bottom pillar pieces with stone bricks. Due to the nature of WorldEdit, the pillars' shapes were not updated, so there were normal pillar blockstates directly touching the stone bricks, instead of the special base states. I then tried to break what should have been the new base pillar (directly above what was now stone bricks), and the game crashed, trying to retrieve the pillar property on a non-pillar block (supposedly the neighboring stone bricks).
Suggested Fix
Changing lines 153 and 162 to these two respective lines:
if (isPillarBlock(world.getBlockState(pos.below())) && world.getBlockState(pos.below()).getValue(column)== PillarShapeType.PILLAR_COLUMN)
and
if (isPillarBlock(world.getBlockState(pos.above())) && world.getBlockState(pos.above()).getValue(column)== PillarShapeType.PILLAR_COLUMN)
Adding the isPillarBlock(...)
condition in both if statements should do the trick. I haven't setup a DO environment locally, and due to being on vacation, I am unable to PR the fix myself, and I am also unable to test it. Hope that helps, though.
If there are any questions left, feel free to ask them here. I'll respond as soon as I can.
(EDIT: Fixed the suggested fix, I used the given state instead of the state above/below.)