PrismarineJS / minecraft-jar-extractor

Extract structured data from the minecraft jar
8 stars 10 forks source link

Extract block_name -> model names from decompiled client code #3

Open rom1504 opened 8 years ago

rom1504 commented 8 years ago

To avoid having to write the mapping manually.

rom1504 commented 8 years ago

Actually I think the mapping is id(/name)+meta -> model

(example of model name : "cake_slice4")

rom1504 commented 8 years ago

(model files provide a direct mapping to textures)

rom1504 commented 8 years ago

Oh actually stuff in assets/minecraft/blockstates provide the name->model mapping as .json files !

rom1504 commented 8 years ago

name->model yes, but name is the variation name. It would be nice to extract the block -> variation names mapping from the code to avoid writing mappings manually.

rom1504 commented 8 years ago

17:37 < rom1504> I need to get the block->block_state_name mapping hmm (stuff like "acacia_log") 17:38 < rom1504> I guess it's in the client code 17:38 < Gjum> rom1504: what is this block_state_name? 17:40 < Gjum> oh, because log is the block, but the meta makes it acacia 17:41 < Gjum> yes it's in the client code at net/minecraft/client/renderer/block/model/ModelBakery.java so burger could extract it 17:41 < rom1504> it's the stuff in assets/minecraft/blockstates , which I'm using to go to models, which themselves go to textures 17:41 < rom1504> blockstates are the closer ones to actual block names, but not 100% because of variations 17:42 < Gjum> so blockstates are a replacement for id:meta? 17:42 < rom1504> writing a mapping manually atm (there are like only 15 non-block-name so it's reasonable), but i'd better get it automatically 17:43 < rom1504> Gjum: kind of but mostly for the graphical part 17:43 < Gjum> rom1504: https://gist.github.com/Gjum/2439bc5a0ba54abaa24f 17:43 < rom1504> oh nice 17:44 < rom1504> that depends on mcp though hmm 17:44 < Gjum> not really, you just need to search for one of them in the decompiled source I guess 17:45 < rom1504> my script is currently fully automated, just give it the version and it gives you the texture dir + a name -> texture_name mapping (it downloads, unzip and all) 17:45 < rom1504> Gjum: one of what ? 17:45 < rom1504> I need to search for the block name 17:46 < rom1504> ah yeah I could first figure out the class_name<->block_name mapping from the code 17:46 < rom1504> then use that

rom1504 commented 8 years ago

18:19 < rom1504> Fenhl: how did you get these "3d" images https://github.com/wurstmineberg/assets.wurstmineberg.de/blob/master/img/grid/birchwoodstairs.png ? 18:19 < rom1504> generate them with something ? 18:19 <+Fenhl> rom1504: from the wiki :P 18:21 <+Fenhl> they're mostly generated by Majr using Blender iirc 18:21 <+Fenhl> I'm planning to generate them from the Minecraft client assets though, similar to what Mapcrafter does

rom1504 commented 8 years ago

Kind of done. Remaining (but not stricly necessary):

Gjum commented 8 years ago

any progress on getting the images of the variants?