From 6c56ce49771a1c42d73a21629106e2cef968487f Mon Sep 17 00:00:00 2001 From: TheRealWormbo Date: Fri, 1 Nov 2024 17:16:12 +0100 Subject: [PATCH] Prevent Dandelifeon from deleting blockers Fixes #4761 by only consuming a block and generating mana for it when the flower would place a cellular block there if the location wasn't adjacent to the flower. --- .../flower/generating/DandelifeonBlockEntity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Xplat/src/main/java/vazkii/botania/common/block/flower/generating/DandelifeonBlockEntity.java b/Xplat/src/main/java/vazkii/botania/common/block/flower/generating/DandelifeonBlockEntity.java index cb74ba7fb7..2a0ea1b3ab 100644 --- a/Xplat/src/main/java/vazkii/botania/common/block/flower/generating/DandelifeonBlockEntity.java +++ b/Xplat/src/main/java/vazkii/botania/common/block/flower/generating/DandelifeonBlockEntity.java @@ -135,10 +135,12 @@ void setBlockForGeneration(BlockPos pos, int cell, int prevCell) { BlockState stateAt = world.getBlockState(pos); BlockEntity tile = world.getBlockEntity(pos); if (cell == Cell.CONSUME) { - int val = prevCell * MANA_PER_GEN; - world.removeBlock(pos, true); - addMana(val); - sync(); + if (stateAt.isAir()) { + int val = prevCell * MANA_PER_GEN; + world.removeBlock(pos, true); + addMana(val); + sync(); + } } else if (tile instanceof CellularBlockEntity cellBlock) { cellBlock.setNextGeneration(this, cell); } else if (Cell.isLive(cell) && stateAt.isAir()) {