Jump to content

Recommended Posts

Posted

Hello, I've been trying to make 3d armor with techne and forge... (obviously) it worked when it was regular armor and now that i tried to make the armor 3d, it doesn't render. i wear the armor and the console spams

[03:55:24] [Client thread/ERROR]: Couldn't render entity
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source) ~[?:1.8.0_45]
at net.Ethereal.armor.EtherealArmor.getArmorTexture(EtherealArmor.java:103) ~[EtherealArmor.class:?]
at net.minecraftforge.client.ForgeHooksClient.getArmorTexture(ForgeHooksClient.java:80) ~[ForgeHooksClient.class:?]
at net.minecraft.client.renderer.entity.RenderBiped.getArmorResource(RenderBiped.java:411) ~[RenderBiped.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) ~[RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) ~[RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]

 

 

and my line 103 just says

		name = name.substring(0, name.indexOf('_'));

 

my entire armor class http://pastebin.com/eBFJzaK4

 

and my model class http://pastebin.com/v4qWeLT3

 

thanks for helping in advance

Posted

package net.Ethereal.main;

import java.util.HashMap;
import java.util.Map;

import net.Ethereal.armor.ArmorModel;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.item.Item;

public class ClientProxy extends ServerProxy {
public static final Map<Item, ModelBiped> armorModels = new HashMap<Item, ModelBiped>();

public static void register_renderers(){

	ArmorModel custom_armor = new ArmorModel(1F);
	ArmorModel custom_legs = new ArmorModel(0.5F);

	armorModels.put(EtherealMain.itemEtherealHelm, custom_armor);
	armorModels.put(EtherealMain.itemEtherealChestplate, custom_armor);
	armorModels.put(EtherealMain.itemEtherealPants, custom_legs);
	armorModels.put(EtherealMain.itemEtherealBoots, custom_armor);

}

}

Posted

 

package net.Ethereal.main;

import net.Ethereal.armor.EtherealArmor;
import net.Ethereal.main.ClientProxy;
import net.Ethereal.itemblocks.EItems;
import net.Ethereal.itemblocks.EtherealOre;
import net.Ethereal.itemblocks.ZirconiumOre;
import net.Ethereal.tools.ToolAxe;
import net.Ethereal.tools.ToolPickaxe;
import net.Ethereal.tools.ToolSpade;
import net.Ethereal.tools.ToolSword;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = EtherealStrings.modid, version = EtherealStrings.version)
public class EtherealMain {
private static final String ClientProxy = "net.Ethereal.main.ClientProxy";
private static final String ServerProxy = "net.Ethereal.main.ServerProxy";

@SidedProxy(clientSide = ClientProxy, serverSide = ServerProxy)
public static ClientProxy proxy;

//armorIDs
public static int etherealHelmID;
public static int etherealChestplateID;
public static int etherealPantsID;
public static int etherealBootsID;

//oregen

//blocks
public static Block oreEtherealOre;
public static Block oreZirconiumOre;

//items(Weapons/tools)
public static Item weaponEtherealSword;
public static Item toolEtherealPickaxe;
public static Item toolEtherealAxe;
public static Item toolEtherealSpade;

//items(Regular)
public static Item itemEtherealIngot;
public static Item itemEtherealShard;
public static Item itemEtherealSwordHandle;
public static Item itemVisor;
public static Item itemEtherealChunk;

//items(Armor)
public static Item itemEtherealHelm;
public static Item itemEtherealChestplate;
public static Item itemEtherealPants;
public static Item itemEtherealBoots;

//biomes

//materials
public static ToolMaterial matEtheralTool = EnumHelper.addToolMaterial("EtherealTools", 3, 1234, 19.0f, 5.0f, 30);
public static ArmorMaterial matEtherealArmor = EnumHelper.addArmorMaterial("EtherealArmor", 9001, new int[] {90, 90, 90, 90}, 30);


//creative tabs
public static CreativeTabs EtherealTabTools = new CreativeTabs("etherealTabTools"){
	public Item getTabIconItem() {
		return Items.diamond_pickaxe;
	}		
};

public static CreativeTabs EtherealTabItemBlocks = new CreativeTabs("etherealTabItemBlocks"){
	public Item getTabIconItem() {
		return Items.emerald;
	}		
};
public static CreativeTabs EtherealTabCombat = new CreativeTabs("etherealTabCombat"){
	public Item getTabIconItem() {
		return Items.diamond_sword;
	}		
};


@EventHandler
public void preInit(FMLPreInitializationEvent e){

	Eworld.mainRegistry();

	//ores and blocks
	oreEtherealOre = new EtherealOre().setBlockName("Ethereal_Ore").setCreativeTab(EtherealTabItemBlocks).setBlockTextureName(EtherealStrings.modid + ":" + "Ethereal_Ore").setHardness(2.0F).setStepSound(Block.soundTypeStone).setResistance(5.0F);;
	oreZirconiumOre = new ZirconiumOre().setBlockName("Zirconium_Ore").setCreativeTab(EtherealTabItemBlocks).setBlockTextureName(EtherealStrings.modid + ":" + "Zirconium_Ore").setHardness(4.0F).setStepSound(Block.soundTypeStone).setResistance(8.0F);;

	//items and tools
	weaponEtherealSword = new ToolSword(matEtheralTool).setUnlocalizedName("Ethereal_Sword").setCreativeTab(EtherealTabCombat).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Sword");
	toolEtherealPickaxe = new ToolPickaxe(matEtheralTool).setUnlocalizedName("Ethereal_Pick").setCreativeTab(EtherealTabTools).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Pick");
	toolEtherealAxe = new ToolAxe(matEtheralTool).setUnlocalizedName("Ethereal_Axe").setCreativeTab(EtherealTabTools).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Axe");
	toolEtherealSpade = new ToolSpade(matEtheralTool).setUnlocalizedName("Ethereal_Spade").setCreativeTab(EtherealTabTools).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Spade");
	itemVisor= new EItems().setUnlocalizedName("Visor").setCreativeTab(EtherealTabItemBlocks).setTextureName(EtherealStrings.modid + ":" + "Visor");
	itemEtherealShard= new EItems().setUnlocalizedName("EtherealShard").setCreativeTab(EtherealTabItemBlocks).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Shard");
	itemEtherealIngot= new EItems().setUnlocalizedName("EtherealIngot").setCreativeTab(EtherealTabItemBlocks).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Ingot");
	itemEtherealChunk= new EItems().setUnlocalizedName("EtherealChunk").setCreativeTab(EtherealTabItemBlocks).setTextureName(EtherealStrings.modid + ":" + "Ethereal_Chunk");

	//armor
	itemEtherealHelm = new EtherealArmor(matEtherealArmor, etherealHelmID, 0).setUnlocalizedName("EtherealHelm");
	itemEtherealChestplate = new EtherealArmor(matEtherealArmor, etherealChestplateID, 1).setUnlocalizedName("EtherealChestplate");
	itemEtherealPants = new EtherealArmor(matEtherealArmor, etherealPantsID, 2).setUnlocalizedName("EtherealPants");
	itemEtherealBoots = new EtherealArmor(matEtherealArmor, etherealBootsID, 3).setUnlocalizedName("EtherealBoots");


	//biomes
	//none yet

}

@EventHandler
public void init(FMLInitializationEvent e){
	proxy.registerRenderInfo();

	//Blockregistry
	GameRegistry.registerBlock(oreEtherealOre, "oreEtherealOre");
	GameRegistry.registerBlock(oreZirconiumOre, "oreZirconiumOre");

	//toolRegister
	GameRegistry.registerItem(weaponEtherealSword, "EtherealSword");
	GameRegistry.registerItem(toolEtherealPickaxe, "EtherealPickaxe");
	GameRegistry.registerItem(EtherealMain.toolEtherealAxe, "EtherealAxe");
	GameRegistry.registerItem(EtherealMain.toolEtherealSpade, "EtherealSpade");

	//armorRegister
	GameRegistry.registerItem(EtherealMain.itemEtherealHelm, "EtherealHelm");
	GameRegistry.registerItem(EtherealMain.itemEtherealChestplate, "EtherealChestplate");
	GameRegistry.registerItem(EtherealMain.itemEtherealPants, "EtherealPants");
	GameRegistry.registerItem(EtherealMain.itemEtherealBoots, "EtherealBoots");

	//itemRegister
	GameRegistry.registerItem(EtherealMain.itemVisor, "Visor");
	GameRegistry.registerItem(EtherealMain.itemEtherealShard, "EtherealShard");
	GameRegistry.registerItem(EtherealMain.itemEtherealIngot, "EtherealIngot");
	GameRegistry.registerItem(EtherealMain.itemEtherealChunk, "EtherealChunk");

	//Armor recipes
	GameRegistry.addRecipe(new ItemStack(EtherealMain.itemEtherealHelm), new Object[]{
    	"EEE",
    	"EVE",
    	"   ",
    	'E', EtherealMain.itemEtherealIngot,
    	'V', EtherealMain.itemVisor});

	GameRegistry.addRecipe(new ItemStack(EtherealMain.itemEtherealHelm), new Object[]{
		"   ",
		"EEE",
		"EVE",
		'E', EtherealMain.itemEtherealIngot,
		'V', EtherealMain.itemVisor});

	//item Recipes
	GameRegistry.addRecipe(new ItemStack(EtherealMain.itemEtherealHelm), new Object[]{
		"CCC",
		"CCC",
		"CCC",
		'C', EtherealMain.itemEtherealChunk});



}

}

 

sorry its a jumble.. i havent really gotten to find out a way to organize the catecoried to classes

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.