Some intital work in displaying recipes on the Lexicon.

This commit is contained in:
Vasco Lavos committed 2014-01-19 17:02:36 +00:00
1 parent fc3a6b3299
commit 9bfd8ff93f
6 files changed
+94 -3

No files matched your search

+18
View File
@@ -14,6 +14,8 @@ package vazkii.botania.api;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import vazkii.botania.api.internal.DummyMethodHandler;
import vazkii.botania.api.internal.IInternalMethodHandler;
@@ -49,4 +51,20 @@ public final class BotaniaAPI {
allEntries.add(entry);
category.entries.add(entry);
}
/**
* Gets the last recipe to have been added to the recipe list.
*/
public static IRecipe getLatestAddedRecipe() {
List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
return list.get(list.size() - 1);
}
/**
* Gets the last x recipes added to the recipe list.
*/
public static List<IRecipe> getLatestAddedRecipes(int x) {
List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
return list.subList(list.size() - 1 - x, list.size() - 1);
}
}