Class MapClickEvent
java.lang.Object
org.bukkit.event.Event
de.pianoman911.mapengine.api.event.MapEvent
de.pianoman911.mapengine.api.event.MapClickEvent
Represents a click on a map done by a player.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionMapClickEvent
(IMapDisplay display, MapClickType clickType, org.bukkit.entity.Player player, Vec2i clickPos, org.bukkit.Location worldPos, double interactDistance) -
Method Summary
Modifier and TypeMethodDescriptionasVec2i()
double
@NotNull PassthroughMode
void
passthroughMode
(@NotNull PassthroughMode passthroughMode) Used for filtering thePassthroughMode
of the packets which triggered this event.org.bukkit.entity.Player
player()
void
setPassthroughMode
(@NotNull PassthroughMode passthroughMode) Deprecated, for removal: This API element is subject to removal in a future version.toString()
org.bukkit.Location
worldPos()
int
x()
int
y()
Methods inherited from class de.pianoman911.mapengine.api.event.MapEvent
display, getHandlerList, getHandlers
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
MapClickEvent
public MapClickEvent(IMapDisplay display, MapClickType clickType, org.bukkit.entity.Player player, Vec2i clickPos, org.bukkit.Location worldPos, double interactDistance)
-
-
Method Details
-
clickType
- Returns:
- the interaction type used by the player
-
player
public org.bukkit.entity.Player player()- Returns:
- the player doing the click
-
x
public int x()- Returns:
- the clicked x-position in pixels
-
y
public int y()- Returns:
- the clicked y-position in pixels
-
asVec2i
- Returns:
- the clicked position as an
Vec2i
-
worldPos
public org.bukkit.Location worldPos()- Returns:
- the clicked position in the world as a
Location
-
interactDistance
public double interactDistance()- Returns:
- the distance at which the player clicked the map
-
passthroughMode
- Returns:
- the
PassthroughMode
of this event
-
setPassthroughMode
@Deprecated(forRemoval=true) public void setPassthroughMode(@NotNull @NotNull PassthroughMode passthroughMode) Deprecated, for removal: This API element is subject to removal in a future version.usepassthroughMode(PassthroughMode)
insteadUsed for filtering thePassthroughMode
of the packets which triggered this event.- Parameters:
passthroughMode
- the new passthrough mode
-
passthroughMode
Used for filtering thePassthroughMode
of the packets which triggered this event.- Parameters:
passthroughMode
- the new passthrough mode
-
toString
-
passthroughMode(PassthroughMode)
instead