Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor configs for vanilla recipes #2197

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,33 @@ private static void hardIronRecipes(Consumer<FinishedRecipe> provider) {

VanillaRecipeHelper.addShapedRecipe(provider, "iron_bucket", new ItemStack(Items.BUCKET), "XhX", " X ", 'X',
new UnificationEntry(TagPrefix.plate, GTMaterials.Iron));

VanillaRecipeHelper.addShapedRecipe(provider, "chain_iron", new ItemStack(Items.CHAIN), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, Iron));

ASSEMBLER_RECIPES.recipeBuilder("chain_iron")
.inputItems(ring, Iron, 3)
.outputItems(new ItemStack(Items.CHAIN, 2))
.duration(40).EUt(10).save(provider);

VanillaRecipeHelper.addShapedRecipe(provider, "chain_wrought_iron", new ItemStack(Items.CHAIN, 2), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, WroughtIron));

ASSEMBLER_RECIPES.recipeBuilder("chain_wrought_iron")
.inputItems(ring, WroughtIron, 3)
.outputItems(new ItemStack(Items.CHAIN, 3))
.duration(40).EUt(10).save(provider);

VanillaRecipeHelper.addShapedRecipe(provider, "chain_steel", new ItemStack(Items.CHAIN, 3), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, Steel));

ASSEMBLER_RECIPES.recipeBuilder("chain_steel")
.inputItems(ring, Steel, 3)
.outputItems(new ItemStack(Items.CHAIN, 4))
.duration(40).EUt(10).save(provider);
}

