Skip to content

Commit

Permalink
Prevent Dandelifeon from deleting blockers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheRealWormbo committed Nov 1, 2024
1 parent f682be9 commit 6c56ce4
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 6c56ce4

Please sign in to comment.