Skip to content

Commit 618c851

Browse files
committed
apply extra wood-associated recipe
1 parent 26e2a79 commit 618c851

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

src/main/java/com/github/gtexpert/gtwp/integration/botania/recipes/BotaniaWoodRecipe.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
import gregtech.api.recipes.ModHandler;
1515
import gregtech.api.recipes.RecipeMaps;
16+
import gregtech.api.unification.OreDictUnifier;
1617
import gregtech.api.unification.material.Materials;
18+
import gregtech.api.unification.stack.ItemMaterialInfo;
19+
import gregtech.api.unification.stack.MaterialStack;
1720
import gregtech.api.util.GTUtility;
1821
import gregtech.common.ConfigHolder;
1922
import gregtech.loaders.WoodTypeEntry;
@@ -66,10 +69,11 @@ public static void init() {
6669
ItemStack slab = Mods.Botania.getItem(name + "0slab");
6770
// stairs
6871
ModHandler.removeRecipeByName(new ResourceLocation(mcModId, name + "0stairs"));
69-
7072
ModHandler.addShapedRecipe(mcModId + name + "_stairs", GTUtility.copy(4, stair),
7173
"P ", "PP ", "PPP",
7274
'P', wood);
75+
OreDictUnifier.registerOre(stair, new ItemMaterialInfo(
76+
new MaterialStack(Materials.Wood, (3 * M) / 2)));
7377

7478
// plank -> stairs assembling
7579
RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
@@ -82,6 +86,8 @@ public static void init() {
8286
// plank -> slab crafting
8387
ModHandler.addShapedRecipe(mcModId + name + "_slab_saw", GTUtility.copy(2, slab),
8488
"sS", 'S', wood);
89+
OreDictUnifier.registerOre(slab, new ItemMaterialInfo(
90+
new MaterialStack(Materials.Wood, M / 2)));
8591

8692
if (ConfigHolder.recipes.hardWoodRecipes) {
8793
ModHandler.removeRecipeByName(new ResourceLocation(mcModId, name + "0slab_0"));

src/main/java/com/github/gtexpert/gtwp/integration/natura/recipes/NaturaWoodRecipe.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
import net.minecraft.item.ItemStack;
1515
import net.minecraft.util.ResourceLocation;
1616

17+
import org.jetbrains.annotations.NotNull;
18+
1719
import gregtech.api.GTValues;
1820
import gregtech.api.recipes.GTRecipeHandler;
1921
import gregtech.api.recipes.ModHandler;
2022
import gregtech.api.recipes.RecipeMaps;
2123
import gregtech.api.unification.OreDictUnifier;
2224
import gregtech.api.unification.material.Materials;
2325
import gregtech.api.unification.ore.OrePrefix;
26+
import gregtech.api.unification.stack.ItemMaterialInfo;
27+
import gregtech.api.unification.stack.MaterialStack;
2428
import gregtech.api.unification.stack.UnificationEntry;
2529
import gregtech.api.util.GTUtility;
2630
import gregtech.common.ConfigHolder;
@@ -29,7 +33,6 @@
2933
import com.github.gtexpert.gtwp.api.util.Mods;
3034
import com.github.gtexpert.gtwp.common.GTWPConfigHolder;
3135
import com.github.gtexpert.gtwp.loaders.GTWPWoodRecipeLoader;
32-
import org.jetbrains.annotations.NotNull;
3336

3437
public class NaturaWoodRecipe {
3538

@@ -222,13 +225,18 @@ public static void init() {
222225
.fluidInputs(Materials.Iron.getFluid(GTValues.L / 9))
223226
.outputs(door.copy())
224227
.duration(400).EUt(4).buildAndRegister();
228+
OreDictUnifier.registerOre(door, new ItemMaterialInfo(
229+
new MaterialStack(Materials.Wood, M * 2),
230+
new MaterialStack(Materials.Iron, M / 9)));
225231
} else {
226232
RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
227233
.inputs(GTUtility.copy(6, log))
228234
.outputs(GTUtility.copy(3, door))
229235
.circuitMeta(6)
230236
.duration(600).EUt(4)
231237
.buildAndRegister();
238+
OreDictUnifier.registerOre(door, new ItemMaterialInfo(
239+
new MaterialStack(Materials.Wood, M * 2)));
232240
}
233241
// Redwood Root
234242
GTWPWoodRecipeLoader.removeCharcoalRecipe(Mods.Natura.getItem("redwood_logs", 1, 2));
@@ -309,6 +317,8 @@ public static void miscRecipe() {
309317
ModHandler.addMirroredShapedRecipe(entry.woodName + "_stick_saw", GTUtility.copy(stick_saw, Stick),
310318
"Ps", " P",
311319
'P', entry.planks);
320+
OreDictUnifier.registerOre(Stick, new ItemMaterialInfo(
321+
new MaterialStack(Materials.Wood, M / 2)));
312322

313323
// Button and Pressure Plate
314324
if (ConfigHolder.recipes.hardRedstoneRecipes) {
@@ -333,7 +343,13 @@ public static void miscRecipe() {
333343
.inputs(GTUtility.copy(2, entry.planks))
334344
.outputs(GTUtility.copy(2, PressurePlate))
335345
.duration(100).EUt(VA[ULV]).buildAndRegister();
346+
OreDictUnifier.registerOre(PressurePlate, new ItemMaterialInfo(
347+
new MaterialStack(Materials.Wood, M), new MaterialStack(Materials.Iron, M / 2)));
348+
} else {
349+
OreDictUnifier.registerOre(PressurePlate,
350+
new ItemMaterialInfo(new MaterialStack(Materials.Wood, M * 2)));
336351
}
352+
OreDictUnifier.registerOre(Button, new ItemMaterialInfo(new MaterialStack(Materials.Wood, M / 9)));
337353

338354
// Trap Door
339355
if (ConfigHolder.recipes.hardWoodRecipes) {
@@ -357,6 +373,8 @@ public static void miscRecipe() {
357373
.inputs(new ItemStack(Items.FLINT))
358374
.outputs(Workbench).buildAndRegister();
359375
}
376+
OreDictUnifier.registerOre(Workbench,
377+
new ItemMaterialInfo(new MaterialStack(Materials.Wood, M * 2)));
360378

361379
// Bookshelf
362380
if (ConfigHolder.recipes.removeVanillaBlockRecipes) {
@@ -370,6 +388,8 @@ public static void miscRecipe() {
370388
.outputs(Bookshelf)
371389
.duration(100).EUt(4)
372390
.buildAndRegister();
391+
OreDictUnifier.registerOre(Bookshelf, new ItemMaterialInfo(
392+
new MaterialStack(Materials.Paper, M * 9), new MaterialStack(Materials.Wood, M * 6)));
373393
} else {
374394
// Nether Wood
375395
int stickMeta = entry.woodName.equals("ghostwood") ? 9 :
@@ -392,6 +412,7 @@ public static void miscRecipe() {
392412
ModHandler.addMirroredShapedRecipe(entry.woodName + "_stick_saw", GTUtility.copy(stick_saw, Stick),
393413
"Ps", " P",
394414
'P', entry.planks);
415+
OreDictUnifier.registerOre(Stick, new ItemMaterialInfo(new MaterialStack(Materials.Wood, M / 2)));
395416

396417
// Button and Pressure Plate
397418
if (ConfigHolder.recipes.hardRedstoneRecipes) {
@@ -416,7 +437,13 @@ public static void miscRecipe() {
416437
.inputs(GTUtility.copy(2, entry.planks))
417438
.outputs(GTUtility.copy(2, PressurePlate))
418439
.duration(100).EUt(VA[ULV]).buildAndRegister();
440+
OreDictUnifier.registerOre(PressurePlate, new ItemMaterialInfo(
441+
new MaterialStack(Materials.Wood, M), new MaterialStack(Materials.Iron, M / 2)));
442+
} else {
443+
OreDictUnifier.registerOre(PressurePlate,
444+
new ItemMaterialInfo(new MaterialStack(Materials.Wood, M * 2)));
419445
}
446+
OreDictUnifier.registerOre(Button, new ItemMaterialInfo(new MaterialStack(Materials.Wood, M / 9)));
420447

421448
// Trap Door
422449
if (ConfigHolder.recipes.hardWoodRecipes) {
@@ -440,6 +467,8 @@ public static void miscRecipe() {
440467
.inputs(new ItemStack(Items.FLINT))
441468
.outputs(Workbench).buildAndRegister();
442469
}
470+
OreDictUnifier.registerOre(Workbench,
471+
new ItemMaterialInfo(new MaterialStack(Materials.Wood, M * 2)));
443472

444473
// Bookshelf
445474
if (ConfigHolder.recipes.removeVanillaBlockRecipes) {
@@ -453,6 +482,8 @@ public static void miscRecipe() {
453482
.outputs(Bookshelf)
454483
.duration(100).EUt(4)
455484
.buildAndRegister();
485+
OreDictUnifier.registerOre(Bookshelf, new ItemMaterialInfo(
486+
new MaterialStack(Materials.Paper, M * 9), new MaterialStack(Materials.Wood, M * 6)));
456487
}
457488
}
458489
}

0 commit comments

Comments
 (0)