mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +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
2624d0d54f
commit
276f86cc29
1 changed files with 40 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.bukkit.map;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
@ -35,12 +36,47 @@ public interface MapCanvas {
|
|||
*/
|
||||
public void setCursors(@NotNull MapCursorCollection cursors);
|
||||
|
||||
/**
|
||||
* Draw a pixel to the canvas.
|
||||
* <p>
|
||||
* The provided color might be converted to another color,
|
||||
* which is in the map color range. This means, that
|
||||
* {@link #getPixelColor(int, int)} might return another
|
||||
* color than set.
|
||||
*
|
||||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @param color The color.
|
||||
*/
|
||||
void setPixelColor(int x, int y, @NotNull Color color);
|
||||
|
||||
/**
|
||||
* Get a pixel from the canvas.
|
||||
*
|
||||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @return The color.
|
||||
*/
|
||||
@NotNull
|
||||
Color getPixelColor(int x, int y);
|
||||
|
||||
/**
|
||||
* Get a pixel from the layers below this canvas.
|
||||
*
|
||||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @return The color.
|
||||
*/
|
||||
@NotNull
|
||||
Color getBasePixelColor(int x, int y);
|
||||
|
||||
/**
|
||||
* Draw a pixel to the canvas.
|
||||
*
|
||||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @param color The color. See {@link MapPalette}.
|
||||
* @deprecated Magic value, use {@link #setPixelColor(int, int, Color)}
|
||||
*/
|
||||
public void setPixel(int x, int y, byte color);
|
||||
|
||||
|
@ -50,7 +86,9 @@ public interface MapCanvas {
|
|||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @return The color. See {@link MapPalette}.
|
||||
* @deprecated Magic value, use {@link #getPixelColor(int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public byte getPixel(int x, int y);
|
||||
|
||||
/**
|
||||
|
@ -59,7 +97,9 @@ public interface MapCanvas {
|
|||
* @param x The x coordinate, from 0 to 127.
|
||||
* @param y The y coordinate, from 0 to 127.
|
||||
* @return The color. See {@link MapPalette}.
|
||||
* @deprecated Magic value, use {@link #getBasePixelColor(int, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public byte getBasePixel(int x, int y);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue