Skip to content

Commit

Permalink
yeet commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Dec 7, 2023
1 parent b8adcb9 commit 55f8fcb
Showing 1 changed file with 0 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ private class QuantumControllerHandler implements IDualHandler {
// IItemHandler saved values
private ItemHandlerList itemHandlers;

// private int insertIndex = -1;
// private int extractIndex = -1;

private void invalidate() {
fluidTanks = new FluidTankList(false);
itemHandlers = new ItemHandlerList(new ArrayList<>());
Expand Down Expand Up @@ -345,75 +342,25 @@ private ItemHandlerList getItemHandlers() {

@Override
public int getSlots() {
// gotta lie to GTTransferUtils
return itemHandlers.getSlots();
}

@NotNull
@Override
public ItemStack getStackInSlot(int slot) {
// make GTTransferUtils always think it can insert items
return itemHandlers.getStackInSlot(slot);
}

@NotNull
@Override
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) {
return itemHandlers.insertItem(slot, stack, simulate);

// // check item handlers if the stack to insert matches a stack already in the item handler
// if (simulate) {
// ItemStack checkStack;
// boolean canInsert = false;
// for (int i = 0; i < getItemHandlers().getSlots(); i++) {
// IItemHandler handler = getItemHandlers().get(i);
// // try to get a stack in output slot
// checkStack = handler.getStackInSlot(2);
//
// // if the check stack is empty, or equal to the incoming stack
// if (checkStack.isItemEqual(stack) || checkStack.isEmpty()) {
// canInsert = true;
// this.insertIndex = i;
// GTTransferUtils.insertItem(itemHandlers, stack, simulate) = handler.insertItem(1,
// GTTransferUtils.insertItem(itemHandlers, stack, simulate), true);
// if (GTTransferUtils.insertItem(itemHandlers, stack, simulate).isEmpty() ||
// GTTransferUtils.insertItem(itemHandlers, stack, simulate).getCount() < stack.getCount()) break;
// }
// }
// if (!canInsert) this.insertIndex = -1;
// } else if (this.insertIndex != -1) {
// GTTransferUtils.insertItem(itemHandlers, stack, simulate) =
// getItemHandlers().get(this.insertIndex).insertItem(1, GTTransferUtils.insertItem(itemHandlers, stack,
// simulate), false);
// }
//
// return GTTransferUtils.insertItem(itemHandlers, stack, simulate);
}

@NotNull
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
return itemHandlers.extractItem(slot, amount, simulate);

// ItemStack extracted = ItemStack.EMPTY;
//
// if (simulate){
// boolean canExtract = false;
// for (int i = 0; i < getItemHandlers().size(); i++) {
// IItemHandler handler = getItemHandlers().get(i);
// extracted = handler.extractItem(0, amount, true);
// if (!extracted.isEmpty()){
// canExtract = true;
// this.extractIndex = i;
// break;
// }
// }
// if (!canExtract) this.extractIndex = -1;
// } else if (this.extractIndex != -1) {
// extracted = getItemHandlers().get(this.extractIndex).extractItem(0, amount, false);
// }
//
// return extracted;
}

@Override
Expand Down

0 comments on commit 55f8fcb

Please sign in to comment.