matches is areItemStacksEqual, isSame is areItemsEqual

obviously
This commit is contained in:
Ell 2021-12-19 15:40:53 +01:00
parent 198a4d359a
commit 2b6b42e091
5 changed files with 5 additions and 5 deletions

View file

@ -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);

View file

@ -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 {

View file

@ -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();

View file

@ -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;

View file

@ -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);