diff options
author | RealSilverMoon <31100241+RealSilverMoon@users.noreply.github.com> | 2024-07-15 17:22:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 16:22:09 +0700 |
commit | de36e0a3fb2035c862b282440b23f4a6e2b6d392 (patch) | |
tree | 9560375c195603205d8544c2d9887e936edf9c05 /src/main/java/gregtech/common | |
parent | e0d55a7759cc5dffc48d4dd424478c41ad1a82a3 (diff) | |
download | GT5-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/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java | 27 |
1 files changed, 22 insertions, 5 deletions
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(); |