private static void hardRedstoneRecipes(Consumer<FinishedRecipe> provider) {
Expand Down Expand Up @@ -711,19 +738,9 @@ private static void harderRods(Consumer<FinishedRecipe> provider) {
}

/**
* Replaces Vanilla Beacon Recipe
* Replaces Vanilla Jack-o-lantern Recipe
* Replaces Vanilla Book Recipe
* Replaces Vanilla Brewing Stand Recipe
* Replaces Vanilla Enchantment Table recipe
* Replaces Vanilla Jukebox recipe
* Replaces Vanilla Note Block recipe
* Replaces Vanilla Furnace recipe
* Replaces Vanilla Flower Pot recipe
* Replaces Vanilla Armor Stand recipe
* Replaces Vanilla Trapped Chest recipe
* Replaces Vanilla Ender Chest recipe
* Replaces Vanilla Bed recipes
* Replaces recipes for items that don't fit in any other config option.
* Vanilla items go here only if they not fit the criteria for removeVanillaBlockRecipes,
* disableManualCompression, or any of the other config options
*/
private static void hardMiscRecipes(Consumer<FinishedRecipe> provider) {
if (ConfigHolder.INSTANCE.recipes.hardMiscRecipes) {
Expand All @@ -733,7 +750,7 @@ private static void hardMiscRecipes(Consumer<FinishedRecipe> provider) {
'S', new ItemStack(Items.NETHER_STAR),
'O', new UnificationEntry(TagPrefix.plate, GTMaterials.Obsidian));

VanillaRecipeHelper.addShapedRecipe(provider, "lit_pumpkin", new ItemStack(Blocks.JACK_O_LANTERN), "PT",
VanillaRecipeHelper.addShapedRecipe(provider, "jack_o_lantern", new ItemStack(Blocks.JACK_O_LANTERN), "PT",
"k ",
'P', new ItemStack(Blocks.PUMPKIN),
'T', new ItemStack(Blocks.TORCH));
Expand Down Expand Up @@ -890,12 +907,6 @@ private static void hardMiscRecipes(Consumer<FinishedRecipe> provider) {
.outputItems(new ItemStack(Blocks.SOUL_LANTERN))
.duration(100).EUt(1).save(provider);

ALLOY_SMELTER_RECIPES.recipeBuilder("tinted_glass")
.inputItems(new ItemStack(Blocks.GLASS))
.inputItems(new ItemStack(Items.AMETHYST_SHARD, 4))
.outputItems(new ItemStack(Blocks.TINTED_GLASS, 2))
.duration(80).EUt(6).save(provider); // eut may need rebalancing

VanillaRecipeHelper.addShapedRecipe(provider, "stonecutter", new ItemStack(Blocks.STONECUTTER), "f d",
"SBS", "XXX",
'X', new ItemStack(Blocks.STONE_SLAB),
Expand Down Expand Up @@ -1151,33 +1162,6 @@ private static void hardMiscRecipes(Consumer<FinishedRecipe> provider) {
// 'L', new ItemStack(Items.CRYING_OBSIDIAN),
// 'G', new UnificationEntry(plate, Glowstone));

VanillaRecipeHelper.addShapedRecipe(provider, "chain_iron", new ItemStack(Items.CHAIN), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, Iron));

ASSEMBLER_RECIPES.recipeBuilder("chain_iron")
.inputItems(ring, Iron, 3)
.outputItems(new ItemStack(Items.CHAIN, 2))
.duration(40).EUt(10).save(provider);

VanillaRecipeHelper.addShapedRecipe(provider, "chain_wrought_iron", new ItemStack(Items.CHAIN, 2), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, WroughtIron));

ASSEMBLER_RECIPES.recipeBuilder("chain_wrought_iron")
.inputItems(ring, WroughtIron, 3)
.outputItems(new ItemStack(Items.CHAIN, 3))
.duration(40).EUt(10).save(provider);

VanillaRecipeHelper.addShapedRecipe(provider, "chain_steel", new ItemStack(Items.CHAIN, 3), " R ",
"wR ", " R ",
'R', new UnificationEntry(ring, Steel));

ASSEMBLER_RECIPES.recipeBuilder("chain_steel")
.inputItems(ring, Steel, 3)
.outputItems(new ItemStack(Items.CHAIN, 4))
.duration(40).EUt(10).save(provider);

for (DyeColor color : DyeColor.values()) {
addBedRecipe(provider, color);
addCarpetRecipe(provider, color);
Expand Down Expand Up @@ -1281,6 +1265,12 @@ private static void addCarpetRecipe(Consumer<FinishedRecipe> provider, DyeColor
private static void hardGlassRecipes(Consumer<FinishedRecipe> provider) {
VanillaRecipeHelper.addShapedRecipe(provider, "glass_pane", new ItemStack(Blocks.GLASS_PANE, 2), "sG", 'G',
new ItemStack(Blocks.GLASS));

ALLOY_SMELTER_RECIPES.recipeBuilder("tinted_glass")
.inputItems(new ItemStack(Blocks.GLASS))
.inputItems(new ItemStack(Items.AMETHYST_SHARD, 4))
.outputItems(new ItemStack(Blocks.TINTED_GLASS, 2))
.duration(80).EUt(6).save(provider);
}

private static void nerfPaperCrafting(Consumer<FinishedRecipe> provider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private static void generalRemovals(Consumer<ResourceLocation> registry) {
* ModHandler.removeFurnaceSmelting(new ItemStack(Blocks.LAPIS_ORE));
* ModHandler.removeFurnaceSmelting(new ItemStack(Blocks.REDSTONE_ORE));
* ModHandler.removeFurnaceSmelting(new ItemStack(Blocks.QUARTZ_ORE));
*
*
* // Remove a bunch of processing recipes for tools and armor, since we have significantly better options
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.IRON_HELMET, 1, W));
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.IRON_CHESTPLATE, 1, W));
Expand All @@ -58,7 +58,7 @@ private static void generalRemovals(Consumer<ResourceLocation> registry) {
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.IRON_AXE, 1, W));
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.IRON_SWORD, 1, W));
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.IRON_HOE, 1, W));
*
*
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.GOLDEN_HELMET, 1, W));
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.GOLDEN_CHESTPLATE, 1, W));
* ModHandler.removeFurnaceSmelting(new ItemStack(Items.GOLDEN_LEGGINGS, 1, W));
Expand All @@ -77,6 +77,9 @@ private static void generalRemovals(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:leather_horse_armor"));
}

