Skip to content

Commit

Permalink
1.3.1 - EMI support on Fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotaPride committed Jan 19, 2025
1 parent 4db957e commit db6039b
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 6 deletions.
74 changes: 72 additions & 2 deletions Common/src/main/resources/assets/hibernalherbs/lang/en_ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,76 @@
"advancements.hibernalherbs.obtain_singed_grimoire.title": "Hellfire! Hellfire in my skin!",
"advancements.hibernalherbs.obtain_singed_grimoire.description": "Obtain a Singed Grimoire to expand your knowledge",

// REI & JEI Integration
"text.hibernalherbs.herbal_conjuration": "Herbal Conjuration"
// REI/JEI/EMI Integration
"text.hibernalherbs.herbal_conjuration": "Herbal Conjuration",
"emi.category.hibernalherbs.herbal_conjuration": "Herbal Conjuration",

"tag.item.hibernalherbs.advancement.is_herbal_sigil": "Is Applicable for is Herbal Sigil Advancement Criteria",
"tag.item.hibernalherbs.blends.diamond": "Diamond Tier Blends",
"tag.item.hibernalherbs.blends.iron": "Iron Tier Blends",
"tag.item.hibernalherbs.blends.netherite": "Netherite Tier Blends",
"tag.item.hibernalherbs.canisters": "Herbal Blend Holding Canisters",
"tag.item.hibernalherbs.contains_mystical_energy": "Contains Mystical Energy",
"tag.item.hibernalherbs.dried_herbs": "Dried Herbs",
"tag.item.hibernalherbs.dye.blue": "Herbs That can Turn Into Blue Dye",
"tag.item.hibernalherbs.dye.cyan": "Herbs That can Turn Into Cyan Dye",
"tag.item.hibernalherbs.dye.green": "Herbs That can Turn Into Green Dye",
"tag.item.hibernalherbs.dye.lime": "Herbs That can Turn Into Lime Dye",
"tag.item.hibernalherbs.dye.orange": "Herbs That can Turn Into Orange Dye",
"tag.item.hibernalherbs.dye.purple": "Herbs That can Turn Into Purple Dye",
"tag.item.hibernalherbs.dye.red": "Herbs That can Turn Into Red Dye",
"tag.item.hibernalherbs.dye.white": "Herbs That can Turn Into White Dye",
"tag.item.hibernalherbs.dye.yellow": "Herbs That can Turn Into Yellow Dye",
"tag.item.hibernalherbs.dye.pounded.blue": "Pounded Herbs That can Turn Into Blue Dye",
"tag.item.hibernalherbs.dye.pounded.cyan": "Pounded Herbs That can Turn Into Cyan Dye",
"tag.item.hibernalherbs.dye.pounded.green": "Pounded Herbs That can Turn Into Green Dye",
"tag.item.hibernalherbs.dye.pounded.lime": "Pounded Herbs That can Turn Into Lime Dye",
"tag.item.hibernalherbs.dye.pounded.orange": "Pounded Herbs That can Turn Into Orange Dye",
"tag.item.hibernalherbs.dye.pounded.purple": "Pounded Herbs That can Turn Into Purple Dye",
"tag.item.hibernalherbs.dye.pounded.red": "Pounded Herbs That can Turn Into Red Dye",
"tag.item.hibernalherbs.dye.pounded.white": "Pounded Herbs That can Turn Into White Dye",
"tag.item.hibernalherbs.dye.pounded.yellow": "Pounded Herbs That can Turn Into Yellow Dye",
"tag.item.hibernalherbs.fertilizer": "Herbal Fertilizers",
"tag.item.hibernalherbs.grimoires": "Herbal Grimoires",
"tag.item.hibernalherbs.herb_blends": "Herbal Blends",
"tag.item.hibernalherbs.herbs": "Herbs",
"tag.item.hibernalherbs.herbs.artificial.blends": "Artificial Herbal Blends",
"tag.item.hibernalherbs.herbs.artificial.herbs": "Artificial Herbs",
"tag.item.hibernalherbs.herbs.calendula": "Calendula Herbs",
"tag.item.hibernalherbs.herbs.ceillis": "Ceillis Herbs",
"tag.item.hibernalherbs.herbs.chamomile": "Chamomile Herbs",
"tag.item.hibernalherbs.herbs.chervil": "Chervil Herbs",
"tag.item.hibernalherbs.herbs.chives": "Chives Herbs",
"tag.item.hibernalherbs.herbs.essitte": "Essitte Herbs",
"tag.item.hibernalherbs.herbs.fennkystral": "Fennkystral Herbs",
"tag.item.hibernalherbs.herbs.fennsel": "Fennsel Herbs",
"tag.item.hibernalherbs.herbs.marjoram": "Marjoram Herbs",
"tag.item.hibernalherbs.herbs.punuel": "Punuel Herbs",
"tag.item.hibernalherbs.herbs.rosemary": "Rosemary Herbs",
"tag.item.hibernalherbs.herbs.sage": "Sage Herbs",
"tag.item.hibernalherbs.herbs.sorrel": "Sorrel Herbs",
"tag.item.hibernalherbs.herbs.tarragon": "Tarragon Herbs",
"tag.item.hibernalherbs.herbs.thyme": "Thyme Herbs",
"tag.item.hibernalherbs.herbs.thyocielle": "Thyocielle Herbs",
"tag.item.hibernalherbs.herbs.verbena": "Verbena Herbs",
"tag.item.hibernalherbs.humus": "Herbal Humus",
"tag.item.hibernalherbs.myqueste_logs": "Myqueste Logs",
"tag.item.hibernalherbs.padlocks.bound": "Bound Herbal Padlocks",
"tag.item.hibernalherbs.padlocks.unbound": "Unbound Herbal Padlocks",
"tag.item.hibernalherbs.petals": "Petals Used In Herbal Conjuration",
"tag.item.hibernalherbs.pouches": "Herbal Pouches",
"tag.item.hibernalherbs.pounded_herbs": "Pounded Herbs",
"tag.item.hibernalherbs.recipe.acceptable_herb_fertilizer_recipe_unlock": "Is Applicable for Herb Fertilizer Advancement Criteria",
"tag.item.hibernalherbs.recipe.acceptable_herb_humus_recipe_unlock": "Is Applicable for Herb Humus Advancement Criteria",
"tag.item.hibernalherbs.sigil.envy": "Herbal Sigils aligned with Envy",
"tag.item.hibernalherbs.sigil.gluttony": "Herbal Sigils aligned with Gluttony",
"tag.item.hibernalherbs.sigil.greed": "Herbal Sigils aligned with Greed",
"tag.item.hibernalherbs.sigil.lust": "Herbal Sigils aligned with Lust",
"tag.item.hibernalherbs.sigil.pride": "Herbal Sigils aligned with Pride",
"tag.item.hibernalherbs.sigil.sigils": "Herbal Sigils",
"tag.item.hibernalherbs.sigil.sloth": "Herbal Sigils aligned with Sloth",
"tag.item.hibernalherbs.sigil.wrath": "Herbal Sigils aligned with Wrath",
"tag.item.hibernalherbs.sinful_herbs": "Sinful Herbs",
"tag.item.hibernalherbs.smoked_blends": "Smoked Herbal Blends",
"tag.item.trinkets.chest.necklace": "Equippable in the Necklace Trinkets slot"
}
74 changes: 72 additions & 2 deletions Common/src/main/resources/assets/hibernalherbs/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,76 @@
"advancements.hibernalherbs.obtain_singed_grimoire.title": "Hellfire! Hellfire in my skin!",
"advancements.hibernalherbs.obtain_singed_grimoire.description": "Obtain a Singed Grimoire to expand your knowledge",

