Skip to content

Commit

Permalink
Fix steam engine energy hatch issues
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Nov 27, 2023
1 parent ff088c0 commit 771ce1f
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
import org.jetbrains.annotations.Nullable;

import gregtech.api.GTValues;
import gregtech.api.capability.GregtechCapabilities;
import gregtech.api.capability.IEnergyContainer;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.FuelMultiblockController;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.TraceabilityPredicate;
import gregtech.api.recipes.RecipeMaps;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.common.blocks.BlockTurbineCasing;
Expand Down Expand Up @@ -51,12 +54,21 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol
.where('X', states(getCasingState()).setMinGlobalLimited(18)
.or(autoAbilities(false, true, true, true, true, true, false)))
.where('G', states(getCasingState2()))
.where('E', abilities(MultiblockAbility.OUTPUT_ENERGY))
.where('E', energyOutputPredicate())
.where('M', abilities(MultiblockAbility.MUFFLER_HATCH))
.where('#', any())
.build();
}

private static TraceabilityPredicate energyOutputPredicate() {
return metaTileEntities(MultiblockAbility.REGISTRY.get(MultiblockAbility.OUTPUT_ENERGY).stream().filter(mte -> {
IEnergyContainer container = mte.getCapability(GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, null);
return container != null && container.getOutputVoltage() <= GTValues.V[GTValues.MV];
}).toArray(MetaTileEntity[]::new))
.addTooltip("gregtech.multiblock.pattern.error.limited.1", GTValues.VN[GTValues.MV])
.addTooltip("gregtech.multiblock.pattern.error.limited.0", GTValues.VN[GTValues.LV]);
}

private static IBlockState getCasingState() {
return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getState(BlockLargeMultiblockCasing.CasingType.STEAM_CASING);
}
Expand Down

0 comments on commit 771ce1f

Please sign in to comment.