Class WorldBorderBoundsChangeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
io.papermc.paper.event.world.border.WorldBorderEvent
io.papermc.paper.event.world.border.WorldBorderBoundsChangeEvent
- All Implemented Interfaces:
Cancellable
@NullMarked
public class WorldBorderBoundsChangeEvent
extends WorldBorderEvent
implements Cancellable
Called when a world border changes its bounds, either over time, or instantly.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class WorldBorderEvent
worldBorderFields inherited from class WorldEvent
world -
Constructor Summary
ConstructorsConstructorDescriptionWorldBorderBoundsChangeEvent(World world, WorldBorder worldBorder, WorldBorderBoundsChangeEvent.Type type, double oldSize, double newSize, long duration) -
Method Summary
Modifier and TypeMethodDescription@NonNegative longDeprecated, for removal: This API element is subject to removal in a future version.Gets the time in ticks for the change.static HandlerListdoubleGets the new size of the world border.doubleGets the old size or the world border.getType()Gets if this change is an instant change or over-time change.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetDuration(@NonNegative long duration) Deprecated, for removal: This API element is subject to removal in a future version.in favor ofsetDurationTicks(long)voidsetDurationTicks(@Range(from=0L,to=2147483647L) long duration) Sets the time in ticks for the change.voidsetNewSize(double newSize) Sets the new size of the world border.Methods inherited from class WorldBorderEvent
getWorldBorderMethods inherited from class WorldEvent
getWorldMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
WorldBorderBoundsChangeEvent
@Internal public WorldBorderBoundsChangeEvent(World world, WorldBorder worldBorder, WorldBorderBoundsChangeEvent.Type type, double oldSize, double newSize, long duration)
-
-
Method Details
-
getType
Gets if this change is an instant change or over-time change.- Returns:
- the change type
-
getOldSize
public double getOldSize()Gets the old size or the world border.- Returns:
- the old size
-
getNewSize
public double getNewSize()Gets the new size of the world border.- Returns:
- the new size
-
setNewSize
public void setNewSize(double newSize) Sets the new size of the world border.- Parameters:
newSize- the new size
-
getDurationTicks
-
setDurationTicks
Sets the time in ticks for the change. Will changegetType()to returnWorldBorderBoundsChangeEvent.Type.STARTED_MOVE.- Parameters:
duration- the time in ticks for the change
-
getDuration
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofgetDurationTicks()Gets the time in milliseconds for the change. Will be 0 if instant.- Returns:
- the time in milliseconds for the change
-
setDuration
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofsetDurationTicks(long)Sets the time in milliseconds for the change. Will changegetType()to returnWorldBorderBoundsChangeEvent.Type.STARTED_MOVE.- Parameters:
duration- the time in milliseconds for the change
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-
getDurationTicks()