Interface ChangeWorldBorderEvent
-
- All Superinterfaces:
Cancellable
,Event
- All Known Subinterfaces:
ChangeWorldBorderEvent.Player
,ChangeWorldBorderEvent.World
public interface ChangeWorldBorderEvent extends Event, Cancellable
Fired when the world border changes for aPlayer
or aWorld
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ChangeWorldBorderEvent.Player
An event that is fired when a player's world border is changed.static interface
ChangeWorldBorderEvent.World
Fired when a value on a world'sWorldBorder
is changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<WorldBorder>
newBorder()
Gets the border that will be used as anOptional
.java.util.Optional<WorldBorder>
originalNewBorder()
Gets the border that was originally meant to be used as anOptional
.java.util.Optional<WorldBorder>
previousBorder()
Gets the border that was previously used as anOptional
.void
setNewBorder(WorldBorder worldBorder)
Sets the border that will be used.-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
-
-
-
Method Detail
-
previousBorder
java.util.Optional<WorldBorder> previousBorder()
Gets the border that was previously used as anOptional
. There may be no border set for the target (especially if it is a player), in which case,Optional.empty()
is returned.- Returns:
- The border that was previously in use, if there was one.
-
originalNewBorder
java.util.Optional<WorldBorder> originalNewBorder()
Gets the border that was originally meant to be used as anOptional
. For some targets, the border may be unset and therefore they may not always have a border. It is in these instances thatOptional.empty()
is returned.- Returns:
- The border that will be in use, if there is one.
-
newBorder
java.util.Optional<WorldBorder> newBorder()
Gets the border that will be used as anOptional
. For some targets, the border may be unset and therefore they may not always have a border. It is in these instances thatOptional.empty()
is returned.- Returns:
- The border that will be in use, if there is one.
-
setNewBorder
void setNewBorder(WorldBorder worldBorder)
Sets the border that will be used.- Parameters:
worldBorder
- The border that will be used.
-
-