Skip to content

Commit

Permalink
refactor: remove useless variable declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jun 15, 2024
1 parent a509afb commit 8a1cc6d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ public void onNeighborUpdate(BlockStateWithPos current, BlockStateWithPos neighb
var plantType = current.blockState().getPropertyValue(VanillaBlockPropertyTypes.DOUBLE_PLANT_TYPE);
var willBreak = false;
if (isUpperBlock) {
var downBlock = dimension.getBlockState(BlockFace.DOWN.offsetPos(current.pos()));
willBreak = notSamePlant(downBlock, plantType);
willBreak = notSamePlant(
dimension.getBlockState(BlockFace.DOWN.offsetPos(current.pos())),
plantType
);
} else {
var upperBlock = dimension.getBlockState(BlockFace.UP.offsetPos(current.pos()));
willBreak = notSamePlant(upperBlock, plantType);
willBreak = notSamePlant(
dimension.getBlockState(BlockFace.UP.offsetPos(current.pos())),
plantType
);
}
if (willBreak) dimension.breakBlock(current.pos(), null, null);
}
Expand Down

0 comments on commit 8a1cc6d

Please sign in to comment.