Skip to content

Commit

Permalink
Add laser hatch amp copying
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursivePineapple committed Jan 19, 2025
1 parent 7e9913e commit cb9e950
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import com.recursive_pineapple.matter_manipulator.common.utils.Mods;

import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import tectech.thing.metaTileEntity.hatch.MTEHatchDynamoTunnel;
import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyTunnel;
import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase;

public class GTAnalysisResult implements ITileAnalysisIntegration {
Expand All @@ -63,6 +65,7 @@ public class GTAnalysisResult implements ITileAnalysisIntegration {
public JsonElement mGTData = null;
public long mGTMEBusCapacity = 0;
public double[] mTTParams = null;
public int mAmperes = 0;

private static int counter = 0;
private static final short GT_BASIC_IO_PUSH_ITEMS = (short) (0b1 << counter++);
Expand Down Expand Up @@ -236,6 +239,14 @@ public GTAnalysisResult(IGregTechTileEntity igte) {
if (mte instanceof TTMultiblockBase tt && tt.parametrization.hasInputs()) {
mTTParams = tt.parametrization.getInputs();
}

if (mte instanceof MTEHatchEnergyTunnel hatch) {
mAmperes = hatch.Amperes;
}

if (mte instanceof MTEHatchDynamoTunnel dynamo) {
mAmperes = dynamo.Amperes;
}
}

@Override
Expand Down Expand Up @@ -417,6 +428,14 @@ public boolean apply(IBlockApplyContext ctx) {
if (mTTParams != null && mTTParams.length == 20 && mte instanceof TTMultiblockBase tt) {
tt.parametrization.setInputs(mTTParams);
}

if (mte instanceof MTEHatchEnergyTunnel hatch) {
hatch.Amperes = MMUtils.clamp(mAmperes, 0, hatch.maxAmperes);
}

if (mte instanceof MTEHatchDynamoTunnel dynamo) {
dynamo.Amperes = MMUtils.clamp(mAmperes, 0, dynamo.maxAmperes);
}
}

return true;
Expand Down

0 comments on commit cb9e950

Please sign in to comment.