/**
* Remove recipes for any item that is 4x4 or 9x9 crafting (nuggets <-> ingot, ingot <-> block, etc.)
*/
private static void disableManualCompression(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:gold_block"));
registry.accept(new ResourceLocation("minecraft:gold_nugget"));
Expand Down Expand Up @@ -131,6 +134,7 @@ private static void hardIronRecipes(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:hopper"));
registry.accept(new ResourceLocation("minecraft:iron_bars"));
registry.accept(new ResourceLocation("minecraft:bucket"));
registry.accept(new ResourceLocation("minecraft:chain"));
}

private static void hardRedstoneRecipes(Consumer<ResourceLocation> registry) {
Expand Down Expand Up @@ -180,17 +184,43 @@ private static void hardToolArmorRecipes(Consumer<ResourceLocation> registry) {
}

/**
* - Removes Vanilla Golden Apple Recipe
* - Removes Vanilla Ender Eye Recipe
* - Removes Vanilla Glistering Melon Recipe
* - Removes Vanilla Golden Carrot Recipe
* - Removes Vanilla Magma Cream Recipe
* - Removes Vanilla Polished Stone Variant Recipes
* - Removes Vanilla Brick Smelting Recipe
* - Removes Vanilla Fermented Spider Eye recipe
* - Removes Vanilla Fire Charge recipe
* Remove recipes for items that don't fit in any other config option.
* Vanilla items go here only if they not fit the criteria for removeVanillaBlockRecipes,
* disableManualCompression, or any of the other config options
*/
private static void hardMiscRecipes(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:jack_o_lantern"));
registry.accept(new ResourceLocation("minecraft:beacon"));
registry.accept(new ResourceLocation("minecraft:respawn_anchor"));
registry.accept(new ResourceLocation("minecraft:lodestone"));
registry.accept(new ResourceLocation("minecraft:chiseled_bookshelf"));
registry.accept(new ResourceLocation("minecraft:brewing_stand"));
registry.accept(new ResourceLocation("minecraft:enchanting_table"));
registry.accept(new ResourceLocation("minecraft:jukebox"));
registry.accept(new ResourceLocation("minecraft:note_block"));
registry.accept(new ResourceLocation("minecraft:furnace"));
registry.accept(new ResourceLocation("minecraft:crafting_table"));
registry.accept(new ResourceLocation("minecraft:flower_pot"));
registry.accept(new ResourceLocation("minecraft:armor_stand"));
registry.accept(new ResourceLocation("minecraft:trapped_chest"));
registry.accept(new ResourceLocation("minecraft:ender_chest"));
registry.accept(new ResourceLocation("minecraft:lantern"));
registry.accept(new ResourceLocation("minecraft:stonecutter"));
registry.accept(new ResourceLocation("minecraft:cartography_table"));
registry.accept(new ResourceLocation("minecraft:fletching_table"));
registry.accept(new ResourceLocation("minecraft:smithing_table"));
registry.accept(new ResourceLocation("minecraft:grindstone"));
registry.accept(new ResourceLocation("minecraft:smoker"));
registry.accept(new ResourceLocation("minecraft:blast_furnace"));
registry.accept(new ResourceLocation("minecraft:loom"));
registry.accept(new ResourceLocation("minecraft:composter"));
registry.accept(new ResourceLocation("minecraft:bell"));
registry.accept(new ResourceLocation("minecraft:conduit"));
registry.accept(new ResourceLocation("minecraft:candle"));
registry.accept(new ResourceLocation("minecraft:scaffolding"));
registry.accept(new ResourceLocation("minecraft:beehive"));
registry.accept(new ResourceLocation("minecraft:lightning_rod"));
registry.accept(new ResourceLocation("minecraft:lectern"));
registry.accept(new ResourceLocation("minecraft:golden_apple"));
registry.accept(new ResourceLocation("minecraft:book"));
registry.accept(new ResourceLocation("minecraft:ender_eye"));
Expand All @@ -214,7 +244,6 @@ private static void hardMiscRecipes(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:brush"));
registry.accept(new ResourceLocation("minecraft:recovery_compass"));
registry.accept(new ResourceLocation("minecraft:spyglass"));
registry.accept(new ResourceLocation("minecraft:chain"));
registry.accept(new ResourceLocation("minecraft:respawn_anchor"));
registry.accept(new ResourceLocation("minecraft:lodestone"));
registry.accept(new ResourceLocation("minecraft:chiseled_bookshelf"));
Expand All @@ -234,6 +263,7 @@ private static void hardGlassRecipes(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation(
String.format("minecraft:%s_stained_glass_pane", color.name().toLowerCase(Locale.ROOT))));
}
registry.accept(new ResourceLocation("minecraft:tinted_glass"));
}

private static void nerfPaperCrafting(Consumer<ResourceLocation> registry) {
Expand Down Expand Up @@ -266,7 +296,17 @@ private static void flintAndSteelRequireSteel(Consumer<ResourceLocation> registr
registry.accept(new ResourceLocation("minecraft:flint_and_steel"));
}

/**
* Removes the vanilla recipe for an item that would has BOTH a normal recipe as well as a GT recipe in normal
JuiceyBeans marked this conversation as resolved.
Show resolved Hide resolved
* configs (think stairs, ladders, etc.)
*/
private static void removeVanillaBlockRecipes(Consumer<ResourceLocation> registry) {
registry.accept(new ResourceLocation("minecraft:dripstone_block"));
registry.accept(new ResourceLocation("minecraft:polished_granite"));
registry.accept(new ResourceLocation("minecraft:polished_diorite"));
registry.accept(new ResourceLocation("minecraft:polished_andesite"));
registry.accept(new ResourceLocation("minecraft:packed_ice"));
registry.accept(new ResourceLocation("minecraft:blue_ice"));
registry.accept(new ResourceLocation("minecraft:slime_block"));
registry.accept(new ResourceLocation("minecraft:slime_ball"));
registry.accept(new ResourceLocation("minecraft:melon"));
Expand Down Expand Up @@ -333,45 +373,6 @@ private static void removeVanillaBlockRecipes(Consumer<ResourceLocation> registr
// registry.accept(new ResourceLocation("minecraft:end_crystal"));
registry.accept(new ResourceLocation("minecraft:end_rod"));
// registry.accept(new ResourceLocation("minecraft:mud_bricks")); //no other way to obtain these rn
registry.accept(new ResourceLocation("minecraft:dripstone_block"));
registry.accept(new ResourceLocation("minecraft:beacon"));
registry.accept(new ResourceLocation("minecraft:jack_o_lantern"));
registry.accept(new ResourceLocation("minecraft:packed_ice"));
registry.accept(new ResourceLocation("minecraft:blue_ice"));
registry.accept(new ResourceLocation("minecraft:respawn_anchor"));
registry.accept(new ResourceLocation("minecraft:lodestone"));
registry.accept(new ResourceLocation("minecraft:chiseled_bookshelf"));
registry.accept(new ResourceLocation("minecraft:brewing_stand"));
registry.accept(new ResourceLocation("minecraft:enchanting_table"));
registry.accept(new ResourceLocation("minecraft:jukebox"));
registry.accept(new ResourceLocation("minecraft:note_block"));
registry.accept(new ResourceLocation("minecraft:furnace"));
registry.accept(new ResourceLocation("minecraft:crafting_table"));
registry.accept(new ResourceLocation("minecraft:polished_granite"));
registry.accept(new ResourceLocation("minecraft:polished_diorite"));
registry.accept(new ResourceLocation("minecraft:polished_andesite"));
registry.accept(new ResourceLocation("minecraft:flower_pot"));
registry.accept(new ResourceLocation("minecraft:armor_stand"));
registry.accept(new ResourceLocation("minecraft:trapped_chest"));
registry.accept(new ResourceLocation("minecraft:ender_chest"));
registry.accept(new ResourceLocation("minecraft:lantern"));
registry.accept(new ResourceLocation("minecraft:tinted_glass"));
registry.accept(new ResourceLocation("minecraft:stonecutter"));
registry.accept(new ResourceLocation("minecraft:cartography_table"));
registry.accept(new ResourceLocation("minecraft:fletching_table"));
registry.accept(new ResourceLocation("minecraft:smithing_table"));
registry.accept(new ResourceLocation("minecraft:grindstone"));
registry.accept(new ResourceLocation("minecraft:smoker"));
registry.accept(new ResourceLocation("minecraft:blast_furnace"));
registry.accept(new ResourceLocation("minecraft:loom"));
registry.accept(new ResourceLocation("minecraft:composter"));
registry.accept(new ResourceLocation("minecraft:bell"));
registry.accept(new ResourceLocation("minecraft:conduit"));
registry.accept(new ResourceLocation("minecraft:candle"));
registry.accept(new ResourceLocation("minecraft:scaffolding"));
registry.accept(new ResourceLocation("minecraft:beehive"));
registry.accept(new ResourceLocation("minecraft:lightning_rod"));
registry.accept(new ResourceLocation("minecraft:lectern"));

// Carpet replacement
for (DyeColor color : DyeColor.values()) {
Expand Down