Jump to content

Recommended Posts

Posted

Hello I'm recieving this error if my custom armor protection values are over 8.

 

Not too sure if the way armors are made in the new version of forge has changed since 1.2.5. If it did change could someone just point me in the right direction on how to convert my armors to the new way forge manages armors

 

2012-08-21 23:47:41 [iNFO] [sTDERR] java.lang.ArrayIndexOutOfBoundsException: 8
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderPlayer.setArmorModel(RenderPlayer.java:41)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderPlayer.shouldRenderPass(RenderPlayer.java:416)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRenderLiving(RenderLiving.java:107)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderPlayer.renderPlayer(RenderPlayer.java:91)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderPlayer.doRender(RenderPlayer.java:450)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:188)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.GuiInventory.func_74223_a(GuiInventory.java:106)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.GuiInventory.drawGuiContainerBackgroundLayer(GuiInventory.java:83)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:57)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:35)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.GuiInventory.drawScreen(GuiInventory.java:67)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:925)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:868)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:761)
2012-08-21 23:47:41 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)

 

In my mod file I have

 

static EnumArmorMaterial bedrockarmor = EnumHelper.addArmorMaterial("Bedrock", 33, new int[]{3, 8, 6, 6}, 10);
public static final Item bedrockHead = new ItemBedrockArmor(578, bedrockarmor, 3, 0).setIconIndex(6).setItemName("bedrockhead");
public static final Item bedrockBody = new ItemBedrockArmor(571, bedrockarmor, 8, 1).setIconIndex(.setItemName("bedrockbody");
public static final Item bedrockLegs = new ItemBedrockArmor(579, bedrockarmor, 6, 2).setIconIndex(9).setItemName("bedrocklegs");
public static final Item bedrockBoots = new ItemBedrockArmor(580, bedrockarmor, 3, 3).setIconIndex(7).setItemName("bedrockboots");

 

The Bedrock legs and bedrock body are giving me errors as I apply the armor to the player and do not show on the player

Posted

Not your EnumArmorMaterial, its within range

private static final int[] maxDamageArray = new int[] {11, 16, 15, 13};

 

Your armor is calling an invalid id, until you register one the array stops at 4 and they are used by the default armors.

 

 

  Reveal hidden contents

 

 

bedrockHead is using the dimond id ( 3 )

bedrockBody is using an invalid id ( 8 )

bedrockLegs is using an invalid id ( 6 )

bedrockBoots is using dimond id ( 3 )

 

you've also got two issues with your item Id's

#1 - they are hard coded, use a config file so users can change the id if they need to

#2 - they are too low, you need to be above 4096 to get into item id's

 

 

Here I'll give you a little push.

 

Put this where your current code is:

public static Item bedrockHead;
public static Item bedrockBody;
public static Item bedrockLegs;
public static Item bedrockBoots;

 

Put this in your @Init

//Read from Config File Here
bedrockHeadId = /*GetValue From Config, Default:*/ 7578; //I added 7000 to your old ids
bedrockBodyId = /*GetValue From Config, Default:*/ 7571;
bedrockLegsId = /*GetValue From Config, Default:*/ 7579;
bedrockBootsId = /*GetValue From Config, Default:*/ 7580;

EnumArmorMaterial bedrockarmor = EnumHelper.addArmorMaterial("Bedrock", 33, new int[]{3, 8, 6, 6}, 10);
int bedRockArmorId = proxy.addArmor("BedRock"); //There is more info about this in the link I gave you

bedrockHead = new ItemBedrockArmor(bedrockHeadId, bedrockarmor, bedRockArmorId, 0).setIconIndex(6).setItemName("bedrockhead");
bedrockBody = new ItemBedrockArmor(bedrockBodyId, bedrockarmor, bedRockArmorId, 1).setIconIndex(.setItemName("bedrockbody");
bedrockLegs = new ItemBedrockArmor(bedrockLegsId, bedrockarmor, bedRockArmorId, 2).setIconIndex(9).setItemName("bedrocklegs");
bedrockBoots = new ItemBedrockArmor(bedrockBootsId, bedrockarmor, bedRockArmorId, 3).setIconIndex(7).setItemName("bedrockboots");

 

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.