Interface ChangeWorldBorderEvent
- All Superinterfaces:
Cancellable,Event
- All Known Subinterfaces:
ChangeWorldBorderEvent.Player,ChangeWorldBorderEvent.World
Fired when the world border changes for a
Player or a World.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn event that is fired when a player's world border is changed.static interfaceFired when a value on a world'sWorldBorderis changed. -
Method Summary
Modifier and TypeMethodDescriptionGets the border that will be used as anOptional.Gets the border that was originally meant to be used as anOptional.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 Details
-
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
Sets the border that will be used.- Parameters:
worldBorder- The border that will be used.
-