Jump to content

Help creating a tool?


sfxworks

Recommended Posts

Trying to make a tool (not a mod. Sorry if this is in the wrong category) that will dive through any jar file I give it.  It should be able to retrieve any new items/blocks added by the mod as well as any recipes and images related to said items/blocks.

 

Want to make some sort of modpack creator/server lister/mod detailer/super awesome thing in the future and this is a key component.

 

Any clue as to where I would start? Just diving through Tinker's Construct with WinRar points me to a bunch of classes with unreadable text..

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

This is not easily possible at all. If anything this would be doable as a mod that runs alongside any other mods you want to analyze.

 

So something like Idfix http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291014-idfix-and-idfix-minus-mods-for-resolving-id where it pulls the mod items and changes their item ids? (The part where it pulls the items & recipes being the part I want)

 

Any idea on how to start using a method like that?

 

I guess I'd have a server that would start & stop and generate reports based on the mods loaded..

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

Just diving through Tinker's Construct with WinRar points me to a bunch of classes with unreadable text..

 

That's because you're looking at the raw bytecode for the mod, not the source code.

If you wanted to read .class files as code, you'd need to decompile it first (fortunately Java is an open source format, albeit complicated).

 

Or you can write it as a mod, as diesieben suggests.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Just diving through Tinker's Construct with WinRar points me to a bunch of classes with unreadable text..

 

That's because you're looking at the raw bytecode for the mod, not the source code.

If you wanted to read .class files as code, you'd need to decompile it first (fortunately Java is an open source format, albeit complicated).

 

Or you can write it as a mod, as diesieben suggests.

 

Decompiling sounds interesting (but another learning curve). Making a mod sounds a bit more interesting. Only made one unlaunched bukkit mod before so playing with forge sounds like a cool new hobby.

 

You would write a mod like normal. Then when the game has loaded you'd go through the registries of the stuff that you want and print out whatever info you need.

 

fx3kcF.jpg

 

Now we're talking. Is there some sort of get all items and blocks from the registry function? I can see that I can search for one as of now. Miiiight not be a good idea to cycle through all possible a-z0-9 variations.

 

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

The

ForgeRegistries

class exposes each registry (blocks, items, etc.) as an

IForgeRegistry

. This extends

Iterable

, so you can iterate through the registry's values with a for-each/enhanced for loop.

 

You can also use

IForgeRegistry#getEntries

to get the entries (keys and values).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

The

ForgeRegistries

class exposes each registry (blocks, items, etc.) as an

IForgeRegistry

. This extends

Iterable

, so you can iterate through the registry's values with a for-each/enhanced for loop.

 

You can also use

IForgeRegistry#getEntries

to get the entries (keys and values).

 

Heh, this is pretty fun.

 

rLocwi.jpg

 

I see a lot of properties I can take advantage of. The only ones I can't find are a default recipe and an image representing the item/block. Where would I find said properties?

 

 

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

You don't need to use an

Iterator

to iterate through an

Iterable

, just use an enhanced for loop.

 

Blocks don't have a single recipe or image. There are many recipes, some of which may output a specified block. Each block can have a model per state, each model can use multiple textures.

 

CraftingManager#getRecipeList

returns the recipe list,

IRecipe#getRecipeOutput

returns the recipe's default output (may be

null

). Recipes can change their actual output based on the contents of the crafting grid, so the default output may not be what the player actually gets when they craft it.

 

BlockModelShapes#getModelForState

returns the model for the specified block state.

IBakedModel#getParticleTexture

returns the model's particle texture (could be used as the default texture).

IBakedModel#getQuads

returns a list of

BakedQuad

s,

BakedQuad#getSprite

returns the quad's texture.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Mind there's also Smelting recipes (Furnace.getSmelting() iirc) and brewing recipes.

Mods then may add their own recipes devices (grinders, sifters, macerators, crushers, extractors, compressers, canners, electrolyzers, injectors, washers, mixers...).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Mind there's also Smelting recipes (Furnace.getSmelting() iirc) and brewing recipes.

Mods then may add their own recipes devices (grinders, sifters, macerators, crushers, extractors, compressers, canners, electrolyzers, injectors, washers, mixers...).

 

Is there a sort of official registry for said types of recipes or would I have to try to work with each mod individually?

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

Is there a sort of official registry for said types of recipes or would I have to try to work with each mod individually?

 

There is not. You would need to handle every mod individually.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Is there a sort of official registry for said types of recipes or would I have to try to work with each mod individually?

 

There is not. You would need to handle every mod individually.

 

Does Too Many Items and Not Enough Items go through the trouble of doing this? I would figure they would have some sort of way to bring up different crafting styles automatically.

 

Is there a sort of default property inside a Mod that stories it's custom recipes along with some detail on it's crafting mechanics?

I have a github https://github.com/sfxworks

 

Also try Public Desktop. It's the main thing I develop/talk about on my twitter.

 

https://twitter.com/quantomworks

 

http://www.speedyshare.com/bVBeE/ProjectDesktop2-0.exe#.V012CNPy7Kg.twitter

Link to comment
Share on other sites

Does Too Many Items and Not Enough Items go through the trouble of doing this? I would figure they would have some sort of way to bring up different crafting styles automatically.

 

Is there a sort of default property inside a Mod that stories it's custom recipes along with some detail on it's crafting mechanics?

 

They have an API that allows mods to register handlers for their custom recipe types, there's no way to automatically handle every recipe type.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.