Posted July 20, 20178 yr 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
July 20, 20178 yr You need to call OBJLoader::addDomain with your modid as an argument before registering your models.
July 20, 20178 yr Author I have already done so in my client proxy preinit. https://gist.github.com/triphion/d5c39d6ba118e01c17d5c745e634fe88#file-ancientariusmod-src-main-java-com-triphion-ancient-proxy-clientproxy-java And reference.modid should call it since my modid is written inside my reference class. Edited July 20, 20178 yr by Triphion
July 20, 20178 yr 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.
July 20, 20178 yr Author 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? Edited July 20, 20178 yr by Triphion
July 20, 20178 yr 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 July 20, 20178 yr by V0idWa1k3r
July 20, 20178 yr Author Block getregistryname should be in what class exactly? My block class or my modblock class?
July 20, 20178 yr 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 July 20, 20178 yr 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.
July 20, 20178 yr Author So in my blockclass then? Well, do my objmodel call work as it is right now? Or in what class should i call objloader? Edited July 20, 20178 yr by Triphion
July 20, 20178 yr 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.
July 20, 20178 yr Author [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 July 20, 20178 yr by Triphion
July 20, 20178 yr 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.
July 20, 20178 yr Author Well, heres the line of code in my client proxy (where i have called objloader): https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/4196d98d76b9a8f9636433cb51395c15c579ed8d/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5Cproxy%5CClientProxy.java and here's the pre init in my "standard class": https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/4196d98d76b9a8f9636433cb51395c15c579ed8d/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5CAncientMod.java Edited July 20, 20178 yr by Triphion
July 20, 20178 yr Author 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.
July 20, 20178 yr 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.
July 20, 20178 yr Author I call proxy.init in my ancientmod class https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/4196d98d76b9a8f9636433cb51395c15c579ed8d/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5CAncientMod.java
July 20, 20178 yr Just now, Triphion said: I call proxy.init in my ancientmod class https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/4196d98d76b9a8f9636433cb51395c15c579ed8d/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5CAncientMod.java 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.
July 20, 20178 yr Author 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(); }
July 20, 20178 yr 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.
July 20, 20178 yr Author okey, here is the updated gist on my ancientmod class and my client proxy class. https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/5d53bee8b2480c0d5cb7ff26e47ec07b4db19962/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5CAncientMod.java https://gist.githubusercontent.com/triphion/d5c39d6ba118e01c17d5c745e634fe88/raw/5d53bee8b2480c0d5cb7ff26e47ec07b4db19962/AncientariusMod%5Csrc%5Cmain%5Cjava%5Ccom%5Ctriphion%5Cancient%5Cproxy%5CClientProxy.java
July 20, 20178 yr Author 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
July 20, 20178 yr 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/
July 20, 20178 yr Author 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. Here it is: https://github.com/triphion/Ancientarius/tree/master/src Edited July 20, 20178 yr by Triphion
July 20, 20178 yr 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.
July 20, 20178 yr Author Edit: I fixed it. Thank you all for the support. <3 Edited July 20, 20178 yr by Triphion
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.