diff options
author | Maxim <maxim235@gmx.de> | 2022-10-12 19:59:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 19:59:27 +0200 |
commit | c770197d9b5b74c23bc83879da5678eaccffd4ce (patch) | |
tree | 000a4504dec29c8b7261ffadaaeb81267a7c5a09 /src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java | |
parent | ca665ff165429d751b2c5142fa5b26d335692b43 (diff) | |
download | GT5-Unofficial-c770197d9b5b74c23bc83879da5678eaccffd4ce.tar.gz GT5-Unofficial-c770197d9b5b74c23bc83879da5678eaccffd4ce.tar.bz2 GT5-Unofficial-c770197d9b5b74c23bc83879da5678eaccffd4ce.zip |
Auto place integration (#83)
* Updated needed dependancies
* Added autoplace integration for compact fusion reactors
* Corrected energy hatch type and increased budget for large fusion
* Applied spotless
* Added autoplace integration to precise assembler
* Reverted check for now
* survival build multis
* spotless
* spotless annoyance
* Added structure check from normal compact to gtpp compact
* SC Steam turbine survival
Co-authored-by: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com>
Diffstat (limited to 'src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java')
-rw-r--r-- | src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java | 71 |
1 files changed, 44 insertions, 27 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java index 5cb63e3afc..b461dfa0dd 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java @@ -5,13 +5,15 @@ import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.ha import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_StructureUtility.ofFrame; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; +import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import goodgenerator.client.GUI.LargeFusionComputerGUIClient; +import gregtech.api.enums.GT_HatchElement; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -23,10 +25,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.objects.GT_ChunkManager; import gregtech.api.objects.GT_ItemStack; import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_HatchElementBuilder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import java.util.ArrayList; import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -36,7 +40,8 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM implements IConstructable { +public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM + implements IConstructable, ISurvivalConstructable { public static final String MAIN_NAME = "largeFusion"; private boolean isLoadedChunk; @@ -52,30 +57,24 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti .addElement('H', lazy(x -> ofBlock(x.getCoilBlock(), x.getCoilMeta()))) .addElement('C', lazy(x -> ofBlock(x.getCasingBlock(), x.getCasingMeta()))) .addElement('B', lazy(x -> ofBlock(x.getGlassBlock(), x.getGlassMeta()))) - .addElement( - 'I', - lazy(x -> ofHatchAdderOptional( - LargeFusionComputer::addInjector, - x.textureIndex(), - 1, - x.getGlassBlock(), - x.getGlassMeta()))) - .addElement( - 'O', - lazy(x -> ofHatchAdderOptional( - LargeFusionComputer::addExtractor, - x.textureIndex(), - 2, - x.getGlassBlock(), - x.getGlassMeta()))) - .addElement( - 'E', - lazy(x -> ofHatchAdderOptional( - LargeFusionComputer::addEnergyInjector, - x.textureIndex(), - 3, - x.getCasingBlock(), - x.getCasingMeta()))) + .addElement('I', lazy(x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() + .atLeast(GT_HatchElement.InputHatch) + .adder(LargeFusionComputer::addInjector) + .casingIndex(x.textureIndex()) + .dot(1) + .buildAndChain(x.getGlassBlock(), x.getGlassMeta()))) + .addElement('O', lazy(x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() + .atLeast(GT_HatchElement.OutputHatch) + .adder(LargeFusionComputer::addExtractor) + .casingIndex(x.textureIndex()) + .dot(2) + .buildAndChain(x.getGlassBlock(), x.getGlassMeta()))) + .addElement('E', lazy(x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() + .atLeast(HatchElement.EnergyMulti.or(GT_HatchElement.Energy)) + .adder(LargeFusionComputer::addEnergyInjector) + .casingIndex(x.textureIndex()) + .dot(3) + .buildAndChain(x.getCasingBlock(), x.getCasingMeta()))) .addElement('F', lazy(x -> ofFrame(x.getFrameBox()))) .build(); } @@ -135,7 +134,6 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti public int textureIndex() { return 53; } - ; public abstract ITexture getTextureOverlay(); @@ -172,6 +170,25 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti } @Override + public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + if (mMachine) { + return -1; + } else { + return survivialBuildPiece( + MAIN_NAME, + stackSize, + 23, + 3, + 40, + elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5), + source, + actor, + false, + true); + } + } + + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide() && !aBaseMetaTileEntity.isAllowedToWork()) { // if machine has stopped, stop chunkloading |