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

Commit

Permalink
adeed a couple methods to GregTechMaterialEvent, to clean up some byp…
Browse files Browse the repository at this point in the history
…roducts stuff
  • Loading branch information
Trinsdar committed Jul 2, 2024
1 parent 0fe483d commit fdc5bc0
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1114,41 +1114,40 @@ public static void byproducts(GregTechMaterialEvent event){
event.setMaterial(BrownLimonite).addByProduct(Malachite, YellowLimonite);
event.setMaterial(Calcite).addByProduct(Andradite, Malachite);
event.setMaterial(Cassiterite).addByProduct(Tin);
event.setMaterial(Chalcopyrite).addByProduct(Pyrite, Cobalt, Cadmium);
event.setMaterial(Chalcopyrite).addByProduct(Pyrite, Cobalt, Cadmium).bathMercury(Gold).bathPersulfate(Cobalt);
event.setMaterial(Chromium).addByProduct(Iron, Magnesium);
event.setMaterial(Chromite).addByProduct(Iron, Magnesium);
event.setMaterial(Cinnabar).addByProduct(Redstone, Sulfur, Glowstone);
event.setMaterial(Clay).addByProduct(Clay);
event.setMaterial(Coal).addByProduct(Lignite, Thorium);
event.setMaterial(Cobalt).addByProduct(Cobaltite);
event.setMaterial(Cobaltite).addByProduct(Cobalt, Cobalt);
event.setMaterial(Sheldonite).addByProduct(Palladium, Nickel, Iridium);
event.setMaterial(Copper).addByProduct(Cobalt, Gold, Nickel);
event.setMaterial(Copper).addByProduct(Cobalt, Gold, Nickel).bathMercury(Gold).bathPersulfate(Copper);
event.setMaterial(DarkAsh).addByProduct(Carbon);
event.setMaterial(Diamond).addByProduct(Graphite);
event.setMaterial(Electrum).addByProduct(Gold, Silver);
event.setMaterial(Emerald).addByProduct(Beryllium, Alumina);
event.setMaterial(Endstone).addByProduct(Helium3);
event.setMaterial(EnrichedNaquadah).addByProduct(Naquadah, Naquadria);
event.setMaterial(Flint).addByProduct(Obsidian);
event.setMaterial(Galena).addByProduct(Sulfur, Silver, Lead);
event.setMaterial(Garnierite).addByProduct(Nickel);
event.setMaterial(Galena).addByProduct(Sulfur, Silver, Lead).bathMercury(Silver);
event.setMaterial(Garnierite).addByProduct(Nickel).bathPersulfate(Nickel);
event.setMaterial(Glauconite).addByProduct(Sodium, Alumina, Iron);
event.setMaterial(Glowstone).addByProduct(Redstone, Gold);
event.setMaterial(Gold).addByProduct(Copper, Nickel);
event.setMaterial(Gold).addByProduct(Copper, Nickel).bathMercury(Gold).bathPersulfate(Copper);
event.setMaterial(Graphite).addByProduct(Carbon);
event.setMaterial(Grossular).addByProduct(YellowGarnet, Calcium);
event.setMaterial(Ilmenite).addByProduct(Iron, Rutile);
event.setMaterial(Iridium).addByProduct(Platinum, Osmium);
event.setMaterial(Iron).addByProduct(Nickel, Tin);
event.setMaterial(Iridium).addByProduct(Platinum, Osmium).bathMercury(Platinum);
event.setMaterial(Iron).addByProduct(Nickel, Tin).bathPersulfate(Nickel);
event.setMaterial(Lapis).addByProduct(Calcite, Pyrite);
event.setMaterial(Lead).addByProduct(Silver, Sulfur);
event.setMaterial(Lead).addByProduct(Silver, Sulfur).bathMercury(Silver);
event.setMaterial(Lepidolite).addByProduct(Lithium, Caesium, Boron);
event.setMaterial(Lignite).addByProduct(Coal);
event.setMaterial(Magnesite).addByProduct(Magnesium);
event.setMaterial(Magnesium).addByProduct(Olivine);
event.setMaterial(Magnetite).addByProduct(Iron, Gold);
event.setMaterial(Malachite).addByProduct(Copper, BrownLimonite, Calcite);
event.setMaterial(Magnetite).addByProduct(Iron, Gold).bathMercury(Gold);
event.setMaterial(Malachite).addByProduct(Copper, BrownLimonite, Calcite).bathPersulfate(Copper);
event.setMaterial(Manganese).addByProduct(Chromium, Iron);
event.setMaterial(Marble).addByProduct(Calcite);
event.setMaterial(Molybdenite).addByProduct(Powellite, Scheelite, Wulfenite, Osmium);
Expand All @@ -1157,17 +1156,17 @@ public static void byproducts(GregTechMaterialEvent event){
event.setMaterial(Neodymium).addByProduct(RareEarth);
event.setMaterial(Netherrack).addByProduct(Sulfur);
event.setMaterial(Neutronium).addByProduct(Neutronium);
event.setMaterial(Nickel).addByProduct(Cobalt, Platinum, Iron);
event.setMaterial(Nickel).addByProduct(Cobalt, Platinum, Iron).bathMercury(Platinum).bathPersulfate(Nickel);
event.setMaterial(Obsidian).addByProduct(Olivine);
event.setMaterial(Olivine).addByProduct(Pyrope, Magnesium);
event.setMaterial(Opal).addByProduct(Tanzanite);
event.setMaterial(Osmium).addByProduct(Iridium);
event.setMaterial(Pentlandite).addByProduct(Iron, Sulfur, Cobalt);
event.setMaterial(Osmium).addByProduct(Iridium).bathMercury(Osmium);
event.setMaterial(Pentlandite).addByProduct(Iron, Sulfur, Cobalt).bathPersulfate(Cobalt);
event.setMaterial(Phosphate).addByProduct(Phosphor);
event.setMaterial(Phosphor).addByProduct(Phosphate);
event.setMaterial(TricalciumPhosphate).addByProduct(Phosphate, Fluorite);
event.setMaterial(Pitchblende).addByProduct(Lead, Thorium, RareEarth);
event.setMaterial(Platinum).addByProduct(Nickel, Iridium);
event.setMaterial(Platinum).addByProduct(Nickel, Iridium).bathMercury(Platinum).bathPersulfate(Nickel);
event.setMaterial(Plutonium).addByProduct(Uranium, Lead);
event.setMaterial(Powellite).addByProduct(Molybdenite, Scheelite);
event.setMaterial(Pyrite).addByProduct(Sulfur, TricalciumPhosphate, Iron);
Expand All @@ -1185,30 +1184,31 @@ public static void byproducts(GregTechMaterialEvent event){
event.setMaterial(Salt).addByProduct(RockSalt);
event.setMaterial(Saltpeter).addByProduct(Saltpeter);
event.setMaterial(Scheelite).addByProduct(Manganese, Molybdenum, Calcium).elecTicks(120); //1920 eu/tick
event.setMaterial(Sheldonite).addByProduct(Palladium, Nickel, Iridium).bathMercury(Sheldonite).bathPersulfate(Nickel);
event.setMaterial(Silicon).addByProduct(SiliconDioxide);
event.setMaterial(Silver).addByProduct(Lead, Sulfur);
event.setMaterial(Sperrylite).addByProduct(Antimony, Copper, Sheldonite, Hematite);
event.setMaterial(Silver).addByProduct(Lead, Sulfur).bathMercury(Silver);
event.setMaterial(Sperrylite).addByProduct(Antimony, Copper, Sheldonite, Hematite).bathMercury(Sheldonite).bathPersulfate(Copper);
event.setMaterial(Spessartine).addByProduct(RedGarnet, Manganese);
event.setMaterial(Sphalerite).addByProduct(YellowGarnet, Cadmium, Indium, Zinc);
event.setMaterial(Sphalerite).addByProduct(YellowGarnet, Cadmium, Indium, Zinc).bathPersulfate(Zinc);
event.setMaterial(Spodumene).addByProduct(Alumina, Lithium);
event.setMaterial(Steel).addByProduct(Iron);
event.setMaterial(Stibnite).addByProduct(Antimony);
event.setMaterial(Sulfur).addByProduct(Sulfur);
event.setMaterial(Tantalite).addByProduct(Manganese, Niobium, Tantalum);
event.setMaterial(Tanzanite).addByProduct(Opal);
event.setMaterial(Tetrahedrite).addByProduct(Antimony, Zinc);
event.setMaterial(Tetrahedrite).addByProduct(Antimony, Zinc).bathPersulfate(Tetrahedrite);
event.setMaterial(Thorium).addByProduct(Lead, Thorium, Indium);
event.setMaterial(Tin).addByProduct(Iron, Zinc);
event.setMaterial(Tin).addByProduct(Iron, Zinc).bathPersulfate(Zinc);
event.setMaterial(Titanium).addByProduct(Almandine);
event.setMaterial(Tungstate).addByProduct(Manganese, Silver, Lithium);
event.setMaterial(Tungstate).addByProduct(Manganese, Silver, Lithium).bathMercury(Silver);
event.setMaterial(Tungsten).addByProduct(Manganese, Molybdenum);
event.setMaterial(Uraninite).addByProduct(Lead, Thorium, RareEarth);
event.setMaterial(Uvarovite).addByProduct(YellowGarnet, Chromium);
event.setMaterial(VanadiumMagnetite).addByProduct(Magnetite, Vanadium);
event.setMaterial(Wulfenite).addByProduct(Powellite/*, Sheelite*/, Molybdenite, Galena);
event.setMaterial(YellowGarnet).addByProduct(Andradite, Grossular, Uvarovite);
event.setMaterial(YellowLimonite).addByProduct(Nickel, BrownLimonite, Cobalt);
event.setMaterial(Zinc).addByProduct(Tin, Gallium);
event.setMaterial(YellowLimonite).addByProduct(Nickel, BrownLimonite, Cobalt).bathPersulfate(Nickel);
event.setMaterial(Zinc).addByProduct(Tin, Gallium).bathPersulfate(Zinc);
}

private static void flags(GregTechMaterialEvent event){
Expand All @@ -1228,36 +1228,6 @@ private static void flags(GregTechMaterialEvent event){
CENT.add(CENT15.all().toArray(new Material[0]));
CENT.add(CENT20.all().toArray(new Material[0]));
RECIPE_MASS.add(Lead, 64);
CHEMBATH_MERCURY.add(Chalcopyrite, Gold);
CHEMBATH_MERCURY.add(Copper, Gold);
CHEMBATH_MERCURY.add(Gold,Gold);
CHEMBATH_MERCURY.add(Sheldonite, Sheldonite);
CHEMBATH_MERCURY.add(Lead, Silver);
CHEMBATH_MERCURY.add(Galena, Silver);
CHEMBATH_MERCURY.add(Magnetite, Gold);
CHEMBATH_MERCURY.add(Nickel, Platinum);
CHEMBATH_MERCURY.add(Osmium, Osmium);
CHEMBATH_MERCURY.add(Platinum, Platinum);
CHEMBATH_MERCURY.add(Iridium, Platinum);
CHEMBATH_MERCURY.add(Silver,Silver);
CHEMBATH_MERCURY.add(Tungstate, Silver);
CHEMBATH_MERCURY.add(Sperrylite, Sheldonite);
CHEMBATH_PERSULFATE.add(Pentlandite,Cobalt);
CHEMBATH_PERSULFATE.add(Copper, Copper);
CHEMBATH_PERSULFATE.add(Gold, Copper);
CHEMBATH_PERSULFATE.add(Chalcopyrite,Cobalt);
CHEMBATH_PERSULFATE.add(Nickel, Nickel);
CHEMBATH_PERSULFATE.add(Garnierite, Nickel);
CHEMBATH_PERSULFATE.add(YellowLimonite, Nickel);
CHEMBATH_PERSULFATE.add(Sphalerite,Zinc);
CHEMBATH_PERSULFATE.add(Tin,Zinc);
CHEMBATH_PERSULFATE.add(Malachite, Copper);
CHEMBATH_PERSULFATE.add(Tetrahedrite,Tetrahedrite);
CHEMBATH_PERSULFATE.add(Zinc, Zinc);
CHEMBATH_PERSULFATE.add(Platinum, Nickel);
CHEMBATH_PERSULFATE.add(Iron, Nickel);
CHEMBATH_PERSULFATE.add(Sheldonite, Nickel);
CHEMBATH_PERSULFATE.add(Sperrylite, Copper);
FURNACE_FUELS.add(CoalCoke, GEM, 3200);
FURNACE_FUELS.add(CoalCoke, DUST, 3200);
FURNACE_FUELS.add(CoalCoke, BLOCK, 32000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class GregTechMaterialTags {
public static final MaterialTag NEEDS_BLAST_FURNACE = AntimatterAPI.register(MaterialTag.class, new MaterialTag("needs_blast_furnace", true));
public static final NumberMaterialTag RECIPE_MASS = (NumberMaterialTag) AntimatterAPI.register(MaterialTag.class, new NumberMaterialTag("recipe_mass", true));
public static final NumberMaterialTag BLAST_FURNACE_TEMP = (NumberMaterialTag) AntimatterAPI.register(MaterialTag.class, new NumberMaterialTag("blast_furnace_temp", true));
public static final DoubleMaterialTag CHEMBATH_MERCURY = new DoubleMaterialTag("chembath_mercury");
public static final DoubleMaterialTag CHEMBATH_PERSULFATE = new DoubleMaterialTag("chembath_persulfate");
public static final DoubleMaterialTag BATH_MERCURY = new DoubleMaterialTag("bath_mercury");
public static final DoubleMaterialTag BATH_PERSULFATE = new DoubleMaterialTag("bath_persulfate");
public static final DoubleMaterialTag THERMAL_CENTRIFUGE_EXPLICIT = new DoubleMaterialTag("thermal_centrifuge_explicit");
public static final ListMaterialTag<FluidProduct> DISTILL_INTO = new ListMaterialTag<>("distill_into");
public static final NumberMaterialTag DISTILLATION_FLUID_INPUT_AMOUNT = new NumberMaterialTag("distillation_fluid_input_amount");
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ private List<Widget> setupChemMachineSlots(OreProcessingDisplay display, Rectang
widgets.add(Widgets.createSlot(xy(29, 48, bounds)).entries(ofMachine(Machines.BATH)).markInput().disableBackground());
if(display.bathingMode == OreProcessingDisplay.BathingMode.MERCURY){
widgets.add(Widgets.createSlot(xy(50, 48, bounds)).entries(ofFluid(Materials.Mercury,1000)).markInput().disableBackground());
widgets.add(Widgets.createSlot(xy(90, 48, bounds)).entries(List.of(EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(DUST.get(GregTechMaterialTags.CHEMBATH_MERCURY.getMapping(display.ore)),1)))).markOutput().disableBackground());
widgets.add(Widgets.createSlot(xy(90, 48, bounds)).entries(List.of(EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(DUST.get(GregTechMaterialTags.BATH_MERCURY.getMapping(display.ore)),1)))).markOutput().disableBackground());
}else{
widgets.add(Widgets.createSlot(xy(50, 48, bounds)).entries(ofFluid(Materials.SodiumPersulfateSolution,1000)).markInput().disableBackground());
widgets.add(Widgets.createSlot(xy(90, 48, bounds)).entries(List.of(EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(DUST.get(GregTechMaterialTags.CHEMBATH_PERSULFATE.getMapping(display.ore)),1)))).markOutput().disableBackground());
widgets.add(Widgets.createSlot(xy(90, 48, bounds)).entries(List.of(EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(DUST.get(GregTechMaterialTags.BATH_PERSULFATE.getMapping(display.ore)),1)))).markOutput().disableBackground());
}
widgets.add(Widgets.createSlot(xy(72, 48, bounds)).entries(List.of(EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(CRUSHED_PURIFIED.get(display.ore),1)))).markOutput().disableBackground());
return widgets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public static void init(){
});
REIUtils.addExtraDisplay(r -> {
AntimatterMaterialTypes.ORE.all().forEach(m -> {
if (m.has(GregTechMaterialTags.CHEMBATH_PERSULFATE) || m.has(GregTechMaterialTags.CHEMBATH_MERCURY)){
if (m.has(GregTechMaterialTags.CHEMBATH_MERCURY)){
if (m.has(GregTechMaterialTags.BATH_PERSULFATE) || m.has(GregTechMaterialTags.BATH_MERCURY)){
if (m.has(GregTechMaterialTags.BATH_MERCURY)){
r.add(new OreProcessingDisplay(m, OreProcessingDisplay.BathingMode.MERCURY));
}
if (m.has(GregTechMaterialTags.CHEMBATH_PERSULFATE)){
if (m.has(GregTechMaterialTags.BATH_PERSULFATE)){
r.add(new OreProcessingDisplay(m, OreProcessingDisplay.BathingMode.PERSULFATE));
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import static muramasa.antimatter.Ref.U;
import static muramasa.antimatter.data.AntimatterMaterialTypes.*;
import static muramasa.antimatter.data.AntimatterMaterials.*;
import static muramasa.gregtech.data.GregTechMaterialTags.CHEMBATH_MERCURY;
import static muramasa.gregtech.data.GregTechMaterialTags.CHEMBATH_PERSULFATE;
import static muramasa.gregtech.data.GregTechMaterialTags.BATH_MERCURY;
import static muramasa.gregtech.data.GregTechMaterialTags.BATH_PERSULFATE;
import static muramasa.gregtech.data.Materials.*;
import static muramasa.gregtech.data.RecipeMaps.*;

Expand Down Expand Up @@ -117,7 +117,7 @@ public static void init() {
addPSGRecipe(Platinum);
}
public static void mercurybathing(){
CHEMBATH_MERCURY.getAll().forEach((main,side) ->
BATH_MERCURY.getAll().forEach((main, side) ->
BATH.RB()
.ii(RecipeIngredient.of(AntimatterMaterialTypes.CRUSHED.get(main),1))
.fi(Mercury.getLiquid(1000))
Expand All @@ -126,7 +126,7 @@ public static void mercurybathing(){
.add("mercury_" + main.getId(),40*20));
}
public static void persulfatebathing(){
CHEMBATH_PERSULFATE.getAll().forEach((main,side) ->
BATH_PERSULFATE.getAll().forEach((main, side) ->
BATH.RB()
.ii(RecipeIngredient.of(AntimatterMaterialTypes.CRUSHED.get(main),1))
.fi(SodiumPersulfateSolution.getLiquid(1000))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package muramasa.gregtech.material;

import com.google.common.collect.ImmutableMap;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.event.MaterialEvent;
import muramasa.antimatter.material.IMaterialTag;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.data.ToolData;
import muramasa.antimatter.tool.AntimatterToolType;
import muramasa.gregtech.data.GregTechMaterialTags;
import net.minecraft.world.item.enchantment.Enchantment;

import java.util.Arrays;

import static muramasa.antimatter.material.MaterialTags.*;

Expand Down Expand Up @@ -60,4 +56,19 @@ protected GregTechMaterialEvent buildTool(ToolData builder) {
flags(AntimatterMaterialTypes.ROD_LONG);
return super.buildTool(builder);
}

public GregTechMaterialEvent thermal(Material byProduct){
GregTechMaterialTags.THERMAL_CENTRIFUGE_EXPLICIT.add(this.material, byProduct);
return this;
}

public GregTechMaterialEvent bathMercury(Material byProduct){
GregTechMaterialTags.BATH_MERCURY.add(this.material, byProduct);
return this;
}

public GregTechMaterialEvent bathPersulfate(Material byProduct){
GregTechMaterialTags.BATH_PERSULFATE.add(this.material, byProduct);
return this;
}
}

0 comments on commit fdc5bc0

Please sign in to comment.