54 lines
1.5 KiB
Java
54 lines
1.5 KiB
Java
|
package com.thebrokenrail.energonrelics.client.rei;
|
||
|
|
||
|
import me.shedaniel.rei.api.EntryStack;
|
||
|
import me.shedaniel.rei.api.RecipeDisplay;
|
||
|
import net.fabricmc.api.EnvType;
|
||
|
import net.fabricmc.api.Environment;
|
||
|
import net.minecraft.item.ItemStack;
|
||
|
import net.minecraft.text.TranslatableText;
|
||
|
import net.minecraft.util.Formatting;
|
||
|
import net.minecraft.util.Identifier;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Collections;
|
||
|
import java.util.List;
|
||
|
|
||
|
@Environment(EnvType.CLIENT)
|
||
|
public class InfuserDisplay implements RecipeDisplay {
|
||
|
private final EntryStack input;
|
||
|
private final List<EntryStack> output;
|
||
|
public final double successChance;
|
||
|
public final long cost;
|
||
|
|
||
|
public InfuserDisplay(ItemStack input, List<ItemStack> output, double successChance, long cost) {
|
||
|
this.input = EntryStack.create(input);
|
||
|
List<EntryStack> newList = new ArrayList<>();
|
||
|
for (ItemStack outputStack : output) {
|
||
|
newList.add(EntryStack.create(outputStack));
|
||
|
}
|
||
|
this.output = newList;
|
||
|
this.successChance = successChance;
|
||
|
this.cost = cost;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<List<EntryStack>> getInputEntries() {
|
||
|
return Collections.singletonList(Collections.singletonList(input));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<EntryStack> getOutputEntries() {
|
||
|
return output;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Identifier getRecipeCategory() {
|
||
|
return EnergonRelicsPlugin.INFUSER;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<List<EntryStack>> getRequiredEntries() {
|
||
|
return getInputEntries();
|
||
|
}
|
||
|
}
|