Skip to content

Commit

Permalink
2.8 fixes (#61)
Browse files Browse the repository at this point in the history
* 2.8 fixes

* Fix steam engine energy hatch issues

* fix steam engine predicate tooltip
  • Loading branch information
serenibyss authored Nov 29, 2023
1 parent 6a602e1 commit c273640
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public boolean canRenderInLayer(@NotNull IBlockState state, @NotNull BlockRender
if (layer == BlockRenderLayer.SOLID) return true;
} else if (layer == BlockRenderLayer.CUTOUT) return true;

if (isBloomEnabled(type)) return layer == BloomEffectUtil.getRealBloomLayer();
if (isBloomEnabled(type)) return layer == BloomEffectUtil.getEffectiveBloomLayer(layer);
return layer == BlockRenderLayer.CUTOUT;
}

Expand Down
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.LV])
.addTooltip("gregtech.multiblock.pattern.error.limited.0", GTValues.VN[GTValues.MV]);
}

private static IBlockState getCasingState() {
return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getState(BlockLargeMultiblockCasing.CasingType.STEAM_CASING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol

@Override
protected Function<BlockPos, Integer> multiblockPartSorter() {
return BlockPos::getY; // todo this needs to be "relative up" with Freedom Wrench
return UP.getSorter(getFrontFacing(), getUpwardsFacing(), isFlipped());
}

@Override
Expand All @@ -69,7 +69,7 @@ protected Function<BlockPos, Integer> multiblockPartSorter() {
.aisle("#YYY#", "YYYYY", "YYYYY", "YYYYY", "#YYY#")
.where('S', selfPredicate())
.where('Y', casingPredicate.or(abilities(MultiblockAbility.IMPORT_ITEMS))
.or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1))
.or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1).setMaxGlobalLimited(2))
.or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMinGlobalLimited(1))
.or(abilities(MultiblockAbility.EXPORT_ITEMS))
.or(abilities(GCYMMultiblockAbility.PARALLEL_HATCH).setMaxGlobalLimited(1).setPreviewCount(1))
Expand Down Expand Up @@ -130,4 +130,9 @@ public boolean hasMufflerMechanics() {
public boolean isTiered() {
return false;
}

@Override
public boolean allowsExtendedFacing() {
return false;
}
}

0 comments on commit c273640

Please sign in to comment.