mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
matches is areItemStacksEqual, isSame is areItemsEqual
obviously
This commit is contained in:
parent
198a4d359a
commit
2b6b42e091
5 changed files with 5 additions and 5 deletions
|
@ -121,7 +121,7 @@ public final class Helper {
|
|||
var handStack = player.getItemInHand(hand);
|
||||
if (!handStack.isEmpty()) {
|
||||
var remain = handler.insertItem(slot, handStack, player.level.isClientSide);
|
||||
if (!ItemStack.isSame(remain, handStack)) {
|
||||
if (!ItemStack.matches(remain, handStack)) {
|
||||
if (sound)
|
||||
player.level.playSound(player, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5,
|
||||
SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.PLAYERS, 0.75F, 1F);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class BlockEntityGratedChute extends BlockEntityImpl implements ITickable
|
|||
if (stack.isEmpty())
|
||||
continue;
|
||||
var left = this.items.insertItem(0, stack, false);
|
||||
if (!ItemStack.isSame(stack, left)) {
|
||||
if (!ItemStack.matches(stack, left)) {
|
||||
if (left.isEmpty()) {
|
||||
item.kill();
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,7 @@ public class BlockEntityHopperUpgrade extends BlockEntityImpl implements ITickab
|
|||
}
|
||||
}
|
||||
|
||||
if (!ItemStack.isSame(stack, copy)) {
|
||||
if (!ItemStack.matches(stack, copy)) {
|
||||
item.setItem(copy);
|
||||
if (copy.isEmpty())
|
||||
item.kill();
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BlockEntityItemDistributor extends BlockEntityImpl implements ITick
|
|||
continue;
|
||||
for (var j = 0; j < dest.getSlots(); j++) {
|
||||
var remain = dest.insertItem(j, stack, false);
|
||||
if (!ItemStack.isSame(remain, stack)) {
|
||||
if (!ItemStack.matches(remain, stack)) {
|
||||
above.extractItem(i, 1, false);
|
||||
this.cooldown = 3;
|
||||
return;
|
||||
|
|
|
@ -68,7 +68,7 @@ public class BlockEntityPlacer extends BlockEntityImpl implements ITickableBlock
|
|||
|
||||
var pos = validPositions.get(this.level.random.nextInt(validPositions.size()));
|
||||
var left = this.tryPlace(stack.copy(), pos);
|
||||
if (ItemStack.isSame(stack, left))
|
||||
if (ItemStack.matches(stack, left))
|
||||
continue;
|
||||
|
||||
handler.extractItem(i, 1, false);
|
||||
|
|
Loading…
Reference in a new issue