Package dev.demeng.pluginbase.model
Class Vector3d
java.lang.Object
dev.demeng.pluginbase.model.Vector3d
- All Implemented Interfaces:
YamlSerializable
An immutable and serializable 3D vector.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Vector3ddeserialize(@NotNull org.bukkit.configuration.ConfigurationSection section) static @NotNull Vector3dof(@NotNull org.bukkit.Location loc) static @NotNull Vector3dof(@NotNull org.bukkit.util.Vector vector) voidserialize(@NotNull org.bukkit.configuration.ConfigurationSection section) Serializes the object into the configuration section.@NotNull org.bukkit.util.VectorConverts the 3D vector to a BukkitVector.@NotNull org.bukkit.LocationtoLocation(@Nullable org.bukkit.World world) Converts the 3D vector to a BukkitLocation.
-
Constructor Details
-
Vector3d
public Vector3d()
-
-
Method Details
-
of
-
of
-
serialize
public void serialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Description copied from interface:YamlSerializableSerializes the object into the configuration section. The configuration file is not saved after serialization.- Specified by:
serializein interfaceYamlSerializable- Parameters:
section- The section the object will be serialized into
-
deserialize
@NotNull public static @NotNull Vector3d deserialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) -
toLocation
@NotNull public @NotNull org.bukkit.Location toLocation(@Nullable @Nullable org.bukkit.World world) Converts the 3D vector to a BukkitLocation.- Parameters:
world- The world- Returns:
- The Bukkit Location
-
toBukkitVector
@NotNull public @NotNull org.bukkit.util.Vector toBukkitVector()Converts the 3D vector to a BukkitVector.- Returns:
- The Bukkit Vector
-