Merge branch '1.8.9' of https://github.com/TechReborn/TechReborn into 1.8.9
This commit is contained in:
commit
7e12e3acbf
67 changed files with 2149 additions and 300 deletions
|
@ -104,13 +104,13 @@ dependencies {
|
|||
compile "slimeknights:TConstruct:1.8.8-2.0.1.jenkins11:deobf"
|
||||
// compile "mods.natura:natura:1.7.10-107.779621d:deobf"
|
||||
compile "slimeknights.mantle:Mantle:1.8.8-0.6.jenkins60:deobf"
|
||||
// compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.8.9-3.0.0.1551:deobf"
|
||||
compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.8.9-3.0.0.1552:deobf"
|
||||
//compile 'Azanor:Thaumcraft:5.0.3:deobf@jar'
|
||||
compile "com.github.azanor:baubles:1.1.2.0:deobf@jar"
|
||||
compile name: "CraftTweaker", version: "1.8.8-3.0.0", classifier: "Dev"
|
||||
// shade 'IC2-Classic-API-STANDALONE:IC2-Classic-API-STANDALONE:1.1.0.19-5:api'
|
||||
compile 'RebornCore:RebornCore-1.8.9:1.2.2.+:dev'
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.13.0.52"
|
||||
compile 'RebornCore:RebornCore-1.8.9:1.3.0.+:dev'
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.13.2.54"
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
|
|
@ -358,18 +358,6 @@ public abstract class BlockMachineBase extends BaseTileBlock implements IBlockTe
|
|||
return "techreborn:blocks/machine/machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
boolean active = false;
|
||||
int facingInt = meta;
|
||||
if(facingInt > 3){
|
||||
active = true;
|
||||
facingInt = facingInt - 3;
|
||||
}
|
||||
EnumFacing facing = getSideFromint(facingInt);
|
||||
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int facingInt = getSideFromEnum(state.getValue(FACING));
|
||||
|
@ -379,7 +367,14 @@ public abstract class BlockMachineBase extends BaseTileBlock implements IBlockTe
|
|||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
boolean active = false;
|
||||
int facingInt = meta;
|
||||
if(facingInt > 3){
|
||||
active = true;
|
||||
facingInt = facingInt - 3;
|
||||
}
|
||||
EnumFacing facing = getSideFromint(facingInt);
|
||||
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
|
||||
}
|
||||
|
||||
public boolean isActive(IBlockState state){
|
||||
|
|
|
@ -39,7 +39,7 @@ public class BlockMachineCasing extends BlockMultiblockBase implements IBlockTex
|
|||
public PropertyInteger METADATA;
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,4 @@ public class BlockMachineCasing extends BlockMultiblockBase implements IBlockTex
|
|||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,14 +67,9 @@ public class BlockMachineFrame extends BaseBlock implements IBlockTextureProvide
|
|||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(METADATA);
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
protected BlockState createBlockState() {
|
||||
|
@ -85,6 +80,6 @@ public class BlockMachineFrame extends BaseBlock implements IBlockTextureProvide
|
|||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ public class BlockOre extends BaseBlock implements IBlockTextureProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
|
@ -189,8 +189,4 @@ public class BlockOre extends BaseBlock implements IBlockTextureProvider {
|
|||
return new BlockState(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,11 +132,6 @@ public class BlockPlayerDetector extends BaseTileBlock implements IBlockTextureP
|
|||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(METADATA);
|
||||
|
@ -150,6 +145,6 @@ public class BlockPlayerDetector extends BaseTileBlock implements IBlockTextureP
|
|||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class BlockStorage extends BaseBlock implements IBlockTextureProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
|
@ -93,8 +93,4 @@ public class BlockStorage extends BaseBlock implements IBlockTextureProvider {
|
|||
return new BlockState(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class BlockStorage2 extends BaseBlock implements IBlockTextureProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMetaValue(int meta) {
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,4 @@ public class BlockStorage2 extends BaseBlock implements IBlockTextureProvider {
|
|||
return new BlockState(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getStateFromMetaValue(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileAlloySmelter;
|
|||
|
||||
public class GuiAlloySmelter extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/electric_alloy_furnace.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/electric_alloy_furnace.png");
|
||||
|
||||
TileAlloySmelter alloysmelter;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileAssemblingMachine;
|
|||
|
||||
public class GuiAssemblingMachine extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/assembling_machine.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/assembling_machine.png");
|
||||
|
||||
TileAssemblingMachine assemblingmachine;
|
||||
ContainerAssemblingMachine containerAssemblingMachine;
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.IOException;
|
|||
|
||||
public class GuiBlastFurnace extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png");
|
||||
|
||||
TileBlastFurnace blastfurnace;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileCentrifuge;
|
|||
|
||||
public class GuiCentrifuge extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_centrifuge.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_centrifuge.png");
|
||||
|
||||
TileCentrifuge centrifuge;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileChemicalReactor;
|
|||
|
||||
public class GuiChemicalReactor extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chemical_reactor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chemical_reactor.png");
|
||||
|
||||
TileChemicalReactor chemicalReactor;
|
||||
ContainerChemicalReactor containerChemicalReactor;
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileGrinder;
|
|||
|
||||
public class GuiGrinder extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
|
||||
|
||||
TileGrinder grinder;
|
||||
ContainerGrinder containerGrinder;
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileImplosionCompressor;
|
|||
|
||||
public class GuiImplosionCompressor extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/implosion_compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/implosion_compressor.png");
|
||||
|
||||
TileImplosionCompressor compresser;
|
||||
ContainerImplosionCompressor containerImplosionCompressor;
|
||||
|
|
|
@ -10,7 +10,7 @@ import techreborn.tiles.TileIndustrialElectrolyzer;
|
|||
|
||||
public class GuiIndustrialElectrolyzer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_electrolyzer.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
TileIndustrialElectrolyzer eletrolyzer;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import techreborn.tiles.TileIndustrialSawmill;
|
|||
|
||||
public class GuiIndustrialSawmill extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
public static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/industrial_sawmill.png");
|
||||
|
||||
TileIndustrialSawmill sawmill;
|
||||
|
|
|
@ -11,7 +11,7 @@ import techreborn.tiles.TileRollingMachine;
|
|||
|
||||
public class GuiRollingMachine extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
public static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/rolling_machine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
ContainerRollingMachine containerRollingMachine;
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.io.IOException;
|
|||
|
||||
public class GuiVacuumFreezer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
|
||||
|
||||
TileVacuumFreezer crafter;
|
||||
ContainerVacuumFreezer containerVacuumFreezer;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package techreborn.compat;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import techreborn.compat.jei.JEIPlugin;
|
||||
import techreborn.compat.minetweaker.MinetweakerCompat;
|
||||
import techreborn.compat.recipes.RecipesBiomesOPlenty;
|
||||
import techreborn.compat.recipes.RecipesStandalone;
|
||||
import techreborn.compat.waila.CompatModuleWaila;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
@ -32,11 +32,10 @@ public class CompatManager {
|
|||
if (Loader.isModLoaded("gregtech")) {
|
||||
isGregTechLoaded = true;
|
||||
}
|
||||
registerCompact(JEIPlugin.class, "JEI");
|
||||
registerCompact(CompatModuleWaila.class, "Waila");
|
||||
registerCompact(RecipesStandalone.class);
|
||||
registerCompact(MinetweakerCompat.class, "MineTweaker3");
|
||||
// registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
|
||||
registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
|
||||
}
|
||||
|
||||
public void registerCompact(Class<?> moduleClass, Object... objs) {
|
||||
|
|
61
src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java
Normal file
61
src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java
Normal file
|
@ -0,0 +1,61 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecipeWrapper {
|
||||
protected final T baseRecipe;
|
||||
private final List<List<ItemStack>> inputs;
|
||||
|
||||
public BaseRecipeWrapper(T baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
|
||||
inputs = new ArrayList<>();
|
||||
for (ItemStack input : baseRecipe.getInputs()) {
|
||||
if (baseRecipe.useOreDic()) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(input);
|
||||
if (oreIds.length > 0) {
|
||||
Set<ItemStack> itemStackSet = new HashSet<>();
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||
itemStackSet.addAll(ores);
|
||||
}
|
||||
inputs.add(new ArrayList<>(itemStackSet));
|
||||
} else {
|
||||
inputs.add(Collections.singletonList(input));
|
||||
}
|
||||
} else {
|
||||
inputs.add(Collections.singletonList(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<ItemStack>> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
// TODO: make right location for each recipe
|
||||
// RecipeUtil.drawInfo(minecraft, 0, 0, baseRecipe.euPerTick(), baseRecipe.tickTime());
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
public class JEIPlugin implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
19
src/main/java/techreborn/compat/jei/RecipeCategoryUids.java
Normal file
19
src/main/java/techreborn/compat/jei/RecipeCategoryUids.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
public class RecipeCategoryUids {
|
||||
private 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";
|
||||
public static final String CENTRIFUGE = "TechReborn.Centrifuge";
|
||||
public static final String CHEMICAL_REACTOR = "TechReborn.ChemicalReactor";
|
||||
public static final String FUSION_REACTOR = "TechReborn.FusionReactor";
|
||||
public static final String GRINDER = "TechReborn.Grinder";
|
||||
public static final String IMPLOSION_COMPRESSOR = "TechReborn.ImplosionCompressor";
|
||||
public static final String INDUSTRIAL_ELECTROLYZER = "TechReborn.IndustrialElectrolyzer";
|
||||
public static final String INDUSTRIAL_SAWMILL = "TechReborn.IndustrialSawmill";
|
||||
public static final String ROLLING_MACHINE = "TechReborn.RollingMachine";
|
||||
public static final String VACUUM_FREEZER = "TechReborn.VacuumFreezer";
|
||||
}
|
92
src/main/java/techreborn/compat/jei/RecipeUtil.java
Normal file
92
src/main/java/techreborn/compat/jei/RecipeUtil.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Color;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
|
||||
public class RecipeUtil {
|
||||
private static final int color = Color.darkGray.getRGB();
|
||||
|
||||
private RecipeUtil() {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
NumberFormat formatter = NumberFormat.getInstance();
|
||||
String startCostEU = formatter.format(startCost);
|
||||
String startCostString = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
fontRendererObj.drawString(startCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
drawInfo(minecraft, x, y, euPerTick, 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;
|
||||
|
||||
String runningCostString = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.running.cost", euPerTick);
|
||||
fontRendererObj.drawString(runningCostString, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
String processingTimeString1 = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", tickTime);
|
||||
fontRendererObj.drawString(processingTimeString1, x, y, color);
|
||||
y += lineSpacing;
|
||||
|
||||
int seconds = tickTime / 20;
|
||||
String processingTimeString2 = StatCollector.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", seconds);
|
||||
fontRendererObj.drawString(processingTimeString2, x + 10, y, color);
|
||||
}
|
||||
|
||||
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) {
|
||||
List<List<ItemStack>> inputs = recipe.getInputs();
|
||||
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
|
||||
int inputSlot = itemInputSlots[i];
|
||||
guiItemStacks.set(inputSlot, inputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (itemOutputSlots != null) {
|
||||
List<ItemStack> outputs = recipe.getOutputs();
|
||||
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
|
||||
int outputSlot = itemOutputSlots[i];
|
||||
guiItemStacks.set(outputSlot, outputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidInputSlots != null) {
|
||||
List<FluidStack> fluidInputs = recipe.getFluidInputs();
|
||||
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
|
||||
int inputTank = fluidInputSlots[i];
|
||||
guiFluidStacks.set(inputTank, fluidInputs.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (fluidOutputSlots != null) {
|
||||
List<FluidStack> fluidOutputs = recipe.getFluidOutputs();
|
||||
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
|
||||
int outputTank = fluidOutputSlots[i];
|
||||
guiFluidStacks.set(outputTank, fluidOutputs.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
165
src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java
Normal file
165
src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java
Normal file
|
@ -0,0 +1,165 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IItemRegistry;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipeRegistry;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.container.ContainerAlloyFurnace;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerChemicalReactor;
|
||||
import techreborn.client.container.ContainerFusionReactor;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.client.container.ContainerIndustrialElectrolyzer;
|
||||
import techreborn.client.container.ContainerIndustrialSawmill;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.client.container.ContainerVacuumFreezer;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory;
|
||||
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeHandler;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.assemblingMachine.AssemblingMachineRecipeHandler;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeCategory;
|
||||
import techreborn.compat.jei.blastFurnace.BlastFurnaceRecipeHandler;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeCategory;
|
||||
import techreborn.compat.jei.centrifuge.CentrifugeRecipeHandler;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeCategory;
|
||||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeHandler;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeHandler;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeCategory;
|
||||
import techreborn.compat.jei.grinder.GrinderRecipeHandler;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeCategory;
|
||||
import techreborn.compat.jei.implosionCompressor.ImplosionCompressorRecipeHandler;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeCategory;
|
||||
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeHandler;
|
||||
import techreborn.compat.jei.industrialSawmill.IndustrialSawmillRecipeCategory;
|
||||
import techreborn.compat.jei.industrialSawmill.IndustrialSawmillRecipeHandler;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeHandler;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeHandler;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin implements IModPlugin {
|
||||
public static IJeiHelpers jeiHelpers;
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
|
||||
TechRebornJeiPlugin.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
|
||||
registry.addRecipeCategories(
|
||||
new AlloySmelterRecipeCategory(guiHelper),
|
||||
new AssemblingMachineRecipeCategory(guiHelper),
|
||||
new BlastFurnaceRecipeCategory(guiHelper),
|
||||
new CentrifugeRecipeCategory(guiHelper),
|
||||
new ChemicalReactorRecipeCategory(guiHelper),
|
||||
new FusionReactorRecipeCategory(guiHelper),
|
||||
new GrinderRecipeCategory(guiHelper),
|
||||
new ImplosionCompressorRecipeCategory(guiHelper),
|
||||
new IndustrialElectrolyzerRecipeCategory(guiHelper),
|
||||
new IndustrialSawmillRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper),
|
||||
new VacuumFreezerRecipeCategory(guiHelper)
|
||||
);
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new AlloySmelterRecipeHandler(),
|
||||
new AssemblingMachineRecipeHandler(),
|
||||
new BlastFurnaceRecipeHandler(),
|
||||
new CentrifugeRecipeHandler(),
|
||||
new ChemicalReactorRecipeHandler(),
|
||||
new FusionReactorRecipeHandler(),
|
||||
new GrinderRecipeHandler(),
|
||||
new ImplosionCompressorRecipeHandler(),
|
||||
new IndustrialElectrolyzerRecipeHandler(),
|
||||
new IndustrialSawmillRecipeHandler(),
|
||||
new RollingMachineRecipeHandler(),
|
||||
new VacuumFreezerRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList);
|
||||
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes);
|
||||
|
||||
try {
|
||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes());
|
||||
} catch (RuntimeException e) {
|
||||
Core.logHelper.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mezz.jei.config.Config.isDebugModeEnabled()) {
|
||||
addDebugRecipes(registry);
|
||||
}
|
||||
|
||||
IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 8, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, 1, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerAssemblingMachine.class, RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2, 8, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, 0, 2, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, 11, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerChemicalReactor.class, RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, 0, 2, 3, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 2, 6, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerImplosionCompressor.class, RecipeCategoryUids.IMPLOSION_COMPRESSOR, 0, 2, 4, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialElectrolyzer.class, RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialSawmill.class, RecipeCategoryUids.INDUSTRIAL_SAWMILL, 0, 2, 5, 36);
|
||||
recipeTransferRegistry.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, 0, 1, 2, 36);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {
|
||||
|
||||
}
|
||||
|
||||
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++) {
|
||||
int time = (int) Math.round(200 + Math.random() * 100);
|
||||
AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock, dirtBlock, time, 120);
|
||||
debugRecipes.add(assemblingMachineRecipe);
|
||||
}
|
||||
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);
|
||||
debugRecipes.add(recipe);
|
||||
}
|
||||
registry.addRecipes(debugRecipes);
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.*;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeHandler;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornPlugin implements IModPlugin {
|
||||
@Override
|
||||
public boolean isModLoaded() {
|
||||
return Loader.isModLoaded(ModInfo.MOD_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
registry.addRecipeCategories(
|
||||
new FusionReactorRecipeCategory()
|
||||
);
|
||||
registry.addRecipeHandlers(
|
||||
new FusionReactorRecipeHandler()
|
||||
);
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
recipes.addAll(FusionReactorRecipeHelper.reactorRecipes);
|
||||
registry.addRecipes(recipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class AlloySmelterRecipeCategory implements IRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2};
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
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);
|
||||
title = StatCollector.translateToLocal("techreborn.jei.category.alloy.furnace");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
if (recipeWrapper instanceof AlloySmelterRecipeWrapper) {
|
||||
AlloySmelterRecipeWrapper recipe = (AlloySmelterRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlloySmelterRecipe> getRecipeClass() {
|
||||
return AlloySmelterRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ALLOY_SMELTER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe) {
|
||||
return new AlloySmelterRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package techreborn.compat.jei.alloySmelter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
|
||||
private final IDrawableAnimated arrow;
|
||||
|
||||
public AlloySmelterRecipeWrapper(AlloySmelterRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17);
|
||||
this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
arrow.draw(minecraft, 33, 19);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class AssemblingMachineRecipeCategory implements IRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2};
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated electricity;
|
||||
private final String title;
|
||||
|
||||
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);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.assemblingmachine.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 10, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);
|
||||
|
||||
if (recipeWrapper instanceof AssemblingMachineRecipeWrapper) {
|
||||
AssemblingMachineRecipeWrapper recipe = (AssemblingMachineRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AssemblingMachineRecipe> getRecipeClass() {
|
||||
return AssemblingMachineRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ASSEMBLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe) {
|
||||
return new AssemblingMachineRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package techreborn.compat.jei.assemblingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper<AssemblingMachineRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public AssemblingMachineRecipeWrapper(AssemblingMachineRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 14, 20, 18);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 40, 18);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class BlastFurnaceRecipeCategory implements IRecipeCategory {
|
||||
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) {
|
||||
background = guiHelper.createDrawable(GuiBlastFurnace.texture, 39, 24, 100, 36);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.blastfurnace.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 10);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 78, 10);
|
||||
|
||||
if (recipeWrapper instanceof BlastFurnaceRecipeWrapper) {
|
||||
BlastFurnaceRecipeWrapper recipe = (BlastFurnaceRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<BlastFurnaceRecipe> getRecipeClass() {
|
||||
return BlastFurnaceRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.BLAST_FURNACE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe) {
|
||||
return new BlastFurnaceRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package techreborn.compat.jei.blastFurnace;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper<BlastFurnaceRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public BlastFurnaceRecipeWrapper(BlastFurnaceRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiBlastFurnace.texture, 176, 14, 20, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 54-29, 13);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class CentrifugeRecipeCategory implements IRecipeCategory {
|
||||
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) {
|
||||
background = guiHelper.createDrawable(GuiCentrifuge.texture, 49, 4, 78, 78);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.centrifuge.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 30, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 60, 30);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 30, 60);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 0, 30);
|
||||
|
||||
if (recipeWrapper instanceof CentrifugeRecipeWrapper) {
|
||||
CentrifugeRecipeWrapper recipe = (CentrifugeRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CentrifugeRecipe> getRecipeClass() {
|
||||
return CentrifugeRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CENTRIFUGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe) {
|
||||
return new CentrifugeRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package techreborn.compat.jei.centrifuge;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class CentrifugeRecipeWrapper extends BaseRecipeWrapper<CentrifugeRecipe> {
|
||||
private final IDrawableAnimated progressUp;
|
||||
private final IDrawableAnimated progressLeft;
|
||||
private final IDrawableAnimated progressDown;
|
||||
private final IDrawableAnimated progressRight;
|
||||
|
||||
public CentrifugeRecipeWrapper(CentrifugeRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressUpStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 14, 12, 12);
|
||||
IDrawableStatic progressLeftStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 26, 12, 12);
|
||||
IDrawableStatic progressDownStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 38, 12, 12);
|
||||
IDrawableStatic progressRightStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 50, 12, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation a bit
|
||||
this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle, IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false);
|
||||
this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle, IDrawableAnimated.StartDirection.TOP, false);
|
||||
this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
progressDown.draw(minecraft, 33, 48);
|
||||
progressRight.draw(minecraft, 48, 33);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ChemicalReactorRecipeCategory implements IRecipeCategory {
|
||||
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) {
|
||||
background = guiHelper.createDrawable(GuiChemicalReactor.texture, 69, 20, 38, 48);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.chemicalreactor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 10, 30);
|
||||
|
||||
if (recipeWrapper instanceof ChemicalReactorRecipeWrapper) {
|
||||
ChemicalReactorRecipeWrapper recipe = (ChemicalReactorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class ChemicalReactorRecipeHandler implements IRecipeHandler<ChemicalReactorRecipe> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ChemicalReactorRecipe> getRecipeClass() {
|
||||
return ChemicalReactorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.CHEMICAL_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe) {
|
||||
return new ChemicalReactorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package techreborn.compat.jei.chemicalReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReactorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ChemicalReactorRecipeWrapper(ChemicalReactorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 3, 18);
|
||||
}
|
||||
}
|
|
@ -1,39 +1,45 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.JEIManager;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class FusionReactorRecipeCategory implements IRecipeCategory {
|
||||
|
||||
private static final int inputSlot1 = 0;
|
||||
private static final int inputSlot2 = 1;
|
||||
private static final int inputSlotTop = 0;
|
||||
private static final int inputSlotBottom = 1;
|
||||
private static final int outputSlot = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
@Nonnull
|
||||
private final String title;
|
||||
|
||||
public FusionReactorRecipeCategory() {
|
||||
background = JEIManager.guiHelper.createDrawable(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20);
|
||||
public FusionReactorRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return "FusionReactor";
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Fusion Reactor";
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -54,14 +60,16 @@ public class FusionReactorRecipeCategory implements IRecipeCategory {
|
|||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
recipeLayout.getItemStacks().init(inputSlot1, true, 21, 0);
|
||||
recipeLayout.getItemStacks().init(inputSlot2, true, 21, 36);
|
||||
recipeLayout.getItemStacks().init(outputSlot, false, 80, 18);
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(inputSlotTop, true, 21, 0);
|
||||
itemStacks.init(inputSlotBottom, true, 21, 36);
|
||||
itemStacks.init(outputSlot, false, 81, 18);
|
||||
|
||||
if (recipeWrapper instanceof FusionReactorRecipeWrapper) {
|
||||
recipeLayout.getItemStacks().set(inputSlot1, (ItemStack) recipeWrapper.getInputs().get(0));
|
||||
recipeLayout.getItemStacks().set(inputSlot2, (ItemStack) recipeWrapper.getInputs().get(1));
|
||||
recipeLayout.getItemStacks().set(outputSlot, recipeWrapper.getOutputs());
|
||||
FusionReactorRecipeWrapper fusionRecipe = (FusionReactorRecipeWrapper) recipeWrapper;
|
||||
itemStacks.set(inputSlotTop, fusionRecipe.getTopInput());
|
||||
itemStacks.set(inputSlotBottom, fusionRecipe.getBottomInput());
|
||||
itemStacks.set(outputSlot, fusionRecipe.getOutputs());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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 javax.annotation.Nonnull;
|
||||
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorRecipe> {
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class FusionReactorRecipeHandler implements IRecipeHandler<FusionReactorR
|
|||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return "FusionReactor";
|
||||
return RecipeCategoryUids.FUSION_REACTOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
|
|
@ -1,71 +1,44 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FusionReactorRecipeWrapper implements IRecipeWrapper {
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
FusionReactorRecipe baseRecipe;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
||||
private FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
List<ItemStack> inputs = new ArrayList<>();
|
||||
inputs.add(baseRecipe.getTopInput());
|
||||
inputs.add(baseRecipe.getBottomInput());
|
||||
return inputs;
|
||||
public List<ItemStack> getInputs() {
|
||||
return Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return Collections.emptyList();
|
||||
public List<ItemStack> getOutputs() {
|
||||
return Collections.singletonList(baseRecipe.getOutput());
|
||||
}
|
||||
|
||||
public ItemStack getTopInput() {
|
||||
return baseRecipe.getTopInput();
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput() {
|
||||
return baseRecipe.getBottomInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
List<ItemStack> outputs = new ArrayList<>();
|
||||
outputs.add(baseRecipe.getOutput());
|
||||
return outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
FontRenderer fontRendererObj = minecraft.fontRendererObj;
|
||||
// fontRendererObj.drawString(baseRecipe.getEuTick() + "", 69 - fontRendererObj.getStringWidth(baseRecipe.getEuTick() + "") / 2, 0, Color.gray.getRGB());
|
||||
|
||||
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
|
||||
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
|
||||
symbols.setGroupingSeparator('.');
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
fontRendererObj.drawStringWithShadow("Start: " + formatter.format(baseRecipe.getStartEU()) + "EU", 0, 70, -1);
|
||||
fontRendererObj.drawStringWithShadow("EU/t: " + baseRecipe.getEuTick(), 0, 80, -1);
|
||||
fontRendererObj.drawStringWithShadow("Ticks to process: " + baseRecipe.getTickTime(), 0, 90, -1);
|
||||
fontRendererObj.drawStringWithShadow("Time to process: " + baseRecipe.getTickTime() / 20 + " seconds", 0, 100, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.TileGrinder;
|
||||
|
||||
public class GrinderRecipeCategory implements IRecipeCategory {
|
||||
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
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public GrinderRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiGrinder.texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(GuiGrinder.texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(GuiGrinder.texture, 176, 86, 12, 47);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.grinder.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 129, 49);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 87, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 105, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 123, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileGrinder.TANK_CAPACITY, tankOverlay);
|
||||
|
||||
if (recipeWrapper instanceof GrinderRecipeWrapper) {
|
||||
GrinderRecipeWrapper recipe = (GrinderRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class GrinderRecipeHandler implements IRecipeHandler<GrinderRecipe> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<GrinderRecipe> getRecipeClass() {
|
||||
return GrinderRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.GRINDER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull GrinderRecipe recipe) {
|
||||
return new GrinderRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull GrinderRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package techreborn.compat.jei.grinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class GrinderRecipeWrapper extends BaseRecipeWrapper<GrinderRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public GrinderRecipeWrapper(GrinderRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiGrinder.texture, 176, 14, 24, 17);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class ImplosionCompressorRecipeCategory implements IRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2, 3};
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawable electricity;
|
||||
private final String title;
|
||||
|
||||
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);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.implosioncompressor.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
electricity.draw(minecraft, 0, 12);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 9);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 9);
|
||||
|
||||
if (recipeWrapper instanceof ImplosionCompressorRecipeWrapper) {
|
||||
ImplosionCompressorRecipeWrapper recipe = (ImplosionCompressorRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ImplosionCompressorRecipe> getRecipeClass() {
|
||||
return ImplosionCompressorRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.IMPLOSION_COMPRESSOR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ImplosionCompressorRecipe recipe) {
|
||||
return new ImplosionCompressorRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ImplosionCompressorRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package techreborn.compat.jei.implosionCompressor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper<ImplosionCompressorRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public ImplosionCompressorRecipeWrapper(ImplosionCompressorRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 14, 21, 11);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 44, 13);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeCategory implements IRecipeCategory {
|
||||
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) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 49, 18, 78, 50);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 0, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 20, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 40, 0);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 60, 0);
|
||||
|
||||
if (recipeWrapper instanceof IndustrialElectrolyzerRecipeWrapper) {
|
||||
IndustrialElectrolyzerRecipeWrapper recipe = (IndustrialElectrolyzerRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialElectrolyzerRecipe> getRecipeClass() {
|
||||
return IndustrialElectrolyzerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialElectrolyzerRecipe recipe) {
|
||||
return new IndustrialElectrolyzerRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialElectrolyzerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package techreborn.compat.jei.industrialElectrolyzer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper<IndustrialElectrolyzerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialElectrolyzerRecipeWrapper(IndustrialElectrolyzerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 176, 14, 30, 10);
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.BOTTOM, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 24, 20);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
|
||||
public class IndustrialSawmillRecipeCategory implements IRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1};
|
||||
private static final int[] OUTPUT_SLOTS = {2, 3, 4};
|
||||
private static final int[] INPUT_TANKS = {0};
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawable blankArea; // for covering the lightning power symbol
|
||||
private final IDrawable tankOverlay;
|
||||
private final String title;
|
||||
|
||||
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 7, 15, 141, 55);
|
||||
blankArea = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 50, 45, 6, 6);
|
||||
tankOverlay = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 83, 12, 47);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
blankArea.draw(minecraft, 31, 51);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, tankOverlay);
|
||||
|
||||
if (recipeWrapper instanceof IndustrialSawmillRecipeWrapper) {
|
||||
IndustrialSawmillRecipeWrapper recipe = (IndustrialSawmillRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialSawmillRecipe> getRecipeClass() {
|
||||
return IndustrialSawmillRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialSawmillRecipe recipe) {
|
||||
return new IndustrialSawmillRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull IndustrialSawmillRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public IndustrialSawmillRecipeWrapper(IndustrialSawmillRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 14, 20, 12);
|
||||
|
||||
int ticksPerCycle = baseRecipe.tickTime();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
if (baseRecipe.fluidStack != null) {
|
||||
return Collections.singletonList(baseRecipe.fluidStack);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 49, 23);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
public class RollingMachineRecipeCategory implements IRecipeCategory {
|
||||
private static final int[] INPUT_SLOTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
private static final int[] OUTPUT_SLOTS = {10};
|
||||
|
||||
private final IDrawable background;
|
||||
private final IDrawableAnimated progress;
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
private final String title;
|
||||
|
||||
public RollingMachineRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(GuiRollingMachine.texture, 29, 16, 116, 54);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRollingMachine.texture, 176, 14, 20, 18);
|
||||
progress = guiHelper.createAnimatedDrawable(progressStatic, 250, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
|
||||
craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOTS[0], OUTPUT_SLOTS[0]);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
progress.draw(minecraft, 62, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18);
|
||||
|
||||
if (recipeWrapper instanceof RollingMachineRecipeWrapper) {
|
||||
RollingMachineRecipeWrapper recipe = (RollingMachineRecipeWrapper) recipeWrapper;
|
||||
craftingGridHelper.setInput(guiItemStacks, recipe.getInputs());
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RollingMachineRecipeWrapper> getRecipeClass() {
|
||||
return RollingMachineRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.ROLLING_MACHINE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
|
||||
public class RollingMachineRecipeMaker {
|
||||
private RollingMachineRecipeMaker() {
|
||||
|
||||
}
|
||||
|
||||
public static List<Object> getRecipes() {
|
||||
List<Object> recipes = new ArrayList<>();
|
||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
|
||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(recipe);
|
||||
if (recipeWrapper != null) {
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package techreborn.compat.jei.rollingMachine;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessOreRecipeWrapper;
|
||||
import mezz.jei.plugins.vanilla.crafting.ShapelessRecipesWrapper;
|
||||
|
||||
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper {
|
||||
private final ICraftingRecipeWrapper baseRecipe;
|
||||
|
||||
@Nullable
|
||||
public static RollingMachineRecipeWrapper create(IRecipe baseRecipe) {
|
||||
ICraftingRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipesWrapper((ShapelessRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessOreRecipeWrapper((ShapelessOreRecipe) baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RollingMachineRecipeWrapper(recipeWrapper);
|
||||
}
|
||||
|
||||
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) {
|
||||
this.baseRecipe = baseRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return baseRecipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return baseRecipe.getOutputs();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
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.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
|
||||
public class VacuumFreezerRecipeCategory implements IRecipeCategory {
|
||||
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) {
|
||||
background = guiHelper.createDrawable(GuiVacuumFreezer.texture, 55, 30, 82, 26);
|
||||
title = StatCollector.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
||||
|
||||
if (recipeWrapper instanceof VacuumFreezerRecipeWrapper) {
|
||||
VacuumFreezerRecipeWrapper recipe = (VacuumFreezerRecipeWrapper) recipeWrapper;
|
||||
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
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> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<VacuumFreezerRecipe> getRecipeClass() {
|
||||
return VacuumFreezerRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeCategoryUids.VACUUM_FREEZER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull VacuumFreezerRecipe recipe) {
|
||||
return new VacuumFreezerRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull VacuumFreezerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package techreborn.compat.jei.vacuumFreezer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||
|
||||
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
public VacuumFreezerRecipeWrapper(VacuumFreezerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = TechRebornJeiPlugin.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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
|
||||
progress.draw(minecraft, 25, 7);
|
||||
}
|
||||
}
|
|
@ -1,82 +1,82 @@
|
|||
//package techreborn.compat.recipes;
|
||||
//
|
||||
//
|
||||
//import biomesoplenty.api.block.BOPBlocks;
|
||||
//import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
//import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
//import net.minecraft.init.Items;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//import net.minecraftforge.fluids.FluidRegistry;
|
||||
//import net.minecraftforge.fluids.FluidStack;
|
||||
//import net.minecraftforge.oredict.OreDictionary;
|
||||
//import techreborn.api.recipe.RecipeHandler;
|
||||
//import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
//import techreborn.compat.ICompatModule;
|
||||
//import techreborn.config.ConfigTechReborn;
|
||||
//
|
||||
//public class RecipesBiomesOPlenty implements ICompatModule {
|
||||
// @Override
|
||||
// public void preInit(FMLPreInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void init(FMLInitializationEvent event) {
|
||||
// if (ConfigTechReborn.AllowBOPRecipes) {
|
||||
// ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
//
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, null, 200, 30, false));
|
||||
// RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void postInit(FMLPostInitializationEvent event) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void serverStarting(FMLServerStartingEvent event) {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
package techreborn.compat.recipes;
|
||||
|
||||
|
||||
import biomesoplenty.api.block.BOPBlocks;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
public class RecipesBiomesOPlenty implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
if (ConfigTechReborn.AllowBOPRecipes) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_0, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 6), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_1, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 7), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 8), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_2, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 9), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 11), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 12), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 13), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPBlocks.log_3, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPBlocks.planks_0, 6, 14), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,10 +24,11 @@ import techreborn.lib.Reference;
|
|||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
||||
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory {
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
||||
public Tank tank = new Tank("TileGrinder", 16000, this);
|
||||
public Tank tank = new Tank("TileGrinder", TANK_CAPACITY, this);
|
||||
public RecipeCrafter crafter;
|
||||
public int connectionStatus;
|
||||
|
||||
|
|
|
@ -24,10 +24,11 @@ import techreborn.lib.Reference;
|
|||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider {
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(5, "TileIndustrialSawmill", 64, this);
|
||||
public Tank tank = new Tank("TileSawmill", 16000, this);
|
||||
public Tank tank = new Tank("TileSawmill", TANK_CAPACITY, this);
|
||||
public RecipeCrafter crafter;
|
||||
|
||||
public TileIndustrialSawmill() {
|
||||
|
|
|
@ -901,3 +901,11 @@ achievement.TechReborn:ore_Pickup=New ore!
|
|||
achievement.TechReborn:ore_Pickup.desc=Mine a techreborn ore
|
||||
achievement.TechReborn:centrifuge_Craft=Time to spin
|
||||
achievement.TechReborn:thermalgen_Craft=Time to heat
|
||||
|
||||
# JEI Integration
|
||||
techreborn.jei.recipe.start.cost=Start: %sEU
|
||||
techreborn.jei.recipe.running.cost=EU/t: %s
|
||||
techreborn.jei.recipe.processing.time.1=Time: %s ticks
|
||||
techreborn.jei.recipe.processing.time.2=(%s seconds)
|
||||
|
||||
techreborn.jei.category.alloy.furnace=Alloy Furnace
|
||||
|
|
Loading…
Reference in a new issue