Jump to content

How do you use ISpecialArmor?


Texasjake95

Recommended Posts

I tried to use it but all I get is errors...

 

These are the errors I have been getting...

 

--- BEGIN ERROR REPORT cb82b14a --------
Generated 6/22/12 12:49 PM

Minecraft: Minecraft 1.2.5
OS: Windows Vista (x86) version 6.0
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 2400 XT        version 3.3.10317 Compatibility Profile Context, ATI Technologies Inc.

java.lang.NullPointerException
at net.minecraft.src.forge.ArmorProperties.ApplyArmor(ArmorProperties.java:61)
at net.minecraft.src.EntityPlayer.damageEntity(EntityPlayer.java:1006)
at net.minecraft.src.EntityLiving.attackEntityFrom(EntityLiving.java:874)
at net.minecraft.src.EntityPlayer.attackEntityFrom(EntityPlayer.java:898)
at net.minecraft.src.Entity.onEntityUpdate(Entity.java:445)
at net.minecraft.src.EntityLiving.onEntityUpdate(EntityLiving.java:433)
at net.minecraft.src.Entity.onUpdate(Entity.java:349)
at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:645)
at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:264)
at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2194)
at net.minecraft.src.World.updateEntity(World.java:2165)
at net.minecraft.src.World.updateEntities(World.java:2047)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1867)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:822)
at net.minecraft.client.Minecraft.run(Minecraft.java:750)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 45c96326 ----------

 

 

This is my armor code...

 

package net.minecraft.src;
import java.util.ArrayList;

import net.minecraft.client.Minecraft;
import net.minecraft.src.forge.*;

public class texasjake95_KingArmor extends ItemArmor implements ITextureProvider, IArmorTextureProvider, ISpecialArmor
{
         
    	
public texasjake95_KingArmor(int i, EnumArmorMaterial enumarmormaterial, int j, int k) 
{

	super(i, enumarmormaterial, j, k);

}

 public String getTextureFile()
        {
                return "/BetterOres/Items.png";
        }
        public String getArmorTextureFile(ItemStack itemstack)
        {
                if(itemstack.itemID == mod_BetterOres.helmetKing.shiftedIndex || 
                   itemstack.itemID == mod_BetterOres.plateKing.shiftedIndex || 
                   itemstack.itemID == mod_BetterOres.bootsKing.shiftedIndex)
                {
                        return "/BetterOres/Armor/king1.png";
                }
                if(itemstack.itemID == mod_BetterOres.legsKing.shiftedIndex)
                {
                        return "/BetterOres/Armor/king2.png";
                }
                return  "/BetterOres/Armor/king1.png";
                          
                
                
        }
        public void addCreativeItems(ArrayList itemList)
    	{
        	itemList.add(new ItemStack(this));
       	}
        public ArmorProperties getProperties(EntityLiving player,
			ItemStack armor, DamageSource source, double damage, int slot) {
		EntityLiving Player = mc.thePlayer;
		player = Player;
		armor = new ItemStack (this);
		source = DamageSource.inFire;
		damage = 0;
		slot = 1;
		return null;
	}

	@Override
	public int getArmorDisplay(EntityPlayer player, ItemStack armor,
			int slot) {
		EntityPlayer Player = mc.thePlayer;
		player = Player;
		armor = new ItemStack (this);
		slot = 1;
		return 2;

	}

	@Override
	public void damageArmor(EntityLiving entity, ItemStack stack,
			DamageSource source, int damage, int slot) {
		EntityLiving Player = mc.thePlayer;
		entity = Player;
		stack = new ItemStack (this);
		source = DamageSource.inFire;
		damage = 0;
		slot = 1;
	}


 

Link to comment
Share on other sites

So.. the interface asks for a return value

And you give it null.

And you expect it NOT to crash?

Really... go read the code it's commented well enough.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.