Skip to content

Commit

Permalink
修复溜槽在无法吸收物品时,删除实体的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
DancingSnow0517 committed Apr 10, 2024
1 parent 7dd59b0 commit 46d6693
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public void tick() {
// TODO: 尝试吸取上方 ItemEntity
List<ItemEntity> itemEntities = getLevel().getEntitiesOfClass(ItemEntity.class, new AABB(getBlockPos().relative(Direction.UP)), itemEntity -> !itemEntity.getItem().isEmpty());
for (ItemEntity itemEntity : itemEntities) {
ItemStack remaining = ItemDepositoryHelper.insertItem(depository, itemEntity.getItem(), true);
if (!remaining.isEmpty()) continue;
ItemDepositoryHelper.insertItem(depository, itemEntity.getItem(), false);
itemEntity.kill();
break;
Expand Down

0 comments on commit 46d6693

Please sign in to comment.