Jump to content

[1.8] [CLOSED] Get the actual location of the mod's 'assets' folder.


mGamer426

Recommended Posts

Hello!

I'm kind of new in modding and I would like to know one thing. I'm making a mod for 1.8 and I want to make model creating (you know, writing all those .json files) a bit easier.

I want to make a model maker! I've already made a little preview of it, but there's one thing missing. Get the location of the assets folder, and inside of it, the models/item or models/block folder.

I'm working in the IntellijIDEA IDE and it is possible to do this by creating a separate module in the whole modding project, and set up a custom application launch, where it launches the model maker module before Minecraft runs. Because it's a separate module, it can easily reference the directories in the source folder. But after a good bit of time it is kind of annoying that every time I launch Minecraft the model maker runs, and it's not even needed. I think it is possible to implement all of this into the mod and get the assets folder location while Minecraft is running. Any ideas how to do this?

Link to comment
Share on other sites

Why wouldn't you output to a different folder? Create an output location that you want and access it with an IResourcePack. This will also allow you to 'hotswap' (guessing you'll have to force the ResourceManagers to reload unless you're feeling rather fancy) models in an out with something like a whitelist for the file contents (contained models).

I don't really see the merits of a secondary application launch, either wrap it up inside of a gui in minecraft or create a standalone, as you've mentioned dual launching applications is a PITA

I think its my java of the variables.

Link to comment
Share on other sites

Do you mean you want to read from the existing models, or do you want to write your new model to that location? Also, are you talking about models for entities, or for blocks and items?

 

In 1.8, entity models are defined in Java code (i.e. the classes that extend ModelBase) but blocks are defined in the blockstates JSON files. So I think you'd have to use different approaches for each case.

 

For the entity models, since the model is active code instead of a resource file I think it would be difficult to "parse" directly. Basically your parser would have  to sort through the class file and figure out what it is doing. So for entities I suggest you simply make your own type of resource and copy the information over but in a format that is easier for you to use.

 

For the blockstate and item models, they are already JSON so are fairly easy to parse. However, the vanilla models are going to be in Minecraft JAR, not your mod JAR. There is probably a way to access the vanilla models from your code, but again it might be easier to simply copy all of them over into your mod (you's simply have to cut and paste all the blockstate related asset packages into your project.

 

Reading existing ones is fairly easy, you just can either use standard Java methods for navigating the JAR, or you can use Minecraft helper methods for accessing resources. Parsing JSON files can be done with the GSON library, or you can make your own text-based format with your own parser.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the VERRRRY late response, and I'd like to thank both of you for the information.

After re-thinking the whole thing again and I think I'll go with the one that jabelar said. Now, I figured out that making this is VERRRRY complicated or it is not even possible. I don't really want to make that whole IResource thingy, but it is a good information... thanks RANKSHANK!

 

And, again thanks for both of you it really helped finding the solution: Copy + paste!  ;D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello there! I am trying to make custom dimensions for a modpack I am making in an older minecraft version, 1.16.5. I like that version and it has a few other mods that have not been updated that I would still like to use. Anyway, I am having a terrible time with getting my dimension to work and have tried using code from other peoples projects to at least figure out what I'm supposed to be doing but it has not been as helpful as I would have liked. If anyone could help that would be greatly appreciated! Here is my github with all the code as I am using it: https://github.com/BladeColdsteel/InvigoratedDimensionsMod I have also included the last log, https://pastebin.com/zX9vsDSq, I had when I tried to load up a world, let me know if there is anything else I should send though, thank you!
    • Whether you are a fan of Hypixel Bedwars, SkyWars and PvP gamemodes like that, well you would enjoy this server! We have a very fun and unique style of PvP that a lot of our players really enjoy and we want to bring this server to more players like you! Yes you reading this post haha. Introducing, the Minezone Network, home of SUPER CRAFT BLOCKS. We've been working on this server for over 4 years now. Here is what we have to offer: SUPER CRAFT BLOCKS: This has 3 different gamemodes you can play, Classic, Duels and Frenzy. Each mode offers over 60 kits to choose from, along with a total of over 60 maps, allowing for various different playstyles on each map. There are also random powerups that spawn on the map which can include Health Pots, Bazookas, Nukes, Extra Lives and way way more! There is also double jump in this gamemode as well, which makes PvP a lot more fun & unique. You only need a minimum of 2 players to start any mode! Classic: Choose a kit, 5 lives for each player, fight it out and claim the #1 spot! Look out for lightning as they can spawn powerups to really give you an advantage in the game! Duels: Fight against another random player or one of your friends and see who is the best! Frenzy: Your kit is randomly selected for you, each life you will have a different kit. You can fight with up to 100 players in this mode and lets see who will be the best out of that 100! All the other stuff from Classic/Duels apply to this mode as well like powerups. We have 2 ranks on this server too, VIP and CAPTAIN which has a bunch of different perks for SCB and other things like Cosmetics and more.   SERVER IP: If this server has caught your interest in any way, please consider joining and you will NOT regret it! Bring some of your friends online for an even better experience and join in on the fun at: IP: minezone.club Hope to see you online!   SERVER TRAILER: https://www.youtube.com/watch?v=0phpMgu1mH0
    • The mod give new blocks  
    • I will a Mode for 1.21 in this Mod give new block, items and dimensions   
  • Topics

×
×
  • Create New...

Important Information

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