Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
more work on large boilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Jul 26, 2023
1 parent 46cd19b commit 8fbeae7
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 33 deletions.
3 changes: 2 additions & 1 deletion common/src/main/java/muramasa/gregtech/GregTech.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package muramasa.gregtech;

import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.AntimatterConfig;
import muramasa.antimatter.AntimatterMod;
import muramasa.antimatter.Ref;
import muramasa.antimatter.datagen.AntimatterDynamics;
Expand All @@ -23,6 +22,7 @@
import muramasa.gregtech.loader.machines.*;
import muramasa.gregtech.loader.machines.generator.CoalBoilerHandler;
import muramasa.gregtech.loader.machines.generator.Fuels;
import muramasa.gregtech.loader.machines.generator.LargeBoilerLoader;
import muramasa.gregtech.loader.multi.*;
import muramasa.gregtech.proxy.ServerHandler;
import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -136,6 +136,7 @@ public static void registerRecipeLoaders(IAntimatterRegistrar registrar, IRecipe
loader.accept("electromagnetic_separating", ElectromagneticSeparatorLoader::init);
loader.accept("polarizing", PolarizerLoader::init);
loader.accept("decaying", DecayChamber::init);
loader.accept("large_boiler", LargeBoilerLoader::init);
//loader.accept("dehydrating", ChemicalDehydrator::init);
loader.accept("autoclaving", Autoclave::init);
if (AntimatterAPI.isModLoaded(Ref.MOD_AE)){
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/muramasa/gregtech/data/Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public class Machines {
public static MultiMachine FUSION_REACTOR = new MultiMachine(GTIRef.ID, "fusion_control_computer").setTiers(LUV, ZPM, UV).setMap(FUSION).addFlags(GUI, FLUID,ENERGY).setTile(TileEntityFusionReactor::new);
public static MultiMachine HEAT_EXCHANGER = new MultiMachine(GTIRef.ID, "heat_exchanger").setTiers(EV).setMap(HEAT_EXCHANGING).addFlags(GUI, FLUID, ENERGY).setTile(TileEntityHeatExchanger::new).custom();
public static MultiMachine IMPLOSION_COMPRESSOR = new MultiMachine(GTIRef.ID, "implosion_compressor").setTiers(HV).setMap(IMPLOSION_COMPRESSING).addFlags(GUI, ITEM, ENERGY).setTile(TileEntityImplosionCompressor::new).setAllowVerticalFacing(true);
public static MultiMachine LARGE_BOILER = new MultiMachine(GTIRef.ID, "large_boiler").setTiers(LV, MV, HV, EV).addFlags(GUI, ITEM, FLUID).setTile(TileEntityLargeBoiler::new).custom();
public static MultiMachine LARGE_BOILER = new MultiMachine(GTIRef.ID, "large_boiler").setTiers(LV, MV, HV, EV).addFlags(GUI, ITEM, FLUID).setMap(LARGE_BOILERS).setTile(TileEntityLargeBoiler::new).custom();
public static MultiMachine LARGE_TURBINE = new MultiMachine(GTIRef.ID, "large_turbine").setTiers(HV, EV, IV, UV).setMap(STEAM_FUELS, HV).setMap(HP_STEAM_FUELS, IV).setMap(GAS_FUELS, EV, UV).addFlags(GUI, FLUID, ENERGY, GENERATOR).setTile(TileEntityLargeTurbine::new).custom(Textures.TURBINE);
public static MultiMachine MULTI_SMELTER = new MultiMachine(GTIRef.ID, "multi_smelter").setTiers(HV).setMap(SMELTING).addFlags(GUI, ITEM, ENERGY).setTile(TileEntityMultiSmelter::new).custom();
public static MultiMachine NUCLEAR_REACTOR = new MultiMachine(GTIRef.ID, "nuclear_reactor").setTiers(EV).setMap(NUCLEAR).addFlags(GUI, ITEM, FLUID, ENERGY).setTile(TileEntityNuclearReactor::new).setAllowVerticalFacing(true).custom();
Expand Down
38 changes: 31 additions & 7 deletions common/src/main/java/muramasa/gregtech/data/RecipeMaps.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package muramasa.gregtech.data;

import com.mojang.blaze3d.vertex.PoseStack;
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.integration.jeirei.renderer.IRecipeInfoRenderer;
import muramasa.antimatter.integration.jeirei.renderer.InfoRenderers;
import muramasa.antimatter.machine.Tier;
import muramasa.antimatter.recipe.IRecipe;
import muramasa.antimatter.recipe.RecipeProxies;
import muramasa.antimatter.recipe.map.RecipeBuilder;
import muramasa.antimatter.recipe.map.RecipeMap;
import muramasa.gregtech.GTIRef;
import net.minecraft.client.gui.Font;

import static muramasa.gregtech.data.Guis.MULTI_DISPLAY;
import static muramasa.gregtech.data.Guis.MULTI_DISPLAY_FLUID;
Expand Down Expand Up @@ -49,7 +53,7 @@ public class RecipeMaps {
public static RecipeMap<RecipeBuilder> BENDING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "bending", new RecipeBuilder()));
public static RecipeMap<BlastingBuilder> BLASTING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "elec_blasting", new BlastingBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "elec_blasting", new BlastingBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> CANNING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "canning", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> CENTRIFUGING = AntimatterAPI.register(RecipeMap.class,
Expand All @@ -69,17 +73,17 @@ public class RecipeMaps {
public static RecipeMap<RecipeBuilder> CUTTING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "cutting", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> CRACKING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "cracking", new RecipeBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "cracking", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> COMPLEX_ASSEMBLING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "complex_assembling", new RecipeBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "complex_assembling", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> DECAYING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "decaying", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> DEHYDRATING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "dehydrating", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> DISASSEMBLING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "disassembling", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> DISTILLATION = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "distillation", new RecipeBuilder()).setGuiData(MULTI_DISPLAY_FLUID));
new RecipeMap<>(GTIRef.ID, "distillation", new RecipeBuilder())).setGuiData(MULTI_DISPLAY_FLUID);
public static RecipeMap<RecipeBuilder> DISTILLING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "distilling", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> ELECTROLYZING = AntimatterAPI.register(RecipeMap.class,
Expand All @@ -101,15 +105,17 @@ public class RecipeMaps {
public static RecipeMap<RecipeBuilder> FLUID_SOLIDIFYING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "fluid_solidifying", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> FUSION = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "fusion", new RecipeBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "fusion", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> GAS_FUELS = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "gas_fuels", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> HAMMERING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "hammering", new SteamBuilder(STEAM_HAMMERING)));
public static RecipeMap<RecipeBuilder> HEAT_EXCHANGING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "heat_exchanging", new RecipeBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "heat_exchanging", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> IMPLOSION_COMPRESSING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "implosion_compressing", new RecipeBuilder()).setGuiData(MULTI_DISPLAY));
new RecipeMap<>(GTIRef.ID, "implosion_compressing", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> LARGE_BOILERS = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "large_boilers", new RecipeBuilder())).setGuiData(MULTI_DISPLAY);
public static RecipeMap<RecipeBuilder> LASER_ENGRAVING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "laser_engraving", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> LATHING = AntimatterAPI.register(RecipeMap.class,
Expand Down Expand Up @@ -163,6 +169,23 @@ public class RecipeMaps {
public static RecipeMap<RecipeBuilder> WIRE_MILLING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "wire_milling", new RecipeBuilder()));

