mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 17:57:34 +01:00
SPIGOT-7138: Can't retrieve pixel color from map
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
9c845eac07
commit
b3585dbf1f
@ -38,12 +38,17 @@ public class CraftMapCanvas implements MapCanvas {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPixelColor(int x, int y, Color color) {
|
public void setPixelColor(int x, int y, Color color) {
|
||||||
setPixel(x, y, MapPalette.matchColor(color));
|
setPixel(x, y, (color == null) ? -1 : MapPalette.matchColor(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Color getPixelColor(int x, int y) {
|
public Color getPixelColor(int x, int y) {
|
||||||
return MapPalette.getColor(getPixel(x, y));
|
byte pixel = getPixel(x, y);
|
||||||
|
if (pixel == -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MapPalette.getColor(pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user