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;
|
2016-05-05 19:50:59 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.*;
|
2016-05-20 17:55:33 +02:00
|
|
|
import net.minecraft.block.Block;
|
2016-05-05 19:50:59 +02:00
|
|
|
import net.minecraft.item.Item;
|
2016-01-05 04:47:35 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2016-05-05 19:50:59 +02:00
|
|
|
import java.util.HashMap;
|
2016-01-05 04:47:35 +01:00
|
|
|
import java.util.List;
|
2016-05-05 19:50:59 +02:00
|
|
|
import java.util.Map;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-06-17 23:39:55 +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";
|
|
|
|
public static final String API_ID = MOD_ID+"api";
|
2016-12-04 15:03:01 +01:00
|
|
|
public static final String API_VERSION = "32";
|
2016-07-20 09:49:19 +02:00
|
|
|
|
2016-05-19 20:05:12 +02:00
|
|
|
public static final List<CrusherRecipe> CRUSHER_RECIPES = new ArrayList<CrusherRecipe>();
|
|
|
|
public static final List<BallOfFurReturn> BALL_OF_FUR_RETURN_ITEMS = new ArrayList<BallOfFurReturn>();
|
|
|
|
public static final List<TreasureChestLoot> TREASURE_CHEST_LOOT = new ArrayList<TreasureChestLoot>();
|
|
|
|
public static final List<LensConversionRecipe> RECONSTRUCTOR_LENS_CONVERSION_RECIPES = new ArrayList<LensConversionRecipe>();
|
2016-08-03 04:01:47 +02:00
|
|
|
public static final List<EmpowererRecipe> EMPOWERER_RECIPES = new ArrayList<EmpowererRecipe>();
|
2016-05-19 20:05:12 +02:00
|
|
|
public static final Map<Item, IColorLensChanger> RECONSTRUCTOR_LENS_COLOR_CHANGERS = new HashMap<Item, IColorLensChanger>();
|
2016-12-04 15:03:01 +01:00
|
|
|
public static final List<IFarmerBehavior> FARMER_BEHAVIORS = new ArrayList<IFarmerBehavior>();
|
2016-05-19 20:05:12 +02:00
|
|
|
public static final List<CoffeeIngredient> COFFEE_MACHINE_INGREDIENTS = new ArrayList<CoffeeIngredient>();
|
2016-05-20 17:55:33 +02:00
|
|
|
public static final List<CompostRecipe> COMPOST_RECIPES = new ArrayList<CompostRecipe>();
|
2016-11-21 13:30:38 +01:00
|
|
|
public static final List<OilGenRecipe> OIL_GENERATOR_RECIPES = new ArrayList<OilGenRecipe>();
|
2016-05-19 20:05:12 +02:00
|
|
|
public static final List<IBookletEntry> BOOKLET_ENTRIES = new ArrayList<IBookletEntry>();
|
2016-11-01 12:00:49 +01:00
|
|
|
//This is added to automatically, you don't need to add anything to this list
|
|
|
|
public static final List<IBookletChapter> ALL_CHAPTERS = new ArrayList<IBookletChapter>();
|
|
|
|
//This is added to automatically, you don't need to add anything to this list
|
2016-11-10 19:50:01 +01:00
|
|
|
public static final List<IBookletPage> BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA = new ArrayList<IBookletPage>();
|
2016-10-31 19:20:29 +01:00
|
|
|
public static final List<WeightedOre> STONE_ORES = new ArrayList<WeightedOre>();
|
|
|
|
public static final List<WeightedOre> NETHERRACK_ORES = new ArrayList<WeightedOre>();
|
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
|
2016-01-05 14:57:50 +01:00
|
|
|
public static IBookletEntry allAndSearch;
|
|
|
|
|
2016-05-15 12:00:42 +02:00
|
|
|
//These are getting initialized in Actually Additions' PreInit phase
|
|
|
|
//DO NOT CHANGE/OVERRIDE THESE!!
|
|
|
|
public static LensConversion lensDefaultConversion;
|
|
|
|
public static Lens lensDetonation;
|
|
|
|
public static Lens lensDeath;
|
2016-11-02 18:49:57 +01:00
|
|
|
public static Lens lensEvenMoarDeath;
|
2016-05-15 12:00:42 +02:00
|
|
|
public static Lens lensColor;
|
|
|
|
public static Lens lensDisruption;
|
2016-07-20 10:42:41 +02:00
|
|
|
public static Lens lensDisenchanting;
|
2016-10-31 16:36:22 +01:00
|
|
|
public static Lens 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
|
|
|
*/
|
|
|
|
public static void addMiningLensStoneOre(String oreName, int weight){
|
|
|
|
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
|
|
|
*/
|
|
|
|
public static void addMiningLensNetherOre(String oreName, int weight){
|
|
|
|
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
|
|
|
|
* @param outputTwo The second output as an ItemStack (can be null if there should be none)
|
|
|
|
* @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
|
|
|
*/
|
2016-10-30 17:13:46 +01:00
|
|
|
public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance){
|
|
|
|
CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputTwo, outputTwoChance));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
* @param outputTwos The second outputs as an ItemStack List (can be null or empty if there should be none)
|
|
|
|
* @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)
|
|
|
|
*/
|
|
|
|
public static boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance){
|
|
|
|
return methodHandler.addCrusherRecipes(inputs, outputOnes, outputOneAmounts, outputTwos, outputTwoAmounts, outputTwoChance);
|
2016-10-19 15:57:30 +02:00
|
|
|
}
|
|
|
|
|
2016-09-01 22:11:51 +02:00
|
|
|
/**
|
|
|
|
* Adds a Recipe to the Oil generator
|
2016-09-12 20:45:29 +02:00
|
|
|
*
|
2016-09-01 22:11:51 +02:00
|
|
|
* @param fluidName The name of the fluid to be consumed
|
|
|
|
* @param genAmount The amount of energy generated per operation
|
|
|
|
*/
|
|
|
|
public static void addOilGenRecipe(String fluidName, int genAmount){
|
2016-11-21 13:30:38 +01:00
|
|
|
addOilGenRecipe(fluidName, genAmount, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a Recipe to the Oil generator
|
|
|
|
*
|
|
|
|
* @param fluidName The name of the fluid to be consumed
|
|
|
|
* @param genAmount The amount of energy generated per operation
|
|
|
|
*/
|
|
|
|
public static void addOilGenRecipe(String fluidName, int genAmount, int genTime){
|
|
|
|
OIL_GENERATOR_RECIPES.add(new OilGenRecipe(fluidName, genAmount, genTime));
|
2016-09-01 22:11:51 +02:00
|
|
|
}
|
|
|
|
|
2016-05-20 17:55:33 +02:00
|
|
|
/**
|
|
|
|
* Adds a new conversion recipe to the compost.
|
|
|
|
*
|
2016-06-01 00:39:35 +02:00
|
|
|
* @param input The itemstack to be input into the compost
|
|
|
|
* @param inputDisplay The block to display when there is input in the compost
|
|
|
|
* @param output The itemstack to be output from the compost once conversion finishes
|
2016-05-20 17:55:33 +02:00
|
|
|
* @param outputDisplay The block to display when there is output in the compost
|
|
|
|
*/
|
|
|
|
public static void addCompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay){
|
|
|
|
COMPOST_RECIPES.add(new CompostRecipe(input, inputDisplay, output, outputDisplay));
|
|
|
|
}
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
/**
|
|
|
|
* Adds an item to the list of possible items to be returned when right-clicking a Ball Of Fur
|
|
|
|
*
|
|
|
|
* @param stack The ItemStack to be returned
|
|
|
|
* @param chance The chance (this is from WeightedRandom.Item)
|
|
|
|
*/
|
|
|
|
public static void addBallOfFurReturnItem(ItemStack stack, int chance){
|
2016-05-19 20:05:12 +02:00
|
|
|
BALL_OF_FUR_RETURN_ITEMS.add(new BallOfFurReturn(stack, chance));
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds an item to the list of possible items to be returned when opening a Treasure Chest
|
|
|
|
*
|
|
|
|
* @param stack The ItemStack to be returned, the stacksize is ignored
|
|
|
|
* @param chance The chance (this is from WeightedRandom.Item)
|
|
|
|
* @param minAmount The minimum stacksize of the returned stack
|
|
|
|
* @param maxAmount The maximum stacksize of the returned stack
|
|
|
|
*/
|
|
|
|
public static void addTreasureChestLoot(ItemStack stack, int chance, int minAmount, int maxAmount){
|
2016-05-19 20:05:12 +02:00
|
|
|
TREASURE_CHEST_LOOT.add(new TreasureChestLoot(stack, chance, minAmount, maxAmount));
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
|
|
|
|
2016-08-03 17:59:27 +02:00
|
|
|
public static void addEmpowererRecipe(ItemStack input, ItemStack output, ItemStack modifier1, ItemStack modifier2, ItemStack modifier3, ItemStack modifier4, int energyPerStand, int time, float[] particleColor){
|
|
|
|
EMPOWERER_RECIPES.add(new EmpowererRecipe(input, output, modifier1, modifier2, modifier3, modifier4, energyPerStand, time, particleColor));
|
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
|
|
|
*/
|
2016-05-14 14:14:06 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type){
|
2016-05-19 20:05:12 +02:00
|
|
|
RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type));
|
2016-05-14 14:14:06 +02:00
|
|
|
}
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse){
|
2016-05-15 12:00:42 +02:00
|
|
|
addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion);
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
|
|
|
|
2016-05-05 19:50:59 +02:00
|
|
|
/**
|
|
|
|
* Adds an item and the way it is modified to the Atomic Reconstructor's color lens.
|
|
|
|
* This also works for blocks, but they have to be in their item form.
|
2016-06-17 23:54:20 +02:00
|
|
|
* The way it is modified is an instance of IColorLensChanger. When modifying the item,
|
2016-05-05 19:50:59 +02:00
|
|
|
* its modifyItem() method will be called with a stack containing the item.
|
|
|
|
*
|
2016-05-06 14:19:25 +02:00
|
|
|
* @param item The item (or block's item) to add
|
2016-05-05 19:50:59 +02:00
|
|
|
* @param changer The change mechanism
|
|
|
|
*/
|
|
|
|
public static void addReconstructorLensColorChangeItem(Item item, IColorLensChanger changer){
|
2016-05-19 20:05:12 +02:00
|
|
|
RECONSTRUCTOR_LENS_COLOR_CHANGERS.put(item, changer);
|
2016-05-05 19:50:59 +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
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
public static void addFarmerBehavior(IFarmerBehavior behavior){
|
|
|
|
FARMER_BEHAVIORS.add(behavior);
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|