Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Need help with rendering .obj models 1.11


Recommended Posts

I'm pretty new to modding, have no real knowledge of java so im not trying to do anything super advanced here, just a simple one block obj model that i've done. So here's the problem. I have for a few days been trying and searching all over the internet for support on how to render .obj models into my mod in minecraft. I've tried alot of things according to what people have been suggesting but all i get is either purple, black chess-like block or an invisible one with text on it. I have checked the destinations and such but i just can't get it to work. I register my block(s) in a file i call "modblocks" and my modid and such in a file called "reference". 

 

The code: https://gist.github.com/triphion/d5c39d6ba118e01c17d5c745e634fe88

 

The error: https://gist.github.com/triphion/c613989e139fdbe623213bcce75d6172

Link to post
Share on other sites
8 minutes ago, Triphion said:

I have already done so in my client proxy preinit.

You don't actually call proxy.preInit.

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 post
Share on other sites
6 minutes ago, Triphion said:

What do you mean? I have called objloader.instance.addomain (Reference.modid) in my client proxy class under pre init. Isn't that what i should do?

You only call proxy.registerRenderers, but not proxy.preInit as @Animefan8888 said.

And don't use unlocalized names for model registering, use Block::getRegistryName.

Edited by V0idWa1k3r
Link to post
Share on other sites
10 minutes ago, Triphion said:

Block getregistryname should be in what class exactly? My block class or my modblock class?

getRegistryName is from IRegistryEntry.Impl which all registry types (Block, Item, etc) extend.

Edited by Animefan8888

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 post
Share on other sites
9 minutes ago, Triphion said:

So in my blockclass then?

In your block object/field/variable call getRegistryName() instead of getUnlocalizedName()

as you do right here

Quote

new ResourceLocation(Reference.MODID, block.getUnlocalizedName().substring(5))

 

 

11 minutes ago, Triphion said:

Well, do my objmodel call work as it is right now?

You are the one with the code...check.

12 minutes ago, Triphion said:

Or in what class should i call objloader?

You call it in your ClientProxy, it is just you never call the method ClientProxy#preInit

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 post
Share on other sites

[19:52:36] [Client thread/INFO] [FML]: OBJLoader: Domain ancient has been added.

Is this line here proof of the objloader working? I'm sorry, but as i said im really new to this and im trying to learn so please be patient with me. ^^

And also, this is what comes up as error. What could this mean? 

[19:52:51] [Client thread/ERROR] [FML]: Could not load vanilla model parent 'ancient:block/bee_box.obj' for 'net.minecraft.client.renderer.block.model.ModelBlock@613da64b

Exception loading model ancient:block/bee_box.obj with loader INSTANCE, skipping

Edited by Triphion
Link to post
Share on other sites
4 minutes ago, Triphion said:

[19:52:36] [Client thread/INFO] [FML]: OBJLoader: Domain ancient has been added.

Is this line here proof of the objloader working? I'm sorry, but as i said im really new to this and im trying to learn so please be patient with me. ^^

Where do you call proxy.preInit

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 post
Share on other sites
Just now, Triphion said:

Okey, so withing proxy.preinit i should call objloader? Right? But in what class should i call proxy.preinit? In the Client proxy? Sorry if im being a complete imbecile here but im really trying lol. 

Look at where you call proxy.init

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 post
Share on other sites
Just now, Triphion said:

And you call it in the init method, so you should call proxy.preInit in your ancientmod class's preInit method.

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 post
Share on other sites

So this should make the objloader work now?     

@EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        ModBlocks.init();
        ModItems.init();
        ModTools.init();
        ModArmour.init();
        ModDevItems.init();
        ModSpecialItems.init();
        DevModArmour.init();
        ModBlocks.register();
        ModItems.register();
        ModTools.register();
        ModArmour.register();
        ModDevItems.register();
        ModSpecialItems.register();
        DevModArmour.register();
        
        proxy.preInit();
        OBJLoader.INSTANCE.addDomain(Reference.MODID.toLowerCase());
        
        proxy.registerRenders();
        
        AchievementHandler.registerAchievements();
    }

Link to post
Share on other sites
4 minutes ago, Triphion said:

So this should make the objloader work now?     

OBJLoader.INSTANCE.addDomain(Reference.MODID.toLowerCase()); is already called in your proxy.preInit class.

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 post
Share on other sites

Okey, so i found an error here, but i have no idea what im supposed to change to get rid of it since it looks like my objloader is executed. 

Caused by: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Error loading model previously: ancient:models/block/bee_box.obj
    at net.minecraftforge.client.model.obj.OBJLoader.loadModel(OBJLoader.java:103) ~[OBJLoader.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    ... 23 more
Caused by: java.io.FileNotFoundException: ancient:models/block/beeboxers.mtl

Link to post
Share on other sites

Your OBJ model needs to have an MTL file associated with it.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to post
Share on other sites
17 minutes ago, Triphion said:

I have an .mtl and an .obj file located in the same directory. models\block. I'm setting up a repository right now so you can navigate through it quickly and maybe tell me exactly where i went wrong. 

What went wrong was it is looking for  beeboxers.mtl not bee_box.mtl

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 post
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.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Here it is the part of the code, the Item:   and the entities' :  
    • My forge wont work in any version of 1.16 ive tried everything but it just doesn't seem to work and i dont know what else to do. Around 3-4 months ago it was working fine. but when one day I got onto vanilla minecraft with optifine on to play with my friends and the next day my forge wasnt working it works with every other version of minecraft just everything from 1.16.1-1.16.5 wont work when I try to use forge. Whenever I try starting up my forge it immediately crashes and it doesnt even start up the game, even when I dont have any mods in the mod folder. When it crashed it says and i quote "An unexpected Issue has occured and the game has crashed. We're sorry for the inconvenience. Exit Code: 0" This doesnt happen when I use the curseforge launcher to launch 1.16 modpacks this only happens when I use the installer that I downloaded. Pls Help Me!
    • None of the code you've shown here is registering an item.   I also don't know why you wrapped DeferredRegister.create in a function with a convoluted signature rather than just going ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES);
    • My forge wont work in any version of 1.16 ive tried everything but it just doesn't seem to work and i dont know what else to do. Around 3-4 months ago it was working fine. but when one day I got onto vanilla minecraft with optifine on to play with my friends and the next day my forge wasnt working it works with every other version of minecraft just everything from 1.16.1-1.16.5 wont work when I try to use forge. Whenever I try starting up my forge it immediately crashes and it doesnt even start up the game, even when I dont have any mods in the mod folder. When it crashed it says and i quote "An unexpected Issue has occured and the game has crashed. We're sorry for the inconvenience. Exit Code: 0" This doesnt happen when I use the curseforge launcher to launch 1.16 modpacks this only happens when I use the installer that I downloaded.
    • I want the HUD to render something different from the DisplayName of the focused item in the hotbar. I was guessing, this had to be done within the RenderGameOverlayEvent but could not find a way to do it. Can someone give me a suggestion on how to achieve this without changing the item?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.