use of net.tropicraft.core.common.drinks.Ingredient in project Tropicraft by Tropicraft.
the class CocktailItem method getIngredients.
public static Ingredient[] getIngredients(ItemStack stack) {
if (!Drink.isDrink(stack.getItem()) || !stack.hasTag()) {
return new Ingredient[0];
}
CompoundTag nbt = stack.getTag();
ListTag tagList = nbt.getList("Ingredients", 10);
Ingredient[] ingredients = new Ingredient[tagList.size()];
for (int i = 0; i < tagList.size(); ++i) {
final int ingredientID = (tagList.getCompound(i)).getByte("IngredientID");
ingredients[i] = Ingredient.ingredientsList[ingredientID];
}
return ingredients;
}
Aggregations