Class XWorldBorder

java.lang.Object
com.cryptomorin.xseries.XWorldBorder

public abstract class XWorldBorder extends Object
Send different World Border data to each player. This class is merely for visual purposes and doesn't support player HP damaging features.
Version:
2.0.0
  • Field Details

  • Constructor Details

    • XWorldBorder

      public XWorldBorder()
  • Method Details

    • getDamageBuffer

      public abstract double getDamageBuffer()
    • getSizeLerpTarget

      public abstract double getSizeLerpTarget()
    • getSize

      public abstract double getSize()
    • isWithinBorder

      public abstract boolean isWithinBorder(org.bukkit.Location location)
    • getWarningDistance

      public abstract int getWarningDistance()
    • getWarningTime

      public abstract Duration getWarningTime()
    • getCenter

      public abstract org.bukkit.Location getCenter()
    • setFor

      public abstract void setFor(Collection<org.bukkit.entity.Player> players, boolean forceInit)
    • getBorderBounds

      public final XWorldBorder.BorderBounds getBorderBounds()
    • copy

      public abstract XWorldBorder copy()
    • setDamageBuffer

      public abstract XWorldBorder setDamageBuffer(double blocks)
    • setWarningTime

      public abstract XWorldBorder setWarningTime(Duration time)
    • setWarningDistance

      public abstract XWorldBorder setWarningDistance(int blocks)
      Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
    • setSize

      public XWorldBorder setSize(double newSize)
    • setSize

      public XWorldBorder setSize(double newSize, @NotNull @NotNull Duration duration)
    • setSizeLerpTarget

      public XWorldBorder setSizeLerpTarget(double sizeLerpTarget)
      The old size in which the border shrinking starts from.
      Parameters:
      sizeLerpTarget - in blocks.
      See Also:
    • setCenter

      public abstract XWorldBorder setCenter(org.bukkit.Location location)
    • setCenter

      public XWorldBorder setCenter(double x, double z)
    • update

      public XWorldBorder update(org.bukkit.entity.Player... players)
      Updates may be instant without needing this method, but it's always recommended to call this method after you're done to ensure changes are sent to the players.
      Parameters:
      players - The players to send the updates to. Note that only players that were previously set using setFor(Collection, boolean) must be present here, otherwise you only need to call the other method.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDistanceToBorder

      public final double getDistanceToBorder(org.bukkit.Location location)
    • updateBorderBounds

      protected void updateBorderBounds(org.bukkit.Location center)
    • create

      public static XWorldBorder create()
    • getOrCreate

      public static XWorldBorder getOrCreate(org.bukkit.entity.Player player)
    • get

      @Nullable public static @Nullable XWorldBorder get(org.bukkit.entity.Player player)
    • remove

      @Nullable public static @Nullable XWorldBorder remove(org.bukkit.entity.Player player)
    • from

      public static XWorldBorder from(org.bukkit.WorldBorder bukkitWb)