BloodMagic/BM_src/WayofTime/alchemicalWizardry/common/items/potion/LengtheningCatalyst.java

65 lines
1.8 KiB
Java
Raw Normal View History

2014-01-17 19:12:49 +00:00
package WayofTime.alchemicalWizardry.common.items.potion;
2014-01-17 21:54:16 +00:00
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ICatalyst;
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
2014-01-17 19:12:49 +00:00
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
2014-01-17 21:54:16 +00:00
2014-01-17 19:12:49 +00:00
import org.lwjgl.input.Keyboard;
import java.util.List;
2014-01-17 19:12:49 +00:00
2014-01-17 21:43:13 +00:00
public class LengtheningCatalyst extends Item implements ICatalyst
{
2014-01-17 19:12:49 +00:00
private int catalystStrength;
public LengtheningCatalyst(int id, int catalystStrength)
{
super(id);
this.catalystStrength = catalystStrength;
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@Override
public int getCatalystLevel()
{
return catalystStrength;
}
@Override
public boolean isConcentration()
{
return false;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Used in alchemy");
if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
ItemStack[] recipe = AlchemyRecipeRegistry.getRecipeForItemStack(par1ItemStack);
if (recipe != null)
{
par3List.add(EnumChatFormatting.BLUE + "Recipe:");
for (ItemStack item : recipe)
2014-01-17 19:12:49 +00:00
{
if (item != null)
{
par3List.add("" + item.getDisplayName());
}
}
}
} else
2014-01-17 19:12:49 +00:00
{
par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-");
}
}
}