Jump to content

[1.11.2] Custom armor model not showing properly


Daring Do

Recommended Posts

I'm trying to add in the explosive slave collar as an item in game, however I can't get it to show on the player model properly. Removing it from the ClientProxy makes it invisible, but leaving it in there, it shows as a glowing Steve head with a leather helmet.

 

How it's supposed to look:

Spoiler

unknown.png

 

How it actually looks when in the ClientProxy:

Spoiler

2017-07-14_10.42.40.png

 

And my code that has any mention of the item and/or model:

 

Honestly, I wish I could've used JSON files for this. It would've been much easier... and knowing me, it's likely a super small piece in the code I've been unable to spot, due to how miniscule it is. But I've looked over the code 20 times at this point, and I'm running thin on ideas. So if anyone has any ideas on how to make it show up as it's supposed to, I'm listening.

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

15 minutes ago, Daring Do said:

Honestly, I wish I could've used JSON files for this. It would've been much easier... and knowing me, it's likely a super small piece in the code I've been unable to spot, due to how miniscule it is. But I've looked over the code 20 times at this point, and I'm running thin on ideas. So if anyone has any ideas on how to make it show up as it's supposed to, I'm listening.

I'm pretty sure it is the fact that your Collar uses ArmorMaterial.LEATHER. Make a custom one and use that instead.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

15 minutes ago, Animefan8888 said:

I'm pretty sure it is the fact that your Collar uses ArmorMaterial.LEATHER. Make a custom one and use that instead.

Nope. It just does this:

2017-07-16_10_55_23.thumb.png.3da6af9876e06649bf988b0b4ea9f6d2.png

 

Nothing =/ 

Edited by Daring Do

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

5 minutes ago, Kokkie said:

Show your code

Only code that had mention to leather armor:

Spoiler

package init;

import com.ibm.icu.text.DisplayContext.Type;

import camellias_.fallout.Reference;
import items.ItemExplosivecollar;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ModArmor 
{
    public static ArmorMaterial EXPLOSIVECOLLARM = EnumHelper.addArmorMaterial("EXCOLLAR", null, 5, new int[]{1, 3, 2, 1}, 1, null, 0);
    
    public static ItemArmor explosivecollar;
    
    public static void init()
    {
        explosivecollar = new ItemExplosivecollar(EXPLOSIVECOLLARM, 1, EntityEquipmentSlot.HEAD);
    }
    
    public static void register()
    {
        GameRegistry.register(explosivecollar);
    }
    
    public static void registerRenders()
    {
        
    }
    
    private static void registerRender(Item item) {
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    }

}
 

 

Changed to have a custom armor type.

Edited by Daring Do

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

4 minutes ago, Daring Do said:

Only code that had mention to leather armor:

  Reveal hidden contents

package init;

import com.ibm.icu.text.DisplayContext.Type;

import camellias_.fallout.Reference;
import items.ItemExplosivecollar;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ModArmor 
{
    public static ArmorMaterial EXPLOSIVECOLLARM = EnumHelper.addArmorMaterial("EXCOLLAR", null, 5, new int[]{1, 3, 2, 1}, 1, null, 0);
    
    public static ItemArmor explosivecollar;
    
    public static void init()
    {
        explosivecollar = new ItemExplosivecollar(EXPLOSIVECOLLARM, 1, EntityEquipmentSlot.HEAD);
    }
    
    public static void register()
    {
        GameRegistry.register(explosivecollar);
    }
    
    public static void registerRenders()
    {
        
    }
    
    private static void registerRender(Item item) {
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    }

}
 

 

Changed to have a custom armor type.

I suggest stepping through your code in the debugger set a breakpoint at the top of getArmorModel.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

11 minutes ago, Animefan8888 said:

I suggest stepping through your code in the debugger set a breakpoint at the top of getArmorModel.

Attempted that, and Ecplise denied it, saying it was a syntax error and to delete it, with not optional fixes.

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

1 minute ago, Daring Do said:

Attempted that, and Ecplise denied it, saying it was a syntax error and to delete it, with not optional fixes.

Could you show me in a picture?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 minutes ago, Animefan8888 said:

Could you show me in a picture?

I'm betting I did it wrong, but eh. And also, I noticed I forgot to register the render for the armor in the ModArmor class, but no, that wasn't it either, if you were thinking it might have been.

 

B6JE6Dd.png

 

