Testing
This commit is contained in:
commit
8601e9faff
498 changed files with 45817 additions and 0 deletions
|
@ -0,0 +1,87 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class WeakFillingAgent extends Item implements IFillingAgent
|
||||
{
|
||||
public WeakFillingAgent(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFilledAmountForPotionNumber(int potionEffects)
|
||||
{
|
||||
Random rand = new Random();
|
||||
|
||||
if (potionEffects == 0)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
if (potionEffects == 1 || potionEffects == 2)
|
||||
{
|
||||
if (rand.nextFloat() > 0.5f)
|
||||
{
|
||||
return(4 - potionEffects);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 3 - potionEffects;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent");
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
par3List.add("" + item.getDisplayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("-Press " + EnumChatFormatting.BLUE + "shift" + EnumChatFormatting.GRAY + " for Recipe-");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue