[Change] Moved Alloying Recipes to BCLib
This commit is contained in:
parent
34d55debce
commit
e45eade668
19 changed files with 72 additions and 471 deletions
|
@ -1,74 +0,0 @@
|
|||
package org.betterx.betterend.integration.emi;
|
||||
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
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 java.util.List;
|
||||
|
||||
public class EMIAlloyingRecipe implements EmiRecipe {
|
||||
private final ResourceLocation id;
|
||||
private final List<EmiIngredient> input;
|
||||
private final List<EmiStack> output;
|
||||
|
||||
public EMIAlloyingRecipe(AlloyingRecipe recipe) {
|
||||
this.id = recipe.getId();
|
||||
this.input = List.of(
|
||||
EmiIngredient.of(recipe.getIngredients().get(0)),
|
||||
EmiIngredient.of(recipe.getIngredients().get(1))
|
||||
);
|
||||
this.output = List.of(EmiStack.of(recipe.getResultItem()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmiRecipeCategory getCategory() {
|
||||
return EMIPlugin.END_SMELTER_CATEGORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmiIngredient> getInputs() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmiStack> getOutputs() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayWidth() {
|
||||
return 76;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayHeight() {
|
||||
return 18;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets(WidgetHolder widgets) {
|
||||
// Add an arrow texture to indicate processing
|
||||
widgets.addTexture(EmiTexture.EMPTY_ARROW, 46, 1);
|
||||
|
||||
// Adds an input slot on the left
|
||||
widgets.addSlot(input.get(0), 0, 0);
|
||||
widgets.addSlot(input.get(1), 20, 0);
|
||||
|
||||
// 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), 58, 0).recipeContext(this);
|
||||
}
|
||||
}
|
|
@ -1,40 +1,10 @@
|
|||
package org.betterx.betterend.integration.emi;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.crafting.RecipeManager;
|
||||
|
||||
import dev.emi.emi.api.EmiPlugin;
|
||||
import dev.emi.emi.api.EmiRegistry;
|
||||
import dev.emi.emi.api.recipe.EmiRecipeCategory;
|
||||
import dev.emi.emi.api.stack.EmiStack;
|
||||
|
||||
public class EMIPlugin implements EmiPlugin {
|
||||
public static final ResourceLocation MY_SPRITE_SHEET = BetterEnd.makeID(
|
||||
"textures/gui/emi_simplified_textures.png"
|
||||
);
|
||||
|
||||
public static final EmiStack END_SMELTER_WORKSTATION = EmiStack.of(EndBlocks.END_STONE_SMELTER);
|
||||
public static final EmiRecipeCategory END_SMELTER_CATEGORY = new EmiRecipeCategory(
|
||||
BCLib.makeID("end_stone_smelter"),
|
||||
END_SMELTER_WORKSTATION//,
|
||||
//new EmiTexture(MY_SPRITE_SHEET, 0, 0, 16, 16)
|
||||
);
|
||||
|
||||
public class EMIPlugin implements dev.emi.emi.api.EmiPlugin {
|
||||
@Override
|
||||
public void register(EmiRegistry emiRegistry) {
|
||||
emiRegistry.addCategory(END_SMELTER_CATEGORY);
|
||||
|
||||
// Add all the workstations your category uses
|
||||
emiRegistry.addWorkstation(END_SMELTER_CATEGORY, END_SMELTER_WORKSTATION);
|
||||
|
||||
RecipeManager manager = emiRegistry.getRecipeManager();
|
||||
for (AlloyingRecipe recipe : manager.getAllRecipesFor(AlloyingRecipe.TYPE)) {
|
||||
emiRegistry.addRecipe(new EMIAlloyingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.betterx.betterend.integration.jei;
|
||||
|
||||
import org.betterx.bclib.recipes.AlloyingRecipe;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.betterx.betterend.integration.jei;
|
||||
|
||||
import org.betterx.bclib.recipes.AlloyingRecipe;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.ui.layout.values.Rectangle;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.betterx.betterend.integration.jei;
|
||||
|
||||
import org.betterx.bclib.recipes.AlloyingRecipe;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.betterx.betterend.integration.rei;
|
||||
|
||||
import org.betterx.bclib.recipes.AlloyingRecipe;
|
||||
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.integration.rei;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseFurnaceBlock;
|
||||
import org.betterx.bclib.recipes.AlloyingRecipe;
|
||||
import org.betterx.bclib.recipes.AnvilRecipe;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.blocks.basis.EndAnvilBlock;
|
||||
import org.betterx.betterend.recipe.builders.AlloyingRecipe;
|
||||
import org.betterx.betterend.recipe.builders.InfusionRecipe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue