Jump to content

[SOLVED!] [1.12.2]Making an item using an OBJ model and blockstates JSON


Thegametutor101

Recommended Posts

10 minutes ago, Thegametutor101 said:

If i don't put the .obj wouldn't it get confused between pokeball.obj and pokeball.mtl..?

No. .mtl is not a .obj file. AFAIK It will look for .obj files first if you called OBJLoader.addDomain, then it will look for .json files.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

8 hours ago, Cadiboo said:

No. .mtl is not a .obj file. AFAIK It will look for .obj files first if you called OBJLoader.addDomain, then it will look for .json files.

Done..still doesn't work

 

8 hours ago, V0idWa1k3r said:

Well, if you would update your github repository I could debug it and tell you the next issue.

here you go:

https://github.com/Thegametutor101/Pixelmon_Project_School/tree/Pixelmon_Main

Link to comment
Share on other sites

Now you never call the pre-init method in your proxy, thus the OBJLoader doesn't know that it is supposed to process your mod. You did have it called previously, why you removed that lime of code I don't know.

You do need the .obj extension at the definition of your model so the OBJLoader itself knows that you are looking for a wavefront model.

 

Also stop using common proxy, it makes no sense.

And don't have your common proxy as your server proxy, that makes even less sense.

 

And well, it took me a while to figure this issue out, but your blockstates file isn't a forge blockstates file. 

forge_maker != forge_marker.

 

Now those issues done and all your obj model is still broken.

Quote

Caused by: java.lang.RuntimeException: OBJLoader.Parser: Exception parsing line #986: `vt 1.029911 0.247618`

UVs MUST be within a [0-1] bounds. This one isn't.

  • Like 1
Link to comment
Share on other sites

11 hours ago, V0idWa1k3r said:

Now you never call the pre-init method in your proxy, thus the OBJLoader doesn't know that it is supposed to process your mod. You did have it called previously, why you removed that lime of code I don't know.

You do need the .obj extension at the definition of your model so the OBJLoader itself knows that you are looking for a wavefront model.

 

Also stop using common proxy, it makes no sense.

And don't have your common proxy as your server proxy, that makes even less sense.

 

And well, it took me a while to figure this issue out, but your blockstates file isn't a forge blockstates file. 

forge_maker != forge_marker.

 

Now those issues done and all your obj model is still broken.

UVs MUST be within a [0-1] bounds. This one isn't.

OH YEAH!! Finally it works!!

I placed the OBJLoader back in the Main's preInit

Checked every single line for vt out of bounds

Corrected the forge_marker tag I miss spelled

Set the Main to use the ClientProxy instead of CommonProxy

 

ok the model needs work but it finally loads!! Thank you so Much @V0idWa1k3r!!!

 

 

2019-04-22_12.19.36.png

Link to comment
Share on other sites

6 hours ago, Thegametutor101 said:

I placed the OBJLoader back in the Main's preInit

This will crash on a dedicated server

6 hours ago, Thegametutor101 said:

Set the Main to use the ClientProxy instead of CommonProxy

This entirely defeats the whole point of proxies and will crash very uglily on a dedicated server

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I would just not use proxies at all. I would put OBJLoader.addDomain in the static initialisers of my client event subscriber.

Proxies work by having a common interface that both your server and client proxy implement and having a field with @SidedProxy that Forge will fill with an instance of either your server or client proxy class when your mod is loaded. This allows you to run code that will crash on the wrong physical side. For your problem you should have a method in your proxy interface called addOBJLoaderDomainIfOnClient. Then your server proxy should have a NOOP implementation (an implementation that doesn’t do anything at all) and your client proxy should have an implementation that calls OBJLoader.addDomain. You would then call PROXY.addOBJLoaderDomainIfOnClientin preInit. On the dedicated server this would do nothing, and on the client it will register your domain.

As you can see, proxies are a lot more complicated than sided event subscribers where everything just works(tm).

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

31 minutes ago, Cadiboo said:

I would just not use proxies at all. I would put OBJLoader.addDomain in the static initialisers of my client event subscriber.

Proxies work by having a common interface that both your server and client proxy implement and having a field with @SidedProxy that Forge will fill with an instance of either your server or client proxy class when your mod is loaded. This allows you to run code that will crash on the wrong physical side. For your problem you should have a method in your proxy interface called addOBJLoaderDomainIfOnClient. Then your server proxy should have a NOOP implementation (an implementation that doesn’t do anything at all) and your client proxy should have an implementation that calls OBJLoader.addDomain. You would then call PROXY.addOBJLoaderDomainIfOnClientin preInit. On the dedicated server this would do nothing, and on the client it will register your domain.

As you can see, proxies are a lot more complicated than sided event subscribers where everything just works(tm).

Ok. So if I understand correctly:

 

I create a method in the Proxies named "addOBJLoaderDomainIfOnClient" that has inside of it the OBJLoader.addDomain.

 

Then in my RegistryHandler (where I register all items/blocks @BusSubscribeEvent) I would call the method in my proxy through a @SubscribeEvent.

 

And finally I have the CommonProxy implement "NOOP"

 

...is that right?

 

I'm not sure if you mean't I call the "addOBJLoaderDomainIfOnClient" method from the Main's preInit

or in a "@BusSubscribeEvent" s "@SubscribeEvent".

Link to comment
Share on other sites

1 minute ago, Thegametutor101 said:

I create a method in the Proxies named "addOBJLoaderDomainIfOnClient" that has inside of it the OBJLoader.addDomain.

No, you create an empty method if you’re using a normal class or an abstract method if your using an abstract class or define a method if your using an interface.

2 minutes ago, Thegametutor101 said:

Then in my RegistryHandler (where I register all items/blocks @BusSubscribeEvent) I would call the method in my proxy through a @SubscribeEvent.

This would work but it doesn’t make sense to call it from there, you would call the method in preInit.

3 minutes ago, Thegametutor101 said:

And finally I have the CommonProxy implement "NOOP"

If your using a class, yes. NOOP stands for NO OPeration i.e. do nothing.

 

4 minutes ago, Thegametutor101 said:

I'm not sure if you mean't I call the "addOBJLoaderDomainIfOnClient" method from the Main's preInit

or in a "@BusSubscribeEvent" s "@SubscribeEvent".

If your using a proxy, you would call it from preInit. If you’re doing it in a client event subscriber you can just call it from inside a static initialiser, without any other code at all.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

4 minutes ago, Cadiboo said:

No, you create an empty method if you’re using a normal class or an abstract method if your using an abstract class or define a method if your using an interface.

This would work but it doesn’t make sense to call it from there, you would call the method in preInit.

If your using a class, yes. NOOP stands for NO OPeration i.e. do nothing.

 

If your using a proxy, you would call it from preInit. If you’re doing it in a client event subscriber you can just call it from inside a static initialiser, without any other code at all.

Ok perfect, I will try to implement all of this info into my mod

Link to comment
Share on other sites

14 hours ago, Cadiboo said:

No, you create an empty method if you’re using a normal class or an abstract method if your using an abstract class or define a method if your using an interface.

This would work but it doesn’t make sense to call it from there, you would call the method in preInit.

If your using a class, yes. NOOP stands for NO OPeration i.e. do nothing.

 

If your using a proxy, you would call it from preInit. If you’re doing it in a client event subscriber you can just call it from inside a static initialiser, without any other code at all.

Ok! did it all and everything works perfectly! Thank you @Cadiboo for explaning proxies for me :)

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.

Announcements



×
×
  • Create New...

Important Information

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