(I'm still rather new to coding in general, so yeah... mostly been following tutorials and frankensteining most of the code I get, building my understanding that way, which works well enough for me, until I hit a roadblock like this :/)

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

Just now, Daring Do said:

I'm betting I did it wrong, but eh. And also, I noticed I forgot to register the render for the armor in the ModArmor class, but no, that wasn't it either, if you were thinking it might have been.

A breakpoint and a break are two different things. Look up how to set a breakpoint in eclipse.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

6 minutes ago, Animefan8888 said:

A breakpoint and a break are two different things. Look up how to set a breakpoint in eclipse.

Ah, okay. Set one up, then. I assumed it was probably somewhat similar to HTML, but I suppose not. Though I might just be thinking of a line break... anyways, running in debug with the breakpoint set at that line.

 

And pressing f5 crashes the game. And completely alters my workspace, apparently.

Edited by Daring Do

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

1 minute ago, Daring Do said:

And pressing f5 crashes the game.

It shouldn't crash the game, it will basically pause it and eclipse should prompt you. Say yes and you should get a debug ui that you can view things with. That looks something like this, though the color shouldn't change.

eclipse debug.png

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

4 minutes ago, Animefan8888 said:

It shouldn't crash the game, it will basically pause it and eclipse should prompt you. Say yes and you should get a debug ui that you can view things with. That looks something like this, though the color shouldn't change.

eclipse debug.png

Oh. Well, I did get that. But the game still crashed.

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

Just now, Daring Do said:

Oh. Well, I did get that. But the game still crashed.

Post the crash report.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

9 minutes ago, Animefan8888 said:

Post the crash report.

Wait, there isn't one... the heck?

 

Maybe it's not a full crash. It just stops responding. I've got that back up, though.

Edited by Daring Do

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

1 minute ago, Daring Do said:
  Reveal hidden contents

---- Minecraft Crash Report ----
// But it works on my machine.

Time: 7/14/17 11:13 AM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Fallout (camfm)
Caused by: net.minecraftforge.fml.common.LoaderException: java.lang.InstantiationException
    at net.minecraftforge.fml.common.ProxyInjector.inject(ProxyInjector.java:102)
    at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:626)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148)
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:582)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:233)
    at net.minecraft.client.Minecraft.init(Minecraft.java:478)
    at net.minecraft.client.Minecraft.run(Minecraft.java:387)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
Caused by: java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at net.minecraftforge.fml.common.ProxyInjector.inject(ProxyInjector.java:85)
    ... 39 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.11.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 796841480 bytes (759 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.38 Powered by Forge 13.20.1.2388 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UC    minecraft{1.11.2} [Minecraft] (minecraft.jar) 
    UC    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
    UC    FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.1.2388.jar) 
    UC    forge{13.20.1.2388} [Minecraft Forge] (forgeSrc-1.11.2-13.20.1.2388.jar) 
    UE    camfm{0.1} [Fallout] (bin) 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'Intel' Version: '4.4.0 - Build 20.19.15.4463' Renderer: 'Intel(R) HD Graphics 5500'

 

Something is wrong with your Proxy setup. Post your main mod class and make sure that your proxies have zero argument constructors.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, Animefan8888 said:

Something is wrong with your Proxy setup. Post your main mod class and make sure that your proxies have zero argument constructors.

I posted one from a while back, not realizing that that was from over half an hour ago. It just stops responding, which I assumed meant a crash was imminent. I usually would execute the process to save time. But it's back up, not responding, that same setup back on Eclipse.

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

1 minute ago, Daring Do said:

It just stops responding, which I assumed meant a crash was imminent.

As you have realized that is not what it means. When you set a breakpoint you essentially says pause here and let me take a look.

2 minutes ago, Daring Do said:

that same setup back on Eclipse.

The one I posted or the normal one?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, Animefan8888 said:

As you have realized that is not what it means. When you set a breakpoint you essentially says pause here and let me take a look.

The one I posted or the normal one?

Eeyup. The one you posted

Edited by Daring Do

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

Just now, Daring Do said:

Eeyup. The one you posted

Good. Now what you can do is click on the buttons on the top left of eclipse "step into", "step over", and "step return" which come after the "resume", "suspend", and "terminate" buttons. And in doing so you can see how your code is executing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Animefan8888 said:

Good. Now what you can do is click on the buttons on the top left of eclipse "step into", "step over", and "step return" which come after the "resume", "suspend", and "terminate" buttons. And in doing so you can see how your code is executing.

Erm, they're muted into the background. I can't use any of those. That entire section of buttons is unclickable.

Gne9eza.png

 

"Be patient with me, because I'm an absolute moron half the time."

Link to comment
Share on other sites

1 minute ago, Daring Do said:

Erm, they're muted into the background. I can't use any of those. That entire section of buttons is unclickable.

Did you run the game in debug mode?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.



×
×
  • Create New...

Important Information

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