Added void shards. Need smelting recipes (with special effects).

This commit is contained in:
allstar69 2013-07-09 19:55:00 -07:00
commit b5b2ddec92
7 changed files with 103 additions and 6 deletions

View file

@ -60,8 +60,9 @@ public class ItemHandler$1 {
public static Item iridiumChestplate;
public static Item iridiumLeggings;
public static Item iridiumBoots;
public static Item voidShard;
public static void init(){
staffParts = new ItemStaffParts(ItemIds.STAFF_PARTS);
@ -101,5 +102,7 @@ public class ItemHandler$1 {
iridiumChestplate = new ItemArmorIridium(ItemIds.IRIDIUM_CHESTPLATE, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 1).setUnlocalizedName(Strings.IRIDIUM_CHESTPLATE_NAME);
iridiumLeggings = new ItemArmorIridium(ItemIds.IRIDIUM_LEGGINGS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 2).setUnlocalizedName(Strings.IRIDIUM_LEGGINGS_NAME);
iridiumBoots = new ItemArmorIridium(ItemIds.IRIDIUM_BOOTS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 3).setUnlocalizedName(Strings.IRIDIUM_BOOTS_NAME);
voidShard = new ItemVoidShard(ItemIds.VOID_SHARD).setUnlocalizedName(Strings.VOID_SHARD_NAME);
}
}

View file

@ -0,0 +1,84 @@
package MysticWorld.Items;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import MysticWorld.MysticWorld;
import MysticWorld.Entity.EntityChargeAir;
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.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ItemVoidShard extends Item {
public ItemVoidShard(int id) {
super(id);
this.setMaxStackSize(1);
this.setCreativeTab(MysticWorld.MysticWorldTab);
this.setMaxDamage(30);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
int currentExperience = entityPlayer.experienceLevel;
if (itemStack.stackTagCompound.getBoolean("filled") == false)
{
if (currentExperience > 0)
{
entityPlayer.experienceLevel = 0;
itemStack.stackTagCompound.setInteger("xpStored", currentExperience);
itemStack.stackTagCompound.setBoolean("filled", true);
}
}
else
{
entityPlayer.experienceLevel += itemStack.stackTagCompound.getInteger("xpStored");
itemStack.stackTagCompound.setInteger("xpStored", 0);
itemStack.stackTagCompound.setBoolean("filled", false);
}
return itemStack;
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
list.add("Experience Stored: " + Integer.toString(itemStack.stackTagCompound.getInteger("xpStored")));
}
@Override
public boolean hasEffect(ItemStack itemStack)
{
if (itemStack.stackTagCompound == null)
itemStack.setTagCompound(new NBTTagCompound());
if (itemStack.stackTagCompound.hasKey("filled"))
{
return itemStack.stackTagCompound.getBoolean("filled");
}
else
{
return false;
}
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticTextures:ShardVoid");
}
}