1.7.10 commit of I-still-can't-do-any-branches
This commit is contained in:
parent
6aec0a87ea
commit
cabc296b21
763 changed files with 64290 additions and 0 deletions
|
@ -0,0 +1,79 @@
|
|||
package WayofTime.alchemicalWizardry.api.alchemy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlchemicalPotionCreationHandler
|
||||
{
|
||||
public static ArrayList<AlchemyPotionHandlerComponent> registeredPotionEffects = new ArrayList();
|
||||
|
||||
public static void addPotion(ItemStack itemStack, int potionID, int tickDuration)
|
||||
{
|
||||
registeredPotionEffects.add(new AlchemyPotionHandlerComponent(itemStack, potionID, tickDuration));
|
||||
}
|
||||
|
||||
public static int getPotionIDForStack(ItemStack itemStack)
|
||||
{
|
||||
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
|
||||
{
|
||||
if (aphc.compareItemStack(itemStack))
|
||||
{
|
||||
return aphc.getPotionID();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int getPotionTickDurationForStack(ItemStack itemStack)
|
||||
{
|
||||
{
|
||||
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
|
||||
{
|
||||
if (aphc.compareItemStack(itemStack))
|
||||
{
|
||||
return aphc.getTickDuration();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean containsRegisteredPotionIngredient(ItemStack[] stackList)
|
||||
{
|
||||
for (ItemStack is : stackList)
|
||||
{
|
||||
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
|
||||
{
|
||||
if (aphc.compareItemStack(is))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getRegisteredPotionIngredientPosition(ItemStack[] stackList)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (ItemStack is : stackList)
|
||||
{
|
||||
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects)
|
||||
{
|
||||
if (aphc.compareItemStack(is))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue