Added a method to get the API Version as an integer to the API

This commit is contained in:
Ellpeck 2016-05-06 14:19:25 +02:00
parent 73ebec3930
commit 3f4f87f273

View file

@ -122,7 +122,7 @@ public class ActuallyAdditionsAPI{
* @param chance The chance (this is from WeightedRandom.Item) * @param chance The chance (this is from WeightedRandom.Item)
*/ */
public static void addBallOfFurReturnItem(ItemStack stack, int chance){ public static void addBallOfFurReturnItem(ItemStack stack, int chance){
ActuallyAdditionsAPI.ballOfFurReturnItems.add(new BallOfFurReturn(stack, chance)); ballOfFurReturnItems.add(new BallOfFurReturn(stack, chance));
} }
/** /**
@ -134,7 +134,7 @@ public class ActuallyAdditionsAPI{
* @param maxAmount The maximum 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){ public static void addTreasureChestLoot(ItemStack stack, int chance, int minAmount, int maxAmount){
ActuallyAdditionsAPI.treasureChestLoot.add(new TreasureChestLoot(stack, chance, minAmount, maxAmount)); treasureChestLoot.add(new TreasureChestLoot(stack, chance, minAmount, maxAmount));
} }
/** /**
@ -200,4 +200,15 @@ public class ActuallyAdditionsAPI{
public static void addPageWithItemStackData(BookletPage page){ public static void addPageWithItemStackData(BookletPage page){
bookletPagesWithItemStackData.add(page); bookletPagesWithItemStackData.add(page);
} }
/**
* This can be used for checking if the API is a certain version for
* compatibility's sake.
* Will always return an integer equivalent to the text in API_VERSION
*
* @return The API's version as an integer
*/
public static int getAPIVersionInt(){
return Integer.parseInt(API_VERSION);
}
} }