mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 11:05:13 +01:00
Correctly validate map colors. Fixes BUKKIT-4984
The validation check in CraftMapView.render(CraftPlayer) filters out any values less than 0. As of Minecraft 1.7, -128 through -113 are valid colors, so filtering them out prevents some of the new colors from being sent. This commit fixes the issue by adjusting the validation check to include any values less than or equal to -113. As the minimum value for a byte is -128, no invalid colors are included.
This commit is contained in:
parent
169fd46960
commit
e5353b82a7
1 changed files with 3 additions and 1 deletions
|
@ -147,7 +147,9 @@ public final class CraftMapView implements MapView {
|
|||
|
||||
byte[] buf = canvas.getBuffer();
|
||||
for (int i = 0; i < buf.length; ++i) {
|
||||
if (buf[i] >= 0) render.buffer[i] = buf[i];
|
||||
byte color = buf[i];
|
||||
// There are 143 valid color id's, 0 -> 127 and -128 -> -113
|
||||
if (color >= 0 || color <= -113) render.buffer[i] = color;
|
||||
}
|
||||
|
||||
for (int i = 0; i < canvas.getCursors().size(); ++i) {
|
||||
|
|
Loading…
Reference in a new issue