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

Add missing recipes for slate, amethyst, and quenched allay block sets #817

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -24,6 +24,10 @@ public static final class Items {
public static final TagKey<Item> DIRECTRICES = create("directrices");
public static final TagKey<Item> MINDFLAYED_CIRCLE_COMPONENTS = create("brainswept_circle_components");

public static final TagKey<Item> SLATE_BLOCKS = create("slate_blocks");
public static final TagKey<Item> AMETHYST_BLOCKS = create("amethyst_blocks");
public static final TagKey<Item> QUENCHED_ALLAY_BLOCKS = create("quenched_allay_blocks");

public static TagKey<Item> create(String name) {
return create(modLoc(name));
}
Expand All @@ -37,11 +41,14 @@ public static final class Blocks {
public static final TagKey<Block> EDIFIED_LOGS = create("edified_logs");
public static final TagKey<Block> EDIFIED_PLANKS = create("edified_planks");


public static final TagKey<Block> IMPETI = create("impeti");
public static final TagKey<Block> DIRECTRICES = create("directrices");
public static final TagKey<Block> MINDFLAYED_CIRCLE_COMPONENTS = create("brainswept_circle_components");

public static final TagKey<Block> SLATE_BLOCKS = create("slate_blocks");
public static final TagKey<Block> AMETHYST_BLOCKS = create("amethyst_blocks");
public static final TagKey<Block> QUENCHED_ALLAY_BLOCKS = create("quenched_allay_blocks");

// Used to determine what blocks should be replaced with air by OpDestroyFluid
public static final TagKey<Block> WATER_PLANTS = create("water_plants");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.item.DyeColor;
Expand All @@ -35,6 +36,7 @@
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer;
import net.minecraft.world.level.block.Blocks;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -280,13 +282,6 @@ public void buildRecipes(Consumer<FinishedRecipe> recipes) {
packing(RecipeCategory.BUILDING_BLOCKS, HexItems.AMETHYST_DUST, HexBlocks.AMETHYST_DUST_BLOCK.asItem(), "amethyst_dust",
false, recipes);

ringAll(RecipeCategory.BUILDING_BLOCKS, HexBlocks.AMETHYST_TILES, 8, Blocks.AMETHYST_BLOCK, HexItems.AMETHYST_DUST)
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes);

SingleItemRecipeBuilder.stonecutting(Ingredient.of(Blocks.AMETHYST_BLOCK), RecipeCategory.BUILDING_BLOCKS, HexBlocks.AMETHYST_TILES)
.unlockedBy("has_item", hasItem(Blocks.AMETHYST_BLOCK))
.save(recipes, modLoc("stonecutting/amethyst_tiles"));

ringAll(RecipeCategory.BUILDING_BLOCKS, HexBlocks.SCROLL_PAPER, 8, Items.PAPER, Items.AMETHYST_SHARD)
.unlockedBy("has_item", hasItem(Items.AMETHYST_SHARD)).save(recipes);

Expand Down Expand Up @@ -427,6 +422,37 @@ public void buildRecipes(Consumer<FinishedRecipe> recipes) {
.pattern("LPL")
.unlockedBy("enlightenment", enlightenment).save(recipes);

// Stone sets
stoneSet(recipes, HexBlocks.SLATE_BLOCK.asItem(), HexBlocks.SLATE_BRICKS.asItem(), HexBlocks.SLATE_BRICKS_SMALL.asItem(), HexBlocks.SLATE_TILES.asItem(), HexBlocks.SLATE_PILLAR.asItem());
stoneSet(recipes, Blocks.AMETHYST_BLOCK.asItem(), HexBlocks.AMETHYST_BRICKS.asItem(), HexBlocks.AMETHYST_BRICKS_SMALL.asItem(), HexBlocks.AMETHYST_TILES.asItem(), HexBlocks.AMETHYST_PILLAR.asItem());
stoneSet(recipes, HexBlocks.QUENCHED_ALLAY.asItem(), HexBlocks.QUENCHED_ALLAY_BRICKS.asItem(), HexBlocks.QUENCHED_ALLAY_BRICKS_SMALL.asItem(), HexBlocks.QUENCHED_ALLAY_TILES.asItem(), null);

// Stone sets in stonecutter
stoneCutterFromTag(recipes, HexTags.Items.SLATE_BLOCKS, HexBlocks.SLATE_BRICKS.asItem(), HexBlocks.SLATE_BRICKS_SMALL.asItem(), HexBlocks.SLATE_TILES.asItem(), HexBlocks.SLATE_PILLAR.asItem());
stoneCutterFromTag(recipes, HexTags.Items.AMETHYST_BLOCKS, HexBlocks.AMETHYST_BRICKS.asItem(), HexBlocks.AMETHYST_BRICKS_SMALL.asItem(), HexBlocks.AMETHYST_TILES.asItem(), HexBlocks.AMETHYST_PILLAR.asItem());
stoneCutterFromTag(recipes, HexTags.Items.QUENCHED_ALLAY_BLOCKS, HexBlocks.QUENCHED_ALLAY_BRICKS.asItem(), HexBlocks.QUENCHED_ALLAY_BRICKS_SMALL.asItem(), HexBlocks.QUENCHED_ALLAY_TILES.asItem());

// Slate & Amethyst block set
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, HexBlocks.SLATE_AMETHYST_BRICKS.asItem(), 2)
.requires(HexBlocks.SLATE_BRICKS)
.requires(HexBlocks.AMETHYST_BRICKS)
.unlockedBy("has_item", has(HexBlocks.SLATE)).save(recipes);

ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, HexBlocks.SLATE_AMETHYST_BRICKS_SMALL.asItem(), 2)
.requires(HexBlocks.SLATE_BRICKS_SMALL)
.requires(HexBlocks.AMETHYST_BRICKS_SMALL)
.unlockedBy("has_item", has(HexBlocks.SLATE)).save(recipes);

ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, HexBlocks.SLATE_AMETHYST_TILES.asItem(), 2)
.requires(HexBlocks.SLATE_TILES)
.requires(HexBlocks.AMETHYST_TILES)
.unlockedBy("has_item", has(HexBlocks.SLATE)).save(recipes);

ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, HexBlocks.SLATE_AMETHYST_PILLAR.asItem(), 2)
.requires(HexBlocks.SLATE_PILLAR)
.requires(HexBlocks.AMETHYST_PILLAR)
.unlockedBy("has_item", has(HexBlocks.SLATE)).save(recipes);

