Auto Format code
This commit is contained in:
parent
112b1657cf
commit
796df6c055
503 changed files with 12260 additions and 16291 deletions
|
@ -1,65 +1,49 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecipeWrapper {
|
||||
protected final T baseRecipe;
|
||||
@Nonnull
|
||||
private final List<List<ItemStack>> inputs;
|
||||
|
||||
public BaseRecipeWrapper(T baseRecipe)
|
||||
{
|
||||
public BaseRecipeWrapper(T baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
|
||||
inputs = new ArrayList<>();
|
||||
for (ItemStack input : baseRecipe.getInputs())
|
||||
{
|
||||
if (baseRecipe.useOreDic())
|
||||
{
|
||||
for (ItemStack input : baseRecipe.getInputs()) {
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(input);
|
||||
inputs.add(oreDictInputs);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
inputs.add(Collections.singletonList(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ItemStack> expandOreDict(ItemStack itemStack)
|
||||
{
|
||||
private static List<ItemStack> expandOreDict(ItemStack itemStack) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(itemStack);
|
||||
if (oreIds.length == 0)
|
||||
{
|
||||
if (oreIds.length == 0) {
|
||||
return Collections.singletonList(itemStack);
|
||||
}
|
||||
|
||||
Set<ItemStack> itemStackSet = new HashSet<>();
|
||||
for (int oreId : oreIds)
|
||||
{
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||
for (ItemStack ore : ores)
|
||||
{
|
||||
if (ore.stackSize != itemStack.stackSize)
|
||||
{
|
||||
for (ItemStack ore : ores) {
|
||||
if (ore.stackSize != itemStack.stackSize) {
|
||||
ItemStack oreCopy = ore.copy();
|
||||
oreCopy.stackSize = itemStack.stackSize;
|
||||
itemStackSet.add(oreCopy);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
itemStackSet.add(ore);
|
||||
}
|
||||
}
|
||||
|
@ -68,23 +52,22 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
ingredients.setOutputs(ItemStack.class, baseRecipe.getOutputs());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<List<ItemStack>> getInputs()
|
||||
{
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
public class RecipeCategoryUids
|
||||
{
|
||||
public class RecipeCategoryUids {
|
||||
public static final String ALLOY_SMELTER = "TechReborn.AlloySmelter";
|
||||
public static final String ASSEMBLING_MACHINE = "TechReborn.AssemblingMachine";
|
||||
public static final String BLAST_FURNACE = "TechReborn.BlastFurnace";
|
||||
|
@ -17,7 +16,7 @@ public class RecipeCategoryUids
|
|||
public static final String EXTRACTOR = "TechReborn.Extractor";
|
||||
public static final String COMPRESSOR = "TechReborn.Compressor";
|
||||
public static final String SCRAPBOX = "TechReborn.Scrapbox";
|
||||
private RecipeCategoryUids()
|
||||
{
|
||||
|
||||
private RecipeCategoryUids() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import java.awt.*;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
|
@ -17,17 +10,22 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class RecipeUtil
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeUtil {
|
||||
private static final int color = Color.darkGray.getRGB();
|
||||
|
||||
private RecipeUtil()
|
||||
{
|
||||
private RecipeUtil() {
|
||||
}
|
||||
|
||||
public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double startCost,
|
||||
final double euPerTick, final int tickTime)
|
||||
{
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double startCost,
|
||||
final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRendererObj = minecraft.fontRendererObj;
|
||||
int lineSpacing = fontRendererObj.FONT_HEIGHT + 1;
|
||||
|
||||
|
@ -40,8 +38,9 @@ public class RecipeUtil
|
|||
drawInfo(minecraft, x, y, euPerTick, tickTime);
|
||||
}
|
||||
|
||||
public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime)
|
||||
{
|
||||
public static void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime) {
|
||||
FontRenderer fontRendererObj = minecraft.fontRendererObj;
|
||||
int lineSpacing = fontRendererObj.FONT_HEIGHT + 1;
|
||||
|
||||
|
@ -50,107 +49,109 @@ public class RecipeUtil
|
|||
y += lineSpacing;
|
||||
|
||||
String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1",
|
||||
tickTime);
|
||||
tickTime);
|
||||
fontRendererObj.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2",
|
||||
seconds);
|
||||
seconds);
|
||||
fontRendererObj.drawString(processingTimeString2, x + 10, y, color);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void setRecipeItems(@Nonnull IRecipeLayout recipeLayout, @Nonnull BaseRecipeWrapper<?> recipe,
|
||||
@Nullable int[] itemInputSlots, @Nullable int[] itemOutputSlots, @Nullable int[] fluidInputSlots,
|
||||
@Nullable int[] fluidOutputSlots)
|
||||
{
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BaseRecipeWrapper<?> recipe,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null)
|
||||
{
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = recipe.getInputs();
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null)
|
||||
{
|
||||
if (itemOutputSlots != null) {
|
||||
List<ItemStack> outputs = recipe.getOutputs();
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null)
|
||||
{
|
||||
if (fluidInputSlots != null) {
|
||||
List<FluidStack> fluidInputs = recipe.getFluidInputs();
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidOutputSlots != null)
|
||||
{
|
||||
if (fluidOutputSlots != null) {
|
||||
List<FluidStack> fluidOutputs = recipe.getFluidOutputs();
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
int outputTank = fluidOutputSlots[i];
|
||||
guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setRecipeItems(@Nonnull IRecipeLayout recipeLayout, @Nonnull IIngredients ingredients,
|
||||
@Nullable int[] itemInputSlots, @Nullable int[] itemOutputSlots, @Nullable int[] fluidInputSlots,
|
||||
@Nullable int[] fluidOutputSlots)
|
||||
{
|
||||
public static void setRecipeItems(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IIngredients ingredients,
|
||||
@Nullable
|
||||
int[] itemInputSlots,
|
||||
@Nullable
|
||||
int[] itemOutputSlots,
|
||||
@Nullable
|
||||
int[] fluidInputSlots,
|
||||
@Nullable
|
||||
int[] fluidOutputSlots) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
if (itemInputSlots != null)
|
||||
{
|
||||
if (itemInputSlots != null) {
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null)
|
||||
{
|
||||
if (itemOutputSlots != null) {
|
||||
List<ItemStack> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null)
|
||||
{
|
||||
if (fluidInputSlots != null) {
|
||||
List<List<FluidStack>> fluidInputs = ingredients.getInputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidOutputSlots != null)
|
||||
{
|
||||
if (fluidOutputSlots != null) {
|
||||
List<FluidStack> fluidOutputs = ingredients.getOutputs(FluidStack.class);
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++)
|
||||
{
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
int outputTank = fluidOutputSlots[i];
|
||||
guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
}
|
||||
|
|
|
@ -58,32 +58,31 @@ import javax.annotation.Nonnull;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@mezz.jei.api.JEIPlugin public class TechRebornJeiPlugin extends BlankModPlugin
|
||||
{
|
||||
private static void addDebugRecipes(IModRegistry registry)
|
||||
{
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin extends BlankModPlugin {
|
||||
private static void addDebugRecipes(IModRegistry registry) {
|
||||
ItemStack diamondBlock = new ItemStack(Blocks.DIAMOND_BLOCK);
|
||||
ItemStack dirtBlock = new ItemStack(Blocks.DIRT);
|
||||
List<Object> debugRecipes = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock,
|
||||
dirtBlock, time, 120);
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(assemblingMachineRecipe);
|
||||
}
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock,
|
||||
dirtBlock, time, 120);
|
||||
dirtBlock, time, 120);
|
||||
debugRecipes.add(recipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes);
|
||||
}
|
||||
|
||||
@Override public void register(@Nonnull IModRegistry registry)
|
||||
{
|
||||
@Override
|
||||
public void register(
|
||||
@Nonnull
|
||||
IModRegistry registry) {
|
||||
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
|
@ -121,56 +120,51 @@ import java.util.List;
|
|||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidOil));
|
||||
|
||||
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper),
|
||||
new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper),
|
||||
new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper),
|
||||
new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper),
|
||||
new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper),
|
||||
new VacuumFreezerRecipeCategory(guiHelper), new GrinderRecipeCategory(guiHelper),
|
||||
new ExtractorRecipeCategory(guiHelper), new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper));
|
||||
new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper),
|
||||
new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper),
|
||||
new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper),
|
||||
new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper),
|
||||
new VacuumFreezerRecipeCategory(guiHelper), new GrinderRecipeCategory(guiHelper),
|
||||
new ExtractorRecipeCategory(guiHelper), new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper));
|
||||
|
||||
registry.addRecipeHandlers(new AlloySmelterRecipeHandler(jeiHelpers),
|
||||
new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers),
|
||||
new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers),
|
||||
new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers),
|
||||
new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers),
|
||||
new RollingMachineRecipeHandler(),
|
||||
new VacuumFreezerRecipeHandler(jeiHelpers), new GrinderRecipeHandler(jeiHelpers),
|
||||
new ExtractorRecipeHandler(jeiHelpers), new CompressorRecipeHandler(jeiHelpers),
|
||||
new ScrapboxRecipeHandler(jeiHelpers));
|
||||
new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers),
|
||||
new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers),
|
||||
new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers),
|
||||
new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers),
|
||||
new RollingMachineRecipeHandler(),
|
||||
new VacuumFreezerRecipeHandler(jeiHelpers), new GrinderRecipeHandler(jeiHelpers),
|
||||
new ExtractorRecipeHandler(jeiHelpers), new CompressorRecipeHandler(jeiHelpers),
|
||||
new ScrapboxRecipeHandler(jeiHelpers));
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList);
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers));
|
||||
} catch (RuntimeException e)
|
||||
{
|
||||
} catch (RuntimeException e) {
|
||||
Core.logHelper
|
||||
.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mezz.jei.config.Config.isDebugModeEnabled())
|
||||
{
|
||||
if (mezz.jei.config.Config.isDebugModeEnabled()) {
|
||||
addDebugRecipes(registry);
|
||||
}
|
||||
|
||||
registry.addDescription(ItemParts.getPartByName("rubberSap"),
|
||||
I18n.translateToLocal("techreborn.desc.rubberSap"));
|
||||
if (!ConfigTechReborn.ScrapboxDispenser)
|
||||
{
|
||||
I18n.translateToLocal("techreborn.desc.rubberSap"));
|
||||
if (!ConfigTechReborn.ScrapboxDispenser) {
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox),
|
||||
I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else
|
||||
{
|
||||
I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
registry.addDescription(new ItemStack(ModItems.scrapBox),
|
||||
I18n.translateToLocal("techreborn.desc.scrapBox"));
|
||||
I18n.translateToLocal("techreborn.desc.scrapBox"));
|
||||
}
|
||||
|
||||
registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeClickArea(GuiBlastFurnace.class, 63, 36, 24, 15, RecipeCategoryUids.BLAST_FURNACE);
|
||||
|
@ -182,82 +176,82 @@ import java.util.List;
|
|||
registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeClickArea(GuiIndustrialGrinder.class, 50, 35, 25, 16, RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15,
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14,
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeClickArea(GuiRollingMachine.class, 89, 32, 26, 25, RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeClickArea(GuiVacuumFreezer.class, 78, 36, 24, 16, RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.addRecipeClickArea(GuiGrinder.class, 78, 36, 24, 16, RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeClickArea(GuiExtractor.class, 78, 36, 24, 16, RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeClickArea(GuiCompressor.class, 78, 36, 24, 16, RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING,
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
VanillaRecipeCategoryUid.FUEL);
|
||||
registry.addRecipeClickArea(GuiElectricFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Compressor), RecipeCategoryUids.COMPRESSOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AlloyFurnace), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AlloySmelter), RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.AssemblyMachine),
|
||||
RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
RecipeCategoryUids.ASSEMBLING_MACHINE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.BlastFurnace), RecipeCategoryUids.BLAST_FURNACE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.centrifuge), RecipeCategoryUids.CENTRIFUGE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ChemicalReactor),
|
||||
RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
RecipeCategoryUids.CHEMICAL_REACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Extractor), RecipeCategoryUids.EXTRACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.FusionControlComputer),
|
||||
RecipeCategoryUids.FUSION_REACTOR);
|
||||
RecipeCategoryUids.FUSION_REACTOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.Grinder), RecipeCategoryUids.GRINDER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ImplosionCompressor),
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
RecipeCategoryUids.IMPLOSION_COMPRESSOR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IndustrialElectrolyzer),
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IndustrialGrinder),
|
||||
RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
RecipeCategoryUids.INDUSTRIAL_GRINDER);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.RollingMachine),
|
||||
RecipeCategoryUids.ROLLING_MACHINE);
|
||||
RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.scrapBox), RecipeCategoryUids.SCRAPBOX);
|
||||
|
||||
IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 4, 36);
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 8, 36);
|
||||
.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 8, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, 1, 4, 36);
|
||||
.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, 1, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerAssemblingMachine.class, RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2,
|
||||
8, 36);
|
||||
.addRecipeTransferHandler(ContainerAssemblingMachine.class, RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2,
|
||||
8, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, 0, 2, 4, 36);
|
||||
.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, 0, 2, 4, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, 11, 36);
|
||||
.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, 11, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerChemicalReactor.class, RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8,
|
||||
36);
|
||||
.addRecipeTransferHandler(ContainerChemicalReactor.class, RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8,
|
||||
36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, 0, 2, 3, 36);
|
||||
.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, 0, 2, 3, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerIndustrialGrinder.class, RecipeCategoryUids.GRINDER, 0, 2, 6, 36);
|
||||
.addRecipeTransferHandler(ContainerIndustrialGrinder.class, RecipeCategoryUids.GRINDER, 0, 2, 6, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerImplosionCompressor.class, RecipeCategoryUids.IMPLOSION_COMPRESSOR,
|
||||
0, 2, 4, 36);
|
||||
.addRecipeTransferHandler(ContainerImplosionCompressor.class, RecipeCategoryUids.IMPLOSION_COMPRESSOR,
|
||||
0, 2, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialElectrolyzer.class,
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36);
|
||||
RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerRollingMachine.class, RecipeCategoryUids.ROLLING_MACHINE, 0, 9, 11,
|
||||
36);
|
||||
.addRecipeTransferHandler(ContainerRollingMachine.class, RecipeCategoryUids.ROLLING_MACHINE, 0, 9, 11,
|
||||
36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, 0, 1, 2, 36);
|
||||
.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 1, 2, 36);
|
||||
.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerExtractor.class, RecipeCategoryUids.EXTRACTOR, 0, 1, 2, 36);
|
||||
.addRecipeTransferHandler(ContainerExtractor.class, RecipeCategoryUids.EXTRACTOR, 0, 1, 2, 36);
|
||||
recipeTransferRegistry
|
||||
.addRecipeTransferHandler(ContainerCompressor.class, RecipeCategoryUids.COMPRESSOR, 0, 1, 2, 36);
|
||||
.addRecipeTransferHandler(ContainerCompressor.class, RecipeCategoryUids.COMPRESSOR, 0, 1, 2, 36);
|
||||
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.pump));
|
||||
|
||||
if(CompatManager.isQuantumStorageLoaded){
|
||||
if (CompatManager.isQuantumStorageLoaded) {
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumChest));
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.quantumTank));
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class AlloySmelterRecipeCategory extends BlankRecipeCategory<AlloySmelterRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeCategory extends BlankRecipeCategory<AlloySmelterRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
|
@ -26,45 +20,45 @@ public class AlloySmelterRecipeCategory extends BlankRecipeCategory<AlloySmelter
|
|||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
public AlloySmelterRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public AlloySmelterRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiAlloySmelter.texture, 46, 16, 91, 54);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
true);
|
||||
title = I18n.translateToLocal("techreborn.jei.category.alloy.furnace");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AlloySmelterRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AlloySmelterRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
|
@ -74,8 +68,13 @@ public class AlloySmelterRecipeCategory extends BlankRecipeCategory<AlloySmelter
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AlloySmelterRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AlloySmelterRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class AlloySmelterRecipeHandler implements IRecipeHandler<AlloySmelterRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeHandler implements IRecipeHandler<AlloySmelterRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public AlloySmelterRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public AlloySmelterRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlloySmelterRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<AlloySmelterRecipe> getRecipeClass() {
|
||||
return AlloySmelterRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlloySmelterRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return new AlloySmelterRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
AlloySmelterRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,35 +9,36 @@ import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
|||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe>
|
||||
{
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
|
||||
private final IDrawableAnimated arrow;
|
||||
|
||||
public AlloySmelterRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AlloySmelterRecipe baseRecipe)
|
||||
{
|
||||
public AlloySmelterRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
AlloySmelterRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17);
|
||||
this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
arrow.draw(minecraft, 33, 19);
|
||||
|
||||
|
||||
int x = recipeWidth / 2;
|
||||
int y = recipeHeight - recipeHeight / 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + (baseRecipe.tickTime / 20) + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + (baseRecipe.tickTime / 20) + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class AssemblingMachineRecipeCategory extends BlankRecipeCategory<AssemblingMachineRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeCategory extends BlankRecipeCategory<AssemblingMachineRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
|
@ -26,45 +20,45 @@ public class AssemblingMachineRecipeCategory extends BlankRecipeCategory<Assembl
|
|||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
public AssemblingMachineRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiAssemblingMachine.texture, 46, 16, 91, 54);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
true);
|
||||
title = I18n.translateToLocal("tile.techreborn.assemblingmachine.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AssemblingMachineRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AssemblingMachineRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
|
@ -74,8 +68,13 @@ public class AssemblingMachineRecipeCategory extends BlankRecipeCategory<Assembl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AssemblingMachineRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
AssemblingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class AssemblingMachineRecipeHandler implements IRecipeHandler<AssemblingMachineRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeHandler implements IRecipeHandler<AssemblingMachineRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public AssemblingMachineRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public AssemblingMachineRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AssemblingMachineRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<AssemblingMachineRecipe> getRecipeClass() {
|
||||
return AssemblingMachineRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AssemblingMachineRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return new AssemblingMachineRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,22 +9,27 @@ import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
|||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe)
|
||||
{
|
||||
public AssemblingMachineRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
AssemblingMachineRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 14, 20, 18);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 40, 18);
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class BlastFurnaceRecipeCategory extends BlankRecipeCategory<BlastFurnaceRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeCategory extends BlankRecipeCategory<BlastFurnaceRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public BlastFurnaceRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public BlastFurnaceRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiBlastFurnace.texture, 39, 24, 90, 60);
|
||||
title = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull BlastFurnaceRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18);
|
||||
|
@ -62,8 +59,13 @@ public class BlastFurnaceRecipeCategory extends BlankRecipeCategory<BlastFurnace
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull BlastFurnaceRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class BlastFurnaceRecipeHandler implements IRecipeHandler<BlastFurnaceRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeHandler implements IRecipeHandler<BlastFurnaceRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public BlastFurnaceRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public BlastFurnaceRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<BlastFurnaceRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<BlastFurnaceRecipe> getRecipeClass() {
|
||||
return BlastFurnaceRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull BlastFurnaceRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return new BlastFurnaceRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,24 +9,27 @@ import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
|||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe>
|
||||
{
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public BlastFurnaceRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull BlastFurnaceRecipe baseRecipe)
|
||||
{
|
||||
public BlastFurnaceRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
BlastFurnaceRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiBlastFurnace.texture, 176, 14, 20, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 54 - 29, 13);
|
||||
|
||||
|
@ -36,8 +37,8 @@ public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRec
|
|||
int y = (int) (recipeHeight - recipeHeight / 2.2F);
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Heat capacity: " + baseRecipe.neededHeat, x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Heat capacity: " + baseRecipe.neededHeat, x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class CentrifugeRecipeCategory extends BlankRecipeCategory<CentrifugeRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeCategory extends BlankRecipeCategory<CentrifugeRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CentrifugeRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public CentrifugeRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiCentrifuge.texture, 49, 4, 78, 78);
|
||||
title = I18n.translateToLocal("tile.techreborn.centrifuge.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull CentrifugeRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CentrifugeRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0);
|
||||
|
@ -65,8 +62,13 @@ public class CentrifugeRecipeCategory extends BlankRecipeCategory<CentrifugeReci
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull CentrifugeRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CentrifugeRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class CentrifugeRecipeHandler implements IRecipeHandler<CentrifugeRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeHandler implements IRecipeHandler<CentrifugeRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public CentrifugeRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public CentrifugeRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CentrifugeRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<CentrifugeRecipe> getRecipeClass() {
|
||||
return CentrifugeRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull CentrifugeRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return new CentrifugeRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
CentrifugeRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,15 +9,19 @@ import techreborn.api.recipe.machines.CentrifugeRecipe;
|
|||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
|
||||
private final IDrawableAnimated progressUp;
|
||||
private final IDrawableAnimated progressLeft;
|
||||
private final IDrawableAnimated progressDown;
|
||||
private final IDrawableAnimated progressRight;
|
||||
|
||||
public CentrifugeRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CentrifugeRecipe baseRecipe)
|
||||
{
|
||||
public CentrifugeRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CentrifugeRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressUpStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 14, 12, 12);
|
||||
|
@ -28,20 +30,21 @@ public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe>
|
|||
IDrawableStatic progressRightStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 50, 12, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
// a bit
|
||||
// a bit
|
||||
this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progressUp.draw(minecraft, 33, 18);
|
||||
progressLeft.draw(minecraft, 18, 33);
|
||||
|
@ -52,8 +55,8 @@ public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe>
|
|||
int y = 60;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ChemicalReactorRecipeCategory extends BlankRecipeCategory<ChemicalReactorRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeCategory extends BlankRecipeCategory<ChemicalReactorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ChemicalReactorRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public ChemicalReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiChemicalReactor.texture, 69, 20, 38, 48);
|
||||
title = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ChemicalReactorRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0);
|
||||
|
@ -62,8 +59,13 @@ public class ChemicalReactorRecipeCategory extends BlankRecipeCategory<ChemicalR
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ChemicalReactorRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class ChemicalReactorRecipeHandler implements IRecipeHandler<ChemicalReactorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeHandler implements IRecipeHandler<ChemicalReactorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ChemicalReactorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public ChemicalReactorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ChemicalReactorRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<ChemicalReactorRecipe> getRecipeClass() {
|
||||
return ChemicalReactorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ChemicalReactorRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return new ChemicalReactorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,24 +11,27 @@ import techreborn.compat.jei.BaseRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe>
|
||||
{
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ChemicalReactorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ChemicalReactorRecipe baseRecipe)
|
||||
{
|
||||
public ChemicalReactorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ChemicalReactorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiChemicalReactor.texture, 176, 14, 32, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
IDrawableAnimated.StartDirection.TOP, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 3, 18);
|
||||
|
||||
|
@ -36,7 +39,7 @@ public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReac
|
|||
int y = (int) (recipeHeight - recipeHeight / 3F);
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.compressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class CompressorRecipeCategory extends BlankRecipeCategory<CompressorRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeCategory extends BlankRecipeCategory<CompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public CompressorRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public CompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull CompressorRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CompressorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
@ -61,8 +58,13 @@ public class CompressorRecipeCategory extends BlankRecipeCategory<CompressorReci
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull CompressorRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
CompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.compressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class CompressorRecipeHandler implements IRecipeHandler<CompressorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeHandler implements IRecipeHandler<CompressorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public CompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public CompressorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CompressorRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<CompressorRecipe> getRecipeClass() {
|
||||
return CompressorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull CompressorRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return RecipeCategoryUids.COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CompressorRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return new CompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CompressorRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
CompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,24 +11,27 @@ import techreborn.compat.jei.BaseRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe>
|
||||
{
|
||||
public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public CompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CompressorRecipe baseRecipe)
|
||||
{
|
||||
public CompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
CompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
|
@ -36,7 +39,7 @@ public class CompressorRecipeWrapper extends BaseRecipeWrapper<CompressorRecipe>
|
|||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiExtractor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ExtractorRecipeCategory extends BlankRecipeCategory<ExtractorRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeCategory extends BlankRecipeCategory<ExtractorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ExtractorRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public ExtractorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiExtractor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.extractor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ExtractorRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ExtractorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
@ -61,8 +58,13 @@ public class ExtractorRecipeCategory extends BlankRecipeCategory<ExtractorRecipe
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ExtractorRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ExtractorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class ExtractorRecipeHandler implements IRecipeHandler<ExtractorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeHandler implements IRecipeHandler<ExtractorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ExtractorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public ExtractorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ExtractorRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<ExtractorRecipe> getRecipeClass() {
|
||||
return ExtractorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ExtractorRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return RecipeCategoryUids.EXTRACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ExtractorRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return new ExtractorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ExtractorRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ExtractorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.extractor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,24 +9,29 @@ import techreborn.api.recipe.machines.ExtractorRecipe;
|
|||
import techreborn.client.gui.GuiExtractor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ExtractorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ExtractorRecipe baseRecipe)
|
||||
{
|
||||
public ExtractorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ExtractorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiExtractor.texture, 176, 17, 22, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
|
@ -36,7 +39,7 @@ public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe>
|
|||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class FusionReactorRecipeCategory extends BlankRecipeCategory<FusionReactorRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeCategory extends BlankRecipeCategory<FusionReactorRecipeWrapper> {
|
||||
|
||||
private static final int inputSlotTop = 0;
|
||||
private static final int inputSlotBottom = 1;
|
||||
|
@ -26,36 +24,35 @@ public class FusionReactorRecipeCategory extends BlankRecipeCategory<FusionReact
|
|||
@Nonnull
|
||||
private final String title;
|
||||
|
||||
public FusionReactorRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public FusionReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20);
|
||||
title = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull FusionReactorRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
FusionReactorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
|
@ -67,8 +64,13 @@ public class FusionReactorRecipeCategory extends BlankRecipeCategory<FusionReact
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull FusionReactorRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
FusionReactorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
|
|
|
@ -1,45 +1,46 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorRecipe> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<FusionReactorRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<FusionReactorRecipe> getRecipeClass() {
|
||||
return FusionReactorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull FusionReactorRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull FusionReactorRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return new FusionReactorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull FusionReactorRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
FusionReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -13,50 +7,51 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class FusionReactorRecipeWrapper extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
||||
private final FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe)
|
||||
{
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
ingredients.setOutputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
|
||||
ingredients.setInput(ItemStack.class, baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
public List<ItemStack> getInputs() {
|
||||
return Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
public List<ItemStack> getOutputs() {
|
||||
return Collections.singletonList(baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
public ItemStack getTopInput()
|
||||
{
|
||||
public ItemStack getTopInput() {
|
||||
return baseRecipe.getTopInput();
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput()
|
||||
{
|
||||
public ItemStack getBottomInput() {
|
||||
return baseRecipe.getBottomInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||
{
|
||||
public void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(),
|
||||
baseRecipe.getTickTime());
|
||||
baseRecipe.getTickTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public GrinderRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public GrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiGrinder.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull GrinderRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
GrinderRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
@ -61,8 +58,13 @@ public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrap
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull GrinderRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
GrinderRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class GrinderRecipeHandler implements IRecipeHandler<GrinderRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeHandler implements IRecipeHandler<GrinderRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public GrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public GrinderRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<GrinderRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<GrinderRecipe> getRecipeClass() {
|
||||
return GrinderRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull GrinderRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull GrinderRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return new GrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull GrinderRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
GrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,24 +11,27 @@ import techreborn.compat.jei.BaseRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe>
|
||||
{
|
||||
public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public GrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull GrinderRecipe baseRecipe)
|
||||
{
|
||||
public GrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
GrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiGrinder.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
|
||||
|
@ -36,7 +39,7 @@ public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe>
|
|||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<ImplosionCompressorRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<ImplosionCompressorRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3 };
|
||||
|
||||
|
@ -26,45 +20,45 @@ public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<Implo
|
|||
private final IDrawable electricity;
|
||||
private final String title;
|
||||
|
||||
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiImplosionCompressor.texture, 16, 25, 116, 36);
|
||||
IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 0, 14, 14);
|
||||
electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
|
||||
true);
|
||||
true);
|
||||
title = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 0, 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ImplosionCompressorRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
|
||||
|
@ -76,8 +70,13 @@ public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory<Implo
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ImplosionCompressorRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class ImplosionCompressorRecipeHandler implements IRecipeHandler<ImplosionCompressorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeHandler implements IRecipeHandler<ImplosionCompressorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ImplosionCompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public ImplosionCompressorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ImplosionCompressorRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<ImplosionCompressorRecipe> getRecipeClass() {
|
||||
return ImplosionCompressorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ImplosionCompressorRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ImplosionCompressorRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ImplosionCompressorRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.init.ModRecipes;
|
||||
|
||||
public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<ImplosionCompressorRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<ImplosionCompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ImplosionCompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers,
|
||||
@Nonnull ImplosionCompressorRecipe baseRecipe)
|
||||
{
|
||||
public ImplosionCompressorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ImplosionCompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 14, 21, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 13);
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<Implosio
|
|||
int y = 4;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory<IndustrialElectrolyzerRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory<IndustrialElectrolyzerRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 49, 18, 78, 50);
|
||||
title = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IndustrialElectrolyzerRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32);
|
||||
|
@ -64,8 +61,13 @@ public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory<In
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IndustrialElectrolyzerRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeHandler implements IRecipeHandler<IndustrialElectrolyzerRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeHandler implements IRecipeHandler<IndustrialElectrolyzerRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialElectrolyzerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public IndustrialElectrolyzerRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialElectrolyzerRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<IndustrialElectrolyzerRecipe> getRecipeClass() {
|
||||
return IndustrialElectrolyzerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull IndustrialElectrolyzerRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialElectrolyzerRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialElectrolyzerRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,23 +9,27 @@ import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
|||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialElectrolyzerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers,
|
||||
@Nonnull IndustrialElectrolyzerRecipe baseRecipe)
|
||||
{
|
||||
public IndustrialElectrolyzerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialElectrolyzerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 176, 14, 30, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(),
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 24, 20);
|
||||
|
||||
|
@ -35,7 +37,7 @@ public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<Indus
|
|||
int y = 30;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
|
@ -9,7 +7,6 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
|||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
|
@ -17,20 +14,20 @@ import techreborn.compat.jei.RecipeCategoryUids;
|
|||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory<IndustrialGrinderRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory<IndustrialGrinderRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawable blankArea; // for covering the lightning power
|
||||
// symbol
|
||||
// symbol
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 86, 12, 47);
|
||||
|
@ -39,34 +36,35 @@ public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory<Industr
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(@Nonnull Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 129, 49);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IndustrialGrinderRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
@ -83,8 +81,13 @@ public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory<Industr
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IndustrialGrinderRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class IndustrialGrinderRecipeHandler implements IRecipeHandler<IndustrialGrinderRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialGrinderRecipeHandler implements IRecipeHandler<IndustrialGrinderRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialGrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public IndustrialGrinderRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialGrinderRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<IndustrialGrinderRecipe> getRecipeClass() {
|
||||
return IndustrialGrinderRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull IndustrialGrinderRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return RecipeCategoryUids.INDUSTRIAL_GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialGrinderRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialGrinderRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package techreborn.compat.jei.industrialGrinder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -15,37 +10,41 @@ import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
|||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialGrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialGrinderRecipe baseRecipe)
|
||||
{
|
||||
public IndustrialGrinderRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
IndustrialGrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 14, 24, 17);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
if (baseRecipe.fluidStack != null)
|
||||
{
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
|
||||
|
@ -53,7 +52,7 @@ public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<Industrial
|
|||
int y = 40;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
|
||||
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,18 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.*;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class RollingMachineRecipeCategory extends BlankRecipeCategory<RollingMachineRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeCategory extends BlankRecipeCategory<RollingMachineRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
private static final int[] OUTPUT_SLOTS = { 10 };
|
||||
|
||||
|
@ -28,8 +21,7 @@ public class RollingMachineRecipeCategory extends BlankRecipeCategory<RollingMac
|
|||
private final ICraftingGridHelper craftingGridHelper;
|
||||
private final String title;
|
||||
|
||||
public RollingMachineRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public RollingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiRollingMachine.texture, 29, 16, 116, 54);
|
||||
title = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
|
||||
|
@ -41,39 +33,38 @@ public class RollingMachineRecipeCategory extends BlankRecipeCategory<RollingMac
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft) {
|
||||
progress.draw(minecraft, 62, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RollingMachineRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
for (int l = 0; l < 3; l++)
|
||||
{
|
||||
for (int k1 = 0; k1 < 3; k1++)
|
||||
{
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
int i = k1 + l * 3;
|
||||
guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18);
|
||||
}
|
||||
|
@ -86,13 +77,16 @@ public class RollingMachineRecipeCategory extends BlankRecipeCategory<RollingMac
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RollingMachineRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
for (int l = 0; l < 3; l++)
|
||||
{
|
||||
for (int k1 = 0; k1 < 3; k1++)
|
||||
{
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
int i = k1 + l * 3;
|
||||
guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18);
|
||||
}
|
||||
|
|
|
@ -1,43 +1,44 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class RollingMachineRecipeHandler implements IRecipeHandler<RollingMachineRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class RollingMachineRecipeHandler implements IRecipeHandler<RollingMachineRecipeWrapper> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RollingMachineRecipeWrapper> getRecipeClass()
|
||||
{
|
||||
public Class<RollingMachineRecipeWrapper> getRecipeClass() {
|
||||
return RollingMachineRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull RollingMachineRecipeWrapper recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
RollingMachineRecipeWrapper recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,25 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
public class RollingMachineRecipeMaker
|
||||
{
|
||||
private RollingMachineRecipeMaker()
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public static List<Object> getRecipes(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList())
|
||||
{
|
||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe);
|
||||
if (recipeWrapper != null)
|
||||
{
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -20,38 +15,33 @@ import net.minecraft.item.crafting.ShapedRecipes;
|
|||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper {
|
||||
private final ICraftingRecipeWrapper baseRecipe;
|
||||
|
||||
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe)
|
||||
{
|
||||
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(@Nonnull IJeiHelpers jeiHelpers, IRecipe baseRecipe)
|
||||
{
|
||||
public static RollingMachineRecipeWrapper create(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers, IRecipe baseRecipe) {
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
ICraftingRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes)
|
||||
{
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipesWrapper(guiHelper, (ShapelessRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes)
|
||||
{
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe)
|
||||
{
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe)
|
||||
{
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessOreRecipeWrapper(guiHelper, (ShapelessOreRecipe) baseRecipe);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -59,22 +49,21 @@ public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(@Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
baseRecipe.getIngredients(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List getInputs()
|
||||
{
|
||||
public List getInputs() {
|
||||
return baseRecipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ScrapboxRecipeCategory extends BlankRecipeCategory<ScrapboxRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeCategory extends BlankRecipeCategory<ScrapboxRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public ScrapboxRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public ScrapboxRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("jei.techreborn.scrapbox.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ScrapboxRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ScrapboxRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
@ -61,8 +58,13 @@ public class ScrapboxRecipeCategory extends BlankRecipeCategory<ScrapboxRecipeWr
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull ScrapboxRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
ScrapboxRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.ScrapboxRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class ScrapboxRecipeHandler implements IRecipeHandler<ScrapboxRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeHandler implements IRecipeHandler<ScrapboxRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ScrapboxRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public ScrapboxRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ScrapboxRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<ScrapboxRecipe> getRecipeClass() {
|
||||
return ScrapboxRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ScrapboxRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return RecipeCategoryUids.SCRAPBOX;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ScrapboxRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return new ScrapboxRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ScrapboxRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
ScrapboxRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.scrapbox;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,24 +9,29 @@ import techreborn.api.recipe.ScrapboxRecipe;
|
|||
import techreborn.client.gui.GuiCompressor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe)
|
||||
{
|
||||
public ScrapboxRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
ScrapboxRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
}
|
||||
|
|
|
@ -1,57 +1,54 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class VacuumFreezerRecipeCategory extends BlankRecipeCategory<VacuumFreezerRecipeWrapper>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeCategory extends BlankRecipeCategory<VacuumFreezerRecipeWrapper> {
|
||||
private static final int[] INPUT_SLOTS = { 0 };
|
||||
private static final int[] OUTPUT_SLOTS = { 1 };
|
||||
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public VacuumFreezerRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiVacuumFreezer.texture, 55, 30, 82, 26);
|
||||
title = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull VacuumFreezerRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
@ -61,8 +58,13 @@ public class VacuumFreezerRecipeCategory extends BlankRecipeCategory<VacuumFreez
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull VacuumFreezerRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(
|
||||
@Nonnull
|
||||
IRecipeLayout recipeLayout,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipeWrapper recipeWrapper,
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
|
|
|
@ -1,53 +1,55 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class VacuumFreezerRecipeHandler implements IRecipeHandler<VacuumFreezerRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeHandler implements IRecipeHandler<VacuumFreezerRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public VacuumFreezerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers)
|
||||
{
|
||||
public VacuumFreezerRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<VacuumFreezerRecipe> getRecipeClass()
|
||||
{
|
||||
public Class<VacuumFreezerRecipe> getRecipeClass() {
|
||||
return VacuumFreezerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull VacuumFreezerRecipe recipe) {
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull VacuumFreezerRecipe recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return new VacuumFreezerRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull VacuumFreezerRecipe recipe)
|
||||
{
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
@ -11,24 +9,29 @@ import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
|||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public VacuumFreezerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull VacuumFreezerRecipe baseRecipe)
|
||||
{
|
||||
public VacuumFreezerRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
VacuumFreezerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiVacuumFreezer.texture, 176, 14, 20, 11);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
public void drawAnimations(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue