Skip to content

Commit

Permalink
Stone Block Recipes (#2563)
Browse files Browse the repository at this point in the history
Co-authored-by: Karthi Suresh <[email protected]>
  • Loading branch information
YoungOnionMC and JuiceyBeans authored Dec 19, 2024
1 parent 32e24ec commit 5f5214f
Show file tree
Hide file tree
Showing 14 changed files with 1,100 additions and 203 deletions.
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -4706,6 +4706,7 @@
"material.gtceu.black_bronze": "ǝzuoɹᗺ ʞɔɐןᗺ",
"material.gtceu.black_dye": "ǝʎᗡ ʞɔɐןᗺ",
"material.gtceu.black_steel": "ןǝǝʇS ʞɔɐןᗺ",
"material.gtceu.blackstone": "ǝuoʇsʞɔɐןᗺ",
"material.gtceu.blaze": "ǝzɐןᗺ",
"material.gtceu.blue_alloy": "ʎoןןⱯ ǝnןᗺ",
"material.gtceu.blue_dye": "ǝʎᗡ ǝnןᗺ",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4706,6 +4706,7 @@
"material.gtceu.black_bronze": "Black Bronze",
"material.gtceu.black_dye": "Black Dye",
"material.gtceu.black_steel": "Black Steel",
"material.gtceu.blackstone": "Blackstone",
"material.gtceu.blaze": "Blaze",
"material.gtceu.blue_alloy": "Blue Alloy",
"material.gtceu.blue_dye": "Blue Dye",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.gregtechceu.gtceu.api.data.tag.TagUtil;
import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKey;
import com.gregtechceu.gtceu.common.data.GTItems;
import com.gregtechceu.gtceu.data.recipe.misc.StoneMachineRecipes;
import com.gregtechceu.gtceu.data.recipe.misc.WoodMachineRecipes;
import com.gregtechceu.gtceu.data.tags.TagsHandler;
import com.gregtechceu.gtceu.utils.SupplierMemoizer;
Expand Down Expand Up @@ -414,5 +415,6 @@ public static void reinitializeUnification() {
}
GTItems.toUnify.forEach(ChemicalHelper::registerUnificationItems);
WoodMachineRecipes.registerUnificationInfo();
StoneMachineRecipes.registerUnificationInfo();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public static void init() {
rock.setIgnored(Endstone, Blocks.END_STONE);
rock.setIgnored(Deepslate, Blocks.DEEPSLATE);
rock.setIgnored(Basalt, Blocks.BASALT);
rock.setIgnored(Blackstone, Blocks.BLACKSTONE);
block.setIgnored(Sculk, Blocks.SCULK);
block.setIgnored(Concrete, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.DARK_CONCRETE.get()));
block.setIgnored(Concrete, SupplierMemoizer.memoizeBlockSupplier(() -> GTBlocks.LIGHT_CONCRETE.get()));
Expand Down Expand Up @@ -911,6 +912,7 @@ private static void excludeAllGemsButNormal(Material material) {
public static Material Marble;
public static Material Deepslate;
public static Material GraniteRed;
public static Material Blackstone;
public static Material VanadiumMagnetite;
public static Material QuartzSand;
public static Material Pollucite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static void recipeAddition(Consumer<FinishedRecipe> originalConsumer) {
MiscRecipeLoader.init(consumer);
VanillaStandardRecipes.init(consumer);
WoodMachineRecipes.init(consumer);
StoneMachineRecipes.init(consumer);
CraftingRecipeLoader.init(consumer);
FuelRecipes.init(consumer);
FusionLoader.init(consumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,12 @@ public static void register() {
.flags(DECOMPOSITION_BY_CENTRIFUGING)
.components(PotassiumIodide, 5, PrussianBlue, 3, DiethylenetriaminepentaaceticAcid, 5)
.buildAndRegister();

Blackstone = new Material.Builder(GTCEu.id("blackstone"))
.dust()
.color(0x090a0a).iconSet(ROUGH)
.flags(NO_SMASHING)
.components(DarkAsh, 2, Basalt, 1, Stone, 5)
.buildAndRegister();
}
}
238 changes: 238 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/data/recipe/StoneTypeEntry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
package com.gregtechceu.gtceu.data.recipe;

import com.gregtechceu.gtceu.api.GTValues;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;

import net.minecraft.world.item.Item;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class StoneTypeEntry {

@NotNull
public final String modid;
@NotNull
public final String stoneName;
@Nullable
public final Item stone;
@Nullable
public final Item polishedStone;
@Nullable
public final Item smeltStone;
@Nullable
public final Item chiselStone;
@Nullable
public final Item crackedStone;
@Nullable
public final Item slab;
@Nullable
public final Item stair;
@Nullable
public final Item button;
@Nullable
public final Item pressurePlate;
@Nullable
public final Item wall;
public final Material material;
public final long materialAmount;
public final boolean addStoneOreDict;
public final boolean addPolishedStoneOreDict;
public final boolean addSlabOreDict;
public final boolean addStairOreDict;
public final boolean addButtonOreDict;
public final boolean addWallOreDict;
public final boolean addPressurePlateOreDict;
public final boolean addStoneUnificationInfo;
public final boolean addPolishedStoneUnificationInfo;
public final boolean addSmeltStoneUnificationInfo;
public final boolean addChiselStoneUnificationInfo;
public final boolean addCrackedStoneUnificationInfo;
public final boolean addSlabUnificationInfo;
public final boolean addStairUnificationInfo;
public final boolean addButtonUnificationInfo;
public final boolean addWallUnificationInfo;
public final boolean addPressurePlateUnificationInfo;

private StoneTypeEntry(@NotNull String modid, @NotNull String stoneName,
@Nullable Item stone, @Nullable Item polishedStone,
@Nullable Item smeltStone, @Nullable Item chiselStone,
@Nullable Item crackedStone, @Nullable Item slab,
@Nullable Item stair, @Nullable Item button,
@Nullable Item wall, @Nullable Item pressurePlate,
@Nullable Material material, long materialAmount,
boolean addStoneOreDict, boolean addPolishedStoneOreDict,
boolean addSlabOreDict,
boolean addStairOreDict, boolean addButtonOreDict,
boolean addWallOreDict, boolean addPressurePlateOreDict,
boolean addStoneUnificationInfo, boolean addPolishedStoneUnificationInfo,
boolean addSmeltStoneUnificationInfo, boolean addChiselStoneUnificationInfo,
boolean addCrackedStoneUnificationInfo, boolean addSlabUnificationInfo,
boolean addStairUnificationInfo, boolean addButtonUnificationInfo,
boolean addWallUnificationInfo, boolean addPressurePlateUnificationInfo) {
this.modid = modid;
this.stoneName = stoneName;
this.stone = stone;
this.polishedStone = polishedStone;
this.smeltStone = smeltStone;
this.chiselStone = chiselStone;
this.crackedStone = crackedStone;
this.slab = slab;
this.stair = stair;
this.button = button;
this.wall = wall;
this.pressurePlate = pressurePlate;
this.material = material;
this.materialAmount = materialAmount;
this.addStoneOreDict = addStoneOreDict;
this.addPolishedStoneOreDict = addPolishedStoneOreDict;
this.addSlabOreDict = addSlabOreDict;
this.addStairOreDict = addStairOreDict;
this.addButtonOreDict = addButtonOreDict;
this.addWallOreDict = addWallOreDict;
this.addPressurePlateOreDict = addPressurePlateOreDict;
this.addStoneUnificationInfo = addStoneUnificationInfo;
this.addPolishedStoneUnificationInfo = addPolishedStoneUnificationInfo;
this.addChiselStoneUnificationInfo = addChiselStoneUnificationInfo;
this.addCrackedStoneUnificationInfo = addCrackedStoneUnificationInfo;
this.addSmeltStoneUnificationInfo = addSmeltStoneUnificationInfo;
this.addSlabUnificationInfo = addSlabUnificationInfo;
this.addStairUnificationInfo = addStairUnificationInfo;
this.addButtonUnificationInfo = addButtonUnificationInfo;
this.addWallUnificationInfo = addWallUnificationInfo;
this.addPressurePlateUnificationInfo = addPressurePlateUnificationInfo;
}

public static class Builder {

public final String modid;
public final String stoneName;
public Item stone = null;
public Item polishedStone = null;
public Item smeltStone = null;
public Item chiselStone = null;
public Item crackedStone = null;
public Item slab = null;
public Item stair = null;
public Item button = null;
public Item wall = null;
public Item pressurePlate = null;
@Nullable
private Material material = null;
private long materialAmount = GTValues.M;
public boolean addStoneOreDict = false;
public boolean addPolishedStoneOreDict = false;
public boolean addSlabOreDict = false;
public boolean addStairOreDict = false;
public boolean addButtonOreDict = false;
public boolean addWallOreDict = false;
public boolean addPressurePlateOreDict = false;
public boolean addStoneUnificationInfo = false;
public boolean addPolishedStoneUnificationInfo = false;
public boolean addSmeltStoneUnificationInfo = false;
public boolean addChiselStoneUnificationInfo = false;
public boolean addCrackedStoneUnificationInfo = false;
public boolean addSlabUnificationInfo = false;
public boolean addStairUnificationInfo = false;
public boolean addButtonUnificationInfo = false;
public boolean addWallUnificationInfo = false;
public boolean addPressurePlateUnificationInfo = false;

public Builder(@NotNull String modid, @NotNull String stoneName) {
this.modid = modid;
this.stoneName = stoneName;
}

public Builder stone(@NotNull Item stone) {
this.stone = stone;
return this;
}

public Builder polishedStone(@NotNull Item polishedStone) {
this.polishedStone = polishedStone;
return this;
}

public Builder smeltStone(@NotNull Item smeltStone) {
this.smeltStone = smeltStone;
return this;
}

public Builder chiselStone(@NotNull Item chiselStone) {
this.chiselStone = chiselStone;
return this;
}

public Builder crackedStone(@NotNull Item crackedStone) {
this.crackedStone = crackedStone;
return this;
}

public Builder slab(@NotNull Item slab) {
this.slab = slab;
return this;
}

public Builder stair(@NotNull Item stair) {
this.stair = stair;
return this;
}

public Builder button(@NotNull Item button) {
this.button = button;
return this;
}

public Builder wall(@NotNull Item wall) {
this.wall = wall;
return this;
}

public Builder pressurePlate(@NotNull Item pressurePlate) {
this.pressurePlate = pressurePlate;
return this;
}

public Builder material(@NotNull Material material) {
return material(material, GTValues.M);
}

public Builder material(@NotNull Material material, long materialAmount) {
this.material = material;
this.materialAmount = materialAmount;
return this;
}

public Builder registerAllUnificationInfo() {
return registerUnificationInfo(true, true, true, true, true, true, true, true, true);
}

public Builder registerUnificationInfo(boolean stone, boolean polishedStone, boolean smeltStone,
boolean chiselStone, boolean slab, boolean stair, boolean button,
boolean wall, boolean pressurePlate) {
this.addStoneUnificationInfo = stone;
this.addPolishedStoneUnificationInfo = polishedStone;
this.addSmeltStoneUnificationInfo = smeltStone;
this.addChiselStoneUnificationInfo = chiselStone;
this.addSlabUnificationInfo = slab;
this.addStairUnificationInfo = stair;
this.addButtonUnificationInfo = button;
this.addWallUnificationInfo = wall;
this.addPressurePlateUnificationInfo = pressurePlate;
return this;
}

public StoneTypeEntry build() {
return new StoneTypeEntry(modid, stoneName,
stone, polishedStone, smeltStone, chiselStone, crackedStone, slab, stair, button, wall,
pressurePlate,
material, materialAmount,
addStoneOreDict, addPolishedStoneOreDict, addSlabOreDict, addStairOreDict,
addButtonOreDict, addWallOreDict, addPressurePlateOreDict,
addStoneUnificationInfo, addPolishedStoneUnificationInfo, addSmeltStoneUnificationInfo,
addChiselStoneUnificationInfo, addCrackedStoneUnificationInfo, addSlabUnificationInfo,
addStairUnificationInfo, addButtonUnificationInfo,
addWallUnificationInfo, addPressurePlateUnificationInfo);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ public static void addSmeltingRecipe(Consumer<FinishedRecipe> provider, @NotNull
addSmeltingRecipe(provider, GTCEu.id(regName), input, output, 0.0f);
}

public static void addSmeltingRecipe(Consumer<FinishedRecipe> provider, @NotNull String regName, Item input,
Item output) {
addSmeltingRecipe(provider, GTCEu.id(regName), input.getDefaultInstance(), output.getDefaultInstance(), 0.0f);
}

public static void addSmeltingRecipe(Consumer<FinishedRecipe> provider, @NotNull String regName, Item input,
Item output, float experience) {
addSmeltingRecipe(provider, GTCEu.id(regName), input.getDefaultInstance(), output.getDefaultInstance(),
experience);
}

public static void addSmeltingRecipe(Consumer<FinishedRecipe> provider, @NotNull String regName, ItemStack input,
ItemStack output, float experience) {
addSmeltingRecipe(provider, GTCEu.id(regName), input, output, experience);
Expand Down
Loading

0 comments on commit 5f5214f

Please sign in to comment.