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

Decide where to put channel data

Open rom1504 opened this issue 7 years ago • 6 comments

example https://gist.github.com/plexigras/3e5d408ce303ac47b9e34838eac2d353

@plexigras

also write the rest of http://wiki.vg/Plugin_channels

rom1504 avatar Aug 10 '16 18:08 rom1504

Possibilities :

  • put it straight in protocol.json as top-level types (or in a channel namespace)
  • create a channels.json

Anyway, the data needs to be written.

rom1504 avatar Aug 10 '16 18:08 rom1504

I guess a channels.json might be simpler for maintenance purposes (no need to change all the existing protocol.json)

rom1504 avatar Aug 10 '16 18:08 rom1504

(any opinion @roblabla @hansihe ?)

rom1504 avatar Aug 10 '16 18:08 rom1504

Going for a separate channels.json seems like the best approach to me.

hansihe avatar Aug 10 '16 19:08 hansihe

ok so it should look like this :

{
  "types": {
    "MC|Brand":"string",
    "MC|TrList": [
      "container",
      [
        {
          "name": "windowId",
          "type": "i32"
        },
        {
          "name": "trades",
          "type": [
            "array",
            {
              "countType": "i8",
              "type": [
                "container",
                [
                  {
                    "name": "firstInput",
                    "type": "slot"
                  },
                  {
                    "name": "output",
                    "type": "slot"
                  },
                  {
                    "name": "hasSecondItem",
                    "type": "bool"
                  },
                  {
                    "name": "secondaryInput",
                    "type": [
                      "switch",
                      {
                        "compareTo": "hasSecondItem",
                        "fields": {
                          "true": "slot",
                          "false": "void"
                        }
                      }
                    ]
                  },
                  {
                    "name": "disabled",
                    "type": "bool"
                  },
                  {
                    "name": "toolUses",
                    "type": "i32"
                  },
                  {
                    "name": "maxTradeuses",
                    "type": "i32"
                  }
                ]
              ]
            }
          ]
        }
      ]
    ]
  }
}

@plexigras let's try to keep the camelCase convention for naming fields ok ?

rom1504 avatar Aug 11 '16 06:08 rom1504

made a channels branch for it there https://github.com/PrismarineJS/minecraft-data/blob/channels/data/pc/1.10/channels.json You can PR to it @plexigras

rom1504 avatar Aug 11 '16 06:08 rom1504