Skip to content

Commit

Permalink
Fix #260
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Nov 10, 2024
1 parent 8dfb953 commit c7c379f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies {
compileOnly "mezz.jei:jei-$minecraft_version-neoforge-api:$jei_version"
localRuntime "mezz.jei:jei-$minecraft_version-neoforge:$jei_version"

compileOnly "dev.emi:emi-neoforge:$emi_version+1.21:api"
compileOnly "dev.emi:emi-neoforge:$emi_version+$minecraft_version:api"
//localRuntime "dev.emi:emi-neoforge:$emi_version+$minecraft_version"

compileOnly "vazkii.patchouli:Patchouli:$patchouli_version:api"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ mod_license=https://github.com/railcraft-reborn/railcraft/blob/1.21.x/LICENSE.md
# Dependencies
jupiter_version=5.10.2
jei_version=19.8.5.118
emi_version=1.1.12
emi_version=1.1.18
patchouli_version=1.21-87-NEOFORGE-SNAPSHOT
jade_id=5591256
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@
import dev.emi.emi.api.stack.EmiIngredient;
import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.api.widget.WidgetHolder;
import mods.railcraft.integrations.jei.category.BlastFurnaceRecipeCategory;
import mods.railcraft.api.core.RailcraftConstants;
import mods.railcraft.world.item.RailcraftItems;
import mods.railcraft.world.item.crafting.BlastFurnaceRecipe;
import net.minecraft.SharedConstants;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeHolder;

public class BlastFurnaceEmiRecipe extends BasicEmiRecipe {

private static final int WIDTH = 82;
private static final int HEIGHT = 54;
private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/blast_furnace.png");

private final BlastFurnaceRecipe recipe;

public BlastFurnaceEmiRecipe(RecipeHolder<BlastFurnaceRecipe> recipe) {
super(RailcraftEmiPlugin.BLASTING_CATEGORY, recipe.id(),
BlastFurnaceRecipeCategory.WIDTH, BlastFurnaceRecipeCategory.HEIGHT);
super(RailcraftEmiPlugin.BLASTING_CATEGORY, recipe.id(), WIDTH, HEIGHT);
this.recipe = recipe.value();
this.inputs.add(EmiIngredient.of(this.recipe.getIngredients().getFirst()));
var level = Minecraft.getInstance().level;
Expand All @@ -35,8 +40,7 @@ public BlastFurnaceEmiRecipe(RecipeHolder<BlastFurnaceRecipe> recipe) {

@Override
public void addWidgets(WidgetHolder widgets) {
widgets.addTexture(BlastFurnaceRecipeCategory.BACKGROUND,
0, 0, width, height, 55, 16);
widgets.addTexture(BACKGROUND, 0, 0, width, height, 55, 16);
widgets.addFillingArrow(24, 18, 10_000).tooltip((x, y) -> {
int cookTime = recipe.getCookingTime();
if (cookTime > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@
import dev.emi.emi.api.stack.EmiIngredient;
import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.api.widget.WidgetHolder;
import mods.railcraft.integrations.jei.category.CokeOvenRecipeCategory;
import mods.railcraft.api.core.RailcraftConstants;
import mods.railcraft.world.item.crafting.CokeOvenRecipe;
import net.minecraft.SharedConstants;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeHolder;

public class CokeOvenEmiRecipe extends BasicEmiRecipe {

private static final int WIDTH = 124;
private static final int HEIGHT = 49;
private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/coke_oven.png");

private final CokeOvenRecipe recipe;

public CokeOvenEmiRecipe(RecipeHolder<CokeOvenRecipe> recipe) {
super(RailcraftEmiPlugin.COKING_CATEGORY, recipe.id(),
CokeOvenRecipeCategory.WIDTH, CokeOvenRecipeCategory.HEIGHT);
super(RailcraftEmiPlugin.COKING_CATEGORY, recipe.id(), WIDTH, HEIGHT);
this.recipe = recipe.value();
this.inputs.add(EmiIngredient.of(this.recipe.getIngredients().getFirst()));
var level = Minecraft.getInstance().level;
Expand All @@ -30,7 +35,7 @@ public CokeOvenEmiRecipe(RecipeHolder<CokeOvenRecipe> recipe) {

@Override
public void addWidgets(WidgetHolder widgets) {
widgets.addTexture(CokeOvenRecipeCategory.BACKGROUND, 0, 0, width, height, 15, 23);
widgets.addTexture(BACKGROUND, 0, 0, width, height, 15, 23);
widgets.addFillingArrow(18, 20, 10_000).tooltip((x, y) -> {
int cookTime = recipe.getCookingTime();
if (cookTime > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@
import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.api.widget.WidgetHolder;
import mods.railcraft.Translations;
import mods.railcraft.integrations.jei.category.CrusherRecipeCategory;
import mods.railcraft.api.core.RailcraftConstants;
import mods.railcraft.world.item.crafting.CrusherRecipe;
import net.minecraft.ChatFormatting;
import net.minecraft.SharedConstants;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeHolder;

public class CrusherEmiRecipe extends BasicEmiRecipe {

private static final int WIDTH = 144;
private static final int HEIGHT = 54;

private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/crusher.png");

private final CrusherRecipe recipe;

public CrusherEmiRecipe(RecipeHolder<CrusherRecipe> recipe) {
super(RailcraftEmiPlugin.CRUSHING_CATEGORY, recipe.id(),
CrusherRecipeCategory.WIDTH, CrusherRecipeCategory.HEIGHT);
super(RailcraftEmiPlugin.CRUSHING_CATEGORY, recipe.id(), WIDTH, HEIGHT);
this.recipe = recipe.value();
this.inputs.add(EmiIngredient.of(this.recipe.getIngredients().getFirst()));
this.recipe.getProbabilityOutputs().stream()
Expand All @@ -32,9 +38,8 @@ public CrusherEmiRecipe(RecipeHolder<CrusherRecipe> recipe) {

@Override
public void addWidgets(WidgetHolder widgets) {
widgets.addTexture(CrusherRecipeCategory.BACKGROUND, 0, 0, width, height, 0, 171);
var crushingTexture = new EmiTexture(CrusherRecipeCategory.BACKGROUND,
144, 171, 29, 53);
widgets.addTexture(BACKGROUND, 0, 0, width, height, 0, 171);
var crushingTexture = new EmiTexture(BACKGROUND, 144, 171, 29, 53);
widgets.addAnimatedTexture(crushingTexture, 58, 0,
1000 * this.recipe.getProcessTime() / SharedConstants.TICKS_PER_SECOND,
true, false, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

public class BlastFurnaceRecipeCategory implements IRecipeCategory<BlastFurnaceRecipe> {

public static final int WIDTH = 82;
public static final int HEIGHT = 54;
private static final int WIDTH = 82;
private static final int HEIGHT = 54;

public static final ResourceLocation BACKGROUND =
private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/blast_furnace.png");

private final IDrawable background, icon, flame, arrow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

public class CokeOvenRecipeCategory implements IRecipeCategory<CokeOvenRecipe> {

public static final int WIDTH = 124;
public static final int HEIGHT = 49;
private static final int WIDTH = 124;
private static final int HEIGHT = 49;

public static final ResourceLocation BACKGROUND =
private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/coke_oven.png");

private final IDrawable background, icon, flame, arrow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

public class CrusherRecipeCategory implements IRecipeCategory<CrusherRecipe> {

public static final int WIDTH = 144;
public static final int HEIGHT = 54;
private static final int WIDTH = 144;
private static final int HEIGHT = 54;

public static final ResourceLocation BACKGROUND =
private static final ResourceLocation BACKGROUND =
RailcraftConstants.rl("textures/gui/container/crusher.png");

private final IDrawable background, icon, arrow;
Expand Down

0 comments on commit c7c379f

Please sign in to comment.