mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-4182: Implement cursor captions
By: md_5 <git@md-5.net>
This commit is contained in:
parent
6da91b6b3c
commit
175280220b
2 changed files with 53 additions and 5 deletions
|
@ -21,11 +21,7 @@ public final class MapCursor {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
|
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
|
||||||
this.x = x;
|
this(x, y, direction, type, visible, null);
|
||||||
this.y = y;
|
|
||||||
setDirection(direction);
|
|
||||||
setRawType(type);
|
|
||||||
this.visible = visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,11 +34,47 @@ public final class MapCursor {
|
||||||
* @param visible Whether the cursor is visible by default.
|
* @param visible Whether the cursor is visible by default.
|
||||||
*/
|
*/
|
||||||
public MapCursor(byte x, byte y, byte direction, Type type, boolean visible) {
|
public MapCursor(byte x, byte y, byte direction, Type type, boolean visible) {
|
||||||
|
this(x, y, direction, type, visible, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the map cursor.
|
||||||
|
*
|
||||||
|
* @param x The x coordinate, from -128 to 127.
|
||||||
|
* @param y The y coordinate, from -128 to 127.
|
||||||
|
* @param direction The facing of the cursor, from 0 to 15.
|
||||||
|
* @param type The type (color/style) of the map cursor.
|
||||||
|
* @param visible Whether the cursor is visible by default.
|
||||||
|
* @param caption cursor caption
|
||||||
|
* @deprecated Magic value
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, String caption) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
setDirection(direction);
|
||||||
|
setRawType(type);
|
||||||
|
this.visible = visible;
|
||||||
|
this.caption = caption;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the map cursor.
|
||||||
|
*
|
||||||
|
* @param x The x coordinate, from -128 to 127.
|
||||||
|
* @param y The y coordinate, from -128 to 127.
|
||||||
|
* @param direction The facing of the cursor, from 0 to 15.
|
||||||
|
* @param type The type (color/style) of the map cursor.
|
||||||
|
* @param visible Whether the cursor is visible by default.
|
||||||
|
* @param caption cursor caption
|
||||||
|
*/
|
||||||
|
public MapCursor(byte x, byte y, byte direction, Type type, boolean visible, String caption) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
setDirection(direction);
|
setDirection(direction);
|
||||||
setType(type);
|
setType(type);
|
||||||
this.visible = visible;
|
this.visible = visible;
|
||||||
|
this.caption = caption;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -93,4 +93,20 @@ public final class MapCursorCollection {
|
||||||
return addCursor(new MapCursor((byte) x, (byte) y, direction, type, visible));
|
return addCursor(new MapCursor((byte) x, (byte) y, direction, type, visible));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a cursor to the collection.
|
||||||
|
*
|
||||||
|
* @param x The x coordinate, from -128 to 127.
|
||||||
|
* @param y The y coordinate, from -128 to 127.
|
||||||
|
* @param direction The facing of the cursor, from 0 to 15.
|
||||||
|
* @param type The type (color/style) of the map cursor.
|
||||||
|
* @param visible Whether the cursor is visible.
|
||||||
|
* @param caption banner caption
|
||||||
|
* @return The newly added MapCursor.
|
||||||
|
* @deprecated Magic value
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible, String caption) {
|
||||||
|
return addCursor(new MapCursor((byte) x, (byte) y, direction, type, visible, caption));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue