Package org.bukkit.map

# Class MapCursorCollection

java.lang.Object
org.bukkit.map.MapCursorCollection

public final class MapCursorCollection extends Object
Represents all the map cursors on a `MapCanvas`. Like MapCanvas, a MapCursorCollection is linked to a specific `MapRenderer`.

## Constructor Summary

Constructors
Constructor
Description
`MapCursorCollection()`

## Method Summary

Modifier and Type
Method
Description
`@NotNull MapCursor`
`addCursor(int x, int y, byte direction)`
Add a cursor to the collection.
`@NotNull MapCursor`
`addCursor(int x, int y, byte direction, byte type)`
Deprecated.
Magic value
`@NotNull MapCursor`
`addCursor(int x, int y, byte direction, byte type, boolean visible)`
Deprecated.
Magic value
`@NotNull MapCursor`
`addCursor(int x, int y, byte direction, byte type, boolean visible, @Nullable String caption)`
Deprecated.
Magic value
`@NotNull MapCursor`
`addCursor(int x, int y, byte direction, byte type, boolean visible, Component caption)`
Deprecated.
Magic value
`@NotNull MapCursor`
`addCursor(@NotNull MapCursor cursor)`
Add a cursor to the collection.
`@NotNull MapCursor`
`getCursor(int index)`
Get a cursor from this collection.
`boolean`
`removeCursor(@NotNull MapCursor cursor)`
Remove a cursor from the collection.
`int`
`size()`
Get the amount of cursors in this collection.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MapCursorCollection

public MapCursorCollection()

## Method Details

### size

public int size()
Get the amount of cursors in this collection.

Returns:
  The size of this collection.

### getCursor

@NotNull public @NotNull MapCursor getCursor(int index)
Get a cursor from this collection.

Parameters:
  `index` - The index of the cursor.
Returns:
  The MapCursor.

### removeCursor

public boolean removeCursor(@NotNull @NotNull MapCursor cursor)
Remove a cursor from the collection.

Parameters:
  `cursor` - The MapCursor to remove.
Returns:
  Whether the cursor was removed successfully.

### addCursor

@NotNull public @NotNull MapCursor addCursor(@NotNull @NotNull MapCursor cursor)
Add a cursor to the collection.

Parameters:
  `cursor` - The MapCursor to add.
Returns:
  The MapCursor that was passed.

### addCursor

@NotNull public @NotNull MapCursor addCursor(int x, int y, byte direction)
Add a cursor to the collection.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
Returns:
  The newly added MapCursor.

### addCursor

@Deprecated @NotNull public @NotNull MapCursor addCursor(int x, int y, byte direction, byte type)
Deprecated.
Magic value
Add a cursor to the collection.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
Returns:
  The newly added MapCursor.

### addCursor

@Deprecated @NotNull public @NotNull MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible)
Deprecated.
Magic value
Add a cursor to the collection.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible.
Returns:
  The newly added MapCursor.

### addCursor

@Deprecated @NotNull public @NotNull MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible, @Nullable @Nullable String caption)
Deprecated.
Magic value
Add a cursor to the collection.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible.
  `caption` - banner caption
Returns:
  The newly added MapCursor.

### addCursor

@Deprecated @NotNull public @NotNull MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible, @Nullable Component caption)
Deprecated.
Magic value
Add a cursor to the collection.

Parameters:
  `x` - The x coordinate, from -128 to 127.
  `y` - The y coordinate, from -128 to 127.
  `direction` - The facing of the cursor, from 0 to 15.
  `type` - The type (color/style) of the map cursor.
  `visible` - Whether the cursor is visible.
  `caption` - banner caption
Returns:
  The newly added MapCursor.