From fe49bb2bfcb4b1eb97c8856cbfe30e139ebeef3c Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:41:39 -0700 Subject: [PATCH] Fixed crash with Croptopia --- .../exdeorum/blockentity/InfestedLeavesBlockEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java index 32daa15b..6891d262 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/InfestedLeavesBlockEntity.java @@ -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);