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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • May this question can't be answered but is for a project. The question is more of how Forge load and manage mods, it's not required code or anything, just an explanation about how do it works on the load/manage of mods internally.
    • I myself am quite new to the modding scene, I started modding in February but have been in development hell a lot and have struggled to focus on one mod though I have been developing the current mod I've been working on since September and have made a lot of progress; during this time I have found a lot of helpful resources and have learnt a lot of things.    1. You can, I have had no Java experience previously and since modding have managed to be quite knowledgeable in Java.   2. Modding does not require massive teams, I and many others work alone, though having a team is certainly helpful in the modding process to get things done in a quicker and more organised way.   3. I absolutely have to recommend ModdingByKaupenjoe, he makes loads of tutorials for Minecraft from 1.16.5 and above with support for Forge, Fabric, and as of his 1.21 tutorials, Neoforge. These tutorials are really well made, covering almost every modding topic, (such as items, blocks, mobs, worldgen, etc.) and are pretty easy to follow, and Kaupenjoe always leaves the link to his GitHub repositories where you can view the code of that tutorial at your own pace as well as linking textures in the description of his videos for you to use. These forums are also quite good if you need help, though I have found that it sometimes takes a little while for a response but it is always worth the wait; from my experience the people on these forums have always been kind and helpful. There are also user-submitted tutorials that may be helpful as well.  Using GitHub to search up a certain class that you are wanting to use in your mod is also quite helpful, the video I have linked goes into more detail. I would also recommend planning out your mod before you make it to have a clearer idea of how you want your mod to be, including sketches and annotations are also a good idea for this. It has helped me make progress a lot quicker when programming as I already know how I want things to look/act.   I hope all this information helps!
    • I don't know what I did differently, but the error code changed to "Invalid signature for profile public key" so I set "enforce-secure-profile" to false since only my friend will be allowed to join anyway and then everything worked properly. Here's the logs anyway, but I hope the problem doesn't come back. https://paste.ee/p/Ri44L
  • Topics

×
×
  • Create New...

Important Information

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