Updated API reference for recipes.
This commit is contained in:
parent
4a369d0ee7
commit
111ee7630a
60 changed files with 76 additions and 156 deletions
|
@ -28,14 +28,11 @@ import net.minecraft.init.SoundEvents;
|
|||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
/**
|
||||
* This contains some static stuff used in recipes and other things
|
||||
*/
|
||||
//TODO move this out of the api, and make it nicer
|
||||
@SuppressWarnings("deprecation")
|
||||
public class Reference {
|
||||
|
||||
private static final Class<?>[] ARMOR_PARAMETERS = { String.class, int.class, int[].class, int.class, SoundEvent.class, float.class };
|
||||
|
@ -55,22 +52,20 @@ public class Reference {
|
|||
public static ToolMaterial SAPPHIRE = EnumHelper.addToolMaterial("SAPPHIRE", 2, 620, 5.0F, 2F, 8);
|
||||
public static ToolMaterial PERIDOT = EnumHelper.addToolMaterial("PERIDOT", 2, 400, 7.0F, 2.4F, 16);
|
||||
|
||||
public static String alloySmelterRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter");
|
||||
public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine");
|
||||
public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace");
|
||||
public static String centrifugeRecipe = I18n.translateToLocal("techreborn.recipe.centrifuge");
|
||||
public static String chemicalReactorRecipe = I18n.translateToLocal("techreborn.recipe.chemicalReactor");
|
||||
public static String industrialGrinderRecipe = I18n.translateToLocal("techreborn.recipe.grinder");
|
||||
public static String implosionCompressorRecipe = I18n.translateToLocal("techreborn.recipe.implosioncompressor");
|
||||
public static String industrialElectrolyzerRecipe = I18n.translateToLocal("techreborn.recipe.industrialelectrolyzer");
|
||||
public static String industrialSawmillRecipe = I18n.translateToLocal("techreborn.recipe.industrialsawmill");
|
||||
public static String latheRecipe = I18n.translateToLocal("techreborn.recipe.lathe");
|
||||
public static String plateCuttingMachineRecipe = I18n.translateToLocal("techreborn.recipe.platecuttingmachine");
|
||||
public static String vacuumFreezerRecipe = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
||||
public static String grinderRecipe = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
public static String extractorRecipe = I18n.translateToLocal("tile.techreborn.extractor.name");
|
||||
public static String compressorRecipe = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
public static String recyclerRecipe = I18n.translateToLocal("tile.techreborn.recycler.name");
|
||||
public static String scrapboxRecipe = I18n.translateToLocal("techreborn.recipe.scrapbox");
|
||||
public static String distillationTowerRecipe = I18n.translateToLocal("techreborn.recipe.distillationtower");
|
||||
public static String ALLOY_SMELTER_RECIPE = "ALLOY_SMELTER_RECIPE";
|
||||
public static String ASSEMBLING_MACHINE_RECIPE = "ASSEMBLING_MACHINE_RECIPE";
|
||||
public static String BLAST_FURNACE_RECIPE = "BLAST_FURNACE_RECIPE";
|
||||
public static String CENTRIFUGE_RECIPE = "CENTRIFUGE_RECIPE";
|
||||
public static String CHEMICAL_REACTOR_RECIPE = "CHEMICAL_REACTOR_RECIPE";
|
||||
public static String COMPRESSOR_RECIPE = "COMPRESSOR_RECIPE";
|
||||
public static String DISTILLATION_TOWER_RECIPE = "DISTILLATION_TOWER_RECIPE";
|
||||
public static String EXTRACTOR_RECIPE = "EXTRACTOR_RECIPE";
|
||||
public static String GRINDER_RECIPE = "GRINDER_RECIPE";
|
||||
public static String IMPLOSION_COMPRESSOR_RECIPE = "IMPLOSION_COMPRESSOR_RECIPE";
|
||||
public static String INDUSTRIAL_ELECTROLYZER_RECIPE = "INDUSTRIAL_ELECTROLYZER_RECIPE";
|
||||
public static String INDUSTRIAL_GRINDER_RECIPE = "INDUSTRIAL_GRINDER_RECIPE";
|
||||
public static String INDUSTRIAL_SAWMILL_RECIPE = "INDUSTRIAL_SAWMILL_RECIPE";
|
||||
public static String RECYCLER_RECIPE = "RECYCLER_RECIPE";
|
||||
public static String SCRAPBOX_RECIPE = "SCRAPBOX_RECIPE";
|
||||
public static String VACUUM_FREEZER_RECIPE = "VACUUM_FREEZER_RECIPE";
|
||||
}
|
||||
|
|
|
@ -46,12 +46,12 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
|
|||
* @param outputSlots Slot IDs for output
|
||||
*/
|
||||
public ScrapboxRecipeCrafter(TileEntity parentTile, Inventory inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(Reference.scrapboxRecipe, parentTile, 1, 1, inventory, inputSlots, outputSlots);
|
||||
super(Reference.SCRAPBOX_RECIPE, parentTile, 1, 1, inventory, inputSlots, outputSlots);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCurrentRecipe(){
|
||||
List<IBaseRecipeType> scrapboxRecipeList = RecipeHandler.getRecipeClassFromName(Reference.scrapboxRecipe);
|
||||
List<IBaseRecipeType> scrapboxRecipeList = RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE);
|
||||
int random = parentTile.getWorld().rand.nextInt(scrapboxRecipeList.size());
|
||||
// Sets the current recipe then syncs
|
||||
setCurrentRecipe(scrapboxRecipeList.get(random));
|
||||
|
|
|
@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class AlloySmelterRecipe extends BaseRecipe {
|
||||
|
||||
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.alloySmelterRecipe, tickTime, euPerTick);
|
||||
super(Reference.ALLOY_SMELTER_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class AssemblingMachineRecipe extends BaseRecipe {
|
||||
|
||||
public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.assemblingMachineRecipe, tickTime, euPerTick);
|
||||
super(Reference.ASSEMBLING_MACHINE_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -34,7 +34,7 @@ public class BlastFurnaceRecipe extends BaseRecipe {
|
|||
|
||||
public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime,
|
||||
int euPerTick, int neededHeat) {
|
||||
super(Reference.blastFurnaceRecipe, tickTime, euPerTick);
|
||||
super(Reference.BLAST_FURNACE_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -34,7 +34,7 @@ public class CentrifugeRecipe extends BaseRecipe {
|
|||
|
||||
public CentrifugeRecipe(Object input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3,
|
||||
ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.centrifugeRecipe, tickTime, euPerTick);
|
||||
super(Reference.CENTRIFUGE_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class ChemicalReactorRecipe extends BaseRecipe {
|
||||
|
||||
public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.chemicalReactorRecipe, tickTime, euPerTick);
|
||||
super(Reference.CHEMICAL_REACTOR_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class CompressorRecipe extends BaseRecipe {
|
||||
|
||||
public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.compressorRecipe, tickTime, euPerTick);
|
||||
super(Reference.COMPRESSOR_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
|
|
@ -48,7 +48,7 @@ public class DistillationTowerRecipe extends BaseRecipe {
|
|||
*/
|
||||
public DistillationTowerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.distillationTowerRecipe, tickTime, euPerTick);
|
||||
super(Reference.DISTILLATION_TOWER_RECIPE, tickTime, euPerTick);
|
||||
if (inputCells != null)
|
||||
addInput(inputCells);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ExtractorRecipe extends BaseRecipe {
|
|||
boolean useOreDic = true;
|
||||
|
||||
public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.extractorRecipe, tickTime, euPerTick);
|
||||
super(Reference.EXTRACTOR_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
|
|
@ -33,7 +33,7 @@ public class GrinderRecipe extends BaseRecipe {
|
|||
public boolean useOreDict = true;
|
||||
|
||||
public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.grinderRecipe, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
|
||||
super(Reference.GRINDER_RECIPE, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
@ -41,7 +41,7 @@ public class GrinderRecipe extends BaseRecipe {
|
|||
}
|
||||
|
||||
public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick, boolean useOreDict) {
|
||||
super(Reference.grinderRecipe, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
|
||||
super(Reference.GRINDER_RECIPE, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
|
||||
this.useOreDict = useOreDict;
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
|
|
|
@ -32,7 +32,7 @@ public class ImplosionCompressorRecipe extends BaseRecipe {
|
|||
|
||||
public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
int tickTime, int euPerTick) {
|
||||
super(Reference.implosionCompressorRecipe, tickTime, euPerTick);
|
||||
super(Reference.IMPLOSION_COMPRESSOR_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -34,7 +34,7 @@ public class IndustrialElectrolyzerRecipe extends BaseRecipe {
|
|||
|
||||
public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialElectrolyzerRecipe, tickTime, euPerTick);
|
||||
super(Reference.INDUSTRIAL_ELECTROLYZER_RECIPE, tickTime, euPerTick);
|
||||
if (inputCells != null)
|
||||
addInput(inputCells);
|
||||
if (input2 != null)
|
||||
|
|
|
@ -36,7 +36,7 @@ public class IndustrialGrinderRecipe extends BaseRecipe {
|
|||
|
||||
public IndustrialGrinderRecipe(ItemStack input1, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialGrinderRecipe, tickTime, euPerTick);
|
||||
super(Reference.INDUSTRIAL_GRINDER_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
|
|
@ -36,7 +36,7 @@ public class IndustrialSawmillRecipe extends BaseRecipe {
|
|||
|
||||
public IndustrialSawmillRecipe(ItemStack input1, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
super(Reference.INDUSTRIAL_SAWMILL_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
@ -50,7 +50,7 @@ public class IndustrialSawmillRecipe extends BaseRecipe {
|
|||
|
||||
public IndustrialSawmillRecipe(ItemStack input1, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict) {
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
super(Reference.INDUSTRIAL_SAWMILL_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
if (output1 != null)
|
||||
|
|
|
@ -33,7 +33,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class RecyclerRecipe extends BaseRecipe {
|
||||
|
||||
public RecyclerRecipe(ItemStack input) {
|
||||
super(Reference.recyclerRecipe, 0, 0);
|
||||
super(Reference.RECYCLER_RECIPE, 0, 0);
|
||||
addInput(input);
|
||||
addOutput(TechRebornAPI.subItemRetriever.getPartByName("scrap"));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class ScrapboxRecipe extends BaseRecipe {
|
||||
|
||||
public ScrapboxRecipe(ItemStack output, int tickTime, int euPerTick) {
|
||||
super(Reference.scrapboxRecipe, tickTime, euPerTick);
|
||||
super(Reference.SCRAPBOX_RECIPE, tickTime, euPerTick);
|
||||
if (output != null) {
|
||||
addInput(new ItemStack(TechRebornAPI.getItem("SCRAP_BOX")));
|
||||
addOutput(output);
|
||||
|
|
|
@ -31,7 +31,7 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
public class VacuumFreezerRecipe extends BaseRecipe {
|
||||
|
||||
public VacuumFreezerRecipe(ItemStack input, ItemStack output, int tickTime, int euPerTick) {
|
||||
super(Reference.vacuumFreezerRecipe, tickTime, euPerTick);
|
||||
super(Reference.VACUUM_FREEZER_RECIPE, tickTime, euPerTick);
|
||||
if (input != null)
|
||||
addInput(input);
|
||||
if (output != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue