mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +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);
|
var handStack = player.getItemInHand(hand);
|
||||||
if (!handStack.isEmpty()) {
|
if (!handStack.isEmpty()) {
|
||||||
var remain = handler.insertItem(slot, handStack, player.level.isClientSide);
|
var remain = handler.insertItem(slot, handStack, player.level.isClientSide);
|
||||||
if (!ItemStack.isSame(remain, handStack)) {
|
if (!ItemStack.matches(remain, handStack)) {
|
||||||
if (sound)
|
if (sound)
|
||||||
player.level.playSound(player, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5,
|
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);
|
SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.PLAYERS, 0.75F, 1F);
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class BlockEntityGratedChute extends BlockEntityImpl implements ITickable
|
||||||
if (stack.isEmpty())
|
if (stack.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
var left = this.items.insertItem(0, stack, false);
|
var left = this.items.insertItem(0, stack, false);
|
||||||
if (!ItemStack.isSame(stack, left)) {
|
if (!ItemStack.matches(stack, left)) {
|
||||||
if (left.isEmpty()) {
|
if (left.isEmpty()) {
|
||||||
item.kill();
|
item.kill();
|
||||||
} else {
|
} 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);
|
item.setItem(copy);
|
||||||
if (copy.isEmpty())
|
if (copy.isEmpty())
|
||||||
item.kill();
|
item.kill();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class BlockEntityItemDistributor extends BlockEntityImpl implements ITick
|
||||||
continue;
|
continue;
|
||||||
for (var j = 0; j < dest.getSlots(); j++) {
|
for (var j = 0; j < dest.getSlots(); j++) {
|
||||||
var remain = dest.insertItem(j, stack, false);
|
var remain = dest.insertItem(j, stack, false);
|
||||||
if (!ItemStack.isSame(remain, stack)) {
|
if (!ItemStack.matches(remain, stack)) {
|
||||||
above.extractItem(i, 1, false);
|
above.extractItem(i, 1, false);
|
||||||
this.cooldown = 3;
|
this.cooldown = 3;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class BlockEntityPlacer extends BlockEntityImpl implements ITickableBlock
|
||||||
|
|
||||||
var pos = validPositions.get(this.level.random.nextInt(validPositions.size()));
|
var pos = validPositions.get(this.level.random.nextInt(validPositions.size()));
|
||||||
var left = this.tryPlace(stack.copy(), pos);
|
var left = this.tryPlace(stack.copy(), pos);
|
||||||
if (ItemStack.isSame(stack, left))
|
if (ItemStack.matches(stack, left))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
handler.extractItem(i, 1, false);
|
handler.extractItem(i, 1, false);
|
||||||
|
|
Loading…
Reference in a new issue