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

Commit

Permalink
renamed hv and ev macerators to pulverizers, added pulverizer map
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 1, 2024
1 parent 979a6dd commit 039fc4b
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package muramasa.gregtech.blockentity.single;

import earth.terrarium.botarium.common.fluid.base.FluidHolder;
import earth.terrarium.botarium.common.fluid.utils.FluidHooks;
import muramasa.antimatter.blockentity.BlockEntityMachine;
import muramasa.antimatter.capability.machine.MachineRecipeHandler;
import muramasa.antimatter.machine.types.Machine;
import muramasa.antimatter.recipe.IRecipe;
import muramasa.antimatter.recipe.Recipe;
import muramasa.antimatter.recipe.ingredient.RecipeIngredient;
import muramasa.antimatter.recipe.map.IRecipeMap;
import muramasa.antimatter.recipe.map.RecipeBuilder;
import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.antimatter.util.TagUtils;
import muramasa.antimatter.util.Utils;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.data.RecipeMaps;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.state.BlockState;
import tesseract.TesseractGraphWrappers;
import tesseract.api.item.ExtendedItemContainer;

import java.util.ArrayList;
import java.util.List;

import static muramasa.antimatter.Ref.L;
import static muramasa.antimatter.machine.Tier.*;
import static muramasa.gregtech.data.Materials.Chlorine;

