-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map updates are ignored after the first call to render() #11856
Comments
The updates are ignored after the first call to render(). A simple MapRenderer with this code was able to reproduce the problem for me: @Override
public void render(MapView view, MapCanvas canvas, Player player) {
BufferedImage image = new BufferedImage(128, 128, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setColor(new Color((int) (Math.random() * 255)));
g.fillRect(0, 0, 128, 128);
canvas.drawImage(0, 0, image);
}```
The maps should cycle between colors constantly, but they remain static. This does work as expected on Spigot. |
cough This is why I shouldn't open tickets from things I understand nothing about 😂 Thanks for the help though! :) |
From a 2 second glance, looks like mojang changed some of the logic here and that collides with an optimisation we have to not waste time doing stuff that won't be sent to the client? |
hm, no, nvm, it's not what I was looking at, that logic is still fine |
Thanks for taking a look, really curious as to why this started happening 🤔 |
The issue was within the drawImage method, there's an optimization in there to copy the image to the map in a more efficient manner, but doing so it was failing to mark the altered pixels as changed, causing them to not be sent to the client. I've created a PR that fixes this, and the reproduction code works fine with it. |
Wohooo, that sounds amazing. I'll also verify if it's working as the new build of paper comes out and if all is good I'll close this issue as well as the other one on the ImageMaps repo :) |
Expected behavior
Map updates should not be ignored from updates after the initial call to render().
Observed/Actual behavior
Maps do not render unless you rejoin
Steps/models to reproduce
This GitHub issue is the whole conversation between me and the developer of ImageMaps. He even provides a way to reproduce the issue: SydMontague/ImageMaps#70
Plugin and Datapack List
Not really relevant, all you technically need is the ImageMaps plugin or the code they provided in the issue I linked above.
Paper version
[Sun 01:47:38 INFO ] Checking version, please wait...
[Sun 01:47:38 INFO ] This server is running Paper version 1.21.4-65-main@287eb52 (2024-12-28T23:19:11Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-53-326c687 (MC: 1.21.4)
Other
No response
The text was updated successfully, but these errors were encountered: