Jump to content

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


Recommended Posts

Posted

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?

Posted

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.

Posted

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/

  • 2 weeks later...
Posted

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

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Sorry for the late response, but the game opened and I made a world but it's stuck at 0% Here's the latest.log https://mclo.gs/peEb1R8 I disabled The Factory Must Grow and soulsweapons
    • Hey everyone! Two of my friends downloaded this modpack and are having an issue with the blocks loading in correctly. Grass looks like bamboo, waystones look like two barrels stacked on eachother, and wheat looks like water and stairs. What is this problem? How can we fix it? Neither of my other friends or myself had this issue. 
    • I removed Yung's cave biome mod and It wasnt in one of those biomes however the log file said the same line (([25Apr2025 21:20:15.500] [Flywheel Task Executor #5/WARN] [Embeddium-MixinTaintDetector/]: Mod(s) [oculus] are modifying Embeddium class me.jellysquid.mods.sodium.client.render.vertex.serializers.VertexSerializerRegistryImpl, which may cause instability.))
    • Note: i had a couple of ideas, but i just don't know how to execute them. The main idea was to make the new block (let's exemplify with a mixer) be essentially a clone of the mechanical mixer (different texture tho) that would have a different recipe type (instead of mixing, advanced_mixing) and i would copy all the create mod recipes and edit the processing time while also adding the tier dependent ones.
    • Hi! Before everything, thank you for even reading. I'm coming here in need of help making a few aspects for a create mod addon. It's an addon that aims to add almost the full periodic table with realistic ways of obtaining all the elements and capability of almost full automation. For what purpose? A techy armor and to go to the moon and rocky planets of the solar system. It'll have 3 different tiers of machines (mixer, millstone, crushing wheels): basic (just the normal create mod machines but renamed), advanced (25% faster and has recipes only possible for this tier and above) end elite (75% faster than basic and recipes only available for this tier). The problem is, I'm not a coder. I know less than the basics. I know how to do everything else but these machine tiers and i need some help if you can.
  • Topics

×
×
  • Create New...

Important Information

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