public class BlockEntityMacerator extends BlockEntityMachine<BlockEntityMacerator> {
public BlockEntityMacerator(Machine<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
recipeHandler.set(() -> new MachineRecipeHandler<>(this){
@Override
protected IRecipeMap getRecipeMap() {
if (tile.getMachineTier() == LV || tile.getMachineTier() == MV) return RecipeMaps.MACERATOR;
return super.getRecipeMap();
}
});
}
}
4 changes: 2 additions & 2 deletions common/src/main/java/muramasa/gregtech/data/Guis.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static void slots(){
EXTRUDER.add(ALLOY_SMELTER);
LATHE.add(IT_IN, 53, 25).add(IT_OUT, 107, 25).add(IT_OUT, 125, 25).add(ENERGY, 80, 63);
MACERATOR.add(COMPRESSOR);
MACERATOR.add(MV, MACERATOR).add(MV, IT_OUT, 125, 25);
MACERATOR.add(HV, MACERATOR).add(HV, IT_OUT, 125, 25).add(HV, IT_OUT, 143, 25);
MACERATOR.add(HV, IT_IN, 53, 25).add(HV, IT_OUT, 107, 16).add(HV, IT_OUT, 125, 16).add(HV, IT_OUT, 107, 34)
.add(HV, IT_OUT, 125, 34);
MACERATOR.add(EV, IT_IN, 53, 25).add(EV, IT_OUT, 107, 16).add(EV, IT_OUT, 125, 16).add(EV, IT_OUT, 107, 34)
.add(EV, IT_OUT, 125, 34);
ROASTER.add(IT_IN, 53, 25).add(IT_OUT, 107, 16).add(IT_OUT, 125, 16).add(IT_OUT, 107, 34)
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/muramasa/gregtech/data/Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class Machines {
public static BasicMachine FURNACE = new BasicMachine(GTIRef.ID, "furnace").setMap(ELECTRIC_FURNACE).addFlags(GUI, ITEM).setSound(GregTechSounds.FURNACE, 0.6f);
public static BasicMachine LASER_ENGRAVER = new BasicMachine(GTIRef.ID, "laser_engraver").setMap(RecipeMaps.LASER_ENGRAVER).addFlags(GUI, ITEM).setSound(GregTechSounds.MAGNETIZER, 0.6f);
public static BasicMachine LATHE = new BasicMachine(GTIRef.ID, "lathe").setMap(RecipeMaps.LATHE).addFlags(GUI, ITEM);
public static BasicMachine MACERATOR = new BasicMachine(GTIRef.ID, "macerator").setMap(RecipeMaps.MACERATOR).custom().addFlags(GUI, ITEM).setGuiTiers(ImmutableMap.<Tier, Tier>builder().put(HV, HV).put(EV, EV).put(IV, IV)).setSound(GregTechSounds.MACERATOR, 0.6f);
public static BasicMachine MACERATOR = new BasicMachine(GTIRef.ID, "macerator").setTiers(LV, MV, HV, EV).setMap(PULVERIZER).setTile(BlockEntityMacerator::new).setTierSpecificLang().custom().addFlags(GUI, ITEM).setSound(GregTechSounds.MACERATOR, 0.6f);
public static BasicMachine MASS_FABRICATOR = new BasicMachine(GTIRef.ID, "mass_fabricator").setMap(RecipeMaps.MASS_FABRICATOR).addFlags(GUI, ITEM, FLUID);
public static BasicMachine MIXER = new BasicMachine(GTIRef.ID, "mixer").setMap(RecipeMaps.MIXER).addFlags(GUI, ITEM, FLUID);
public static BasicMachine ORE_WASHER = new BasicMachine(GTIRef.ID, "ore_washer").setMap(RecipeMaps.ORE_WASHER).addFlags(GUI, ITEM, FLUID);
Expand Down Expand Up @@ -243,7 +243,7 @@ public class Machines {
public static MultiMachine LARGE_CENTRIFUGE = new MultiMachine(GTIRef.ID, "large_centrifuge").setTiers(HV).setMap(RecipeMaps.CENTRIFUGE).addFlags(GUI, ITEM, FLUID, EU).addStructureTooltip(7).setTile(BlockEntityLargeCentrifuge::new).setTextureBlock(GregTechBlocks.CASING_TUNGSTENSTEEL);
public static MultiMachine LARGE_CHEMICAL_REACTOR = new MultiMachine(GTIRef.ID, "large_chemical_reactor").setTiers(HV).setMap(RecipeMaps.CHEMICAL_REACTOR).addFlags(GUI, ITEM, FLUID, EU).addStructureTooltip(10).setTile(BlockEntityLargeChemicalReactor::new).custom().setTextureBlock(GregTechBlocks.CASING_CHEMICALLY_INERT);
public static MultiMachine LARGE_ELECTROLYZER = new MultiMachine(GTIRef.ID, "large_electrolyzer").setTiers(HV).setMap(RecipeMaps.ELECTROLYZER).addFlags(GUI, ITEM, FLUID, EU).addStructureTooltip(9).setTile(BlockEntityLargeElectrolyzer::new).setTextureBlock(GregTechBlocks.CASING_STAINLESS_STEEL);
public static MultiMachine LARGE_MACERATOR = new MultiMachine(GTIRef.ID, "large_macerator").setTiers(HV).setMap(RecipeMaps.MACERATOR).addFlags(GUI, ITEM, EU).addStructureTooltip(8).setTile(BlockEntityLargeMacerator::new).setTextureBlock(GregTechBlocks.TUNGSTENSTEEL_WALL).blockColorHandler((state, world, pos, machine, i) -> i == 0 ? TungstenSteel.getRGB() : -1).itemColorHandler((stack, block, i) -> i == 0 ? TungstenSteel.getRGB() : -1);
public static MultiMachine LARGE_MACERATOR = new MultiMachine(GTIRef.ID, "large_macerator").setTiers(HV).setMap(PULVERIZER).addFlags(GUI, ITEM, EU).addStructureTooltip(8).setTile(BlockEntityLargeMacerator::new).setTextureBlock(GregTechBlocks.TUNGSTENSTEEL_WALL).blockColorHandler((state, world, pos, machine, i) -> i == 0 ? TungstenSteel.getRGB() : -1).itemColorHandler((stack, block, i) -> i == 0 ? TungstenSteel.getRGB() : -1);
public static MultiMachine LARGE_ORE_WASHER = new MultiMachine(GTIRef.ID, "large_ore_washer").setTiers(EV).setMap(RecipeMaps.ORE_WASHER).addFlags(GUI, ITEM, FLUID, EU).setTile(BlockEntityLargeOreWasher::new).setTextureBlock(GregTechBlocks.TITANIUM_WALL).blockColorHandler((state, world, pos, machine, i) -> i == 0 ? Titanium.getRGB() : -1).itemColorHandler((stack, block, i) -> i == 0 ? Titanium.getRGB() : -1);
public static MultiMachine LARGE_TURBINE = new MultiMachine(GTIRef.ID, "large_turbine").setTiers(HV, EV, IV).setMap(STEAM_FUELS, HV).setMap(HP_STEAM_FUELS, IV).setMap(GAS_FUELS, EV).addFlags(GUI, ITEM, FLUID, EU, GENERATOR).setTile(BlockEntityLargeTurbine::new).custom(Textures.TURBINE).setTierSpecificLang().addStructureTooltip(8, (machine, stack, world, flag, i) -> {
if (i == 0){
Expand Down
20 changes: 19 additions & 1 deletion common/src/main/java/muramasa/gregtech/data/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public class RecipeMaps {
public static RecipeMap<RecipeBuilder> LATHE = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "lathe", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> MACERATOR = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "macerator", new SteamBuilder(STEAM_MACERATOR)).setGuiTier(Tier.EV));
new RecipeMap<>(GTIRef.ID, "macerator", new SteamBuilder(STEAM_MACERATOR)));
public static RecipeMap<RecipeBuilder> MASS_FABRICATOR = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "mass_fabricator", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> MIXER = AntimatterAPI.register(RecipeMap.class,
Expand All @@ -168,6 +168,8 @@ public class RecipeMaps {
new RecipeMap<>(GTIRef.ID, "polarizer", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> PLASMA_FUELS = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "plasma_fuels", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> PULVERIZER = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "pulverizer", new PulverizerBulder()).setGuiTier(Tier.HV));
public static RecipeMap<RecipeBuilder> FORMING_PRESS = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "forming_press", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> PRINTING = AntimatterAPI.register(RecipeMap.class,
Expand Down Expand Up @@ -367,4 +369,20 @@ public static void clientMaps() {
FUSION.setInfoRenderer(FUSION_RENDERER);
CHEMICAL_REACTOR.setInfoRenderer(CHEM_RENDERER);
}

public static class PulverizerBulder extends RecipeBuilder{
@Override
public IRecipe add(String domain, String id) {
IRecipe recipe = super.add(domain, id);
var recipeBuilder = MACERATOR.RB().hide().ii(recipe.getInputItems());
if (recipe.hasOutputItems() && recipe.getOutputItems().length > 0) {
recipeBuilder.io(recipe.getOutputItems(false)[0]);
}
if (recipe.hasOutputChances() && recipe.getOutputChances().length > 0) {
recipeBuilder.outputChances(recipe.getOutputChances()[0]);
}
recipeBuilder.inputChances(recipe.getInputChances()).add(domain, id, recipe.getDuration(), recipe.getPower(), recipe.getSpecialValue(), recipe.getAmps());
return recipe;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.Ref;
import muramasa.antimatter.datagen.providers.AntimatterLanguageProvider;
import muramasa.antimatter.item.ItemBasic;
import muramasa.antimatter.util.Utils;
Expand Down Expand Up @@ -369,6 +370,8 @@ protected void english(String domain, String locale) {
override(LARGE_BOILER, MV, "Large Steel Boiler");
override(LARGE_BOILER, HV, "Large Titanium Boiler");
override(LARGE_BOILER, EV, "Large Tungstensteel Boiler");
override(MACERATOR, HV, "Pulverizer (%s)");
override(MACERATOR, EV, "Pulverizer (%s)");
override(GregTechItems.EmptyGeigerCounter.getDescriptionId(), "Geiger Counter (Empty)");
add(GregTechBlocks.POWDER_BARREL, "Powder Barrel");
override(GregTechBlocks.CASING_BRONZE_PLATED_BRICK.getDescriptionId(), "Bronze Plated Bricks");
Expand All @@ -379,6 +382,11 @@ protected void english(String domain, String locale) {
override(HULL, tier, tier.getId().toUpperCase() + " " + HULL.getLang(locale));
});
}

@Override
protected void overrides() {
override(Ref.ID, "jei.category.pulverizer", "Macerator/Pulverizer");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static void machineRecipes(){
RecipeMaps.ASSEMBLER.RB().ii(of(getAe2Item("printed_calculation_processor")), of(getAe2Item("printed_silicon"))).fi(Redstone.getLiquid(AntimatterPlatformUtils.isForge() ? 144L : 9000L)).io(new ItemStack(getAe2Item("calculation_processor"))).add("calculation_processor", 64, 32);
RecipeMaps.ASSEMBLER.RB().ii(DUST.getMaterialIngredient(CertusQuartz, 1), of(ItemTags.SAND)).io(new ItemStack(getAe2Item("certus_crystal_seed"), 2)).add("certus_crystal_seed", 64, 8);
RecipeMaps.ASSEMBLER.RB().ii(DUST.getMaterialIngredient(Fluix, 1), of(ItemTags.SAND)).io(new ItemStack(getAe2Item("fluix_crystal_seed"), 2)).add("fluix_crystal_seed", 64, 8);
RecipeMaps.MACERATOR.RB().ii(of(getAe2Item("sky_stone_chest"))).io(new ItemStack(getAe2Item("sky_dust"), 8)).add("sky_dust_from_chest", 400, 2);
RecipeMaps.MACERATOR.RB().ii(of(getAe2Item("sky_stone_block"))).io(new ItemStack(getAe2Item("sky_dust"))).add("sky_dust", 400, 2);
PULVERIZER.RB().ii(of(getAe2Item("sky_stone_chest"))).io(new ItemStack(getAe2Item("sky_dust"), 8)).add("sky_dust_from_chest", 400, 2);
PULVERIZER.RB().ii(of(getAe2Item("sky_stone_block"))).io(new ItemStack(getAe2Item("sky_dust"))).add("sky_dust", 400, 2);
RecipeMaps.ELECTROLYZER.RB().ii(GEM.getMaterialIngredient(CertusQuartz, 1)).io(new ItemStack(getAe2Item("charged_certus_quartz_crystal"))).add("charged_certus_quartz", 2000, 30);
E_BLAST_FURNACE.RB().ii(RecipeIngredient.of(TagUtils.getForgelikeItemTag("silicon")), GTCoreItems.SELECTOR_TAG_INGREDIENTS.get(1)).io(INGOT.get(Silicon)).add("silicon_ingot_from_silicon", 1683, 120, 1683);
LASER_ENGRAVER.RB().ii(BLOCK.getMaterialIngredient(Iron, 1), LENS.getMaterialIngredient(GreenSapphire, 1).setNoConsume()).io(new ItemStack(getAe2Item("logic_processor_press"))).add("inscriber_logic_press", 2000, 1920);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private static void addRecyclingRecipe(ItemLike input, ImmutableMap<Material, Fl

private static void addRecyclingRecipe(Ingredient input, ImmutableMap<Material, Float> outputs, String id){
RecipeBuilder arc = RecipeMaps.ARC_FURNACE.RB();
RecipeBuilder mac = RecipeMaps.MACERATOR.RB();
RecipeBuilder mac = RecipeMaps.PULVERIZER.RB();
arc.ii(input);
mac.ii(input);
long[] totalMassArc = new long[]{0};
Expand Down
Loading

0 comments on commit 039fc4b

Please sign in to comment.