Skip to content

Commit

Permalink
feat: Bookshelf Recipe Gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 26, 2024
1 parent 2a415a7 commit 9fc16b2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.zepalesque.redux.blockset.util;

public interface AetherTabModifying {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.zepalesque.redux.blockset.wood.type;

import com.aetherteam.aether.block.construction.BookshelfBlock;
import net.minecraft.data.recipes.RecipeOutput;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.SoundType;
Expand All @@ -12,6 +13,7 @@
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.data.prov.ReduxItemModelProvider;
import net.zepalesque.redux.data.prov.ReduxLanguageProvider;
import net.zepalesque.redux.data.prov.ReduxRecipeProvider;
import net.zepalesque.redux.data.prov.loot.ReduxBlockLootProvider;
import net.zepalesque.redux.data.prov.tags.ReduxBlockTagsProvider;
import net.zepalesque.redux.item.ReduxItems;
Expand Down Expand Up @@ -52,6 +54,12 @@ protected void langData(ReduxLanguageProvider data) {
data.addLore(this.bookshelf(), "A nice bookshelf made of " + name + " wood. These are nice for decoration, and also will enhance the abilities of Enchanting Tables!");
}

@Override
protected void recipeData(ReduxRecipeProvider data, RecipeOutput consumer) {
super.recipeData(data, consumer);
ReduxRecipeProvider.bookshelf(consumer, this.planks(), this.bookshelf());
}

@Override
protected void lootData(ReduxBlockLootProvider data) {
super.lootData(data);
Expand All @@ -70,4 +78,5 @@ public void flammables(FireAccessor accessor) {
super.flammables(accessor);
accessor.callSetFlammable(this.bookshelf().get(), 30, 20);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;

import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Supplier;

public abstract class ReduxRecipeProvider extends AetherRecipeProvider {
Expand Down Expand Up @@ -89,4 +91,14 @@ public static void wall(RecipeOutput output, RecipeCategory category, ItemLike w
RecipeProvider.wall(output, category, wall, material);
}

public static void bookshelf(RecipeOutput output, ItemLike plank, ItemLike bookshelf) {
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, bookshelf, 1)
.define('P', plank)
.define('B', Items.BOOK)
.pattern("PPP")
.pattern("BBB")
.pattern("PPP")
.unlockedBy(getHasName(Items.BOOK), has(Items.BOOK))
.save(output, getItemName(plank) + "_to_" + getItemName(bookshelf));
}
}

0 comments on commit 9fc16b2

Please sign in to comment.