
I redone where the items/blocsks are stored and how the configs are handled to clean up it and give space. You can change the config line to AWWayofTime if you want to keep the compatibility with old configs. Now you reference the blocks from the ModBlocks and Items from the ModItems.
64 lines
2 KiB
Java
64 lines
2 KiB
Java
package WayofTime.alchemicalWizardry.common.items.potion;
|
|
|
|
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
|
|
import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
|
import WayofTime.alchemicalWizardry.common.alchemy.AlchemyRecipeRegistry;
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
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 java.util.List;
|
|
|
|
public class StandardBindingAgent extends Item implements IBindingAgent {
|
|
public StandardBindingAgent(int id)
|
|
{
|
|
super(id);
|
|
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
|
}
|
|
|
|
@Override
|
|
public float getSuccessRateForPotionNumber(int potions)
|
|
{
|
|
return (float) Math.pow(0.65, potions);
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public void registerIcons(IconRegister iconRegister)
|
|
{
|
|
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent");
|
|
}
|
|
|
|
@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-");
|
|
}
|
|
}
|
|
}
|