Fixed crash with Croptopia

This commit is contained in:
thedarkcolour 2024-06-29 22:41:39 -07:00
parent 3e0a9c1366
commit fe49bb2bfc
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38

View File

@ -77,8 +77,8 @@ public class InfestedLeavesBlockEntity extends EBlockEntity {
if (state.is(BlockTags.LEAVES) && state.getBlock() != EBlocks.INFESTED_LEAVES.get()) {
// Spread and keep distance/persistent properties
level.setBlock(targetPos, EBlocks.INFESTED_LEAVES.get().defaultBlockState()
.setValue(LeavesBlock.DISTANCE, state.getValue(LeavesBlock.DISTANCE))
.setValue(LeavesBlock.PERSISTENT, state.getValue(LeavesBlock.PERSISTENT)),
.setValue(LeavesBlock.DISTANCE, state.hasProperty(LeavesBlock.DISTANCE) ? state.getValue(LeavesBlock.DISTANCE) : 0)
.setValue(LeavesBlock.PERSISTENT, state.hasProperty(LeavesBlock.PERSISTENT) ? state.getValue(LeavesBlock.PERSISTENT) : false),
2);
var te = level.getBlockEntity(targetPos);