Skip to content

Commit

Permalink
More gcyms (#38)
Browse files Browse the repository at this point in the history
* Switching branches

* Start on rock breaker and finished air collector

* Finished rock breaker structure

* Match air collector overlay to vanilla GCYM

* Lang

* Large gas collector recipe

* Rock breaka'

* Rebase and spotless

* Oops duplicate MTE IDs

* Credit

* Switching branches

* Base work

* Actually works now

* Fix rebase, I don't know how to git istg

* I don't care about making a whole new branch for this

* spotlbesl

* Remove silly casing

* Large alloy smelter recipe
  • Loading branch information
Zorbatron authored Oct 10, 2024
1 parent ede175f commit 7783012
Show file tree
Hide file tree
Showing 19 changed files with 446 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ Single Item Input Bus
- Ursamina for the dual cover textures and the icon! :heart:
- [Synthitic](https://github.com/Synthitic/) for porting GT:NH's CoAL to [GCYL: CEu](https://github.com/Synthitic/GCYL-CEu), which I more or less directly copied.
- [GT:CEu](https://github.com/GregTechCEu/GregTech) for much code inspiration.
- MkcTao/[D-Alessian](https://github.com/D-Alessian/) for the Large Air Collector multiblock shape.
- Quacker quack from https://freesound.org/people/WavJunction.com/sounds/456770/.
2 changes: 2 additions & 0 deletions src/main/java/com/zorbatron/zbgt/api/render/ZBGTTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class ZBGTTextures {
public static SimpleOverlayRenderer PRECISE_CASING_4;

public static SimpleOverlayRenderer IRIDIUM_CASING;

public static ICubeRenderer YOTTANK_CASING;

public static void preInit() {
Expand All @@ -59,6 +60,7 @@ public static void preInit() {
PRECISE_CASING_4 = new SimpleOverlayRenderer("casings/precise/precise_4");

IRIDIUM_CASING = new SimpleOverlayRenderer("casings/material/iridium");

YOTTANK_CASING = new SidedCubeRenderer("casings/yottank");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.nomiceu.nomilabs.gregtech.material.registry.LabsMaterials;
import com.zorbatron.zbgt.api.ZBGTAPI;

import gregicality.multiblocks.api.unification.GCYMMaterials;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.info.MaterialFlag;

Expand Down Expand Up @@ -41,14 +42,14 @@ public static void register() {
}

private static void doublePlates() {
Material[] materials = { Invar };
Material[] materials = { Invar, GCYMMaterials.MaragingSteel300 };

setFlags(materials, GENERATE_DOUBLE_PLATE);
}

private static void densePlates() {
Material[] materials = { Steel, Aluminium, StainlessSteel, Titanium, TungstenSteel, Tritanium, HSSS,
Osmiridium, NiobiumTitanium, Iridium, WroughtIron, Trinaquadalloy };
Osmiridium, NiobiumTitanium, Iridium, WroughtIron, Trinaquadalloy, GCYMMaterials.Trinaquadalloy };

setFlags(materials, GENERATE_DENSE);
}
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/com/zorbatron/zbgt/common/ZBGTMetaTileEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import static gregtech.common.metatileentities.MetaTileEntities.registerMetaTileEntity;

import com.zorbatron.zbgt.common.metatileentities.multi.MetaTileEntityYOTTank;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.megamultis.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.quads.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCoAL;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.large.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.mega.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.quad.*;
import com.zorbatron.zbgt.common.metatileentities.multi.multiblockpart.*;
import com.zorbatron.zbgt.common.metatileentities.storage.MetaTileEntityCreativeComputationProvider;

Expand Down Expand Up @@ -42,6 +43,10 @@ public class ZBGTMetaTileEntities {

public static MetaTileEntityYOTTank YOTTANK;

public static MetaTileEntityLargeRockBreaker LARGE_ROCK_BREAKER;
public static MetaTileEntityLargeAirCollector LARGE_AIR_COLLECTOR;
public static MetaTileEntityLargeAlloySmelter LARGE_ALLOY_SMELTER;

public static void init() {
// 18000-18049 (50) reserved for multiblock parts
CREATIVE_ENERGY_SOURCE = registerMetaTileEntity(18000,
Expand Down Expand Up @@ -125,6 +130,14 @@ public static void init() {
new MetaTileEntityMegaFusionReactor(zbgtId("mega_fusion_2"), GTValues.ZPM));
MEGA_FUSION[2] = registerMetaTileEntity(18062,
new MetaTileEntityMegaFusionReactor(zbgtId("mega_fusion_3"), GTValues.UV));
// Reserve 18063 and 18064 for the mega fusion 4 and 5 if I ever do them

LARGE_ROCK_BREAKER = registerMetaTileEntity(18065,
new MetaTileEntityLargeRockBreaker(zbgtId("large_rock_breaker")));
LARGE_AIR_COLLECTOR = registerMetaTileEntity(18066,
new MetaTileEntityLargeAirCollector(zbgtId("large_air_collector")));
LARGE_ALLOY_SMELTER = registerMetaTileEntity(18068,
new MetaTileEntityLargeAlloySmelter(zbgtId("large_alloy_smelter")));

QUACKER = registerMetaTileEntity(18069,
new MetaTileEntityQuacker(zbgtId("quacker")));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.zorbatron.zbgt.common.metatileentities.multi.electric.large;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.recipes.RecipeMaps;
import gregtech.api.util.RelativeDirection;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.client.renderer.texture.Textures;
import gregtech.common.blocks.*;

public class MetaTileEntityLargeAirCollector extends GCYMRecipeMapMultiblockController {

public MetaTileEntityLargeAirCollector(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, RecipeMaps.GAS_COLLECTOR_RECIPES);
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityLargeAirCollector(metaTileEntityId);
}

@Override
protected @NotNull BlockPattern createStructurePattern() {
return FactoryBlockPattern.start(RelativeDirection.RIGHT, RelativeDirection.FRONT, RelativeDirection.UP)
.aisle(" XSX ", "XIXIX", "XXXXX", "XIXIX", " XXX ")
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ")
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ")
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ")
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ")
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ")
.aisle(" XXX ", "XIXIX", "XXPXX", "XIXIX", " XXX ")
.where('S', selfPredicate())
.where('X', states(getCasingState())
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('I', states(getIntakeState()))
.where('L', states(getGlassState()))
.where('G', states(getGrateState()))
.where('P', states(getPipeCasingState()))
.build();
}

protected IBlockState getCasingState() {
return MetaBlocks.TURBINE_CASING.getState(
BlockTurbineCasing.TurbineCasingType.TUNGSTENSTEEL_TURBINE_CASING);
}

protected IBlockState getIntakeState() {
return MetaBlocks.MULTIBLOCK_CASING.getState(
BlockMultiblockCasing.MultiblockCasingType.EXTREME_ENGINE_INTAKE_CASING);
}

protected IBlockState getGlassState() {
return MetaBlocks.TRANSPARENT_CASING.getState(
BlockGlassCasing.CasingType.TEMPERED_GLASS);
}

protected IBlockState getGrateState() {
return MetaBlocks.MULTIBLOCK_CASING.getState(
BlockMultiblockCasing.MultiblockCasingType.GRATE_CASING);
}

protected IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(
BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE);
}

@SideOnly(Side.CLIENT)
@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.ROBUST_TUNGSTENSTEEL_CASING;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
package com.zorbatron.zbgt.common.metatileentities.multi.electric.large;

import java.util.List;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic;
import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController;
import gregicality.multiblocks.api.render.GCYMTextures;
import gregicality.multiblocks.common.block.GCYMMetaBlocks;
import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing;
import gregicality.multiblocks.common.block.blocks.BlockUniqueCasing;
import gregtech.api.block.IHeatingCoilBlockStats;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.MultiblockDisplayText;
import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.PatternMatchContext;
import gregtech.api.recipes.RecipeMaps;
import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage;
import gregtech.api.util.GTUtility;
import gregtech.api.util.TextComponentUtil;
import gregtech.client.renderer.ICubeRenderer;

public class MetaTileEntityLargeAlloySmelter extends GCYMRecipeMapMultiblockController {

private int coilTier;

public MetaTileEntityLargeAlloySmelter(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, RecipeMaps.ALLOY_SMELTER_RECIPES);
this.recipeMapWorkable = new LargeAlloySmelterRecipeLogic(this);
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityLargeAlloySmelter(metaTileEntityId);
}

@Override
protected @NotNull BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle("XXX", "CCC", "VVV", "CCC", "XXX")
.aisle("XXX", "C#C", "V#V", "C#C", "XXX")
.aisle("XSX", "CCC", "VVV", "CCC", "XXX")
.where('S', selfPredicate())
.where('X', states(getCasingState()).setMinGlobalLimited(10)
.or(autoAbilities()))
.where('C', heatingCoils())
.where('V', states(getVentState()))
.where('#', air())
.build();
}

protected IBlockState getCasingState() {
return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING
.getState(BlockLargeMultiblockCasing.CasingType.HIGH_TEMPERATURE_CASING);
}

protected IBlockState getVentState() {
return GCYMMetaBlocks.UNIQUE_CASING.getState(BlockUniqueCasing.UniqueCasingType.HEAT_VENT);
}

@Override
public boolean hasMufflerMechanics() {
return true;
}

@Override
protected void formStructure(PatternMatchContext context) {
super.formStructure(context);

Object type = context.get("CoilType");
if (type instanceof IHeatingCoilBlockStats) {
this.coilTier = ((IHeatingCoilBlockStats) type).getTier();
} else {
this.coilTier = 0;
}
}

@Override
public void invalidateStructure() {
super.invalidateStructure();

this.coilTier = -1;
}

@Override
protected void addDisplayText(List<ITextComponent> textList) {
MultiblockDisplayText.builder(textList, isStructureFormed())
.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive())
.addEnergyUsageLine(getEnergyContainer())
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage()))
.addCustom(tl -> {
// Coil energy discount line
if (isStructureFormed()) {
ITextComponent energyDiscount = TextComponentUtil.stringWithColor(TextFormatting.AQUA,
Math.max(0.1, 100 - 10 * coilTier) + "%");

ITextComponent base = TextComponentUtil.translationWithColor(
TextFormatting.GRAY,
"gregtech.multiblock.cracking_unit.energy",
energyDiscount);

ITextComponent hover = TextComponentUtil.translationWithColor(
TextFormatting.GRAY,
"gregtech.multiblock.cracking_unit.energy_hover");

tl.add(TextComponentUtil.setHover(base, hover));
}
})
.addParallelsLine(recipeMapWorkable.getParallelLimit())
.addWorkingStatusLine()
.addProgressLine(recipeMapWorkable.getProgressPercent());
}

@SideOnly(Side.CLIENT)
@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return GCYMTextures.BLAST_CASING;
}

protected int getCoilTier() {
return coilTier;
}

@SuppressWarnings("InnerClassMayBeStatic")
private class LargeAlloySmelterRecipeLogic extends GCYMMultiblockRecipeLogic {

public LargeAlloySmelterRecipeLogic(RecipeMapMultiblockController tileEntity) {
super(tileEntity);
}

@Override
protected void modifyOverclockPost(int[] overclockResults, @NotNull IRecipePropertyStorage storage) {
super.modifyOverclockPost(overclockResults, storage);

int coilTier = ((MetaTileEntityLargeAlloySmelter) metaTileEntity).getCoilTier();
if (coilTier <= 0) return;

overclockResults[0] = (int) Math.max(1, overclockResults[0] * (1.0f - coilTier * 0.1));
}
}
}
Loading

0 comments on commit 7783012

Please sign in to comment.