// REI & JEI Integration
"text.hibernalherbs.herbal_conjuration": "Herbal Conjuration"
// REI/JEI/EMI Integration
"text.hibernalherbs.herbal_conjuration": "Herbal Conjuration",
"emi.category.hibernalherbs.herbal_conjuration": "Herbal Conjuration",

"tag.item.hibernalherbs.advancement.is_herbal_sigil": "Is Applicable for is Herbal Sigil Advancement Criteria",
"tag.item.hibernalherbs.blends.diamond": "Diamond Tier Blends",
"tag.item.hibernalherbs.blends.iron": "Iron Tier Blends",
"tag.item.hibernalherbs.blends.netherite": "Netherite Tier Blends",
"tag.item.hibernalherbs.canisters": "Herbal Blend Holding Canisters",
"tag.item.hibernalherbs.contains_mystical_energy": "Contains Mystical Energy",
"tag.item.hibernalherbs.dried_herbs": "Dried Herbs",
"tag.item.hibernalherbs.dye.blue": "Herbs That can Turn Into Blue Dye",
"tag.item.hibernalherbs.dye.cyan": "Herbs That can Turn Into Cyan Dye",
"tag.item.hibernalherbs.dye.green": "Herbs That can Turn Into Green Dye",
"tag.item.hibernalherbs.dye.lime": "Herbs That can Turn Into Lime Dye",
"tag.item.hibernalherbs.dye.orange": "Herbs That can Turn Into Orange Dye",
"tag.item.hibernalherbs.dye.purple": "Herbs That can Turn Into Purple Dye",
"tag.item.hibernalherbs.dye.red": "Herbs That can Turn Into Red Dye",
"tag.item.hibernalherbs.dye.white": "Herbs That can Turn Into White Dye",
"tag.item.hibernalherbs.dye.yellow": "Herbs That can Turn Into Yellow Dye",
"tag.item.hibernalherbs.dye.pounded.blue": "Pounded Herbs That can Turn Into Blue Dye",
"tag.item.hibernalherbs.dye.pounded.cyan": "Pounded Herbs That can Turn Into Cyan Dye",
"tag.item.hibernalherbs.dye.pounded.green": "Pounded Herbs That can Turn Into Green Dye",
"tag.item.hibernalherbs.dye.pounded.lime": "Pounded Herbs That can Turn Into Lime Dye",
"tag.item.hibernalherbs.dye.pounded.orange": "Pounded Herbs That can Turn Into Orange Dye",
"tag.item.hibernalherbs.dye.pounded.purple": "Pounded Herbs That can Turn Into Purple Dye",
"tag.item.hibernalherbs.dye.pounded.red": "Pounded Herbs That can Turn Into Red Dye",
"tag.item.hibernalherbs.dye.pounded.white": "Pounded Herbs That can Turn Into White Dye",
"tag.item.hibernalherbs.dye.pounded.yellow": "Pounded Herbs That can Turn Into Yellow Dye",
"tag.item.hibernalherbs.fertilizer": "Herbal Fertilizers",
"tag.item.hibernalherbs.grimoires": "Herbal Grimoires",
"tag.item.hibernalherbs.herb_blends": "Herbal Blends",
"tag.item.hibernalherbs.herbs": "Herbs",
"tag.item.hibernalherbs.herbs.artificial.blends": "Artificial Herbal Blends",
"tag.item.hibernalherbs.herbs.artificial.herbs": "Artificial Herbs",
"tag.item.hibernalherbs.herbs.calendula": "Calendula Herbs",
"tag.item.hibernalherbs.herbs.ceillis": "Ceillis Herbs",
"tag.item.hibernalherbs.herbs.chamomile": "Chamomile Herbs",
"tag.item.hibernalherbs.herbs.chervil": "Chervil Herbs",
"tag.item.hibernalherbs.herbs.chives": "Chives Herbs",
"tag.item.hibernalherbs.herbs.essitte": "Essitte Herbs",
"tag.item.hibernalherbs.herbs.fennkystral": "Fennkystral Herbs",
"tag.item.hibernalherbs.herbs.fennsel": "Fennsel Herbs",
"tag.item.hibernalherbs.herbs.marjoram": "Marjoram Herbs",
"tag.item.hibernalherbs.herbs.punuel": "Punuel Herbs",
"tag.item.hibernalherbs.herbs.rosemary": "Rosemary Herbs",
"tag.item.hibernalherbs.herbs.sage": "Sage Herbs",
"tag.item.hibernalherbs.herbs.sorrel": "Sorrel Herbs",
"tag.item.hibernalherbs.herbs.tarragon": "Tarragon Herbs",
"tag.item.hibernalherbs.herbs.thyme": "Thyme Herbs",
"tag.item.hibernalherbs.herbs.thyocielle": "Thyocielle Herbs",
"tag.item.hibernalherbs.herbs.verbena": "Verbena Herbs",
"tag.item.hibernalherbs.humus": "Herbal Humus",
"tag.item.hibernalherbs.myqueste_logs": "Myqueste Logs",
"tag.item.hibernalherbs.padlocks.bound": "Bound Herbal Padlocks",
"tag.item.hibernalherbs.padlocks.unbound": "Unbound Herbal Padlocks",
"tag.item.hibernalherbs.petals": "Petals Used In Herbal Conjuration",
"tag.item.hibernalherbs.pouches": "Herbal Pouches",
"tag.item.hibernalherbs.pounded_herbs": "Pounded Herbs",
"tag.item.hibernalherbs.recipe.acceptable_herb_fertilizer_recipe_unlock": "Is Applicable for Herb Fertilizer Advancement Criteria",
"tag.item.hibernalherbs.recipe.acceptable_herb_humus_recipe_unlock": "Is Applicable for Herb Humus Advancement Criteria",
"tag.item.hibernalherbs.sigil.envy": "Herbal Sigils aligned with Envy",
"tag.item.hibernalherbs.sigil.gluttony": "Herbal Sigils aligned with Gluttony",
"tag.item.hibernalherbs.sigil.greed": "Herbal Sigils aligned with Greed",
"tag.item.hibernalherbs.sigil.lust": "Herbal Sigils aligned with Lust",
"tag.item.hibernalherbs.sigil.pride": "Herbal Sigils aligned with Pride",
"tag.item.hibernalherbs.sigil.sigils": "Herbal Sigils",
"tag.item.hibernalherbs.sigil.sloth": "Herbal Sigils aligned with Sloth",
"tag.item.hibernalherbs.sigil.wrath": "Herbal Sigils aligned with Wrath",
"tag.item.hibernalherbs.sinful_herbs": "Sinful Herbs",
"tag.item.hibernalherbs.smoked_blends": "Smoked Herbal Blends",
"tag.item.trinkets.chest.necklace": "Equippable in the Necklace Trinkets slot"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ dependencies {
// REI
// modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}"
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"
//modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}"

// EMI
//modCompileOnly "dev.emi:emi-fabric:${emi_version}:api"
//modRuntimeOnly "dev.emi:emi-fabric:${emi_version}"
modImplementation "dev.emi:emi-fabric:${emi_version}+${minecraft_version}"

// Trinkets
modImplementation("dev.emi:trinkets:${trinkets_version}")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package net.dakotapride.hibernalHerbs.common.integration.emi;

import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.recipe.EmiRecipeCategory;
import dev.emi.emi.api.render.EmiTexture;
import dev.emi.emi.api.stack.EmiStack;
import net.dakotapride.hibernalHerbs.common.init.BlockInit;
import net.dakotapride.hibernalHerbs.common.init.RecipeInit;
import net.dakotapride.hibernalHerbs.common.recipe.HerbalConjurationRecipe;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.util.Identifier;

import static net.dakotapride.hibernalHerbs.common.Constants.MOD_ID;

public class EmiHibernalHerbsPlugin implements EmiPlugin {
public static final Identifier SPRITE_SHEET = new Identifier(MOD_ID, "textures/gui/recipe_viewer/emi/sprite_sheet.png");
public static final EmiStack CONJURATION_ALTAR = EmiStack.of(BlockInit.CONJURATION_ALTAR);
public static final EmiRecipeCategory CONJURATION_CATEGORY
= new EmiRecipeCategory(new Identifier(MOD_ID, "herbal_conjuration"), CONJURATION_ALTAR, new EmiTexture(SPRITE_SHEET, 0, 0, 16, 16));

@Override
public void register(EmiRegistry registry) {
// Tell EMI to add a tab for your category
registry.addCategory(CONJURATION_CATEGORY);

// Add all the workstations your category uses
registry.addWorkstation(CONJURATION_CATEGORY, CONJURATION_ALTAR);

RecipeManager manager = registry.getRecipeManager();

// Use vanilla's concept of your recipes and pass them to your EmiRecipe representation
for (HerbalConjurationRecipe recipe : manager.listAllOfType(RecipeInit.HERBAL_CONJURATION_TYPE)) {
registry.addRecipe(new HerbalConjurationEmiRecipe(recipe));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package net.dakotapride.hibernalHerbs.common.integration.emi;

import dev.emi.emi.api.recipe.EmiRecipe;
import dev.emi.emi.api.recipe.EmiRecipeCategory;
import dev.emi.emi.api.render.EmiTexture;
import dev.emi.emi.api.stack.EmiIngredient;
import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.api.widget.WidgetHolder;
import me.shedaniel.math.Point;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
import net.dakotapride.hibernalHerbs.common.recipe.HerbalConjurationRecipe;
import net.minecraft.registry.DynamicRegistryManager;
import net.minecraft.util.Identifier;

import java.util.ArrayList;
import java.util.List;

public class HerbalConjurationEmiRecipe implements EmiRecipe {
private final Identifier id;
private final List<EmiIngredient> input;
private final List<EmiStack> output;

public HerbalConjurationEmiRecipe(HerbalConjurationRecipe recipe) {
this.id = recipe.getId();
this.input = List.of(
EmiIngredient.of(recipe.getIngredients().get(5)),EmiIngredient.of(recipe.getIngredients().get(0)),
EmiIngredient.of(recipe.getIngredients().get(1)),EmiIngredient.of(recipe.getIngredients().get(2)),
EmiIngredient.of(recipe.getIngredients().get(3)),EmiIngredient.of(recipe.getIngredients().get(4)));
this.output = List.of(EmiStack.of(recipe.getOutput(DynamicRegistryManager.EMPTY)));
}

@Override
public EmiRecipeCategory getCategory() {
return EmiHibernalHerbsPlugin.CONJURATION_CATEGORY;
}

@Override
public Identifier getId() {
return id;
}

@Override
public List<EmiIngredient> getInputs() {
return input;
}

@Override
public List<EmiStack> getOutputs() {
return output;
}

@Override
public int getDisplayWidth() {
return 110;
}

@Override
public int getDisplayHeight() {
return 40;
}

@Override
public void addWidgets(WidgetHolder widgets) {
// Add an arrow texture to indicate processing
widgets.addTexture(EmiTexture.EMPTY_ARROW, 63, 11);

// Adds an input slot on the left
widgets.addSlot(input.get(0), 3, 21);
widgets.addSlot(input.get(1), 23, 21);
widgets.addSlot(input.get(2), 43, 21);
widgets.addSlot(input.get(3), 3, 1);
widgets.addSlot(input.get(4), 23, 1);
widgets.addSlot(input.get(5), 43, 1);

// Adds an output slot on the right
// Note that output slots need to call `recipeContext` to inform EMI about their recipe context
// This includes being able to resolve recipe trees, favorite stacks with recipe context, and more
widgets.addSlot(output.get(0), 90, 11).recipeContext(this);
}
}
3 changes: 3 additions & 0 deletions Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
],
"rei_client": [
"net.dakotapride.hibernalHerbs.common.integration.rei.ReiHibernalHerbsPlugin"
],
"emi": [
"net.dakotapride.hibernalHerbs.common.integration.emi.EmiHibernalHerbsPlugin"
]
},
"mixins": [
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
version=1.3
version=1.3.1
group=net.dakotapride.hibernalHerbs

# Common
Expand All @@ -18,6 +18,7 @@ forge_version=47.3.0
# https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items/files
jei_version=15.8.0.16
rei_version=12.1.740
emi_version=1.1.19

# Trinkets & Curios
# https://www.curseforge.com/minecraft/mc-mods/trinkets/files
Expand Down

0 comments on commit db6039b

Please sign in to comment.