diff options
author | md_5 <git@md-5.net> | 2018-07-29 15:09:54 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-29 15:09:54 +1000 |
commit | 32dd1e593b312a894b03095ac0d22a37f72ee5c5 (patch) | |
tree | 052c581d70710b6aa23cdd3a4daae1b597a2a0b3 | |
parent | 47e3d2954d0dd279c93524baec241b76acaef7c7 (diff) | |
download | bukkit-32dd1e593b312a894b03095ac0d22a37f72ee5c5.tar bukkit-32dd1e593b312a894b03095ac0d22a37f72ee5c5.tar.gz bukkit-32dd1e593b312a894b03095ac0d22a37f72ee5c5.tar.lz bukkit-32dd1e593b312a894b03095ac0d22a37f72ee5c5.tar.xz bukkit-32dd1e593b312a894b03095ac0d22a37f72ee5c5.zip |
SPIGOT-4182: Implement cursor captions
-rw-r--r-- | src/main/java/org/bukkit/map/MapCursor.java | 34 | ||||
-rw-r--r-- | src/main/java/org/bukkit/map/MapCursorCollection.java | 16 |
2 files changed, 49 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java index 94b26ae2..3205c92d 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java @@ -21,11 +21,41 @@ public final class MapCursor { */ @Deprecated public MapCursor(byte x, byte y, byte direction, byte 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. + */ + 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; } /** @@ -36,13 +66,15 @@ public final class MapCursor { * @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) { + public MapCursor(byte x, byte y, byte direction, Type type, boolean visible, String caption) { this.x = x; this.y = y; setDirection(direction); setType(type); this.visible = visible; + this.caption = caption; } /** diff --git a/src/main/java/org/bukkit/map/MapCursorCollection.java b/src/main/java/org/bukkit/map/MapCursorCollection.java index 1dc9025d..802d736d 100644 --- a/src/main/java/org/bukkit/map/MapCursorCollection.java +++ b/src/main/java/org/bukkit/map/MapCursorCollection.java @@ -93,4 +93,20 @@ public final class MapCursorCollection { 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)); + } } |