Skip to content

Commit

Permalink
fix: door-related bug (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-xi authored Dec 26, 2024
1 parent 7556d67 commit 35553b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Unless otherwise specified, any version comparison below is the comparison of se
- Fixed visual flashes when eating chorus fruits.
- Fixed incorrect comparison of `Position3x#dimension`.
- Fixed a number of falling block related bugs.
- Fixed incorrectly dropping drops when destroying the upper part of a door in creation mode.

## [0.1.0](https://github.com/AllayMC/Allay/releases/tag/0.1.0) (API 0.1.0) - 2024-12-22

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ public boolean onInteract(ItemStack itemStack, Dimension dimension, PlayerIntera
return true;
}

@Override
public void onBreak(BlockStateWithPos blockState, ItemStack usedItem, Entity entity) {
if (blockState.blockState().getPropertyValue(UPPER_BLOCK_BIT)) {
blockState.pos().dimension().breakBlock(((Vector3i) blockState.pos()).sub(0, 1, 0), null, entity);
}
super.onBreak(blockState, usedItem, entity);
}

@Override
public Set<ItemStack> getDrops(BlockStateWithPos blockState, ItemStack usedItem, Entity entity) {
return blockState.blockState().getPropertyValue(UPPER_BLOCK_BIT) ? Utils.EMPTY_ITEM_STACK_SET : super.getDrops(blockState, usedItem, entity);
Expand Down

0 comments on commit 35553b5

Please sign in to comment.