mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 05:11:27 +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,5 +1,6 @@
|
|||||||
package org.bukkit.map;
|
package org.bukkit.map;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@ -35,12 +36,47 @@ public interface MapCanvas {
|
|||||||
*/
|
*/
|
||||||
public void setCursors(@NotNull MapCursorCollection cursors);
|
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.
|
* Draw a pixel to the canvas.
|
||||||
*
|
*
|
||||||
* @param x The x coordinate, from 0 to 127.
|
* @param x The x coordinate, from 0 to 127.
|
||||||
* @param y The y coordinate, from 0 to 127.
|
* @param y The y coordinate, from 0 to 127.
|
||||||
* @param color The color. See {@link MapPalette}.
|
* @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);
|
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 x The x coordinate, from 0 to 127.
|
||||||
* @param y The y coordinate, from 0 to 127.
|
* @param y The y coordinate, from 0 to 127.
|
||||||
* @return The color. See {@link MapPalette}.
|
* @return The color. See {@link MapPalette}.
|
||||||
|
* @deprecated Magic value, use {@link #getPixelColor(int, int)}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public byte getPixel(int x, int y);
|
public byte getPixel(int x, int y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,7 +97,9 @@ public interface MapCanvas {
|
|||||||
* @param x The x coordinate, from 0 to 127.
|
* @param x The x coordinate, from 0 to 127.
|
||||||
* @param y The y coordinate, from 0 to 127.
|
* @param y The y coordinate, from 0 to 127.
|
||||||
* @return The color. See {@link MapPalette}.
|
* @return The color. See {@link MapPalette}.
|
||||||
|
* @deprecated Magic value, use {@link #getBasePixelColor(int, int)}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public byte getBasePixel(int x, int y);
|
public byte getBasePixel(int x, int y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user