Class BukkitAdapter

java.lang.Object
kr.toxicity.model.api.bukkit.platform.BukkitAdapter
All Implemented Interfaces:
kr.toxicity.model.api.platform.PlatformAdapter

public final class BukkitAdapter extends Object implements kr.toxicity.model.api.platform.PlatformAdapter
Provides an adapter for converting Bukkit objects to BetterModel platform objects.

This class implements PlatformAdapter and offers static utility methods for adapting entities, players, items, locations, and worlds.

Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull kr.toxicity.model.api.platform.PlatformLocation
    adapt(@NotNull org.bukkit.Location location)
    Adapts a Bukkit location to a PlatformLocation.
    static @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayer
    adapt(@NotNull org.bukkit.OfflinePlayer player)
    Adapts a Bukkit offline player to a PlatformOfflinePlayer.
    static @NotNull kr.toxicity.model.api.platform.PlatformWorld
    adapt(@NotNull org.bukkit.World world)
    Adapts a Bukkit world to a PlatformWorld.
    static @NotNull kr.toxicity.model.api.platform.PlatformEntity
    adapt(@NotNull org.bukkit.entity.Entity entity)
    Adapts a Bukkit entity to a PlatformEntity.
    static @NotNull kr.toxicity.model.api.platform.PlatformLivingEntity
    adapt(@NotNull org.bukkit.entity.LivingEntity livingEntity)
    Adapts a Bukkit living entity to a PlatformLivingEntity.
    static @NotNull kr.toxicity.model.api.platform.PlatformPlayer
    adapt(@NotNull org.bukkit.entity.Player player)
    Adapts a Bukkit player to a PlatformPlayer.
    static @NotNull kr.toxicity.model.api.platform.PlatformItemStack
    adapt(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Adapts a Bukkit item stack to a PlatformItemStack.
    @NotNull kr.toxicity.model.api.platform.PlatformItemStack
    air()
     
    boolean
     
    boolean
     
    @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayer
    offlinePlayer(@NotNull UUID uuid)
     
    @Nullable kr.toxicity.model.api.platform.PlatformPlayer
    player(@NotNull UUID uuid)
     
    int
     
    @NotNull kr.toxicity.model.api.platform.PlatformLocation
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BukkitAdapter

      public BukkitAdapter()
  • Method Details

    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformEntity adapt(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Adapts a Bukkit entity to a PlatformEntity.
      Parameters:
      entity - the Bukkit entity
      Returns:
      the platform entity
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformLivingEntity adapt(@NotNull @NotNull org.bukkit.entity.LivingEntity livingEntity)
      Adapts a Bukkit living entity to a PlatformLivingEntity.
      Parameters:
      livingEntity - the Bukkit living entity
      Returns:
      the platform living entity
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayer adapt(@NotNull @NotNull org.bukkit.OfflinePlayer player)
      Adapts a Bukkit offline player to a PlatformOfflinePlayer.
      Parameters:
      player - the Bukkit offline player
      Returns:
      the platform offline player
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformPlayer adapt(@NotNull @NotNull org.bukkit.entity.Player player)
      Adapts a Bukkit player to a PlatformPlayer.
      Parameters:
      player - the Bukkit player
      Returns:
      the platform player
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformItemStack adapt(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Adapts a Bukkit item stack to a PlatformItemStack.
      Parameters:
      itemStack - the Bukkit item stack
      Returns:
      the platform item stack
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformLocation adapt(@NotNull @NotNull org.bukkit.Location location)
      Adapts a Bukkit location to a PlatformLocation.
      Parameters:
      location - the Bukkit location
      Returns:
      the platform location
      Since:
      2.0.0
    • adapt

      @NotNull public static @NotNull kr.toxicity.model.api.platform.PlatformWorld adapt(@NotNull @NotNull org.bukkit.World world)
      Adapts a Bukkit world to a PlatformWorld.
      Parameters:
      world - the Bukkit world
      Returns:
      the platform world
      Since:
      2.0.0
    • player

      @Nullable public @Nullable kr.toxicity.model.api.platform.PlatformPlayer player(@NotNull @NotNull UUID uuid)
      Specified by:
      player in interface kr.toxicity.model.api.platform.PlatformAdapter
    • offlinePlayer

      @NotNull public @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayer offlinePlayer(@NotNull @NotNull UUID uuid)
      Specified by:
      offlinePlayer in interface kr.toxicity.model.api.platform.PlatformAdapter
    • serverViewDistance

      public int serverViewDistance()
      Specified by:
      serverViewDistance in interface kr.toxicity.model.api.platform.PlatformAdapter
    • isTickThread

      public boolean isTickThread()
      Specified by:
      isTickThread in interface kr.toxicity.model.api.platform.PlatformAdapter
    • isRegionSafe

      public boolean isRegionSafe()
      Specified by:
      isRegionSafe in interface kr.toxicity.model.api.platform.PlatformAdapter
    • air

      @NotNull public @NotNull kr.toxicity.model.api.platform.PlatformItemStack air()
      Specified by:
      air in interface kr.toxicity.model.api.platform.PlatformAdapter
    • zero

      @NotNull public @NotNull kr.toxicity.model.api.platform.PlatformLocation zero()
      Specified by:
      zero in interface kr.toxicity.model.api.platform.PlatformAdapter