diff --git a/src/generated/resources/assets/occultism/lang/en_us.json b/src/generated/resources/assets/occultism/lang/en_us.json index c625121df..11883f9f4 100644 --- a/src/generated/resources/assets/occultism/lang/en_us.json +++ b/src/generated/resources/assets/occultism/lang/en_us.json @@ -278,6 +278,12 @@ "book.occultism.dictionary_of_spirits.getting_started.books_of_binding.name": "Books of Binding", "book.occultism.dictionary_of_spirits.getting_started.books_of_binding.purified_ink_recipe.text": "In order to craft [#](ad03fc)Books of Binding[#]() to summon spirits, you need purified ink. Simply drop any black dye into [](item://occultism:spirit_fire) to purify it.\n", "book.occultism.dictionary_of_spirits.getting_started.books_of_binding.taboo_book_recipe.text": "Lastly you need taboo book to craft [#](ad03fc)Books of Binding[#]() to summon spirits. Simply drop a book into [](item://occultism:spirit_fire) to get it.\n", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.description": "Tips for using books of binding in Crafting Automation such as AE2 or RS", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.intro.text": "Bound Books of Binding are generated with a random spirit name. This tricks many automated crafting processes into no longer recognizing the item as the requested crafting result, because it does not expect NBT/Data Components on the item.\n\\\n\\\nThis leads to stuck crafting processes.\n", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.intro.title": "The Problem", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.name": "Books of Binding in Automation", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.solution.text": "1. Put a dictionary of spirits into an anvil and give it a name. This will be the name of all spirits summoned in the future.\n2. Use this dictionary to configure crafting patterns (if your automation mod requires it).\n2. Use this dictionary to craft the Bound Books of Binding in the automation system. As usual, the dictionary will not be used up.\n3. All crafted books will now have the same name and will be recognized by your automation system.\n", + "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.solution.title": "The Solution", "book.occultism.dictionary_of_spirits.getting_started.books_of_calling.description": "Telling your spirits what to do", "book.occultism.dictionary_of_spirits.getting_started.books_of_calling.intro.text": "Books of Calling allow to control a summoned spirit, and to store it to prevent essence decay or move it more easily.\n\\\n\\\nOnly spirits that require precise instructions - such as a work area or drop-off storage - come with a book of calling.\n", "book.occultism.dictionary_of_spirits.getting_started.books_of_calling.intro.title": "Books of Calling", @@ -1880,6 +1886,7 @@ "tag.item.c.tools.metal.axes": "Metal Axes", "tag.item.occultism.books.book_of_calling_djinni": "Book of Calling Djinni", "tag.item.occultism.books.book_of_calling_foliot": "Book of Calling Foliot", + "tag.item.occultism.books.books_of_binding": "Books of Binding", "tag.item.occultism.elytra": "Elytras", "tag.item.occultism.miners.basic_resources": "Basic Resource Miners", "tag.item.occultism.miners.deeps": "Deepslate Miners", diff --git a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_afrit.json b/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_afrit.json deleted file mode 100644 index a69ba7654..000000000 --- a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_afrit.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_book_of_binding_afrit": { - "conditions": { - "items": [ - { - "items": "occultism:book_of_binding_afrit" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "occultism:crafting/book_of_binding_bound_afrit" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_book_of_binding_afrit" - ] - ], - "rewards": { - "recipes": [ - "occultism:crafting/book_of_binding_bound_afrit" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_djinni.json b/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_djinni.json deleted file mode 100644 index f2a29e511..000000000 --- a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_djinni.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_book_of_binding_djinni": { - "conditions": { - "items": [ - { - "items": "occultism:book_of_binding_djinni" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "occultism:crafting/book_of_binding_bound_djinni" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_book_of_binding_djinni" - ] - ], - "rewards": { - "recipes": [ - "occultism:crafting/book_of_binding_bound_djinni" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_foliot.json b/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_foliot.json deleted file mode 100644 index e24e0a2a5..000000000 --- a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_foliot.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_book_of_binding_foliot": { - "conditions": { - "items": [ - { - "items": "occultism:book_of_binding_foliot" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "occultism:crafting/book_of_binding_bound_foliot" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_book_of_binding_foliot" - ] - ], - "rewards": { - "recipes": [ - "occultism:crafting/book_of_binding_bound_foliot" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_marid.json b/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_marid.json deleted file mode 100644 index d8a7873a6..000000000 --- a/src/generated/resources/data/occultism/advancement/recipes/misc/crafting/book_of_binding_bound_marid.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_book_of_binding_marid": { - "conditions": { - "items": [ - { - "items": "occultism:book_of_binding_marid" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "occultism:crafting/book_of_binding_bound_marid" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_book_of_binding_marid" - ] - ], - "rewards": { - "recipes": [ - "occultism:crafting/book_of_binding_bound_marid" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding_automation.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding_automation.json new file mode 100644 index 000000000..ab0c51a53 --- /dev/null +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding_automation.json @@ -0,0 +1,47 @@ +{ + "background_u_index": 0, + "background_v_index": 0, + "category": "occultism:getting_started", + "description": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.description", + "hide_while_locked": false, + "icon": { + "item": "minecraft:crafter" + }, + "name": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.name", + "pages": [ + { + "type": "modonomicon:text", + "anchor": "", + "condition": { + "type": "modonomicon:none" + }, + "show_title_separator": true, + "text": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.intro.text", + "title": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.intro.title", + "use_markdown_in_title": false + }, + { + "type": "modonomicon:text", + "anchor": "", + "condition": { + "type": "modonomicon:none" + }, + "show_title_separator": true, + "text": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.solution.text", + "title": "book.occultism.dictionary_of_spirits.getting_started.books_of_binding_automation.solution.title", + "use_markdown_in_title": false + } + ], + "parents": [ + { + "draw_arrow": true, + "entry": "occultism:getting_started/books_of_binding", + "line_enabled": true, + "line_reversed": false + } + ], + "show_when_any_parent_unlocked": false, + "sort_number": -1, + "x": -3, + "y": 4 +} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_afrit.json b/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_afrit.json deleted file mode 100644 index ef2790d1a..000000000 --- a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_afrit.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "occultism:book_of_binding_afrit" - }, - { - "item": "occultism:dictionary_of_spirits" - } - ], - "result": { - "count": 1, - "id": "occultism:book_of_binding_bound_afrit" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_djinni.json b/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_djinni.json deleted file mode 100644 index 17aff1657..000000000 --- a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_djinni.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "occultism:book_of_binding_djinni" - }, - { - "item": "occultism:dictionary_of_spirits" - } - ], - "result": { - "count": 1, - "id": "occultism:book_of_binding_bound_djinni" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_foliot.json b/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_foliot.json deleted file mode 100644 index 17fc39603..000000000 --- a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_foliot.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "occultism:book_of_binding_foliot" - }, - { - "item": "occultism:dictionary_of_spirits" - } - ], - "result": { - "count": 1, - "id": "occultism:book_of_binding_bound_foliot" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_marid.json b/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_marid.json deleted file mode 100644 index d2a7ee6d7..000000000 --- a/src/generated/resources/data/occultism/recipe/crafting/book_of_binding_bound_marid.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "occultism:book_of_binding_marid" - }, - { - "item": "occultism:dictionary_of_spirits" - } - ], - "result": { - "count": 1, - "id": "occultism:book_of_binding_bound_marid" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/recipe/crafting/bound_book_of_binding.json b/src/generated/resources/data/occultism/recipe/crafting/bound_book_of_binding.json new file mode 100644 index 000000000..7a1bb6caf --- /dev/null +++ b/src/generated/resources/data/occultism/recipe/crafting/bound_book_of_binding.json @@ -0,0 +1,4 @@ +{ + "type": "occultism:crafting_special_book_binding", + "category": "misc" +} \ No newline at end of file diff --git a/src/generated/resources/data/occultism/tags/item/books/books_of_binding.json b/src/generated/resources/data/occultism/tags/item/books/books_of_binding.json new file mode 100644 index 000000000..270494b8d --- /dev/null +++ b/src/generated/resources/data/occultism/tags/item/books/books_of_binding.json @@ -0,0 +1,8 @@ +{ + "values": [ + "occultism:book_of_binding_foliot", + "occultism:book_of_binding_djinni", + "occultism:book_of_binding_afrit", + "occultism:book_of_binding_marid" + ] +} \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/BoundBookOfBindingRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/BoundBookOfBindingRecipe.java new file mode 100644 index 000000000..77ba75325 --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/BoundBookOfBindingRecipe.java @@ -0,0 +1,120 @@ +package com.klikli_dev.occultism.crafting.recipe; + +import com.klikli_dev.occultism.registry.OccultismItems; +import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.klikli_dev.occultism.registry.OccultismTags; +import com.klikli_dev.occultism.util.ItemNBTUtil; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.core.component.DataComponents; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.*; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; + +public class BoundBookOfBindingRecipe extends CustomRecipe { + public static RecipeSerializer SERIALIZER = new SimpleCraftingRecipeSerializer<>(BoundBookOfBindingRecipe::new); + + public BoundBookOfBindingRecipe(CraftingBookCategory category) { + super(category); + } + + @Override + public boolean matches(CraftingInput input, @NotNull Level level) { + int i = 0; + ItemStack dictionaryOfSpirits = ItemStack.EMPTY; + ItemStack bookOfBinding = ItemStack.EMPTY; + + for (int j = 0; j < input.size(); j++) { + ItemStack inputStack = input.getItem(j); + if (!inputStack.isEmpty()) { + if (inputStack.is(OccultismItems.DICTIONARY_OF_SPIRITS)) { + if (!dictionaryOfSpirits.isEmpty()) { + return false; + } + + dictionaryOfSpirits = inputStack; + } else { + if (!inputStack.is(OccultismTags.Items.BOOKS_OF_BINDING)) { + return false; + } + if (!bookOfBinding.isEmpty()) { + return false; + } + bookOfBinding = inputStack; + i++; + } + } + } + + return !dictionaryOfSpirits.isEmpty() && !bookOfBinding.isEmpty() && i > 0; + } + + @Override + public @NotNull ItemStack assemble(CraftingInput input, HolderLookup.@NotNull Provider registries) { + int i = 0; + ItemStack dictionaryOfSpirits = ItemStack.EMPTY; + ItemStack bookOfBinding = ItemStack.EMPTY; + + for (int j = 0; j < input.size(); j++) { + ItemStack inputStack = input.getItem(j); + if (!inputStack.isEmpty()) { + if (inputStack.is(OccultismItems.DICTIONARY_OF_SPIRITS)) { + if (!dictionaryOfSpirits.isEmpty()) { + return ItemStack.EMPTY; + } + + dictionaryOfSpirits = inputStack; + } else { + if (!inputStack.is(OccultismTags.Items.BOOKS_OF_BINDING)) { + return ItemStack.EMPTY; + } + if (!bookOfBinding.isEmpty()) { + return ItemStack.EMPTY; + } + bookOfBinding = inputStack; + i++; + } + } + } + + var boundBook = this.getBoundBookFromBook(bookOfBinding); + if (boundBook.isEmpty()) + return ItemStack.EMPTY; + + var customName = dictionaryOfSpirits.get(DataComponents.CUSTOM_NAME); + if (customName != null) { + ItemNBTUtil.setBoundSpiritName(boundBook, customName.getString()); + } else { + ItemNBTUtil.generateBoundSpiritName(boundBook); + } + + return boundBook; + } + + public ItemStack getBoundBookFromBook(ItemStack book) { + if (book.is(OccultismItems.BOOK_OF_BINDING_FOLIOT)) + return new ItemStack(OccultismItems.BOOK_OF_BINDING_BOUND_FOLIOT.get()); + + if (book.is(OccultismItems.BOOK_OF_BINDING_DJINNI)) + return new ItemStack(OccultismItems.BOOK_OF_BINDING_BOUND_DJINNI.get()); + + if (book.is(OccultismItems.BOOK_OF_BINDING_AFRIT)) + return new ItemStack(OccultismItems.BOOK_OF_BINDING_BOUND_AFRIT.get()); + + if (book.is(OccultismItems.BOOK_OF_BINDING_MARID)) + return new ItemStack(OccultismItems.BOOK_OF_BINDING_BOUND_MARID.get()); + + return ItemStack.EMPTY; + } + + @Override + public boolean canCraftInDimensions(int width, int height) { + return width >= 2 && height >= 2; + } + + @Override + public @NotNull RecipeSerializer getSerializer() { + return OccultismRecipes.BOOK_BINDING.get(); + } +} diff --git a/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java index b9210ad2d..237a8ad18 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java @@ -105,7 +105,7 @@ private BookCategoryModel makeGettingStartedCategory() { "__________________________________", "______e_h_____ạ_______m___________", "__________________________________", - "________________C___p_S___w_x_y_z_" + "______________Á_C___p_S___w_x_y_z_" ); //B=brush, N=Next Steps, P=iesnium pick //i=intro, r=divinationRod, ç = chalk, b=bowls, g=goggles, I=infused pick O= tier 2 otherworld materials @@ -159,6 +159,9 @@ private BookCategoryModel makeGettingStartedCategory() { var booksOfBinding = this.makeBooksOfBindingEntry(entryMap, 'ạ'); booksOfBinding.withParent(BookEntryParentModel.create(candleEntry.getId())); + var booksOfBindingAutomation = this.makeBooksOfBindingAutomationEntry(entryMap, 'Á'); + booksOfBindingAutomation.withParent(BookEntryParentModel.create(booksOfBinding.getId())); + var booksOfCalling = this.makeBooksOfCallingEntry(entryMap, 'C'); booksOfCalling.withParent(BookEntryParentModel.create(booksOfBinding.getId())); @@ -226,6 +229,7 @@ private BookCategoryModel makeGettingStartedCategory() { ritualPrepChalkEntry, ritualPrepBowlEntry, booksOfBinding, + booksOfBindingAutomation, ritualEntry, brushEntry, moreRitualsEntry, @@ -1116,6 +1120,49 @@ There is a type of book corresponding to each type (or tier) of spirit. ); } + private BookEntryModel makeBooksOfBindingAutomationEntry(CategoryEntryMap entryMap, char icon) { + this.context().entry("books_of_binding_automation"); + this.lang().add(this.context().entryName(), "Books of Binding in Automation"); + this.lang().add(this.context().entryDescription(), "Tips for using books of binding in Crafting Automation such as AE2 or RS"); + + this.context().page("intro"); + var intro = BookTextPageModel.create() + .withTitle(this.context().pageTitle()) + .withText(this.context().pageText()); + this.lang().add(this.context().pageTitle(), "The Problem"); + this.lang().add(this.context().pageText(), + """ + Bound Books of Binding are generated with a random spirit name. This tricks many automated crafting processes into no longer recognizing the item as the requested crafting result, because it does not expect NBT/Data Components on the item. + \\ + \\ + This leads to stuck crafting processes. + """ + ); + + this.context().page("solution"); + var solution = BookTextPageModel.create() + .withTitle(this.context().pageTitle()) + .withText(this.context().pageText()); + this.lang().add(this.context().pageTitle(), "The Solution"); + this.lang().add(this.context().pageText(), + """ + 1. Put a dictionary of spirits into an anvil and give it a name. This will be the name of all spirits summoned in the future. + 2. Use this dictionary to configure crafting patterns (if your automation mod requires it). + 2. Use this dictionary to craft the Bound Books of Binding in the automation system. As usual, the dictionary will not be used up. + 3. All crafted books will now have the same name and will be recognized by your automation system. + """ + ); + + return BookEntryModel.create(this.modLoc(this.context().categoryId() + "/" + this.context().entryId()), this.context().entryName()) + .withDescription(this.context().entryDescription()) + .withIcon(Items.CRAFTER) + .withLocation(entryMap.get(icon)) + .withPages( + intro, + solution + ); + } + private BookEntryModel makeBooksOfCallingEntry(CategoryEntryMap entryMap, char icon) { this.context().entry("books_of_calling"); this.lang().add(this.context().entryName(), "Books of Calling"); diff --git a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java index a2ed9431b..6c4bbfa3d 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java @@ -3231,6 +3231,7 @@ private void addTags() { this.addItemTag(OccultismTags.Items.OTHERWORLD_SAPLINGS,"Otherworld Saplings"); this.addItemTag(OccultismTags.Items.BOOK_OF_CALLING_DJINNI,"Book of Calling Djinni"); this.addItemTag(OccultismTags.Items.BOOK_OF_CALLING_FOLIOT,"Book of Calling Foliot"); + this.addItemTag(OccultismTags.Items.BOOKS_OF_BINDING,"Books of Binding"); this.addItemTag(OccultismTags.Items.Miners.BASIC_RESOURCES,"Basic Resource Miners"); this.addItemTag(OccultismTags.Items.Miners.DEEPS,"Deepslate Miners"); this.addItemTag(OccultismTags.Items.Miners.MASTER,"Rare Resource Miners"); diff --git a/src/main/java/com/klikli_dev/occultism/datagen/recipe/OccultismRecipeProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/recipe/OccultismRecipeProvider.java index 8905de304..7dc9af824 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/recipe/OccultismRecipeProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/recipe/OccultismRecipeProvider.java @@ -1,6 +1,7 @@ package com.klikli_dev.occultism.datagen.recipe; import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.crafting.recipe.BoundBookOfBindingRecipe; import com.klikli_dev.occultism.datagen.recipe.builders.CrushingRecipeBuilder; import com.klikli_dev.occultism.datagen.recipe.builders.MinerRecipeBuilder; import com.klikli_dev.occultism.datagen.recipe.builders.SpiritFireRecipeBuilder; @@ -15,6 +16,7 @@ import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.ArmorDyeRecipe; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Blocks; import net.neoforged.neoforge.common.Tags; @@ -349,6 +351,9 @@ private void crushingMetalRecipe(String metalName, RecipeOutput recipeOutput) { } private void craftingRecipes(RecipeOutput pRecipeOutput) { + SpecialRecipeBuilder.special(BoundBookOfBindingRecipe::new).save(pRecipeOutput, + ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/bound_book_of_binding")); + metalRecipes(pRecipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_EMPTY.get()) .requires(OccultismItems.AWAKENED_FEATHER.get()) @@ -376,11 +381,11 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) { .define('b', OccultismItems.BOOK_OF_BINDING_EMPTY.get()) .unlockedBy("has_taboo_book", has(OccultismItems.BOOK_OF_BINDING_EMPTY.get())) .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_afrit_from_empty")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_AFRIT.get()) - .requires(OccultismItems.BOOK_OF_BINDING_AFRIT.get()) - .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) - .unlockedBy("has_book_of_binding_afrit", has(OccultismItems.BOOK_OF_BINDING_AFRIT.get())) - .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_afrit")); +// ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_AFRIT.get()) +// .requires(OccultismItems.BOOK_OF_BINDING_AFRIT.get()) +// .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) +// .unlockedBy("has_book_of_binding_afrit", has(OccultismItems.BOOK_OF_BINDING_AFRIT.get())) +// .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_afrit")); // Djinni ShapedRecipeBuilder.shaped(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_DJINNI.get()) @@ -402,11 +407,11 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) { .unlockedBy("has_empty_binding", has(OccultismItems.BOOK_OF_BINDING_EMPTY.get())) .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_djinni_from_empty")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_DJINNI.get()) - .requires(OccultismItems.BOOK_OF_BINDING_DJINNI.get()) - .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) - .unlockedBy("has_book_of_binding_djinni", has(OccultismItems.BOOK_OF_BINDING_DJINNI.get())) - .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_djinni")); +// ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_DJINNI.get()) +// .requires(OccultismItems.BOOK_OF_BINDING_DJINNI.get()) +// .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) +// .unlockedBy("has_book_of_binding_djinni", has(OccultismItems.BOOK_OF_BINDING_DJINNI.get())) +// .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_djinni")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_DJINNI.get()) .requires(OccultismTags.Items.BOOK_OF_CALLING_DJINNI) .unlockedBy("has_book_of_calling_djinni", has(OccultismTags.Items.BOOK_OF_CALLING_DJINNI)) @@ -432,11 +437,11 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) { .unlockedBy("has_empty_binding", has(OccultismItems.BOOK_OF_BINDING_EMPTY.get())) .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_foliot_from_empty")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_FOLIOT.get()) - .requires(OccultismItems.BOOK_OF_BINDING_FOLIOT.get()) - .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) - .unlockedBy("has_book_of_binding_foliot", has(OccultismItems.BOOK_OF_BINDING_FOLIOT.get())) - .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_foliot")); +// ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_FOLIOT.get()) +// .requires(OccultismItems.BOOK_OF_BINDING_FOLIOT.get()) +// .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) +// .unlockedBy("has_book_of_binding_foliot", has(OccultismItems.BOOK_OF_BINDING_FOLIOT.get())) +// .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_foliot")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_FOLIOT.get()) .requires(OccultismTags.Items.BOOK_OF_CALLING_FOLIOT) .unlockedBy("has_book_of_calling_foliot", has(OccultismTags.Items.BOOK_OF_CALLING_FOLIOT)) @@ -464,11 +469,11 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) { .unlockedBy("has_empty_binding", has(OccultismItems.BOOK_OF_BINDING_EMPTY.get())) .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_marid_from_empty")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_MARID.get()) - .requires(OccultismItems.BOOK_OF_BINDING_MARID.get()) - .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) - .unlockedBy("has_book_of_binding_marid", has(OccultismItems.BOOK_OF_BINDING_MARID.get())) - .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_marid")); +// ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_BINDING_BOUND_MARID.get()) +// .requires(OccultismItems.BOOK_OF_BINDING_MARID.get()) +// .requires(OccultismItems.DICTIONARY_OF_SPIRITS.get()) +// .unlockedBy("has_book_of_binding_marid", has(OccultismItems.BOOK_OF_BINDING_MARID.get())) +// .save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/book_of_binding_bound_marid")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, OccultismItems.BOOK_OF_CALLING_DJINNI_MANAGE_MACHINE.get()) .requires(OccultismItems.BOOK_OF_BINDING_BOUND_DJINNI.get()) diff --git a/src/main/java/com/klikli_dev/occultism/datagen/tags/OccultismItemTagProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/tags/OccultismItemTagProvider.java index 6bdf34c73..06e7de21a 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/tags/OccultismItemTagProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/tags/OccultismItemTagProvider.java @@ -89,6 +89,13 @@ private void addOccultismTags(HolderLookup.Provider provider) { .add(OccultismItems.BOOK_OF_CALLING_FOLIOT_TRANSPORT_ITEMS.get()).replace(false); this.tag(OccultismTags.Items.BOOK_OF_CALLING_DJINNI) .add(OccultismItems.BOOK_OF_CALLING_DJINNI_MANAGE_MACHINE.get()).replace(false); + + this.tag(OccultismTags.Items.BOOKS_OF_BINDING) + .add(OccultismItems.BOOK_OF_BINDING_FOLIOT.get()) + .add(OccultismItems.BOOK_OF_BINDING_DJINNI.get()) + .add(OccultismItems.BOOK_OF_BINDING_AFRIT.get()) + .add(OccultismItems.BOOK_OF_BINDING_MARID.get()); + this.tag(OccultismTags.Items.Miners.BASIC_RESOURCES).add(OccultismItems.MINER_FOLIOT_UNSPECIALIZED.get(), OccultismItems.MINER_DEBUG_UNSPECIALIZED.get()).replace(false); this.tag(OccultismTags.Items.Miners.DEEPS).add(OccultismItems.MINER_AFRIT_DEEPS.get(), OccultismItems.MINER_MARID_MASTER.get()).replace(false); diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java index 7c0941425..ee32581bb 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java @@ -54,7 +54,8 @@ public class OccultismRecipes { public static final DeferredHolder, RecipeSerializer> RITUAL = RECIPES.register("ritual", () -> RitualRecipe.SERIALIZER); - + public static final DeferredHolder, RecipeSerializer> BOOK_BINDING = RECIPES.register("crafting_special_book_binding", + () -> BoundBookOfBindingRecipe.SERIALIZER); static > DeferredHolder, RecipeType> registerRecipeType(final String id) { return RECIPE_TYPES.register(id, () -> new RecipeType() { diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismTags.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismTags.java index c7e646ace..83cfdd1d6 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismTags.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismTags.java @@ -100,6 +100,7 @@ public static class Items { public static final TagKey TALLOW = makeItemTag(ResourceLocation.fromNamespaceAndPath("c", "tallow")); public static final TagKey BOOK_OF_CALLING_FOLIOT = makeItemTag(ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "books/book_of_calling_foliot")); public static final TagKey BOOK_OF_CALLING_DJINNI = makeItemTag(ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "books/book_of_calling_djinni")); + public static final TagKey BOOKS_OF_BINDING = makeItemTag(ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "books/books_of_binding")); public static final TagKey MAGMA = makeItemTag(ResourceLocation.fromNamespaceAndPath("c", "magma"));