PrismarineJS / PrismarineJS/node-minecraft-assets

Easier way to access pre-1.13 colored items

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
22
Forks
21
Avg merge
50m
Merged PRs (30d)
2

Description

In versions 1.12.2 and below, some colored items (wool, concrete, glass, ...) had a single type and the color was coded into the item's metadata

const metadataToColor = {
  0: 'white',
  1: 'orange',
  2: 'magenta',
  3: 'light_blue',
  4: 'yellow',
  5: 'lime',
  6: 'pink',
  7: 'gray',
  8: 'silver',
  9: 'cyan',
  10: 'purple',
  11: 'blue',
  12: 'brown',
  13: 'green',
  14: 'red',
  15: 'black'
}

Right now I'm having to access pre-1.13 colored items (wool, concrete, glass, ...) using something like this:

  const textureBase64 = fs.readFileSync(path.join(
    mcAssets.directory, 'blocks', 'wool_colored_blue.png')
  ).toString('base64')

I think there should be an easier way


Also, this is more of a minecraft-assets issue but:

  • require('minecraft-assets')('1.12.2').textureContent['glass_pane'].texture is null
  • require('minecraft-assets')('1.12.2').textureContent['concrete'].texture is null

Related to mineflayer-web-inventory#28

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how version 1.12.2 exposes colored block textures through the public minecraft-assets API, including the textureContent examples in the issue. Compare the existing wool access pattern with glass and concrete, then define a consistent access path and verify that the affected pre-1.13 items no longer return null.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.