Skip to content

Commit

Permalink
Add sampling recipe to EMI
Browse files Browse the repository at this point in the history
  • Loading branch information
OffsetMonkey538 committed Oct 29, 2023
1 parent d54571d commit f3996fd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package top.offsetmonkey538.compactmobfarms.emi;
package top.offsetmonkey538.compactmobfarms.client.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.recipe.EmiInfoRecipe;
import dev.emi.emi.api.recipe.EmiWorldInteractionRecipe;
import dev.emi.emi.api.stack.Comparison;
import dev.emi.emi.api.stack.EmiIngredient;
import dev.emi.emi.api.stack.EmiStack;
import java.util.List;
import net.minecraft.entity.EntityType;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.text.Text;
import top.offsetmonkey538.compactmobfarms.config.EntityTiers;
import top.offsetmonkey538.compactmobfarms.item.ModItems;

Expand All @@ -25,6 +29,22 @@ public void register(EmiRegistry registry) {
.build()
);

for (EntityType<?> entity : EntityTiers.INSTANCE.getSupported()) {
registry.addRecipe(new EmiInfoRecipe(
List.of(
EmiIngredient.of(Ingredient.ofItems(ModItems.SAMPLE_TAKER)),
EmiIngredient.of(Ingredient.ofStacks(ModItems.FILLED_SAMPLE_TAKER.forEntity(entity)))
),
List.of(
Text.translatable(
"emi_info.compact_mob_farms.sampling",
Text.translatable(entity.getTranslationKey())
)
),
id("/sampling/" + entity)
));
}

registry.setDefaultComparison(ModItems.FILLED_SAMPLE_TAKER, Comparison.compareNbt());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public ModEnglishLanguageProvider(FabricDataOutput dataOutput) {

@Override
public void generateTranslations(TranslationBuilder translationBuilder) {
translationBuilder.add("emi_info.compact_mob_farms.sampling", "Use a sample taker on a(n) %s 10 times.");

translationBuilder.add("itemGroup.compact_mob_farms.main_group", "Compact Mob Farms");
translationBuilder.add("itemGroup.compact_mob_farms.filled_sample_takers_group", "Sample Takers");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public ModEstonianLanguageProvider(FabricDataOutput dataOutput) {

@Override
public void generateTranslations(TranslationBuilder translationBuilder) {
translationBuilder.add("emi_info.compact_mob_farms.sampling", "Kasuta proovivõtjat olendi \"%s\" peal 10 korda.");

translationBuilder.add("itemGroup.compact_mob_farms.main_group", "Kompaktsed Olendi Farmid");
translationBuilder.add("itemGroup.compact_mob_farms.filled_sample_takers_group", "Proovivõtjad");

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"com.llamalad7.mixinextras.MixinExtrasBootstrap::init"
],
"emi": [
"top.offsetmonkey538.compactmobfarms.emi.CompactMobFarmsEmiPlugin"
"top.offsetmonkey538.compactmobfarms.client.emi.CompactMobFarmsEmiPlugin"
]
},
"mixins": [
Expand Down

0 comments on commit f3996fd

Please sign in to comment.