Add heat to REI
This commit is contained in:
parent
21d77a2d7d
commit
fee7d69919
4 changed files with 26 additions and 0 deletions
|
@ -94,6 +94,7 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
|
|||
for (List<ItemStack> inputs : machineRecipe.getInput()){
|
||||
widgets.add(new SlotWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStacks(inputs), true, true, true));
|
||||
}
|
||||
|
||||
Text energyPerTick = new TranslatableText("techreborn.jei.recipe.running.cost", "E", machineRecipe.getEnergy());
|
||||
widgets.add(new LabelWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), energyPerTick.asFormattedString()){
|
||||
@Override
|
||||
|
@ -106,6 +107,17 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
|
|||
for (ItemStack outputs : machineRecipe.getOutput()){
|
||||
widgets.add(new SlotWidget(startPoint.x + 61, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStack(outputs), true, true, true));
|
||||
}
|
||||
|
||||
int heat = machineRecipe.getHeat();
|
||||
if (heat > 0) {
|
||||
String neededHeat = heat + " " + StringUtils.t("techreborn.jei.recipe.heat");
|
||||
widgets.add(new LabelWidget(startPoint.x + 61, startPoint.y + 1 + (i++ * 20), neededHeat){
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float delta) {
|
||||
font.draw(text, x - font.getStringWidth(text) / 2, y, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return widgets;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import me.shedaniel.rei.api.RecipeDisplay;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.common.crafting.ingredient.RebornIngredient;
|
||||
import techreborn.api.recipe.recipes.BlastFurnaceRecipe;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -40,17 +41,25 @@ public class MachineRecipeDisplay<R extends RebornRecipe> implements RecipeDispl
|
|||
private List<List<ItemStack>> inputs;
|
||||
private List<ItemStack> outputs;
|
||||
private int energy = 0;
|
||||
private int heat = 0;
|
||||
|
||||
public MachineRecipeDisplay(R recipe) {
|
||||
this.recipe = recipe;
|
||||
this.inputs = recipe.getRebornIngredients().stream().map(RebornIngredient::getPreviewStacks).collect(Collectors.toList());
|
||||
this.outputs = recipe.getOutputs();
|
||||
this.energy = recipe.getPower();
|
||||
if (recipe instanceof BlastFurnaceRecipe) {
|
||||
this.heat = ((BlastFurnaceRecipe) recipe).getHeat();
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergy() {
|
||||
return energy;
|
||||
}
|
||||
|
||||
public int getHeat() {
|
||||
return heat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Identifier> getRecipeLocation() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue