minecraft-data icon indicating copy to clipboard operation
minecraft-data copied to clipboard

images ?

Open rom1504 opened this issue 10 years ago • 26 comments

see https://github.com/wurstmineberg/assets.wurstmineberg.de/tree/master/img/grid

It might be interesting for http://prismarinejs.github.io/minecraft-data purposes

rom1504 avatar Oct 29 '15 15:10 rom1504

What about just extracting them from the .jar when generating the docs? I don't feel the need to have these in minecraft-data, as they are more of a (default, preinstalled) resource pack.

Also, legal issues should be considered before we redistribute them.

Gjum avatar Jan 14 '16 17:01 Gjum

Yeah it's true that these images take 3MB.

Maybe they should be stored elsewhere (the mcdata docs are hosted by github though, so that would be somewhere else on github (/an other repo))

No clue about legal issues but http://minecraft.gamepedia.com/Data_values/Block_IDs is using these images just fine.

rom1504 avatar Jan 14 '16 17:01 rom1504

mojang's brand guidelines about "assets":

[who is using them] MUST [...] NOT include anything else around it that makes people think that you or what you are doing is official; approved or endorsed by us; or associated or connected with us; [...] sufficiently differentiate the use of any Name you are using from any other branding.

(last part regarding the PrismarineJS name)

So using them in the docs with a disclaimer should be fine.

Gjum avatar Jan 14 '16 18:01 Gjum

On that theme https://github.com/deathcap/ProgrammerArt is interesting, if not vanilla mc.

rom1504 avatar Jan 19 '16 23:01 rom1504

Well, it's already been mentioned, but I think this repo should keep using as much of the mojangian data as it possibly can. Given the guidelines (and the track record of Mojang), I think it'd be safe to include their assets, properly categorized, if we put a disclaimer somewhere in the README.

roblabla avatar Jan 20 '16 00:01 roblabla

:-1: for including Minecraft image assets in minecraft-data, not only would bloat the repo unnecessarily but a better solution imho is for graphical clients to support loading arbitrary resource/texture packs (e.g. using this module), which can include minecraft.jar if the user chooses, or a freely-redistributable resource pack like my own ProgrammerArt (CC), or Pixeludi Pack as used in TrueCraft

Worth noting, there are other NPM modules already with other texture packs: such as https://www.npmjs.com/package/painterly-textures and https://www.npmjs.com/package/isabella-texture-pack - if you want to publish textures I'd rather it be in a separate module, and minecraft-data stick to programmatically-useful structures like protocols, recipes etc.

deathcap avatar Jan 24 '16 05:01 deathcap

On the other hand, I think including the texture image names could be a good idea — as the mapping between item name and texture is not straightforward, and it doesn't seem this data is currently available in minecraft-data.

For example, data/1.8/items.json:

  {
    "id": 295,
    "displayName": "Seeds",
    "stackSize": 64,
    "name": "wheat_seeds"
  },

this item has a texture of "textures/items/seeds_wheat.png"

edit: looks like this information is in the resource pack data (models/item/wheat_seeds.json - textures layer0: "items/seeds_wheat")

deathcap avatar Feb 07 '16 20:02 deathcap

So, I'm going to try to figure out this issue for https://github.com/rom1504/minecraft-crafter/issues/2 (http://rom1504.github.io/web-minecraft-crafter/)

If I understand correctly I only need the texture names for https://github.com/deathcap/artpacks and then I should be able to use something like https://github.com/deathcap/inventory-window with an existing pack like https://github.com/deathcap/ProgrammerArt or mojang pack.

I think instead of bloating blocks.json even more, I'm going to make a textures.json than will be extracted from the vanilla minecraft assets files, and that will reference the blocks and items by their ids (or names ?)

rom1504 avatar Mar 04 '16 19:03 rom1504

How to get data from the client:

  1. open ~/.minecraft/versions/1.8.9/1.8.9.json
  2. at the end of the file, get client.jar url
  3. download it
  4. unzip it
  5. assets/minecraft/models/item contain json files

These json files seem to have to standard minecraft names (the property "name" in our blocks.json and items.json).

wheat_seeds.json contain:

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "items/seeds_wheat"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -2.5 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

seeds_wheat is the name of the texture image file.

That means it looks like all the information is available from the .jar in a structured way.

edit: an easier way to get the jar is simply https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/1.8.8.jar

edit2: It's now possible to get the jar by doing downloadMinecraft 1.8.8 1.8.8.jar client (https://github.com/rom1504/node-minecraft-wrap)

rom1504 avatar Mar 04 '16 19:03 rom1504

What do texture packs generally contain and how can we link it to standard block/item names ?

rom1504 avatar Mar 04 '16 19:03 rom1504

related http://hydra-media.cursecdn.com/minecraft.gamepedia.com/f/f5/ItemCSS.png <span class="sprite item-sprite" style="background-position:-80px -0px;"><br></span>

rom1504 avatar Mar 04 '16 20:03 rom1504

Any idea when this may become a thing? instead of me having to keep a block to texture map in my code.

wgaylord avatar Mar 07 '16 05:03 wgaylord

Done at https://github.com/rom1504/minecraft-assets

It's still kind of raw, so I'll close that issue when I tried to use these images and it works ok.

rom1504 avatar Mar 18 '16 17:03 rom1504

Would it make sense to put https://github.com/rom1504/minecraft-assets/blob/master/data/1.8.8/blocks_textures.json directly in minecraft-data ?

rom1504 avatar Mar 18 '16 18:03 rom1504

Yes. Maybe even the same type of thing for sounds later.

wgaylord avatar Mar 19 '16 01:03 wgaylord

Only problem I see is it does not account for metadata.

wgaylord avatar Mar 19 '16 01:03 wgaylord

I went with keeping it separate for now, and built a wrapper for node at https://github.com/rom1504/node-minecraft-assets/

I think it probably make sense to keep it separate, at least until it's more clear how stuff could go into mcdata.

Yes indeed it doesn't account for metadata, I need that kind of thing https://github.com/PrismarineJS/minecraft-jar-extractor/issues/3#issuecomment-198464127 for this, it's not completely easy. I think not having the metadata variation of images is ok for now.

rom1504 avatar Mar 19 '16 01:03 rom1504

The variant name is in the block's json file for the texture data if I recall.

wgaylord avatar Mar 19 '16 01:03 wgaylord

Or am I wrong here.

wgaylord avatar Mar 19 '16 01:03 wgaylord

No , each variation is in its one file, the names of these files are mapped to the block names in the client code.

rom1504 avatar Mar 19 '16 02:03 rom1504

I could make some python code to extract this data. (With out decompiling.) If that would help.

wgaylord avatar Mar 23 '16 02:03 wgaylord

How would you extract that data without decompiling ?

rom1504 avatar Mar 23 '16 07:03 rom1504

Using jawa.

wgaylord avatar Mar 23 '16 12:03 wgaylord

Ok yeah, that's a way to decompile.

On Wed, Mar 23, 2016, 13:18 Chibill [email protected] wrote:

Using jawa.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/PrismarineJS/minecraft-data/issues/78#issuecomment-200326006

rom1504 avatar Mar 23 '16 13:03 rom1504

No.. It's a Python module.... http://jawa.tkte.ch/

wgaylord avatar Mar 23 '16 13:03 wgaylord

Jawa is a pure-python Java disassembler

disassembling means decompiling in this case.

Gjum avatar Mar 23 '16 14:03 Gjum