mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
RecipeType.GetInputList() will now return an empty List if the Machine
is null
This commit is contained in:
parent
467b5ac74c
commit
c787a9a538
@ -66,6 +66,7 @@ public class RecipeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemStack> getRecipeInputs(SlimefunItem machine) {
|
public static List<ItemStack> getRecipeInputs(SlimefunItem machine) {
|
||||||
|
if (machine == null) return new ArrayList<ItemStack>();
|
||||||
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
|
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
|
||||||
List<ItemStack> convertable = new ArrayList<ItemStack>();
|
List<ItemStack> convertable = new ArrayList<ItemStack>();
|
||||||
for (int i = 0; i < recipes.size(); i++) {
|
for (int i = 0; i < recipes.size(); i++) {
|
||||||
@ -75,6 +76,7 @@ public class RecipeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemStack[]> getRecipeInputList(SlimefunItem machine) {
|
public static List<ItemStack[]> getRecipeInputList(SlimefunItem machine) {
|
||||||
|
if (machine == null) return new ArrayList<ItemStack[]>();
|
||||||
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
|
List<ItemStack[]> recipes = (machine instanceof SlimefunMachine ? ((SlimefunMachine) machine).getRecipes(): ((SlimefunGadget) machine).getRecipes());
|
||||||
List<ItemStack[]> convertable = new ArrayList<ItemStack[]>();
|
List<ItemStack[]> convertable = new ArrayList<ItemStack[]>();
|
||||||
for (int i = 0; i < recipes.size(); i++) {
|
for (int i = 0; i < recipes.size(); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user