Skip to content
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
@@ -0,0 +1,41 @@
{
"neoforge:conditions": [
{
"type": "neoforge:not",
"value": {
"type": "neoforge:tag_empty",
"tag": "hexcasting:pans"
}
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "hexcasting:amethyst_dust"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:pride_colorizer_pansexual"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:pride_colorizer_pansexual"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"neoforge:conditions": [
{
"type": "neoforge:tag_empty",
"tag": "hexcasting:pans"
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "hexcasting:amethyst_dust"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:pride_colorizer_pansexual_fallback"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:pride_colorizer_pansexual_fallback"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"neoforge:conditions": [
{
"type": "neoforge:not",
"value": {
"type": "neoforge:tag_empty",
"tag": "hexcasting:pans"
}
}
],
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"C": {
"tag": "hexcasting:pans"
},
"D": {
"item": "hexcasting:amethyst_dust"
}
},
"pattern": [
" D ",
"DCD",
" D "
],
"result": {
"count": 1,
"id": "hexcasting:pride_colorizer_pansexual"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"neoforge:conditions": [
{
"type": "neoforge:tag_empty",
"tag": "hexcasting:pans"
}
],
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"C": {
"item": "minecraft:carrot"
},
"D": {
"item": "hexcasting:amethyst_dust"
}
},
"pattern": [
" D ",
"DCD",
" D "
],
"result": {
"count": 1,
"id": "hexcasting:pride_colorizer_pansexual"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
{
"id": "farmersdelight:skillet",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public static final class Items {
public static final TagKey<Item> AMETHYST_BLOCKS = create("amethyst_blocks");
public static final TagKey<Item> QUENCHED_ALLAY_BLOCKS = create("quenched_allay_blocks");

public static final TagKey<Item> PANS = create("pans");


public static TagKey<Item> create(String name) {
return create(modLoc(name));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package at.petrak.hexcasting.datagen;

import net.minecraft.data.recipes.RecipeBuilder;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

public interface IXplatConditionsBuilder extends RecipeBuilder {
IXplatConditionsBuilder whenModLoaded(String modid);

IXplatConditionsBuilder whenModMissing(String modid);

IXplatConditionsBuilder whenTagEmpty(TagKey<Item> tag);

IXplatConditionsBuilder whenTagPopulated(TagKey<Item> tag);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package at.petrak.hexcasting.datagen;

import at.petrak.hexcasting.datagen.recipe.builders.FarmersDelightToolIngredient;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.crafting.Ingredient;

import java.util.EnumMap;
Expand All @@ -25,8 +27,6 @@ public interface IXplatIngredients {

Ingredient stick();

Ingredient whenModIngredient(Ingredient defaultIngredient, String modid, Ingredient modIngredient);

FarmersDelightToolIngredient axeStrip();

FarmersDelightToolIngredient axeDig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,7 @@ public void buildRecipes(RecipeOutput recipes) {
gayRecipe(recipes, ItemPridePigment.Type.INTERSEX, Ingredient.of(Items.AZALEA));
gayRecipe(recipes, ItemPridePigment.Type.LESBIAN, Ingredient.of(Items.HONEYCOMB));
gayRecipe(recipes, ItemPridePigment.Type.NONBINARY, Ingredient.of(Items.MOSS_BLOCK));
// TODO port: This is neither an item value nor a tag value.
/*gayRecipe(recipes, ItemPridePigment.Type.PANSEXUAL, ingredients.whenModIngredient(
Ingredient.of(Items.CARROT),
"farmersdelight",
CompatIngredientValue.of("farmersdelight:skillet")
));*/
gayRecipe(recipes, ItemPridePigment.Type.PANSEXUAL, HexTags.Items.PANS, Ingredient.of(Items.CARROT));
gayRecipe(recipes, ItemPridePigment.Type.PLURAL, Ingredient.of(Items.REPEATER));
gayRecipe(recipes, ItemPridePigment.Type.TRANSGENDER, Ingredient.of(Items.EGG));

Expand Down Expand Up @@ -613,6 +608,33 @@ private void gayRecipe(RecipeOutput recipes, ItemPridePigment.Type type, Ingredi
.save(recipes);
}

private void gayRecipe(RecipeOutput recipes, ItemPridePigment.Type type, TagKey<Item> mainMaterial, Ingredient fallback) {
var colorizer = HexItems.PRIDE_PIGMENTS.get(type);
var defaultLocation = BuiltInRegistries.ITEM.getKey(colorizer.get());

ShapedRecipeBuilder mainRecipe = ShapedRecipeBuilder.shaped(RecipeCategory.MISC, colorizer.get())
.define('D', HexItems.AMETHYST_DUST.get())
.define('C', mainMaterial)
.pattern(" D ")
.pattern("DCD")
.pattern(" D ")
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST.get()));
conditions.apply(mainRecipe)
.whenTagPopulated(mainMaterial)
.save(recipes);

ShapedRecipeBuilder fallbackRecipe = ShapedRecipeBuilder.shaped(RecipeCategory.MISC, colorizer.get())
.define('D', HexItems.AMETHYST_DUST.get())
.define('C', fallback)
.pattern(" D ")
.pattern("DCD")
.pattern(" D ")
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST.get()));
conditions.apply(fallbackRecipe)
.whenTagEmpty(mainMaterial)
.save(recipes, defaultLocation.withPath(original -> original + "_fallback"));
}

private <T extends Recipe<?>> void specialRecipe(RecipeOutput consumer, RecipeSerializer<T> serializer, Function<CraftingBookCategory, T> recipeFunc) {
var name = BuiltInRegistries.RECIPE_SERIALIZER.getKey(serializer);
SpecialRecipeBuilder.special(recipeFunc::apply).save(consumer, HexAPI.MOD_ID + ":dynamic" + name.getPath());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Item;
Expand Down Expand Up @@ -46,6 +47,9 @@ protected void addTags(HolderLookup.Provider provider) {
add(tag(HexTags.Items.SEAL_MATERIALS),
Items.HONEYCOMB);

add(tag(HexTags.Items.PANS),
ResourceLocation.fromNamespaceAndPath("farmersdelight", "skillet"));

this.copy(HexTags.Blocks.EDIFIED_LOGS, HexTags.Items.EDIFIED_LOGS);
this.copy(HexTags.Blocks.EDIFIED_PLANKS, HexTags.Items.EDIFIED_PLANKS);
this.copy(HexTags.Blocks.IMPETI, HexTags.Items.IMPETI);
Expand Down Expand Up @@ -75,4 +79,10 @@ void add(TagAppender<Item> appender, Item... items) {
appender.add(BuiltInRegistries.ITEM.getResourceKey(item).orElseThrow());
}
}

void add(TagAppender<Item> appender, ResourceLocation... locations) {
for (ResourceLocation location : locations) {
appender.addOptional(location);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:tags_populated",
"registry": "minecraft:item",
"values": [
"hexcasting:pans"
]
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "hexcasting:amethyst_dust"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:pride_colorizer_pansexual"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:pride_colorizer_pansexual"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:not",
"value": {
"condition": "fabric:tags_populated",
"registry": "minecraft:item",
"values": [
"hexcasting:pans"
]
}
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "hexcasting:amethyst_dust"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:pride_colorizer_pansexual_fallback"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:pride_colorizer_pansexual_fallback"
]
}
}
Loading
Loading