Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qwer523 committed Jun 19, 2024
1 parent a545a4f commit d943ffc
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 109 deletions.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencyResolutionManagement {
def configurationVersion = "2.2.0"
def ldLibVersion = "1.0.25.p"
def mixinextrasVersion = "0.3.2"
def monomorphismLibVersion = "1.1.1-build.24"
def monomorphismLibVersion = "1.1.1-build.25"
def spotlessVersion = "7.0.0.BETA1"

forge {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
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;
import com.epimorphismmc.monomorphism.transfer.item.BigItemStackTransfer;

import appeng.api.networking.IStackWatcher;
import appeng.api.networking.security.IActionSource;
Expand Down Expand Up @@ -355,7 +355,7 @@ public boolean isItemValid(int slot, ItemStack stack) {

@Override
public ItemStackTransfer copy() {
var copy = new UnlimitedItemStackTransfer(getSlots());
var copy = new BigItemStackTransfer(getSlots(), true, Integer.MAX_VALUE);
for (int i = 0; i < inventory.length; i++) {
copy.setStackInSlot(i, getStackInSlot(i));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,44 @@ public List<Ingredient> handleItemInner(
GTRecipe recipe, List<Ingredient> left, boolean simulate) {
var internalInv = getMachine().getInternalInventory();
if (recipe.id.equals(lockedRecipeId) && lockedSlot >= 0) {
left = internalInv[lockedSlot].handleItemInternal(left, simulate);
} else {
this.lockedRecipeId = recipe.id;
List<Ingredient> contents = copyIngredients(left);
for (int i = 0; i < internalInv.length; i++) {
if (internalInv[i].isItemEmpty()) continue;
contents = internalInv[i].handleItemInternal(contents, simulate);
if (contents == null) {
this.lockedSlot = i;
return contents;
}
contents = copyIngredients(left);
return internalInv[lockedSlot].handleItemInternal(left, simulate);
}

this.lockedRecipeId = recipe.id;
List<Ingredient> contents = left;
for (int i = 0; i < internalInv.length; i++) {
if (internalInv[i].isItemEmpty()) continue;
contents = internalInv[i].handleItemInternal(contents, simulate);
if (contents == null) {
this.lockedSlot = i;
return contents;
}
this.lockedSlot = -1;
contents = copyIngredients(left);
}
this.lockedSlot = -1;
return left;
}

public List<FluidIngredient> handleFluidInner(
GTRecipe recipe, List<FluidIngredient> left, boolean simulate) {
var internalInv = getMachine().getInternalInventory();
if (recipe.id.equals(lockedRecipeId) && lockedSlot >= 0) {
left = internalInv[lockedSlot].handleFluidInternal(left, simulate);
} else {
this.lockedRecipeId = recipe.id;
List<FluidIngredient> contents = copyFluidIngredients(left);
for (int i = 0; i < internalInv.length; i++) {
if (internalInv[i].isFluidEmpty()) continue;
contents = internalInv[i].handleFluidInternal(contents, simulate);
if (contents == null) {
this.lockedSlot = i;
return contents;
}
contents = copyFluidIngredients(left);
return internalInv[lockedSlot].handleFluidInternal(left, simulate);
}

this.lockedRecipeId = recipe.id;
List<FluidIngredient> contents = left;
for (int i = 0; i < internalInv.length; i++) {
if (internalInv[i].isFluidEmpty()) continue;
contents = internalInv[i].handleFluidInternal(contents, simulate);

if (contents == null) {
this.lockedSlot = i;
return contents;
}
this.lockedSlot = -1;
contents = copyFluidIngredients(left);
}
this.lockedSlot = -1;
return left;
}

Expand Down Expand Up @@ -147,10 +148,8 @@ public List<Ingredient> handleRecipeInner(
if (io != IO.IN) return left;
var machine = getMachine();
machine.getCircuitInventory().handleRecipeInner(io, recipe, left, slotName, simulate);
left = handleItemInner(recipe, left, simulate);
return left != null
? machine.getShareInventory().handleRecipeInner(io, recipe, left, slotName, simulate)
: null;
machine.getShareInventory().handleRecipeInner(io, recipe, left, slotName, simulate);
return handleItemInner(recipe, left, simulate);
}

@Override
Expand Down Expand Up @@ -212,10 +211,8 @@ public List<FluidIngredient> handleRecipeInner(
@Nullable String slotName,
boolean simulate) {
if (io != IO.IN) return left;
left = handleFluidInner(recipe, left, simulate);
return left != null
? getMachine().getShareTank().handleRecipeInner(io, recipe, left, slotName, simulate)
: null;
getMachine().getShareTank().handleRecipeInner(io, recipe, left, slotName, simulate);
return handleFluidInner(recipe, left, simulate);
}

@Override
Expand Down

0 comments on commit d943ffc

Please sign in to comment.