+ more Block Tags
+ more recepis
This commit is contained in:
@@ -119,6 +119,8 @@ public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
.add(ModBlocks.MESH_IRON.get())
|
||||
;
|
||||
|
||||
// Stone-tier tools are "incorrect" for anything that needs iron or diamond tool.
|
||||
// (IRON_GRATE itself needs only stone, so it stays excluded here.)
|
||||
tag(BlockTags.INCORRECT_FOR_STONE_TOOL)
|
||||
.add(ModBlocks.GOLD_GRATE.get())
|
||||
.add(ModBlocks.DIAMOND_GRATE.get())
|
||||
@@ -149,6 +151,7 @@ public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
.add(ModBlocks.MESH_IRON.get())
|
||||
;
|
||||
|
||||
// Iron-tier tools are "incorrect" for anything that needs diamond tool.
|
||||
tag(BlockTags.INCORRECT_FOR_IRON_TOOL)
|
||||
.add(ModBlocks.OBSIDIAN_GRATE.get())
|
||||
.add(ModBlocks.NETHERITE_GRATE.get())
|
||||
@@ -206,7 +209,8 @@ public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
|
||||
;
|
||||
|
||||
|
||||
// Vanilla glass/stained glass/tinted glass all sit in this tag; it controls
|
||||
// how adjacent fluids render against the glass faces (no water bleeding through).
|
||||
tag(BlockTags.IMPERMEABLE)
|
||||
.add(ModBlocks.WHITE_GLOW_STAINED_GLASS.get())
|
||||
.add(ModBlocks.ORANGE_GLOW_STAINED_GLASS.get())
|
||||
|
||||
@@ -6,9 +6,13 @@ import net.minecraft.data.recipes.RecipeCategory;
|
||||
import net.minecraft.data.recipes.RecipeOutput;
|
||||
import net.minecraft.data.recipes.RecipeProvider;
|
||||
import net.minecraft.data.recipes.ShapedRecipeBuilder;
|
||||
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
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 ovh.glitchlabs.ornamentum.Ornamentum;
|
||||
import ovh.glitchlabs.ornamentum.blocks.ModBlocks;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -29,6 +33,24 @@ public class ModRecipeProvider extends RecipeProvider {
|
||||
Map<ItemLike, ItemLike> grateRecipes = new LinkedHashMap<>();
|
||||
Map<ItemLike, ItemLike> stairRecipes = new LinkedHashMap<>();
|
||||
Map<ItemLike, ItemLike> slabRecipes = new LinkedHashMap<>();
|
||||
Map<ItemLike, ItemLike> glowBlockRecipes = new LinkedHashMap<>();
|
||||
|
||||
glowBlockRecipes.put(Items.WHITE_CONCRETE, ModBlocks.WHITE_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.ORANGE_CONCRETE, ModBlocks.ORANGE_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.MAGENTA_CONCRETE, ModBlocks.MAGENTA_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.LIGHT_BLUE_CONCRETE, ModBlocks.LIGHT_BLUE_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.YELLOW_CONCRETE, ModBlocks.YELLOW_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.LIME_CONCRETE, ModBlocks.LIME_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.PINK_CONCRETE, ModBlocks.PINK_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.GRAY_CONCRETE, ModBlocks.GRAY_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.LIGHT_GRAY_CONCRETE, ModBlocks.LIGHT_GRAY_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.CYAN_CONCRETE, ModBlocks.CYAN_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.PURPLE_CONCRETE, ModBlocks.PURPLE_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.BLUE_CONCRETE, ModBlocks.BLUE_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.BROWN_CONCRETE, ModBlocks.BROWN_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.GREEN_CONCRETE, ModBlocks.GREEN_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.RED_CONCRETE, ModBlocks.RED_GLOW_BLOCK.get());
|
||||
glowBlockRecipes.put(Items.BLACK_CONCRETE, ModBlocks.BLACK_GLOW_BLOCK.get());
|
||||
|
||||
glowGlassRecipes.put(Items.WHITE_STAINED_GLASS, ModBlocks.WHITE_GLOW_STAINED_GLASS.get());
|
||||
glowGlassRecipes.put(Items.ORANGE_STAINED_GLASS, ModBlocks.ORANGE_GLOW_STAINED_GLASS.get());
|
||||
@@ -95,11 +117,93 @@ public class ModRecipeProvider extends RecipeProvider {
|
||||
glowGlassRecipes.forEach((input, result) ->
|
||||
createGlowGlassRecipe(output, input, result));
|
||||
|
||||
glowBlockRecipes.forEach((input, result) ->
|
||||
createGlowBlockRecipe(output, input, result));
|
||||
|
||||
stairRecipes.forEach((input, result) ->
|
||||
createStairsRecipe(output, input, result));
|
||||
|
||||
slabRecipes.forEach((input, result) ->
|
||||
createSlabRecipe(output, input, result));
|
||||
|
||||
// ---- Dye / recolor recipes (like vanilla wool/glass: any color + dye -> target color) ----
|
||||
String[] colorNames = {
|
||||
"white", "orange", "magenta", "light_blue", "yellow", "lime", "pink",
|
||||
"gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black"
|
||||
};
|
||||
|
||||
Item[] dyes = {
|
||||
Items.WHITE_DYE, Items.ORANGE_DYE, Items.MAGENTA_DYE, Items.LIGHT_BLUE_DYE,
|
||||
Items.YELLOW_DYE, Items.LIME_DYE, Items.PINK_DYE, Items.GRAY_DYE,
|
||||
Items.LIGHT_GRAY_DYE, Items.CYAN_DYE, Items.PURPLE_DYE, Items.BLUE_DYE,
|
||||
Items.BROWN_DYE, Items.GREEN_DYE, Items.RED_DYE, Items.BLACK_DYE
|
||||
};
|
||||
|
||||
ItemLike[] glowGlassColors = {
|
||||
ModBlocks.WHITE_GLOW_STAINED_GLASS.get(), ModBlocks.ORANGE_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.MAGENTA_GLOW_STAINED_GLASS.get(), ModBlocks.LIGHT_BLUE_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.YELLOW_GLOW_STAINED_GLASS.get(), ModBlocks.LIME_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.PINK_GLOW_STAINED_GLASS.get(), ModBlocks.GRAY_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.LIGHT_GRAY_GLOW_STAINED_GLASS.get(), ModBlocks.CYAN_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.PURPLE_GLOW_STAINED_GLASS.get(), ModBlocks.BLUE_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.BROWN_GLOW_STAINED_GLASS.get(), ModBlocks.GREEN_GLOW_STAINED_GLASS.get(),
|
||||
ModBlocks.RED_GLOW_STAINED_GLASS.get(), ModBlocks.BLACK_GLOW_STAINED_GLASS.get()
|
||||
};
|
||||
|
||||
ItemLike[] woolStairsColors = {
|
||||
ModBlocks.WHITE_WOOL_STAIRS.get(), ModBlocks.ORANGE_WOOL_STAIRS.get(),
|
||||
ModBlocks.MAGENTA_WOOL_STAIRS.get(), ModBlocks.LIGHT_BLUE_WOOL_STAIRS.get(),
|
||||
ModBlocks.YELLOW_WOOL_STAIRS.get(), ModBlocks.LIME_WOOL_STAIRS.get(),
|
||||
ModBlocks.PINK_WOOL_STAIRS.get(), ModBlocks.GRAY_WOOL_STAIRS.get(),
|
||||
ModBlocks.LIGHT_GRAY_WOOL_STAIRS.get(), ModBlocks.CYAN_WOOL_STAIRS.get(),
|
||||
ModBlocks.PURPLE_WOOL_STAIRS.get(), ModBlocks.BLUE_WOOL_STAIRS.get(),
|
||||
ModBlocks.BROWN_WOOL_STAIRS.get(), ModBlocks.GREEN_WOOL_STAIRS.get(),
|
||||
ModBlocks.RED_WOOL_STAIRS.get(), ModBlocks.BLACK_WOOL_STAIRS.get()
|
||||
};
|
||||
|
||||
ItemLike[] woolSlabColors = {
|
||||
ModBlocks.WHITE_WOOL_SLAB.get(), ModBlocks.ORANGE_WOOL_SLAB.get(),
|
||||
ModBlocks.MAGENTA_WOOL_SLAB.get(), ModBlocks.LIGHT_BLUE_WOOL_SLAB.get(),
|
||||
ModBlocks.YELLOW_WOOL_SLAB.get(), ModBlocks.LIME_WOOL_SLAB.get(),
|
||||
ModBlocks.PINK_WOOL_SLAB.get(), ModBlocks.GRAY_WOOL_SLAB.get(),
|
||||
ModBlocks.LIGHT_GRAY_WOOL_SLAB.get(), ModBlocks.CYAN_WOOL_SLAB.get(),
|
||||
ModBlocks.PURPLE_WOOL_SLAB.get(), ModBlocks.BLUE_WOOL_SLAB.get(),
|
||||
ModBlocks.BROWN_WOOL_SLAB.get(), ModBlocks.GREEN_WOOL_SLAB.get(),
|
||||
ModBlocks.RED_WOOL_SLAB.get(), ModBlocks.BLACK_WOOL_SLAB.get()
|
||||
};
|
||||
|
||||
ItemLike[] glowBlockColors = {
|
||||
ModBlocks.WHITE_GLOW_BLOCK.get(), ModBlocks.ORANGE_GLOW_BLOCK.get(),
|
||||
ModBlocks.MAGENTA_GLOW_BLOCK.get(), ModBlocks.LIGHT_BLUE_GLOW_BLOCK.get(),
|
||||
ModBlocks.YELLOW_GLOW_BLOCK.get(), ModBlocks.LIME_GLOW_BLOCK.get(),
|
||||
ModBlocks.PINK_GLOW_BLOCK.get(), ModBlocks.GRAY_GLOW_BLOCK.get(),
|
||||
ModBlocks.LIGHT_GRAY_GLOW_BLOCK.get(), ModBlocks.CYAN_GLOW_BLOCK.get(),
|
||||
ModBlocks.PURPLE_GLOW_BLOCK.get(), ModBlocks.BLUE_GLOW_BLOCK.get(),
|
||||
ModBlocks.BROWN_GLOW_BLOCK.get(), ModBlocks.GREEN_GLOW_BLOCK.get(),
|
||||
ModBlocks.RED_GLOW_BLOCK.get(), ModBlocks.BLACK_GLOW_BLOCK.get()
|
||||
};
|
||||
|
||||
createDyeRecipes(output, "glow_stained_glass", glowGlassColors, dyes, colorNames);
|
||||
createDyeRecipes(output, "wool_stairs", woolStairsColors, dyes, colorNames);
|
||||
createDyeRecipes(output, "wool_slabs", woolSlabColors, dyes, colorNames);
|
||||
createDyeRecipes(output, "glow_block", glowBlockColors, dyes, colorNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates 16 recolor recipes (one per target color) for a set of 16 same-shape,
|
||||
* differently-colored items: any item from {@code items} + the matching dye -> the
|
||||
* item of that dye's color. Mirrors how vanilla lets you redye wool/stained glass.
|
||||
*/
|
||||
private void createDyeRecipes(RecipeOutput output, String category, ItemLike[] items, Item[] dyes, String[] names) {
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, items[i], 1)
|
||||
.requires(Ingredient.of(items))
|
||||
.requires(dyes[i])
|
||||
.group(category + "_dye")
|
||||
.unlockedBy("has_dye", has(dyes[i]))
|
||||
.save(output, ResourceLocation.fromNamespaceAndPath(
|
||||
Ornamentum.MODID, names[i] + "_" + category + "_from_dye"));
|
||||
}
|
||||
}
|
||||
|
||||
private void createGlowGlassRecipe(RecipeOutput output,
|
||||
@@ -136,6 +240,22 @@ public class ModRecipeProvider extends RecipeProvider {
|
||||
.save(output);
|
||||
}
|
||||
|
||||
private void createGlowBlockRecipe(RecipeOutput output, ItemLike input, ItemLike result) {
|
||||
ShapedRecipeBuilder.shaped(
|
||||
RecipeCategory.BUILDING_BLOCKS,
|
||||
result,
|
||||
1
|
||||
)
|
||||
.pattern(" # ")
|
||||
.pattern("#A#")
|
||||
.pattern(" # ")
|
||||
.define('#', input)
|
||||
.define('A', Items.GLOW_INK_SAC)
|
||||
.group("glow_block")
|
||||
.unlockedBy("has_glow_ink_sac", has(Items.GLOW_INK_SAC))
|
||||
.save(output);
|
||||
}
|
||||
|
||||
private void createStairsRecipe(RecipeOutput output, ItemLike input, ItemLike result) {
|
||||
ShapedRecipeBuilder.shaped(
|
||||
RecipeCategory.BUILDING_BLOCKS,
|
||||
|
||||
Reference in New Issue
Block a user