Skip to content

Commit

Permalink
Fix missing hard recipe config recipes (GregTechCEu#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss authored Nov 16, 2023
1 parent 3584c61 commit 190fc3a
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 46 deletions.
2 changes: 2 additions & 0 deletions src/main/java/gregtech/api/items/OreDictNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ public enum OreDictNames {
string,
chestWood,
chestEnder,
fenceWood,

cobblestone, // For just cobblestone.
stoneCobble, // For any kind of cobblestone (e.g. mossy cobblestone).
stoneBricks, // For any kind of stone bricks

craftingAnvil,
craftingFurnace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public String toString() {
.requireProps(PropertyKey.INGOT)
.build();

public static final MaterialFlag GENERATE_DENSE = new MaterialFlag.Builder("generate_dense")
.requireFlags(GENERATE_PLATE)
.requireProps(PropertyKey.DUST)
.build();

public static final MaterialFlag GENERATE_ROD = new MaterialFlag.Builder("generate_rod")
.requireProps(PropertyKey.DUST)
.build();
Expand Down Expand Up @@ -234,11 +239,6 @@ public String toString() {
.requireProps(PropertyKey.INGOT)
.build();

public static final MaterialFlag GENERATE_DENSE = new MaterialFlag.Builder("generate_dense")
.requireFlags(GENERATE_PLATE)
.requireProps(PropertyKey.INGOT)
.build();

public static final MaterialFlag GENERATE_ROUND = new MaterialFlag.Builder("generate_round")
.requireProps(PropertyKey.INGOT)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public static void register() {
Obsidian = new Material.Builder(297, gregtechId("obsidian"))
.dust(3)
.color(0x503264)
.flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, GENERATE_PLATE)
.flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, GENERATE_PLATE, GENERATE_DENSE)
.components(Magnesium, 1, Iron, 1, Silicon, 2, Oxygen, 4)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void register() {
EnderEye = new Material.Builder(2508, gregtechId("ender_eye"))
.gem(1)
.color(0x66FF66)
.flags(NO_SMASHING, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
.flags(GENERATE_PLATE, NO_SMASHING, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
.build();

Diatomite = new Material.Builder(2509, gregtechId("diatomite"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/unification/ore/OrePrefix.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class OrePrefix {
public static final OrePrefix nugget = new OrePrefix("nugget", M / 9, null, MaterialIconType.nugget, ENABLE_UNIFICATION, hasIngotProperty);

// 9 Plates combined in one Item.
public static final OrePrefix plateDense = new OrePrefix("plateDense", M * 9, null, MaterialIconType.plateDense, ENABLE_UNIFICATION, mat -> mat.hasFlag(GENERATE_DENSE) && !mat.hasFlag(NO_SMASHING));
public static final OrePrefix plateDense = new OrePrefix("plateDense", M * 9, null, MaterialIconType.plateDense, ENABLE_UNIFICATION, mat -> mat.hasFlag(GENERATE_DENSE));
// 2 Plates combined in one Item
public static final OrePrefix plateDouble = new OrePrefix("plateDouble", M * 2, null, MaterialIconType.plateDouble, ENABLE_UNIFICATION, hasIngotProperty.and(mat -> mat.hasFlags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE) && !mat.hasFlag(NO_SMASHING)));
// Regular Plate made of one Ingot/Dust. Introduced by Calclavia
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static class RecipeOptions {
@Config.Comment({"Whether to remove Vanilla Block Recipes from the Crafting Table.", "Default: false"})
public boolean removeVanillaBlockRecipes = false;

@Config.Comment({"Whether to make crafting recipes for Bricks, Firebricks, and Coke Bricks harder.", "Default: false"})
@Config.Comment({"Whether to make crafting recipes for Bricks, Nether Bricks, Firebricks, and Coke Bricks harder.", "Default: false"})
public boolean harderBrickRecipes = false;

@Config.Comment({"Whether to make the recipe for the EBF Controller harder.", "Default: false"})
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/gregtech/loaders/MaterialInfoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,21 @@ public static void init() {
new MaterialStack(Materials.Obsidian, M * 3),
new MaterialStack(Materials.Glass, M * 4)));

OreDictUnifier.registerOre(new ItemStack(Blocks.ENCHANTING_TABLE, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.Diamond, M * 4), new MaterialStack(Materials.Obsidian, M * 3), new MaterialStack(Materials.Paper, M * 9)));
OreDictUnifier.registerOre(new ItemStack(Blocks.ENCHANTING_TABLE, 1, W), new ItemMaterialInfo(
new MaterialStack(Materials.Diamond, M * 4),
new MaterialStack(Materials.Obsidian, M * 3),
new MaterialStack(Materials.Paper, M * 9)));

OreDictUnifier.registerOre(new ItemStack(Blocks.ENDER_CHEST, 1, W), new ItemMaterialInfo(
new MaterialStack(Materials.Wood, M * 8), // chest
new MaterialStack(Materials.Obsidian, M * 9 * 6), // 6 dense plates
new MaterialStack(Materials.EnderEye, M)));
} else {
OreDictUnifier.registerOre(new ItemStack(Blocks.BEACON, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.NetherStar, M), new MaterialStack(Materials.Obsidian, M * 3), new MaterialStack(Materials.Glass, M * 5)));
OreDictUnifier.registerOre(new ItemStack(Blocks.ENCHANTING_TABLE, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.Diamond, M * 2), new MaterialStack(Materials.Obsidian, M * 4), new MaterialStack(Materials.Paper, M * 3)));
OreDictUnifier.registerOre(new ItemStack(Blocks.ENDER_CHEST, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.EnderEye, M), new MaterialStack(Materials.Obsidian, M * 8)));
}

OreDictUnifier.registerOre(new ItemStack(Blocks.ENDER_CHEST, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.EnderEye, M), new MaterialStack(Materials.Obsidian, M * 8)));

OreDictUnifier.registerOre(new ItemStack(Blocks.FURNACE, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.Stone, M * 8)));
OreDictUnifier.registerOre(new ItemStack(Blocks.STONEBRICK, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.Stone, M)));
OreDictUnifier.registerOre(new ItemStack(Blocks.COBBLESTONE, 1, W), new ItemMaterialInfo(new MaterialStack(Materials.Stone, M)));
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/gregtech/loaders/WoodTypeEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public final class WoodTypeEntry {
public final String doorRecipeName;
@Nonnull
public final ItemStack slab;
@Nullable
public final String slabRecipeName;
public final boolean addSlabCraftingRecipe;
public final ItemStack fence;
@Nullable
Expand Down Expand Up @@ -77,9 +79,9 @@ public final class WoodTypeEntry {
private WoodTypeEntry(@Nonnull String modid, @Nonnull String woodName, @Nonnull ItemStack log,
boolean removeCharcoalRecipe, boolean addCharcoalRecipe, @Nonnull ItemStack planks,
@Nullable String planksRecipeName, @Nonnull ItemStack door, @Nullable String doorRecipeName,
@Nonnull ItemStack slab, boolean addSlabCraftingRecipe, @Nonnull ItemStack fence,
@Nullable String fenceRecipeName, @Nonnull ItemStack fenceGate,
@Nullable String fenceGateRecipeName, @Nonnull ItemStack stairs,
@Nonnull ItemStack slab, @Nullable String slabRecipeName, boolean addSlabCraftingRecipe,
@Nonnull ItemStack fence, @Nullable String fenceRecipeName,
@Nonnull ItemStack fenceGate, @Nullable String fenceGateRecipeName, @Nonnull ItemStack stairs,
boolean addStairsCraftingRecipe, @Nonnull ItemStack boat, @Nullable String boatRecipeName,
@Nullable Material material, boolean addLogOreDict, boolean addPlanksOreDict,
boolean addDoorsOreDict, boolean addSlabsOreDict, boolean addFencesOreDict,
Expand All @@ -97,6 +99,7 @@ private WoodTypeEntry(@Nonnull String modid, @Nonnull String woodName, @Nonnull
this.door = door;
this.doorRecipeName = doorRecipeName;
this.slab = slab;
this.slabRecipeName = slabRecipeName;
this.addSlabCraftingRecipe = addSlabCraftingRecipe;
this.fence = fence;
this.fenceRecipeName = fenceRecipeName;
Expand Down Expand Up @@ -142,6 +145,7 @@ public static class Builder {
private ItemStack door = ItemStack.EMPTY;
private String doorRecipeName;
private ItemStack slab = ItemStack.EMPTY;
private String slabRecipeName;
private boolean addSlabsCraftingRecipe;
private ItemStack fence = ItemStack.EMPTY;
private String fenceRecipeName;
Expand Down Expand Up @@ -244,8 +248,9 @@ public Builder door(@Nonnull ItemStack door, @Nullable String doorRecipeName) {
* @param slab the slab to add
* @return this
*/
public Builder slab(@Nonnull ItemStack slab) {
public Builder slab(@Nonnull ItemStack slab, @Nullable String slabRecipeName) {
this.slab = slab;
this.slabRecipeName = slabRecipeName;
return this;
}

Expand Down Expand Up @@ -403,7 +408,7 @@ public Builder registerUnificationInfo(boolean planks, boolean door, boolean sla
public WoodTypeEntry build() {
Preconditions.checkArgument(!planks.isEmpty(), "Planks cannot be empty.");
return new WoodTypeEntry(modid, woodName, log, removeCharcoalRecipe, addCharcoalRecipe, planks,
planksRecipeName, door, doorRecipeName, slab, addSlabsCraftingRecipe, fence, fenceRecipeName,
planksRecipeName, door, doorRecipeName, slab, slabRecipeName, addSlabsCraftingRecipe, fence, fenceRecipeName,
fenceGate, fenceGateRecipeName, stairs, addStairsCraftingRecipe, boat, boatRecipeName, material,
addLogOreDict, addPlanksOreDict, addDoorsOreDict, addSlabsOreDict, addFencesOreDict,
addFenceGatesOreDict, addStairsOreDict, addPlanksUnificationInfo, addDoorsUnificationInfo,
Expand Down
Loading

0 comments on commit 190fc3a

Please sign in to comment.