PaperMC / PaperMC/Paper

Allow access to the pixel colors of a map

Open
#12,916 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Is your feature request related to a problem?

Yes

Describe the solution you'd like.

A way to access all colors/pixels of a map, so that it can be retrieved for database storage or cross server synchronization.

Describe alternatives you've considered.

The current way i do this is by using reflection to retrieve the buffer field from the maps MapItemSavedData#vanillaRender.

This field returns a byte[], which represents all colors stored as indexes, but since usage of the byte indexes is recently deprecated in the API, all access to byte -> color related methods are now scheduled for removal. So i will be unable to convert the retrieved byte[] into proper colors to for example render a map from one server on another, or save the pixel data.

After the removal, i am unsure how to continue development without access to map pixel data

Other

No response

Contributor guide

Open the contributing guide

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 reviewing MapItemSavedData#vanillaRender and the current API methods that expose map byte indexes, including the methods scheduled for removal. Determine the public representation needed for retrieving all map colors or pixels; done means callers can obtain pixel data for database storage, synchronization, or rendering without reflection or deprecated byte-to-color methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.