Skip to content

Commit

Permalink
Implement the Volcanus and Cryogenic Freezer from GT:NH (#112)
Browse files Browse the repository at this point in the history
* HELL

* Bolt had weird transparency

* My MTEs are registered before Thermal registers its fluids...........

* Should work without thermal too!!

* Snow!!!!

* Snow powder!!!

* spotlleslls
  • Loading branch information
Zorbatron authored Dec 18, 2024
1 parent 8915ff6 commit 0337ad4
Show file tree
Hide file tree
Showing 144 changed files with 1,049 additions and 2 deletions.
5 changes: 5 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ dependencies {
implementation rfg.deobf("curse.maven:ulv-covers-635555:4912949")
compileOnly rfg.deobf("curse.maven:nomi-labs-932060:5677263")

compileOnly rfg.deobf("curse.maven:thermal-foundation-222880:2926428")
//implementation rfg.deobf("curse.maven:cofh-world-271384:2920434")
//implementation rfg.deobf("curse.maven:cofh-core-69162:2920433")
//implementation rfg.deobf("curse.maven:redstone-flux-270789:2920436")

//For easier testing
runtimeOnlyNonPublishable("curse.maven:nae2-884359:5380800")
runtimeOnlyNonPublishable("curse.maven:spark-361579:3542217")
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/zorbatron/zbgt/api/ZBGTAPI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.zorbatron.zbgt.api;

import net.minecraft.block.state.IBlockState;
import net.minecraftforge.fluids.FluidStack;

import com.zorbatron.zbgt.api.util.ZBGTMods;
import com.zorbatron.zbgt.common.ZBGTConfig;
Expand Down Expand Up @@ -29,4 +30,7 @@ public class ZBGTAPI {

public static final BaseCreativeTab TAB_ZBGT = new BaseCreativeTab("ZBGT",
() -> ZBGTMetaItems.ZBGT_ITEM.getStackForm(), false);

public static FluidStack pyrotheum;
public static FluidStack cryotheum;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.zorbatron.zbgt.api.metatileentity;

import net.minecraftforge.fluids.IFluidTank;

import gregtech.api.metatileentity.multiblock.MultiblockAbility;

@SuppressWarnings("InstantiationOfUtilityClass")
public class ZBGTMultiblockAbilities {

public static final MultiblockAbility<IFluidTank> PYROTHEUM_HATCH = new MultiblockAbility<>("pyrotheum_hatch");
public static final MultiblockAbility<IFluidTank> CRYOTHEUM_HATCH = new MultiblockAbility<>("cryotheum_hatch");
}
8 changes: 8 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 @@ -14,6 +14,7 @@ public class ZBGTTextures {
public static SimpleOverlayRenderer SWIRLY_INFINITY;
public static SimpleOverlayRenderer YOTTANK_ME_HATCH;
public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_STERILE;
public static SimpleOverlayRenderer FLUID_INPUT_BLACK;

// GUI overlays
public static TextureArea ITEM_FLUID_OVERLAY;
Expand All @@ -38,12 +39,16 @@ public class ZBGTTextures {

public static ICubeRenderer YOTTANK_CASING;

public static SimpleOverlayRenderer VOLCANUS_CASING;
public static SimpleOverlayRenderer CRYOGENIC_CASING;

public static void preInit() {
WATER_OVERLAY_INFINITY = new SimpleOverlayRenderer("overlay/machine/water_infinity");
ITEM_OVERLAY_INFINITY = new SimpleOverlayRenderer("overlay/machine/item_infinity");
SWIRLY_INFINITY = new SimpleOverlayRenderer("overlay/machine/swirly_infinity");
YOTTANK_ME_HATCH = new SimpleOverlayRenderer("overlay/machine/yottank_me_hatch");
MAINTENANCE_OVERLAY_STERILE = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_sterile");
FLUID_INPUT_BLACK = new SimpleOverlayRenderer("overlay/machine/fluid_input_black");

ITEM_FLUID_OVERLAY = TextureArea.fullImage("textures/gui/widget/item_fluid.png");
AUTO_PULL = TextureArea.fullImage("textures/gui/widget/auto_pull.png");
Expand All @@ -64,6 +69,9 @@ public static void preInit() {
IRIDIUM_CASING = new SimpleOverlayRenderer("casings/material/iridium");

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

VOLCANUS_CASING = new SimpleOverlayRenderer("casings/misc/volcanus");
CRYOGENIC_CASING = new SimpleOverlayRenderer("casings/misc/cryogenic");
}

public static SimpleOverlayRenderer getPrassTextureByTier(int tier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public final class ZBGTMaterials {
public static Material Luminessence;
public static Material EglinSteelBase;
public static Material Inconel792;
public static Material SnowPowder;

// Second degree materials
public static Material MAR_CE_M200;
Expand All @@ -48,6 +49,10 @@ public final class ZBGTMaterials {
public static Material EnergeticAlloy;
public static Material VibrantAlloy;

public static Material Blizz;
public static Material Pyrotheum;
public static Material Cryotheum;

// Unknown Composition Materials
public static Material SpecialCeramics;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.zorbatron.zbgt.api.unification.material.info;

import gregtech.api.unification.material.info.MaterialIconSet;

public class ZBGTMaterialIconSet {

public static final MaterialIconSet FIERY = new MaterialIconSet("fiery");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import static gregtech.api.unification.material.info.MaterialIconSet.*;

import com.zorbatron.zbgt.api.ZBGTAPI;
import com.zorbatron.zbgt.api.unification.material.info.ZBGTMaterialIconSet;
import com.zorbatron.zbgt.api.util.ZBGTMods;

import gregtech.api.fluids.FluidBuilder;
import gregtech.api.unification.material.Material;
Expand Down Expand Up @@ -146,5 +148,27 @@ public static void register() {
.blastStats(VA[HV], (int) (20 * 37.5)))
.components(Nickel, 2, Niobium, 1, Aluminium, 2, Nichrome, 1)
.build();

if (!ZBGTMods.THERMAL_FOUNDATION.isModLoaded()) {
Blizz = new Material.Builder(id++, zbgtId("blizz"))
.dust()
.flags(GENERATE_ROD)
.color(0xDCE9FF).iconSet(SHINY)
.build();

Pyrotheum = new Material.Builder(id++, zbgtId("pyrotheum"))
.dust().liquid(new FluidBuilder().temperature(4000))
.color(0xFF9000).iconSet(ZBGTMaterialIconSet.FIERY)
.flags(DECOMPOSITION_BY_CENTRIFUGING)
.components(Redstone, 1, Blaze, 1, Sulfur, 1, Coal, 1)
.build();
} else {
id += 2;
}

SnowPowder = new Material.Builder(id++, zbgtId("snowpowder"))
.dust()
.color(0xFAFAFA).iconSet(FINE)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static gregtech.api.unification.material.info.MaterialIconSet.*;

import com.zorbatron.zbgt.api.ZBGTAPI;
import com.zorbatron.zbgt.api.util.ZBGTMods;

import gregicality.multiblocks.api.unification.GCYMMaterialFlags;
import gregtech.api.fluids.FluidBuilder;
Expand Down Expand Up @@ -101,5 +102,16 @@ public static void register() {
.flags(EXT_METAL, DECOMPOSITION_BY_CENTRIFUGING)
.components(EglinSteelBase, 10, Sulfur, 1, Silicon, 4, Carbon, 1)
.build();

if (!ZBGTMods.THERMAL_FOUNDATION.isModLoaded()) {
Cryotheum = new Material.Builder(id++, zbgtId("cryotheum"))
.dust().liquid(new FluidBuilder().temperature(5))
.color(0x0094CB).iconSet(SHINY)
.flags(DECOMPOSITION_BY_CENTRIFUGING)
.components(Redstone, 1, SnowPowder, 1, Saltpeter, 1, Blizz, 1)
.build();
} else {
id++;
}
}
}
4 changes: 3 additions & 1 deletion src/main/java/com/zorbatron/zbgt/api/util/ZBGTMods.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public enum ZBGTMods {

GCYM(Names.GCYM),
ULV_COVERS(Names.ULV_COVERS),
NOMI_LABS(Names.NOMI_LABS);
NOMI_LABS(Names.NOMI_LABS),
THERMAL_FOUNDATION(Names.THERMAL_FOUNDATION);

private final String ID;
private Boolean modLoaded;
Expand All @@ -27,5 +28,6 @@ public static class Names {
public static final String GCYM = "gcym";
public static final String ULV_COVERS = "ulv_covers";
public static final String NOMI_LABS = "nomilabs";
public static final String THERMAL_FOUNDATION = "thermalfoundation";
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/zorbatron/zbgt/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.ConfigManager;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.registries.IForgeRegistry;

import com.zorbatron.zbgt.ZBGTCore;
import com.zorbatron.zbgt.api.ZBGTAPI;
import com.zorbatron.zbgt.api.recipes.ZBGTRecipeMaps;
import com.zorbatron.zbgt.api.recipes.properties.CoALProperty;
import com.zorbatron.zbgt.api.unification.material.ZBGTMaterials;
import com.zorbatron.zbgt.api.util.ZBGTLog;
import com.zorbatron.zbgt.api.util.ZBGTMods;
import com.zorbatron.zbgt.api.worldgen.CustomOreVeins;
import com.zorbatron.zbgt.common.block.ZBGTMetaBlocks;
import com.zorbatron.zbgt.common.covers.ZBGTCovers;
Expand Down Expand Up @@ -50,6 +53,13 @@ public void postInit() throws IOException {
if (ZBGTConfig.worldGenerationSettings.enableOreGeneration) {
CustomOreVeins.init();
}

ZBGTAPI.pyrotheum = ZBGTMods.THERMAL_FOUNDATION.isModLoaded() ?
FluidRegistry.getFluidStack("pyrotheum", 1) :
ZBGTMaterials.Pyrotheum.getFluid(1);
ZBGTAPI.cryotheum = ZBGTMods.THERMAL_FOUNDATION.isModLoaded() ?
FluidRegistry.getFluidStack("cryotheum", 1) :
ZBGTMaterials.Cryotheum.getFluid(1);
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public enum CasingType implements IStringSerializable {
COMPACT_FUSION_COIL_1("compact_fusion_coil_1"),
COMPACT_FUSION_COIL_2("compact_fusion_coil_2"),
COMPACT_FUSION_COIL_3("compact_fusion_coil_3"),
COMPACT_FUSION_COIL_4("compact_fusion_coil_4");
COMPACT_FUSION_COIL_4("compact_fusion_coil_4"),
VOLCANUS_CASING("volcanus_casing"),
CRYOGENIC_CASING("cryogenic_casing");

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import static gregtech.common.metatileentities.MetaTileEntities.registerMetaTileEntity;

import com.zorbatron.zbgt.api.ZBGTAPI;
import com.zorbatron.zbgt.api.metatileentity.ZBGTMultiblockAbilities;
import com.zorbatron.zbgt.common.metatileentities.multi.MetaTileEntityYOTTank;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCircuitAssemblyLine;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCoAL;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCryogenicFreezer;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityVolcanus;
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.*;
Expand All @@ -30,6 +33,8 @@ public class ZBGTMetaTileEntities {
public static MetaTileEntityLargeParallelHatch[] ZBGT_PARALLEL_HATCHES = new MetaTileEntityLargeParallelHatch[7];
public static MetaTileEntityYOTTankMEHatch YOTTANK_ME_HATCH;
public static MetaTileEntitySterileCleaningHatch STERILE_CLEANING_HATCH;
public static MetaTileEntityFilteredHatch PYROTHEUM_HEATING_HATCH;
public static MetaTileEntityFilteredHatch CRYOTHEUM_COOLING_HATCH;

public static MetaTileEntityMegaEBF MEGA_EBF;
public static MetaTileEntityMegaLCR MEGA_LCR;
Expand All @@ -52,6 +57,9 @@ public class ZBGTMetaTileEntities {
public static MetaTileEntityLargeAirCollector LARGE_AIR_COLLECTOR;
public static MetaTileEntityLargeAlloySmelter LARGE_ALLOY_SMELTER;

public static MetaTileEntityVolcanus VOLCANUS;
public static MetaTileEntityCryogenicFreezer CRYOGENIC_FREEZER;

public static void init() {
MachineItemBlock.addCreativeTab(ZBGTAPI.TAB_ZBGT);

Expand Down Expand Up @@ -104,6 +112,13 @@ public static void init() {
STERILE_CLEANING_HATCH = registerMetaTileEntity(18018,
new MetaTileEntitySterileCleaningHatch(zbgtId("sterile_cleaning_hatch")));

PYROTHEUM_HEATING_HATCH = registerMetaTileEntity(18019,
new MetaTileEntityFilteredHatch(zbgtId("pyrotheum_heating_hatch"), GTValues.IV,
ZBGTMultiblockAbilities.PYROTHEUM_HATCH, () -> ZBGTAPI.pyrotheum, 128_000));
CRYOTHEUM_COOLING_HATCH = registerMetaTileEntity(18020,
new MetaTileEntityFilteredHatch(zbgtId("cryotheum_cooling_hatch"), GTValues.IV,
ZBGTMultiblockAbilities.CRYOTHEUM_HATCH, () -> ZBGTAPI.cryotheum, 128_000));

// 18050-18099 (50) reserved for multiblocks
MEGA_EBF = registerMetaTileEntity(18050,
new MetaTileEntityMegaEBF(zbgtId("mega_ebf")));
Expand Down Expand Up @@ -154,5 +169,10 @@ public static void init() {

CAL = registerMetaTileEntity(18070,
new MetaTileEntityCircuitAssemblyLine(zbgtId("cal")));

VOLCANUS = registerMetaTileEntity(18071,
new MetaTileEntityVolcanus(zbgtId("volcanus")));
CRYOGENIC_FREEZER = registerMetaTileEntity(18072,
new MetaTileEntityCryogenicFreezer(zbgtId("cryogenic_freezer")));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package com.zorbatron.zbgt.common.metatileentities.multi.electric;

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

import org.jetbrains.annotations.NotNull;

import com.zorbatron.zbgt.api.metatileentity.ZBGTMultiblockAbilities;
import com.zorbatron.zbgt.api.render.ZBGTTextures;
import com.zorbatron.zbgt.common.block.ZBGTMetaBlocks;
import com.zorbatron.zbgt.common.block.blocks.MiscCasing;

import gregtech.api.capability.impl.MultiblockRecipeLogic;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
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.Recipe;
import gregtech.api.recipes.RecipeMaps;
import gregtech.client.renderer.ICubeRenderer;

public class MetaTileEntityCryogenicFreezer extends RecipeMapMultiblockController {

private final int CRYOTHEUM_DRAIN_AMOUNT = 10;

private IFluidTank cryotheumTank;

public MetaTileEntityCryogenicFreezer(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, RecipeMaps.VACUUM_RECIPES);
recipeMapWorkable = new MultiblockRecipeLogic(this) {

@Override
protected boolean shouldSearchForRecipes() {
return hasCryotheum() && super.shouldSearchForRecipes();
}

@Override
protected boolean canProgressRecipe() {
return hasCryotheum() && super.canProgressRecipe();
}
};
recipeMapWorkable.setSpeedBonus(0.5);
recipeMapWorkable.setParallelLimit(4);
}

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

@Override
protected void updateFormedValid() {
super.updateFormedValid();

if (isActive() && getOffsetTimer() % 20 == 0) {
cryotheumTank.drain(CRYOTHEUM_DRAIN_AMOUNT, true);
}
}

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

cryotheumTank = getAbilities(ZBGTMultiblockAbilities.CRYOTHEUM_HATCH).get(0);
}

@Override
public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) {
return cryotheumTank.getFluidAmount() != 0;
}

@Override
protected @NotNull BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle("XXX", "XXX", "XXX")
.aisle("XXX", "X#X", "XXX")
.aisle("XXX", "XSX", "XXX")
.where('S', selfPredicate())
.where('X', states(getCasing()).setMinGlobalLimited(10)
.or(autoAbilities(true, true, true, true, true, true, false))
.or(abilities(ZBGTMultiblockAbilities.CRYOTHEUM_HATCH).setExactLimit(1)))
.where('#', air())
.build();
}

protected IBlockState getCasing() {
return ZBGTMetaBlocks.MISC_CASING.getState(MiscCasing.CasingType.CRYOGENIC_CASING);
}

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

@SideOnly(Side.CLIENT)
@Override
protected @NotNull ICubeRenderer getFrontOverlay() {
return ZBGTTextures.GTPP_MACHINE_OVERLAY;
}

private boolean hasCryotheum() {
return cryotheumTank.getFluidAmount() > CRYOTHEUM_DRAIN_AMOUNT;
}
}
Loading

0 comments on commit 0337ad4

Please sign in to comment.