Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.8 fixes #61

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}