2016-01-05 04:47:35 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("ActuallyAdditionsAPI.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-05 04:47:35 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-05 04:47:35 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2016-01-05 04:47:35 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.api;
|
|
|
|
|
2016-11-01 12:00:49 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
|
2016-01-05 14:57:50 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
2016-11-10 19:50:01 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
2016-12-04 15:03:01 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
|
2016-05-14 13:51:18 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.internal.IMethodHandler;
|
2016-07-30 17:07:32 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.laser.ILaserRelayConnectionHandler;
|
2016-05-15 12:00:42 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
2016-05-14 14:14:06 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.lens.LensConversion;
|
2024-03-02 21:23:08 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.LiquidFuelRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.MiningLensRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.PressingRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensColor;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensDeath;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensDetonation;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensKiller;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensMining;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import net.minecraft.world.item.ItemStack;
|
|
|
|
import net.minecraft.world.item.crafting.Ingredient;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2021-02-27 16:33:00 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public final class ActuallyAdditionsAPI {
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-04-20 21:39:03 +02:00
|
|
|
public static final String MOD_ID = "actuallyadditions";
|
2019-05-02 09:10:29 +02:00
|
|
|
public static final String API_ID = MOD_ID + "api";
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final String API_VERSION = "34";
|
2016-07-20 09:49:19 +02:00
|
|
|
|
2021-10-24 18:49:48 +02:00
|
|
|
public static final List<CrushingRecipe> CRUSHER_RECIPES = new ArrayList<>();
|
2021-10-23 20:17:04 +02:00
|
|
|
public static final List<EmpowererRecipe> EMPOWERER_RECIPES = new ArrayList<>();
|
2022-08-03 23:48:00 +02:00
|
|
|
public static final List<ColorChangeRecipe> COLOR_CHANGE_RECIPES = new ArrayList<>();
|
2021-12-19 18:27:43 +01:00
|
|
|
public static final List<SolidFuelRecipe> SOLID_FUEL_RECIPES = new ArrayList<>();
|
2022-04-02 04:50:39 +02:00
|
|
|
public static final List<LiquidFuelRecipe> LIQUID_FUEL_RECIPES = new ArrayList<>();
|
2022-01-07 00:16:37 +01:00
|
|
|
public static final List<PressingRecipe> PRESSING_RECIPES = new ArrayList<>();
|
2022-01-15 19:38:00 +01:00
|
|
|
public static final List<FermentingRecipe> FERMENTING_RECIPES = new ArrayList<>();
|
2022-01-19 02:11:23 +01:00
|
|
|
public static final List<LaserRecipe> CONVERSION_LASER_RECIPES = new ArrayList<>();
|
2022-08-31 19:07:18 +02:00
|
|
|
public static final List<MiningLensRecipe> MINING_LENS_RECIPES = new ArrayList<>();
|
2022-01-19 02:11:23 +01:00
|
|
|
|
2018-07-07 12:07:22 +02:00
|
|
|
/**
|
|
|
|
* Farmer behaviors are sorted when first accessed, this will not be done until after loading, but do not add behaviors at runtime.
|
|
|
|
*/
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<IFarmerBehavior> FARMER_BEHAVIORS = new ArrayList<>();
|
|
|
|
public static final List<CoffeeIngredient> COFFEE_MACHINE_INGREDIENTS = new ArrayList<>();
|
2021-02-27 22:44:00 +01:00
|
|
|
// public static final List<CompostRecipe> COMPOST_RECIPES = new ArrayList<>();
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<IBookletEntry> BOOKLET_ENTRIES = new ArrayList<>();
|
2016-11-01 12:00:49 +01:00
|
|
|
//This is added to automatically, you don't need to add anything to this list
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<IBookletChapter> ALL_CHAPTERS = new ArrayList<>();
|
2016-11-01 12:00:49 +01:00
|
|
|
//This is added to automatically, you don't need to add anything to this list
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<IBookletPage> BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA = new ArrayList<>();
|
2022-08-31 19:07:18 +02:00
|
|
|
@Deprecated
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<WeightedOre> STONE_ORES = new ArrayList<>();
|
2022-08-31 19:07:18 +02:00
|
|
|
@Deprecated
|
2018-06-23 01:39:30 +02:00
|
|
|
public static final List<WeightedOre> NETHERRACK_ORES = new ArrayList<>();
|
2016-07-30 17:07:32 +02:00
|
|
|
|
2016-06-01 00:39:35 +02:00
|
|
|
/**
|
|
|
|
* Use this to handle things that aren't based in the API itself
|
|
|
|
* DO NOT CHANGE/OVERRIDE THIS!!
|
|
|
|
* This is getting initialized in Actually Additions' PreInit phase
|
|
|
|
*/
|
|
|
|
public static IMethodHandler methodHandler;
|
2016-07-30 17:07:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use this to add, remove or get Laser Relay Connections and Networks
|
|
|
|
* The network system is built in a way that doesn't need the individual
|
|
|
|
* positions to be Laser Relays, it relies only on BlockPos
|
|
|
|
* DO NOT CHANGE/OVERRIDE THIS!!
|
|
|
|
* This is getting initialized in Actually Additions' PreInit phase
|
|
|
|
*/
|
|
|
|
public static ILaserRelayConnectionHandler connectionHandler;
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
//These are getting initialized in Actually Additions' PreInit phase
|
|
|
|
//DO NOT CHANGE/OVERRIDE THESE!!
|
2016-01-05 14:57:50 +01:00
|
|
|
public static IBookletEntry entryGettingStarted;
|
2016-07-20 11:03:56 +02:00
|
|
|
public static IBookletEntry entryReconstruction;
|
2016-11-09 19:26:53 +01:00
|
|
|
public static IBookletEntry entryLaserRelays;
|
2016-01-05 14:57:50 +01:00
|
|
|
public static IBookletEntry entryFunctionalNonRF;
|
|
|
|
public static IBookletEntry entryFunctionalRF;
|
|
|
|
public static IBookletEntry entryGeneratingRF;
|
|
|
|
public static IBookletEntry entryItemsNonRF;
|
|
|
|
public static IBookletEntry entryItemsRF;
|
|
|
|
public static IBookletEntry entryMisc;
|
2016-11-17 18:00:26 +01:00
|
|
|
public static IBookletEntry entryUpdatesAndInfos;
|
2016-11-11 15:21:57 +01:00
|
|
|
//This is added to automatically, you don't need to add anything to this entry
|
2017-02-18 00:54:58 +01:00
|
|
|
public static IBookletEntry entryAllAndSearch;
|
|
|
|
public static IBookletEntry entryTrials;
|
2016-01-05 14:57:50 +01:00
|
|
|
|
2016-05-15 12:00:42 +02:00
|
|
|
//These are getting initialized in Actually Additions' PreInit phase
|
|
|
|
//DO NOT CHANGE/OVERRIDE THESE!!
|
2022-06-24 21:23:43 +02:00
|
|
|
public static final LensConversion lensDefaultConversion = new LensConversion();
|
|
|
|
public static final Lens lensDetonation = new LensDetonation();
|
|
|
|
public static final Lens lensDeath = new LensDeath();
|
|
|
|
public static final Lens lensEvenMoarDeath = new LensKiller();
|
|
|
|
public static final Lens lensColor = new LensColor();
|
|
|
|
public static final Lens lensDisenchanting = new LensDisenchanting();
|
|
|
|
public static final Lens lensMining = new LensMining();
|
2016-05-15 12:00:42 +02:00
|
|
|
|
2016-10-31 19:20:29 +01:00
|
|
|
/**
|
|
|
|
* Adds an ore with a specific weight to the list of ores that the lens of the miner will generate inside of stone.
|
|
|
|
* Higher weight means higher occurence.
|
|
|
|
*
|
|
|
|
* @param oreName The ore's name
|
2016-11-08 20:04:36 +01:00
|
|
|
* @param weight The ore's weight
|
2016-10-31 19:20:29 +01:00
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addMiningLensStoneOre(String oreName, int weight) {
|
2016-10-31 19:20:29 +01:00
|
|
|
STONE_ORES.add(new WeightedOre(oreName, weight));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds an ore with a specific weight to the list of ores that the lens of the miner will generate inside of netherrack.
|
|
|
|
* Higher weight means higher occurence.
|
|
|
|
*
|
|
|
|
* @param oreName The ore's name
|
2016-11-08 20:04:36 +01:00
|
|
|
* @param weight The ore's weight
|
2016-10-31 19:20:29 +01:00
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addMiningLensNetherOre(String oreName, int weight) {
|
2016-10-31 19:20:29 +01:00
|
|
|
NETHERRACK_ORES.add(new WeightedOre(oreName, weight));
|
|
|
|
}
|
|
|
|
|
2016-10-19 15:57:30 +02:00
|
|
|
/**
|
|
|
|
* Adds a Recipe to the Crusher Recipe Registry
|
|
|
|
*
|
|
|
|
* @param input The input as an ItemStack
|
2016-10-30 17:13:46 +01:00
|
|
|
* @param outputOne The first output as an ItemStack
|
2017-11-02 22:49:53 +01:00
|
|
|
* @param outputTwo The second output as an ItemStack (can be ItemStack.EMPTY if there should be none)
|
2016-10-30 17:13:46 +01:00
|
|
|
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
|
2016-10-19 15:57:30 +02:00
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) {
|
2021-11-13 17:30:53 +01:00
|
|
|
CRUSHER_RECIPES.add(new CrushingRecipe(Ingredient.of(input), outputOne, 1.0f, outputTwo.isEmpty()
|
2021-02-27 16:33:00 +01:00
|
|
|
? ItemStack.EMPTY
|
|
|
|
: outputTwo, outputTwoChance));
|
2018-06-23 01:39:30 +02:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-06-23 01:39:30 +02:00
|
|
|
/**
|
|
|
|
* Adds a Recipe to the Crusher Recipe Registry
|
|
|
|
*
|
|
|
|
* @param input The input as an Ingredient
|
|
|
|
* @param outputOne The first output as an ItemStack
|
|
|
|
* @param outputTwo The second output as an ItemStack (can be ItemStack.EMPTY if there should be none)
|
|
|
|
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addCrusherRecipe(Ingredient input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) {
|
2021-11-13 17:30:53 +01:00
|
|
|
CRUSHER_RECIPES.add(new CrushingRecipe(input, outputOne, 1.0f, outputTwo.isEmpty()
|
2021-02-27 16:33:00 +01:00
|
|
|
? ItemStack.EMPTY
|
|
|
|
: outputTwo, outputTwoChance));
|
2016-10-30 17:13:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds multiple Recipes to the Crusher Recipe Registry
|
|
|
|
* Use this if you want to add OreDictionary recipes easier
|
|
|
|
*
|
|
|
|
* @param inputs The inputs as an ItemStack List, stacksizes are ignored
|
|
|
|
* @param outputOnes The first outputs as an ItemStack List, stacksizes are ignored
|
|
|
|
* @param outputOneAmounts The amount of the first output, will be equal for all entries in the list
|
2017-11-20 17:46:02 +01:00
|
|
|
* @param outputTwos The second outputs as a List (can be null or empty if there should be none)
|
2016-10-30 17:13:46 +01:00
|
|
|
* @param outputTwoAmounts The amount of the second output, will be equal for all entries in the list
|
|
|
|
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance) {
|
2016-10-30 17:13:46 +01:00
|
|
|
return methodHandler.addCrusherRecipes(inputs, outputOnes, outputOneAmounts, outputTwos, outputTwoAmounts, outputTwoChance);
|
2016-10-19 15:57:30 +02:00
|
|
|
}
|
|
|
|
|
2017-08-08 17:05:44 +02:00
|
|
|
//Same thing as above, but with ItemStack outputs.
|
2018-06-23 01:39:30 +02:00
|
|
|
@Deprecated //Use Ingredient
|
2019-05-02 09:10:29 +02:00
|
|
|
public static boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance) {
|
2017-08-08 17:05:44 +02:00
|
|
|
return methodHandler.addCrusherRecipes(inputs, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance);
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2021-10-23 20:17:04 +02:00
|
|
|
public static void addEmpowererRecipe(ResourceLocation id, Ingredient input, ItemStack output, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3, Ingredient modifier4, int energyPerStand, int time, int particleColor) {
|
|
|
|
EMPOWERER_RECIPES.add(new EmpowererRecipe(id, output, input, modifier1, modifier2, modifier3, modifier4, energyPerStand, time, particleColor));
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2016-08-03 04:01:47 +02:00
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
/**
|
2016-05-14 13:51:18 +02:00
|
|
|
* Adds a recipe to the Atomic Reconstructor conversion lenses
|
2016-01-05 04:47:35 +01:00
|
|
|
* StackSizes can only be 1 and greater ones will be ignored
|
|
|
|
*
|
|
|
|
* @param input The input as an ItemStack
|
|
|
|
* @param output The output as an ItemStack
|
|
|
|
* @param energyUse The amount of RF used per conversion
|
2016-05-14 14:14:06 +02:00
|
|
|
* @param type The type of lens used for the conversion. To use the default type, use method below.
|
2016-06-17 23:54:20 +02:00
|
|
|
* Note how this always has to be the same instance of the lens type that the item also has for it to work!
|
2016-01-05 04:47:35 +01:00
|
|
|
*/
|
2018-06-24 02:44:47 +02:00
|
|
|
@Deprecated
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type) {
|
2022-01-19 02:11:23 +01:00
|
|
|
//RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type));
|
2016-05-14 14:14:06 +02:00
|
|
|
}
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
@Deprecated
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse) {
|
2022-01-19 02:11:23 +01:00
|
|
|
//addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion);
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
/**
|
|
|
|
* Adds a recipe to the Atomic Reconstructor conversion lenses
|
|
|
|
* StackSizes can only be 1 and greater ones will be ignored
|
|
|
|
*
|
|
|
|
* @param input The input as an ItemStack
|
|
|
|
* @param output The output as an ItemStack
|
|
|
|
* @param energyUse The amount of RF used per conversion
|
|
|
|
* @param type The type of lens used for the conversion. To use the default type, use method below.
|
|
|
|
* Note how this always has to be the same instance of the lens type that the item also has for it to work!
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse, LensConversion type) {
|
2022-01-19 02:11:23 +01:00
|
|
|
//RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type));
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse) {
|
2022-01-19 02:11:23 +01:00
|
|
|
//addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion);
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
/**
|
|
|
|
* Adds an ingredient to the Coffee Machine ingredient list
|
2016-01-05 14:57:50 +01:00
|
|
|
*
|
2016-01-05 04:47:35 +01:00
|
|
|
* @param ingredient The ingredient to add
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addCoffeeMachineIngredient(CoffeeIngredient ingredient) {
|
2016-05-19 20:05:12 +02:00
|
|
|
COFFEE_MACHINE_INGREDIENTS.add(ingredient);
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
2016-01-05 14:57:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a booklet entry to the list of entries
|
|
|
|
*
|
|
|
|
* @param entry The entry to add
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addBookletEntry(IBookletEntry entry) {
|
2016-05-19 20:05:12 +02:00
|
|
|
BOOKLET_ENTRIES.add(entry);
|
2016-01-05 14:57:50 +01:00
|
|
|
}
|
2016-12-04 15:03:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a new farmer behavior to the Farmer
|
|
|
|
*
|
|
|
|
* @param behavior The behavior to add
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public static void addFarmerBehavior(IFarmerBehavior behavior) {
|
2016-12-04 15:03:01 +01:00
|
|
|
FARMER_BEHAVIORS.add(behavior);
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|