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

Commit

Permalink
added recipes for multiblock tanks and their walls
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 18, 2023
1 parent 3cba873 commit 7833a01
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public static void onMaterialEvent(GregTechMaterialEvent event){
event.setMaterial(Lutetium).asMetal(1925, 1925);
event.setMaterial(Hafnium).asMetal(2506);
event.setMaterial(Tantalum).asSolid(3290, 0);
event.setMaterial(Tungsten).asMetal(3695, 3000, FOIL);
event.setMaterial(Tungsten).asMetal(3695, 3000, FOIL, RING);
event.setMaterial(Rhenium).asMetal(3459,3459);
event.setMaterial(Osmium).asOre().asMetal(3306, 3306, SCREW, BOLT, RING, PLATE, FOIL, ROD, WIRE_FINE);
event.setMaterial(Iridium).asMetal(2719, 2719, FRAME, PLATE).asOre();
event.setMaterial(Platinum).asMetal(2041, 0, PLATE, FOIL, ROD, WIRE_FINE).asOre();
//Gold, added by vanilla
event.setMaterial(Mercury).asFluid();
event.setMaterial(Thallium).asMetal(577, 0);
event.setMaterial(Lead).asMetal(600, 0, PLATE, PLATE_DENSE, FOIL, ROD, FRAME, BOLT).asOre().harvestLevel(1);
event.setMaterial(Lead).asMetal(600, 0, PLATE, PLATE_DENSE, FOIL, ROD, FRAME, BOLT, RING).asOre().harvestLevel(1);
event.setMaterial(Bismuth).asOre();
event.setMaterial(Polonium).asMetal(527, 0);
event.setMaterial(Astatine).asMetal(575, 0);
Expand Down Expand Up @@ -153,7 +153,7 @@ public static void onMaterialEvent(GregTechMaterialEvent event){
event.setMaterial(HSSE).asMetal(5400, 5400, GEAR, FRAME);
event.setMaterial(HSSG).asMetal(4500, 4500, GEAR, FRAME);
event.setMaterial(HSSS).asMetal(5400, 5400);
event.setMaterial(Invar).asMetal(1700, FRAME);
event.setMaterial(Invar).asMetal(1700, FRAME, RING);
event.setMaterial(IronMagnetic).asMetal(1811, ROD);
event.setMaterial(Kanthal).asMetal(1800, 1800);
event.setMaterial(Magnalium).asMetal(870, 0, PLATE, ROD_LONG);
Expand Down Expand Up @@ -1627,7 +1627,7 @@ private static void antimatterMaterials(GregTechMaterialEvent event){
event.setMaterial(Flint).flags(ROCK);
event.setMaterial(Gold).flags(FOIL, ROD, WIRE_FINE, GEAR);
event.setMaterial(Iron).flags(RING, GEAR, FRAME);
event.setMaterial(AntimatterMaterials.Netherite).asMetal(2246, 1300);
event.setMaterial(AntimatterMaterials.Netherite).asMetal(2246, 1300, RING);
event.setMaterial(Lapis).asGemBasic(false, PLATE).mats(of(Lazurite, 12, Sodalite, 2, Pyrite, 1, Calcite, 1));
event.setMaterial(Prismarine).mats(of(Potassium, 2, Oxygen, 8, Manganese, 1, Silicon, 5));
event.setMaterial(Redstone).mats(of(Silicon, 1, Pyrite, 5, Ruby, 1, Mercury, 3)).asFluid(0, MaterialTags.MELTING_POINT.getInt(Redstone));//.setOreMulti(4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.block.BlockCasing;
import muramasa.gregtech.block.BlockCoil;
import muramasa.gregtech.block.BlockColoredWall;
import muramasa.gregtech.data.GregTechData;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.data.recipes.FinishedRecipe;
Expand All @@ -24,9 +26,9 @@
import java.util.function.Consumer;

import static com.google.common.collect.ImmutableMap.of;
import static muramasa.antimatter.data.AntimatterDefaultTools.HAMMER;
import static muramasa.antimatter.data.AntimatterDefaultTools.WRENCH;
import static muramasa.antimatter.data.AntimatterDefaultTools.*;
import static muramasa.antimatter.data.AntimatterMaterialTypes.*;
import static muramasa.antimatter.data.AntimatterMaterials.Wood;
import static muramasa.gregtech.data.GregTechData.*;
import static muramasa.gregtech.data.Materials.*;
import static muramasa.gregtech.data.TierMaps.*;
Expand All @@ -40,6 +42,16 @@ public static void loadRecipes(Consumer<FinishedRecipe> output, AntimatterRecipe
, "RRR","RWR", "RRR");
});

AntimatterAPI.all(BlockColoredWall.class, b -> {
if (b.getMaterial() == Wood){
provider.addItemRecipe(output, "walls", "has_hammer", provider.hasSafeItem(HAMMER.getTag()), b.asItem(),
of('P', PLATE.getMaterialTag(Lead), 'H', HAMMER.getTag(), 'S', SAW.getTag(), 'W', ItemTags.PLANKS), "W W", "SPH", "W W");
} else {
provider.addItemRecipe(output, "walls", "has_hammer", provider.hasSafeItem(HAMMER.getTag()), b.asItem(),
of('P', PLATE.getMaterialTag(b.getMaterial()), 'H', HAMMER.getTag(), 'W', WRENCH.getTag()), "WPP", "HPP");
}
});

addBrickedCasing(output, provider, Bronze, GregTechData.CASING_BRICKED_BRONZE);
provider.addStackRecipe(output, GTIRef.ID, "firebricks", "blocks", "has_fire_brick", provider.hasSafeItem(FireBrick),
new ItemStack(CASING_FIRE_BRICK), of('F', FireBrick), "FF", "FF");
Expand Down Expand Up @@ -93,7 +105,7 @@ public static void loadRecipes(Consumer<FinishedRecipe> output, AntimatterRecipe
addTierCasing(output, provider, Tier.UV);
addTierCasing(output, provider, Tier.UHV);

addTierHull(output, provider, AntimatterMaterials.Wood,Tier.ULV);
addTierHull(output, provider, Wood,Tier.ULV);
addTierHull(output, provider, WroughtIron,Tier.LV);
addTierHull(output, provider, WroughtIron,Tier.MV);
addTierHull(output, provider, Polyethylene,Tier.HV);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import muramasa.gregtech.data.GregTechTags;
import muramasa.gregtech.data.Materials;
import muramasa.gregtech.data.TierMaps;
import muramasa.gregtech.machine.MultiblockTankMachine;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
Expand All @@ -37,6 +38,7 @@
import static muramasa.antimatter.data.AntimatterDefaultTools.*;
import static muramasa.antimatter.data.AntimatterMaterialTypes.*;
import static muramasa.antimatter.data.AntimatterMaterials.Iron;
import static muramasa.antimatter.data.AntimatterMaterials.Wood;
import static muramasa.antimatter.machine.Tier.*;
import static muramasa.gregtech.data.GregTechData.*;
import static muramasa.gregtech.data.GregTechTags.CIRCUITS_ADVANCED;
Expand Down Expand Up @@ -533,6 +535,22 @@ public static void loadRecipes(Consumer<FinishedRecipe> output, AntimatterRecipe
of('S', SCREWDRIVER.getTag(), 'w', WIRE_CUTTER.getTag(), 'W', Machine.get(m.getId().replace("charging_", ""), GTUtility.ID).map(mch -> mch.getItem(NONE)).orElse(Items.AIR), 'c', CABLE_GETTER.apply(PipeSize.SMALL, HV, false), 'C', CIRCUITS_ADVANCED, 'R', ROD.getMaterialTag(m.getMaterial())), "RCR", "SWw", "ccc");
}
});

AntimatterAPI.all(MultiblockTankMachine.class).forEach(m -> {
if (m.isSmall()){
Block block = AntimatterAPI.get(Block.class, m.getMaterial().getId() + "_wall", GTIRef.ID);
if (block == null) return;
Material ringMaterial = m.getMaterial() == Wood ? Lead : m.getMaterial();
TagKey<Item> hammer = m.getMaterial() == Wood ? SOFT_HAMMER.getTag() : HAMMER.getTag();
provider.addItemRecipe(output, "multiblock_tanks", "has_saw", provider.hasSafeItem(SAW.getTag()), m.getItem(NONE),
of('R', RING.getMaterialTag(ringMaterial), 'S', SAW.getTag(), 'H', hammer, 'W', block.asItem()), " R ", "HWS", " R ");
} else {
Block block = AntimatterAPI.get(Block.class, m.getId().replace("large", "small"), GTIRef.ID);
if (block == null) return;
provider.addItemRecipe(output, "multiblock_tanks", "has_saw", provider.hasSafeItem(SAW.getTag()), m.getItem(NONE),
of('P', PLATE.getMaterialTag(m.getMaterial()), 'S', SAW.getTag(), 'H', HAMMER.getTag(), 'W', block.asItem()), "PPP", "HWS", "PPP");
}
});
}

private static void addHatchRecipes(Consumer<FinishedRecipe> output, AntimatterRecipeProvider provider){
Expand Down

0 comments on commit 7833a01

Please sign in to comment.