Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
revert ulv input bus limit in cal (#96)
Browse files Browse the repository at this point in the history
* revert ulv input bus limit in cal

* tooltip

Former-commit-id: e23ede3a4f63769c2baea03a76e99b44e83e2373
  • Loading branch information
GlodBlock authored Feb 23, 2022
1 parent 7dbbedf commit 15c2bcf
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

Expand Down Expand Up @@ -175,7 +176,7 @@ public boolean checkRecipe(ItemStack itemStack) {
if (!this.imprintMachine(itemStack))
return false;

if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this))) {
if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) {
setRecipeStats();
return true;
}
Expand All @@ -194,7 +195,7 @@ public boolean checkRecipe(ItemStack itemStack) {
}

for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) {
if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), BW_Util.getItemsFromInputBusses(this)))
if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0])))
this.bufferedRecipe = recipe;
else
continue;
Expand All @@ -218,6 +219,23 @@ private void setRecipeStats() {
this.updateSlots();
}

@Override
public ArrayList<ItemStack> getStoredInputs() {
ArrayList<ItemStack> rList = new ArrayList<>();
for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) {
rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
break;
}
}
}
}
return rList;
}

@Override
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
Expand All @@ -228,7 +246,7 @@ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseC
((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap();
return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) {
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap();
return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity);
Expand Down Expand Up @@ -283,7 +301,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
private static final String[] DESCRIPTION = new String[]{
"Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length",
"Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),",
"ULV Input Bus (Last Output Bus), Steel Machine Casing",
"Input Bus (Last Output Bus), Steel Machine Casing",
"Middle: EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass",
"Top: Grate Machine Casing (or Controller or 1x Energy Hatch)",
"Up to 7 repeating slices, last is Output Bus",
Expand Down

0 comments on commit 15c2bcf

Please sign in to comment.