aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRealSilverMoon <31100241+RealSilverMoon@users.noreply.github.com>2024-07-15 17:22:09 +0800
committerGitHub <noreply@github.com>2024-07-15 16:22:09 +0700
commitde36e0a3fb2035c862b282440b23f4a6e2b6d392 (patch)
tree9560375c195603205d8544c2d9887e936edf9c05 /src
parente0d55a7759cc5dffc48d4dd424478c41ad1a82a3 (diff)
downloadGT5-Unofficial-de36e0a3fb2035c862b282440b23f4a6e2b6d392.tar.gz
GT5-Unofficial-de36e0a3fb2035c862b282440b23f4a6e2b6d392.tar.bz2
GT5-Unofficial-de36e0a3fb2035c862b282440b23f4a6e2b6d392.zip
Add DroneHatch to fusion reactor (#2670)
* Add DroneHatch to fusion reactor * Reduce input hatch requirement * Change location to avoid conflict
Diffstat (limited to 'src')
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java21
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java27
2 files changed, 42 insertions, 6 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
index dbb6beae8b..80533b8a09 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java
@@ -2,6 +2,7 @@ package goodgenerator.blocks.tileEntity.base;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
import static gregtech.api.util.GT_Utility.filterValidMTEs;
@@ -64,6 +65,7 @@ import gregtech.api.util.GT_ParallelHelper;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;
+import gregtech.common.tileentities.machines.multi.drone.GT_MetaTileEntity_Hatch_DroneDownLink;
public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider {
@@ -106,6 +108,14 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
.dot(2)
.buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
.addElement('F', lazy(x -> ofFrame(x.getFrameBox())))
+ .addElement(
+ 'D',
+ lazy(
+ x -> buildHatchAdder(LargeFusionComputer.class).adder(LargeFusionComputer::addDroneHatch)
+ .hatchId(9401)
+ .casingIndex(x.textureIndex())
+ .dot(3)
+ .buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
.build();
}
};
@@ -525,6 +535,15 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
return false;
}
+ private boolean addDroneHatch(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
+ if (aBaseMetaTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DroneDownLink tHatch)) return false;
+ tHatch.updateTexture(aBaseCasingIndex);
+ return addToMachineList(aBaseMetaTileEntity, aBaseCasingIndex);
+ }
+
@Override
public IStructureDefinition<LargeFusionComputer> getStructure_EM() {
return STRUCTURE_DEFINITION.get(getClass());
@@ -692,7 +711,7 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti
" CCHCC CCHCC ", " CCHCC CCHCC ",
" CCHCE ECHCC ", " ECHCC CCHCE ",
" CCHCE ECHCC ", " CCHCCC CCCHCC ",
- " CCHCCCC CCCCHCC ", " ECHHCCCCC FCCCCCF CCCCCHHCE ",
+ " CCHCCCC CCCCHCC ", " ECHHCCCCC FCCDCCF CCCCCHHCE ",
" CCCHHCCCCC CCCCCHHCCC ", " CCCCHHHCC CCHHHCCCC ",
" CCCCCHHHHHHHHHCCCCC ", " CCCCC CCCCC ",
" CC CC ", " FCCCCCF ", };
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
index cac611cf0d..b2e675bfcb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
@@ -75,6 +75,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.shutdown.ShutDownReason;
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
+import gregtech.common.tileentities.machines.multi.drone.GT_MetaTileEntity_Hatch_DroneDownLink;
public abstract class GT_MetaTileEntity_FusionComputer
extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer>
@@ -96,7 +97,7 @@ public abstract class GT_MetaTileEntity_FusionComputer
" h h ", " h h ", " i i ", " h h ",
" i i ", " h h ", " h h ", " h h ",
" hh hh ", " ihi ", " ", },
- { " xhx ", " hhccchh ", " eccxhxcce ", " eceh hece ",
+ { " xhx ", " hhccchh ", " eccxdxcce ", " eceh hece ",
" hce ech ", " hch hch ", "xcx xcx", "hch hch",
"xcx xcx", " hch hch ", " hce ech ", " eceh hece ",
" eccx~xcce ", " hhccchh ", " xhx ", },
@@ -111,7 +112,7 @@ public abstract class GT_MetaTileEntity_FusionComputer
lazy(
t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class)
.atLeast(
- ImmutableMap.of(InputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addInjector), 2))
+ ImmutableMap.of(InputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addInjector), 1))
.hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE))
.casingIndex(53)
.dot(1)
@@ -134,6 +135,15 @@ public abstract class GT_MetaTileEntity_FusionComputer
.casingIndex(53)
.dot(3)
.buildAndChain(t.getCasing(), t.getCasingMeta())))
+ .addElement(
+ 'd',
+ lazy(
+ t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class)
+ .adder(GT_MetaTileEntity_FusionComputer::addDroneHatch)
+ .hatchId(9401)
+ .casingIndex(53)
+ .dot(4)
+ .buildAndChain(t.getCasing(), t.getCasingMeta())))
.build();
}
};
@@ -223,9 +233,7 @@ public abstract class GT_MetaTileEntity_FusionComputer
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- return checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) && mInputHatches.size() > 1
- && !mOutputHatches.isEmpty()
- && !mEnergyHatches.isEmpty();
+ return checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) && !mOutputHatches.isEmpty() && !mEnergyHatches.isEmpty();
}
private boolean addEnergyInjector(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
@@ -257,6 +265,15 @@ public abstract class GT_MetaTileEntity_FusionComputer
return mOutputHatches.add(tHatch);
}
+ private boolean addDroneHatch(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
+ if (aBaseMetaTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (!(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DroneDownLink tHatch)) return false;
+ tHatch.updateTexture(aBaseCasingIndex);
+ return addToMachineList(aBaseMetaTileEntity, aBaseCasingIndex);
+ }
+
public abstract Block getCasing();
public abstract int getCasingMeta();