Giter VIP home page Giter VIP logo

minecraft-data's Issues

Is indexing in items.json and blocks.json a good thing ?

Currently blocks and items are indexed by id in items.json and blocks.json.
Is that really a good idea ? As seen in #7 users sometimes need to index by name or by metadata+id.

It should probably not be the responsibility of minecraft-data to choose that indexing, but the responsibility of the reader/user.

Not doing that indexing would simply mean using json arrays instead of json objects.

Use countType in array to reduce field count

Example :

{
  "name": "chunkDataLength",
  "type": "count",
  "typeArgs": {
    "type": "varint",
    "countFor": "chunkData"
  }
},
{
  "name": "chunkData",
  "type": "buffer",
  "typeArgs": {
    "count": "chunkDataLength"
  }
}

should become

{
  "name": "chunkData",
  "type": "buffer",
  "typeArgs": {
    "countType": "varint"
  }
}

This greatly simplifies the protocol.json file, and makes it more obvious that count fields should not be supplied on write. I went over the 1.8 protocol, there are no instances where the count field is far away from the data it counts.

MCPE support

It'd be interesting to have the MCPE data available here as well. I believe the two games are close enough to actually be able to support both schema types. The protocol will probably be the one file to change the most, but I believe its schema won't have to change all that much either

Internationalization ?

Mojang provides Internationalization files in the client jar (for the display names)
It might be interesting in the long term to provide that kind of data somehow.

Example in english http://hastebin.com/tisalowasa

01:13 < roblabla> > you need to open 1.8.json
01:13 < roblabla> find the asset you want (probably minecraft/lang/en_GB.json
01:13 < roblabla> and see the associated hash
01:13 < roblabla> for me it's 03f31164d234f10a3230611656332f1756e570a9
01:13 < roblabla> then it's in assets/bojects/03/03f31164d234f10a3230611656332f1756e570a9
01:13 < roblabla> something like that
01:13 < roblabla> 1.8.json is inside .minecraft/assets/index

Expand option type doc

Option type documentation currently doesn't show the underlying type. Need to find a simple way to do that.

define the schema of a future Windows.json

22:09 <+Gjum> it's just the window name (for protocol), readable name (although that can get set by server), named slot ranges, names for the properties, and later buttons
22:10 <+Gjum> properties are for example the smelting progress of a furnace
22:11 <+Gjum> buttons would just be list[id -> "name"]
22:12 <+Gjum> and then there are some edge cases like the horse, and the player itself
22:12 <+Gjum> horse has an entity id, player has armor and crafting, but no nameID

Add metadata variation to items.json and blocks.json

We need to be able to know things (like the metadata id) about variation of blocks, like http://minecraft.gamepedia.com/Polished_Granite is a variation of http://minecraft.gamepedia.com/Granite

blocks.json currently looks like that :

"1": {
    "id": 1,
    "displayName": "Stone",
    "name": "stone",
    "hardness": 1.5,
    "stackSize": 64,
    "diggable": true,
    "boundingBox": "block",
    "material": "rock",
    "harvestTools": {
      "270": true,
      "274": true,
      "257": true,
      "278": true,
      "285": true
    }
  }

I propose a schema like that instead :

"1": [{
    "id": 1,
    "displayName": "Stone",
    "name": "stone",
    "hardness": 1.5,
    "stackSize": 64,
    "diggable": true,
    "boundingBox": "block",
    "material": "rock",
    "harvestTools": {
      "270": true,
      "274": true,
      "257": true,
      "278": true,
      "285": true
    }
  },
{
    "id": 1,
    "displayName": "Polished Stone",
    "name": "polishedStone",
    "hardness": 1.5,
    "stackSize": 64,
    "diggable": true,
    "boundingBox": "block",
    "material": "rock",
    "harvestTools": {
      "270": true,
      "274": true,
      "257": true,
      "278": true,
      "285": true
    }
  },

]

or similar : maybe some properties never change between two blocks only different by metadata ?

Create a blocksPhysics.json

With data like canFall , ...

Not sure what it would contain exactly and how it would be used.

The main point is we would have to build it manually though.

Expand buffer countType field

Currently, buffer "hides" the countType field. Need to find a simple way to reveal it. A suggestion rom1504 made : make type array counted by <countType>.

Minecraft versions : branches or folder

Currently mc version are stored as different branches.

Problem with that is a lot of commits need to be cherry-picked from 1.8 to 1.9 because they change things common between versions : changes in the README, sometimes changes in the extractors, new data files.

I think storing version in enums/1.8 and enums/1.9 might be saner : only the data should really be different.

  • the schemas should be the same : see #49
  • the readme should be the same
  • the extractor and tools are a bit more complicated, but basically it would be better to have everything that is common in common files and to have a few functions/files specific for different mc version / revision of the wiki / java decompiled code format

I think to be really sure it can work, the best way would be to try to use the extractors for 1.9.

So I'll do that at some point and that'll give us more info into that issue.

node.js data "provider" ?

I think it would be useful to have a javascript provider for node.js users of this library.
For example it might provide indexes and function using these indexes to find blocks by name (something like this https://github.com/PrismarineJS/minecraft-data/blob/master/bin/wiki_extractor/lib/find_item_object_by_name.js)

That way users of that library wouldn't have to build the index themselves every time (see #14 (comment) )

The problem is minecraft-data should stay a language interdependent library imho. Does that mean that "data provider" should still be in this repo and other language users would just not use them or should there be a "node-minecraft-data" repo that would depend on this repo and provide these indexer and all ?

I also thought about simply putting that provider inside mineflayer, but the thing is minecraft-data will be used by projects not using mineflayer (see PrismarineJS/prismarine-server#23)

The advantage of a node-minecraft-data provider is would provide an example of how to read the data, so that other people using other languages could do that kind of providers too if they want (for example a python-minecraft-data )

What do you think ?

New data in minecraft-data

New recipe format

Some cases are not handled by the recipes format, in particular a lot of thing related to metadata.
See https://github.com/PrismarineJS/minecraft-data/wiki/Recipe-format vs https://github.com/PrismarineJS/minecraft-data/wiki/Proposed-new-recipe-format
What should be done :

  • finish defining the new format
    • check it handles all cases
    • check it isn't too ugly
  • see how it would be implemented in mineflayer
  • update the wiki extractor scripts
  • update the resulting recipes.json file

Might also be related to PrismarineJS/mineflayer#222

It might also be a good idea to define a jsonformat for this ( see #2 ) if it's not too complicated.

Supporting several protocol versions

The current plan is to support minecraft 1.8.
But at some point 1.9 will be out, and supporting both version might be nice.
How could we support multiple versions ?
Different branches ? Different folders ?

(this is a long-term issue, mainly becoming relevant when 1.9 comes out)

Keeping file size reasonable and schema independance

Main issue

Currently each version has its own schema.

What would be nice is having a common schema for every version.

Problem is : new things will be added and older versions didn't have as much data.

An other problem : some files, for examples blocks.json contain too many things which is annoying when creating extraction scripts (and possibly when reading it too)

One solution : keep things meaningful, split big files.

For example we might have a blockVariation.json instead of storing all the variations in blocks.json.

That would allow to have one common schema for all the versions. Some version just wouldn't have some of the data files.

Related/ideas

The knowledge base way is close to what we are doing (for example <1,name,stone>)
and it's even possible to convert all our data to a knowledge base forma (like n triples) by using json ld (http://json-ld.org/)

Also see http://wikiba.se/

Document better harvestTools

Currently harvestTools is interpreted by mineflayer as requiredTools : one of these tool is needed to harvest a block (see https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/digging.js#L92 )

In the reality of data there are tools that improve the digging time but are not needed to dig that block. (see chest in http://minecraft.gamepedia.com/Breaking#Blocks_by_hardness for example)

I actually think that mineflayer algorithm to compute the digging time is correct (might be interesting to check that by computing a similar table than in http://minecraft.gamepedia.com/Breaking#Blocks_by_hardness using that algo) but it would be better to document that harvestTools means needed tools.

Also see http://minecraft.gamepedia.com/index.php?title=Template:Block&action=edit to understand better in which case a tool is required (=3.33 times penalty if not wearing it) or just better.

Packets and field names

Currently packets names are taken from https://github.com/aadnk/ProtocolLib/blob/master/ProtocolLib/src/main/java/com/comphenix/protocol/PacketType.java#L123
I don't know where the fields names are coming from (@roblabla ?)

These names are different from what is currently found in http://wiki.vg/Protocol

Can reasonable names be chosen to make protocol.json more standard ?

The packet name difference with wiki.vg can be seen here https://gist.github.com/rom1504/1b432d5e7efc278015dd/revisions?diff=split

I mapped the new names to the old and got that which show mainly the field names difference :
https://gist.github.com/rom1504/64535ed808327b78c72e/revisions?diff=split

Replace condition with the more powerful switch

Protocols define a data-type named "switch" which seem to handle everything condition does, in a cleaner, more readable way. It looks like this :

{
  "type": "switch",
  "typeArgs": {
      "compareTo": "this.someOtherArg",
      "fields": {
        "0": "int",
        "default": "void"
      }
  }
}

Void is a new datatype that does nothing. It doesn't read, and returns nothing. It may as well not have been called.

Block state data

There are block state files available by doing this :

mkdir /tmp/dminecraft
cp ~/.minecraft/versions/1.8.4/1.8.4.jar  /tmp/dminecraft
cd /tmp/dminecraft && unzip 1.8.4.jar
cd /tmp/dminecraft/assets/minecraft/blockstates

Example : birch_fence_gate.json :

{
    "variants": {
        "facing=south,in_wall=false,open=false": { "model": "birch_fence_gate_closed" },
        "facing=west,in_wall=false,open=false":  { "model": "birch_fence_gate_closed", "y": 90, "uvlock": true },
        "facing=north,in_wall=false,open=false": { "model": "birch_fence_gate_closed", "y": 180, "uvlock": true },
        "facing=east,in_wall=false,open=false":  { "model": "birch_fence_gate_closed", "y": 270, "uvlock": true },
        "facing=south,in_wall=false,open=true": { "model": "birch_fence_gate_open" },
        "facing=west,in_wall=false,open=true":  { "model": "birch_fence_gate_open", "y": 90, "uvlock": true },
        "facing=north,in_wall=false,open=true": { "model": "birch_fence_gate_open", "y": 180, "uvlock": true },
        "facing=east,in_wall=false,open=true":  { "model": "birch_fence_gate_open", "y": 270, "uvlock": true },
        "facing=south,in_wall=true,open=false": { "model": "birch_wall_gate_closed" },
        "facing=west,in_wall=true,open=false":  { "model": "birch_wall_gate_closed", "y": 90, "uvlock": true },
        "facing=north,in_wall=true,open=false": { "model": "birch_wall_gate_closed", "y": 180, "uvlock": true },
        "facing=east,in_wall=true,open=false":  { "model": "birch_wall_gate_closed", "y": 270, "uvlock": true },
        "facing=south,in_wall=true,open=true": { "model": "birch_wall_gate_open" },
        "facing=west,in_wall=true,open=true":  { "model": "birch_wall_gate_open", "y": 90, "uvlock": true },
        "facing=north,in_wall=true,open=true": { "model": "birch_wall_gate_open", "y": 180, "uvlock": true },
        "facing=east,in_wall=true,open=true":  { "model": "birch_wall_gate_open", "y": 270, "uvlock": true }
    }
}

Might be interesting for handling metadata/blockstate (and placing that kind of blocks)

A variations.json file ?

It might be interesting to have variations of name/displayName of blocks/items, that might be useful to parse what an user is saying.
It could look like that :

{
   "variation":"unique_identifier",
}

That could be extracted from :

  • redirect pages in the wiki
  • links labels in the wiki

Cut documentation into tabs

I propose something like one tab by data type (block, entity, protocol, ...) and then in each tab you can choose schema or value (like http://getbootstrap.com/javascript/#tabs )

That way the schema and the value display can take as much room as they need, and it will be less confusing to point somebody to the protocol values for example.

Unindex recipes and materials

Not having an index in json files makes it easier for users to index by what they need. That means the data doesn't have to change if one index or an other becomes more pratical (id vs id:metadata vs name ,... ). It also makes it possible to consider one element as a document of a database.

All json files are now unindexed except for recipes and materials.

I think materials could have a format like this :

{
  "material":"rock",
  "multipliers":  {
    "257": 6,
    "270": 2,
    "274": 4,
    "278": 8,
    "285": 12
  }
}

I'm not sure whether multipliers should be unindexed too since it only has one value, maybe.

The recipes file is currently indexed by output id. The simplest solution might be to just remove that indexing, and to say that the recipes should be ordered by a lexicographic order on (id,metadata) in order to have a decent diff.

Remove some duplicated recipes

For recipes for which any metadata in the items produce the same result (for example bed) :

  • remove the ingredients metadata (=any metadata)
  • have juste one recipe

Add block drops

Currently, there's no way to know what kind of blocks drops we can have. The problem with block drops is that they depend on item used to mine, among other things. Anyway, a good start would be :

{
  "id": 1,
  "name": "stone",
  // ...
  "drops": [{ "id": 4, "minAmount": 1, "maxAmount": 1 }]
}

The problem with the above : it doesn't take into account tool used to mine. Not too sure how to make the schema not too fugly otherwise...

How does this sound ?

Add some missing recipes

Some recipes are missing :

  • wool
  • banner

To do : fix the wiki recipes extractor to handle these.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.