mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
SPIGOT-5984: Add non deprecated / magic value way to set pixel in MapCanvas
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
0edbb16bb4
commit
c67855f651
1 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.bukkit.craftbukkit.map;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import java.util.Arrays;
|
||||
import org.bukkit.map.MapCanvas;
|
||||
|
@ -35,6 +36,21 @@ public class CraftMapCanvas implements MapCanvas {
|
|||
this.cursors = cursors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPixelColor(int x, int y, Color color) {
|
||||
setPixel(x, y, MapPalette.matchColor(color));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getPixelColor(int x, int y) {
|
||||
return MapPalette.getColor(getPixel(x, y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getBasePixelColor(int x, int y) {
|
||||
return MapPalette.getColor(getBasePixel(x, y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPixel(int x, int y, byte color) {
|
||||
if (x < 0 || y < 0 || x >= 128 || y >= 128)
|
||||
|
|
Loading…
Reference in a new issue