Added emi integration for the shaping bench

This commit is contained in:
Sollace 2023-11-20 22:57:41 +00:00
parent 63243e254d
commit c1b5c58eab
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
5 changed files with 35 additions and 6 deletions

View file

@ -11,6 +11,7 @@ import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellEnhancingRe
import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellShapedCraftingRecipe; import com.minelittlepony.unicopia.ability.magic.spell.crafting.SpellShapedCraftingRecipe;
import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits; import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits;
import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait;
import com.minelittlepony.unicopia.block.UBlocks;
import com.minelittlepony.unicopia.item.EnchantableItem; import com.minelittlepony.unicopia.item.EnchantableItem;
import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.item.URecipes; import com.minelittlepony.unicopia.item.URecipes;
@ -22,6 +23,7 @@ import dev.emi.emi.api.recipe.EmiRecipeCategory;
import dev.emi.emi.api.render.EmiTexture; import dev.emi.emi.api.render.EmiTexture;
import dev.emi.emi.api.stack.Comparison; import dev.emi.emi.api.stack.Comparison;
import dev.emi.emi.api.stack.EmiStack; import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.recipe.EmiStonecuttingRecipe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.recipe.RecipeType; import net.minecraft.recipe.RecipeType;
import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.registry.DynamicRegistryManager;
@ -30,7 +32,9 @@ import net.minecraft.util.Identifier;
public class Main implements EmiPlugin { public class Main implements EmiPlugin {
static final EmiStack SPELL_BOOK_STATION = EmiStack.of(UItems.SPELLBOOK); static final EmiStack SPELL_BOOK_STATION = EmiStack.of(UItems.SPELLBOOK);
static final EmiStack CLOUD_SHAPING_STATION = EmiStack.of(UBlocks.SHAPING_BENCH);
static final EmiRecipeCategory SPELL_BOOK_CATEGORY = new EmiRecipeCategory(Unicopia.id("spellbook"), SPELL_BOOK_STATION, SPELL_BOOK_STATION); static final EmiRecipeCategory SPELL_BOOK_CATEGORY = new EmiRecipeCategory(Unicopia.id("spellbook"), SPELL_BOOK_STATION, SPELL_BOOK_STATION);
static final EmiRecipeCategory CLOUD_SHAPING_CATEGORY = new EmiRecipeCategory(Unicopia.id("cloud_shaping"), CLOUD_SHAPING_STATION, CLOUD_SHAPING_STATION);
static final Identifier WIDGETS = Unicopia.id("textures/gui/widgets.png"); static final Identifier WIDGETS = Unicopia.id("textures/gui/widgets.png");
static final EmiTexture EMPTY_ARROW = new EmiTexture(WIDGETS, 44, 0, 24, 17); static final EmiTexture EMPTY_ARROW = new EmiTexture(WIDGETS, 44, 0, 24, 17);
@ -70,6 +74,17 @@ public class Main implements EmiPlugin {
} }
}); });
registry.addCategory(CLOUD_SHAPING_CATEGORY);
registry.addWorkstation(CLOUD_SHAPING_CATEGORY, CLOUD_SHAPING_STATION);
registry.getRecipeManager().listAllOfType(URecipes.CLOUD_SHAPING).forEach(recipe -> {
registry.addRecipe(new EmiStonecuttingRecipe(recipe) {
@Override
public EmiRecipeCategory getCategory() {
return CLOUD_SHAPING_CATEGORY;
}
});
});
Stream.of(UItems.GEMSTONE, UItems.BOTCHED_GEM, UItems.MAGIC_STAFF, UItems.FILLED_JAR).forEach(item -> { Stream.of(UItems.GEMSTONE, UItems.BOTCHED_GEM, UItems.MAGIC_STAFF, UItems.FILLED_JAR).forEach(item -> {
registry.setDefaultComparison(item, comparison -> Comparison.compareNbt()); registry.setDefaultComparison(item, comparison -> Comparison.compareNbt());
}); });

View file

@ -45,6 +45,7 @@
"item.unicopia.spellbook": "Spellbook", "item.unicopia.spellbook": "Spellbook",
"emi.category.unicopia.spellbook": "Spellbook", "emi.category.unicopia.spellbook": "Spellbook",
"emi.category.unicopia.cloud_shaping": "Shaping",
"item.unicopia.alicorn_badge": "Alicorn Emblem", "item.unicopia.alicorn_badge": "Alicorn Emblem",
"item.unicopia.unicorn_badge": "Unicorn Emblem", "item.unicopia.unicorn_badge": "Unicorn Emblem",

View file

@ -1,6 +0,0 @@
{
"type": "unicopia:cloud_shaping",
"ingredient": { "item": "unicopia:cloud" },
"result": "unicopia:unstable_cloud",
"count": 1
}

View file

@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"#O#",
"###"
],
"key": {
"#": [
{ "item": "unicopia:cloud" }
],
"O": [
{ "item": "unicopia:lightning_jar" },
{ "item": "unicopia:zap_apple_jam_jar" }
]
},
"result": { "item": "unicopia:unstable_cloud", "count": 8 }
}

View file

@ -1,6 +1,7 @@
{ {
"replace": false, "replace": false,
"values": [ "values": [
"unicopia:shaping_bench",
"#unicopia:clouds", "#unicopia:clouds",
"#unicopia:bed_sheets", "#unicopia:bed_sheets",
"#unicopia:food_types/raw_fish", "#unicopia:food_types/raw_fish",