public class SignChangeEvent extends BlockEvent implements Cancellable
If a Sign Change event is cancelled, the sign will not be changed.
Event.Result
block
Constructor and Description |
---|
SignChangeEvent(@NotNull Block theBlock,
@NotNull Player player,
List<net.kyori.adventure.text.Component> adventure$lines) |
SignChangeEvent(@NotNull Block theBlock,
@NotNull Player thePlayer,
@NotNull String[] theLines)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@Nullable String |
getLine(int index)
Deprecated.
in favour of
line(int) |
@NotNull String[] |
getLines()
Deprecated.
in favour of
lines() |
@NotNull Player |
getPlayer()
Gets the player changing the sign involved in this event.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
net.kyori.adventure.text.Component |
line(int index)
Gets a single line of text from the sign involved in this event.
|
void |
line(int index,
net.kyori.adventure.text.Component line)
Sets a single line for the sign involved in this event
|
List<net.kyori.adventure.text.Component> |
lines()
Gets all of the lines of text from the sign involved in this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setLine(int index,
@Nullable String line)
Deprecated.
in favour of
line(int, net.kyori.adventure.text.Component) |
getBlock
callEvent, getEventName, isAsynchronous
public SignChangeEvent(@NotNull @NotNull Block theBlock, @NotNull @NotNull Player player, @NotNull List<net.kyori.adventure.text.Component> adventure$lines)
@NotNull public @NotNull Player getPlayer()
@NotNull public List<net.kyori.adventure.text.Component> lines()
@Nullable public net.kyori.adventure.text.Component line(int index) throws IndexOutOfBoundsException
index
- index of the line to getIndexOutOfBoundsException
- thrown when the provided index is > 3
or < 0public void line(int index, @Nullable net.kyori.adventure.text.Component line) throws IndexOutOfBoundsException
index
- index of the line to setline
- text to setIndexOutOfBoundsException
- thrown when the provided index is > 3
or < 0@NotNull @Deprecated public @NotNull String[] getLines()
lines()
@Nullable @Deprecated public @Nullable String getLine(int index) throws IndexOutOfBoundsException
line(int)
index
- index of the line to getIndexOutOfBoundsException
- thrown when the provided index is > 3
or < 0@Deprecated public void setLine(int index, @Nullable @Nullable String line) throws IndexOutOfBoundsException
line(int, net.kyori.adventure.text.Component)
index
- index of the line to setline
- text to setIndexOutOfBoundsException
- thrown when the provided index is > 3
or < 0public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.