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 -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull kr.toxicity.model.api.platform.PlatformLocationadapt(@NotNull org.bukkit.Location location) Adapts a Bukkit location to aPlatformLocation.static @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayeradapt(@NotNull org.bukkit.OfflinePlayer player) Adapts a Bukkit offline player to aPlatformOfflinePlayer.static @NotNull kr.toxicity.model.api.platform.PlatformWorldadapt(@NotNull org.bukkit.World world) Adapts a Bukkit world to aPlatformWorld.static @NotNull kr.toxicity.model.api.platform.PlatformEntityadapt(@NotNull org.bukkit.entity.Entity entity) Adapts a Bukkit entity to aPlatformEntity.static @NotNull kr.toxicity.model.api.platform.PlatformLivingEntityadapt(@NotNull org.bukkit.entity.LivingEntity livingEntity) Adapts a Bukkit living entity to aPlatformLivingEntity.static @NotNull kr.toxicity.model.api.platform.PlatformPlayeradapt(@NotNull org.bukkit.entity.Player player) Adapts a Bukkit player to aPlatformPlayer.static @NotNull kr.toxicity.model.api.platform.PlatformItemStackadapt(@NotNull org.bukkit.inventory.ItemStack itemStack) Adapts a Bukkit item stack to aPlatformItemStack.@NotNull kr.toxicity.model.api.platform.PlatformItemStackair()booleanboolean@NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayerofflinePlayer(@NotNull UUID uuid) @Nullable kr.toxicity.model.api.platform.PlatformPlayerint@NotNull kr.toxicity.model.api.platform.PlatformLocationzero()
-
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 aPlatformEntity.- 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 aPlatformLivingEntity.- 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 aPlatformOfflinePlayer.- 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 aPlatformPlayer.- 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 aPlatformItemStack.- 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 aPlatformLocation.- 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 aPlatformWorld.- 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:
playerin interfacekr.toxicity.model.api.platform.PlatformAdapter
-
offlinePlayer
@NotNull public @NotNull kr.toxicity.model.api.platform.PlatformOfflinePlayer offlinePlayer(@NotNull @NotNull UUID uuid) - Specified by:
offlinePlayerin interfacekr.toxicity.model.api.platform.PlatformAdapter
-
serverViewDistance
public int serverViewDistance()- Specified by:
serverViewDistancein interfacekr.toxicity.model.api.platform.PlatformAdapter
-
isTickThread
public boolean isTickThread()- Specified by:
isTickThreadin interfacekr.toxicity.model.api.platform.PlatformAdapter
-
isRegionSafe
public boolean isRegionSafe()- Specified by:
isRegionSafein interfacekr.toxicity.model.api.platform.PlatformAdapter
-
air
@NotNull public @NotNull kr.toxicity.model.api.platform.PlatformItemStack air()- Specified by:
airin interfacekr.toxicity.model.api.platform.PlatformAdapter
-
zero
@NotNull public @NotNull kr.toxicity.model.api.platform.PlatformLocation zero()- Specified by:
zeroin interfacekr.toxicity.model.api.platform.PlatformAdapter
-