public static final IRecipeInfoRenderer LARGE_BOILER_RENDERER = new IRecipeInfoRenderer() {
@Override
public void render(PoseStack stack, IRecipe recipe, Font fontRenderer, int guiOffsetX, int guiOffsetY) {
String duration = "Duration: " + recipe.getDuration() + " ticks (" + (recipe.getDuration() / 20.0f) + " s)";
String extraBurntime = "Extra saved Burntime: " + recipe.getPower();
String heatIncreaseMultiplier = "Heat increase multiplier: " + (Math.max(recipe.getSpecialValue(), 1));
renderString(stack, duration, fontRenderer, 5, 0, guiOffsetX, guiOffsetY);
renderString(stack, extraBurntime, fontRenderer, 5, 10, guiOffsetX, guiOffsetY);
renderString(stack, heatIncreaseMultiplier, fontRenderer, 5, 20, guiOffsetX, guiOffsetY);
}

@Override
public int getRows() {
return 3;
}
};

static {
COMBUSTION_FUELS.setGuiData(Guis.MULTI_DISPLAY);
GAS_FUELS.setGuiData(Guis.MULTI_DISPLAY);
Expand Down Expand Up @@ -194,5 +217,6 @@ public static void clientMaps() {
STEAM_MACERATING.setInfoRenderer(InfoRenderers.STEAM_RENDERER);
STEAM_SMELTING.setInfoRenderer(InfoRenderers.STEAM_RENDERER);
STEAM_SIFTING.setInfoRenderer(InfoRenderers.STEAM_RENDERER);
LARGE_BOILERS.setInfoRenderer(LARGE_BOILER_RENDERER);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package muramasa.gregtech.loader.machines.generator;

import com.google.common.collect.ImmutableList;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.material.MaterialTags;
import muramasa.antimatter.recipe.ingredient.RecipeIngredient;
import muramasa.antimatter.recipe.map.RecipeBuilder;
import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.gregtech.data.RecipeMaps;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.ItemLike;

import java.util.List;

import static muramasa.gregtech.data.GregTechMaterialTags.SEMIFUELS;

public class LargeBoilerLoader {
public static void init(){
AntimatterPlatformUtils.getAllBurnables().forEach((i, b) -> {
ResourceLocation id = AntimatterPlatformUtils.getIdFromItem(i);
RecipeMaps.LARGE_BOILERS.RB().ii(RecipeIngredient.of(i)).add(id.getNamespace() + "." + id.getPath(), b / 80, b % 80);
});
AntimatterMaterialTypes.LIQUID.all().forEach(mat -> {
if (!mat.has(MaterialTags.FUEL_POWER) || MaterialTags.FUEL_POWER.getInt(mat) <= 0) return;
int special = mat.has(SEMIFUELS) ? 0 : 4;
int ticks = mat.has(SEMIFUELS) ? MaterialTags.FUEL_POWER.getInt(mat) * 2 : MaterialTags.FUEL_POWER.getInt(mat) / 2;
RecipeMaps.LARGE_BOILERS.RB().fi(mat.getLiquid(1000)).add(mat.getId(), ticks, 0, special);
});
}
}
Loading

0 comments on commit 8fbeae7

Please sign in to comment.