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

Commit

Permalink
Advanced implosion supports buffer (#838)
Browse files Browse the repository at this point in the history
migrate
  • Loading branch information
HoleFish authored Feb 22, 2024
1 parent c7267d4 commit dca836f
Showing 1 changed file with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.GregTech_API.sBlockCasings4;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import static gregtech.api.enums.GT_HatchElement.Energy;
import static gregtech.api.enums.GT_HatchElement.InputBus;
import static gregtech.api.enums.GT_HatchElement.Maintenance;
import static gregtech.api.enums.GT_HatchElement.Muffler;
import static gregtech.api.enums.GT_HatchElement.OutputBus;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;

import net.minecraft.item.ItemStack;

Expand All @@ -17,11 +22,6 @@
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
Expand Down Expand Up @@ -80,33 +80,15 @@ public IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> getStructureDe
.addElement(
'C',
ofChain(
ofHatchAdder(GregtechMetaTileEntity_Adv_Implosion::addAdvImplosionList, 48, 1),
buildHatchAdder(GregtechMetaTileEntity_Adv_Implosion.class)
.atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(48)
.dot(1).build(),
onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings4, 0))))
.build();
}
return STRUCTURE_DEFINITION;
}

public final boolean addAdvImplosionList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
} else {
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
return addToMachineList(aTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
return addToMachineList(aTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
return addToMachineList(aTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
return addToMachineList(aTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
return addToMachineList(aTileEntity, aBaseCasingIndex);
}
}
return false;
}

@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
buildPiece(mName, stackSize, hintsOnly, 1, 1, 0);
Expand Down

0 comments on commit dca836f

Please sign in to comment.