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 aPlayeror aWorld.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceChangeWorldBorderEvent.PlayerAn event that is fired when a player's world border is changed.static interfaceChangeWorldBorderEvent.WorldFired when a value on a world'sWorldBorderis changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<WorldBorder>newBorder()Gets the border that will be used as anOptional.Optional<WorldBorder>originalNewBorder()Gets the border that was originally meant to be used as anOptional.Optional<WorldBorder>previousBorder()Gets the border that was previously used as anOptional.voidsetNewBorder(WorldBorder worldBorder)Sets the border that will be used.-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
-
-
-
Method Detail
-
previousBorder
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
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
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.
-
-