new BrainsweepRecipeBuilder(StateIngredientHelper.of(Blocks.AMETHYST_BLOCK),
new VillagerIngredient(null, null, 3),
Blocks.BUDDING_AMETHYST.defaultBlockState(), MediaConstants.CRYSTAL_UNIT * 10)
Expand Down Expand Up @@ -570,4 +596,52 @@ private void specialRecipe(Consumer<FinishedRecipe> consumer, SimpleCraftingReci
var name = BuiltInRegistries.RECIPE_SERIALIZER.getKey(serializer);
SpecialRecipeBuilder.special(serializer).save(consumer, HexAPI.MOD_ID + ":dynamic" + name.getPath());
}

private void stoneSet(Consumer<FinishedRecipe> recipes, Item base, Item bricks, Item smallBricks, Item tiles, @Nullable Item pillar) {
// Bricks from base block
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, bricks, 4)
.define('#', base)
.pattern("##")
.pattern("##")
.unlockedBy("has_item", hasItem(base))
.save(recipes);

// Bricks from small bricks
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, bricks)
.requires(smallBricks)
.unlockedBy("has_item", hasItem(base))
.save(recipes, modLoc(bricks + "_from_" + smallBricks));

// Small bricks from bricks
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, smallBricks)
.requires(bricks)
.unlockedBy("has_item", hasItem(base))
.save(recipes, modLoc(smallBricks + "_from_" + bricks));

// Tiles from bricks
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, tiles, 4)
.define('#', bricks)
.pattern("##")
.pattern("##")
.unlockedBy("has_item", hasItem(base))
.save(recipes);

// Pillar from base block
if (pillar != null) {
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, pillar, 2)
.define('#', base)
.pattern("#")
.pattern("#")
.unlockedBy("has_item", hasItem(base))
.save(recipes);
}
}

private void stoneCutterFromTag(Consumer<FinishedRecipe> recipes, TagKey<Item> tagKey, Item ...results) {
for (Item result : results) {
SingleItemRecipeBuilder.stonecutting(Ingredient.of(tagKey), RecipeCategory.BUILDING_BLOCKS, result)
.unlockedBy("has_item", hasItem(tagKey))
.save(recipes, modLoc("stonecutting/" + result));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ protected void addTags(HolderLookup.Provider provider) {
add(tag(HexTags.Blocks.CHEAP_TO_BREAK_BLOCK),
HexBlocks.CONJURED_BLOCK, HexBlocks.CONJURED_LIGHT);

add(tag(HexTags.Blocks.SLATE_BLOCKS),
HexBlocks.SLATE_BLOCK, HexBlocks.SLATE_BRICKS, HexBlocks.SLATE_BRICKS_SMALL, HexBlocks.SLATE_TILES, HexBlocks.SLATE_PILLAR);
add(tag(HexTags.Blocks.AMETHYST_BLOCKS),
Blocks.AMETHYST_BLOCK, HexBlocks.AMETHYST_BRICKS, HexBlocks.AMETHYST_BRICKS_SMALL, HexBlocks.AMETHYST_TILES, HexBlocks.AMETHYST_PILLAR);
add(tag(HexTags.Blocks.QUENCHED_ALLAY_BLOCKS),
HexBlocks.QUENCHED_ALLAY, HexBlocks.QUENCHED_ALLAY_BRICKS, HexBlocks.QUENCHED_ALLAY_BRICKS_SMALL, HexBlocks.QUENCHED_ALLAY_TILES);

// this is a hack but fixes #532
var createBrittle = TagKey.create(Registries.BLOCK, new ResourceLocation("create", "brittle"));
tag(createBrittle).addOptionalTag(BuiltInRegistries.BLOCK.getKey(HexBlocks.SLATE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ protected void addTags(HolderLookup.Provider provider) {
this.copy(HexTags.Blocks.IMPETI, HexTags.Items.IMPETI);
this.copy(HexTags.Blocks.DIRECTRICES, HexTags.Items.DIRECTRICES);
this.copy(HexTags.Blocks.MINDFLAYED_CIRCLE_COMPONENTS, HexTags.Items.MINDFLAYED_CIRCLE_COMPONENTS);
this.copy(HexTags.Blocks.SLATE_BLOCKS, HexTags.Items.SLATE_BLOCKS);
this.copy(HexTags.Blocks.AMETHYST_BLOCKS, HexTags.Items.AMETHYST_BLOCKS);
this.copy(HexTags.Blocks.QUENCHED_ALLAY_BLOCKS, HexTags.Items.QUENCHED_ALLAY_BLOCKS);
this.copy(BlockTags.LOGS_THAT_BURN, ItemTags.LOGS_THAT_BURN);
this.copy(BlockTags.LOGS, ItemTags.LOGS);
this.copy(BlockTags.PLANKS, ItemTags.PLANKS);
Expand Down
Loading
Loading