Class SpigotAdapter
java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.util.SpigotAdapter
Class that contains utility methods to convert between AnimatedArchitecture and Spigot objects.
For example, getBukkitWorld(IWorld) converts an IWorld to a World and
wrapWorld(World) can be used to do the opposite.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.LocationgetBukkitLocation(ILocation location) Converts anILocationobject to aLocationobject.static org.bukkit.util.VectorgetBukkitVector(Vector3Dd vector) Gets a Bukkit vector from a AnimatedArchitecture vector.static org.bukkit.util.VectorgetBukkitVector(Vector3Di vector) Gets a Bukkit vector from a AnimatedArchitecture vector.static @Nullable org.bukkit.WorldgetBukkitWorld(IWorld world) Converts anIWorldobject to aWorldobject.static ILocationwrapLocation(org.bukkit.Location location) Wraps a Bukkit location in an ILocation.static IWorldwrapWorld(org.bukkit.World world) Wraps a Bukkit world in an IWorld.
-
Method Details
-
getBukkitWorld
Converts anIWorldobject to aWorldobject.If the
ILocationis anWorldSpigot, only a simple cast is performed. Otherwise, a newWorldis constructed.- Parameters:
world- The AnimatedArchitecture world.- Returns:
- The Spigot world.
-
getBukkitLocation
Converts anILocationobject to aLocationobject.If the
ILocationis anLocationSpigot, only a simple cast is performed. Otherwise, a newLocationis constructed.- Parameters:
location- The AnimatedArchitecture location.- Returns:
- The Spigot location.
-
getBukkitVector
Gets a Bukkit vector from a AnimatedArchitecture vector.- Parameters:
vector- The AnimatedArchitecture vector.- Returns:
- The bukkit vector.
-
getBukkitVector
Gets a Bukkit vector from a AnimatedArchitecture vector.- Parameters:
vector- The AnimatedArchitecture vector.- Returns:
- The bukkit vector.
-
wrapLocation
Wraps a Bukkit location in an ILocation.- Parameters:
location- The Bukkit location.- Returns:
- The ILocation.
-
wrapWorld
Wraps a Bukkit world in an IWorld.- Parameters:
world- The Bukkit world.- Returns:
- The IWorld.
-