Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
qwer523 committed Jun 15, 2024
1 parent 0845a58 commit 7d55e7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import com.lowdragmc.lowdraglib.misc.ItemStackTransfer;
import com.lowdragmc.lowdraglib.side.item.ItemTransferHelper;

import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;

import org.jetbrains.annotations.NotNull;

public class UnlimitedItemStackTransfer extends ItemStackTransfer {

public UnlimitedItemStackTransfer() {
}
public UnlimitedItemStackTransfer() {}

public UnlimitedItemStackTransfer(int size) {
super(size);
Expand All @@ -24,17 +25,14 @@ public UnlimitedItemStackTransfer(ItemStack stack) {
}

@Override
@NotNull
public ItemStack extractItem(int slot, int amount, boolean simulate, boolean notifyChanges) {
if (amount == 0)
return ItemStack.EMPTY;
@NotNull public ItemStack extractItem(int slot, int amount, boolean simulate, boolean notifyChanges) {
if (amount == 0) return ItemStack.EMPTY;

validateSlotIndex(slot);

ItemStack existing = this.stacks.get(slot);

if (existing.isEmpty())
return ItemStack.EMPTY;
if (existing.isEmpty()) return ItemStack.EMPTY;

if (existing.getCount() <= amount) {
if (!simulate) {
Expand All @@ -48,7 +46,8 @@ public ItemStack extractItem(int slot, int amount, boolean simulate, boolean not
}
} else {
if (!simulate) {
this.stacks.set(slot, ItemTransferHelper.copyStackWithSize(existing, existing.getCount() - amount));
this.stacks.set(
slot, ItemTransferHelper.copyStackWithSize(existing, existing.getCount() - amount));
if (notifyChanges) {
onContentsChanged(slot);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.epimorphismmc.gregiceng.api.machine.feature.multiblock.IMEStockingBus;
import com.epimorphismmc.gregiceng.api.misc.ConfigurableAESlot;
import com.epimorphismmc.gregiceng.api.misc.IConfigurableAESlotList;

import com.epimorphismmc.gregiceng.api.misc.UnlimitedItemStackTransfer;

import com.epimorphismmc.monomorphism.ae2.MEPartMachine;
import com.epimorphismmc.monomorphism.machine.fancyconfigurator.InventoryFancyConfigurator;

Expand Down

0 comments on commit 7d55e7b

Please sign in to comment.