Skip to content

Commit

Permalink
Merge pull request #152 from YocyCraft/1.20.1
Browse files Browse the repository at this point in the history
修复溜槽无限提取上方雕纹书架内的书,以及播放完的唱片机里的唱片
  • Loading branch information
Gu-ZT authored Apr 4, 2024
2 parents bebe385 + 1ca1272 commit 7439915
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ public static boolean suckInItems(Level level, Hopper hopper) {
}

private static boolean tryTakeInItemFromSlot(Hopper hopper, @NotNull Container container, int slot, Direction direction) {
ItemStack itemStack = container.getItem(slot);
ItemStack itemStack = container.getItem(slot).copy();
int amount = itemStack.getCount();
if (!itemStack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(hopper, container, itemStack, slot, direction)) {
ItemStack itemStack3 = HopperBlockEntity.addItem(container, hopper, itemStack, null);
container.setItem(slot, itemStack3);
if(itemStack3 == null || itemStack3.isEmpty()){
container.removeItem(slot, amount);
}else{
container.setItem(slot, itemStack3);
}
return true;
}
return false;
Expand Down

0 comments on commit 7439915

Please sign in to comment.