Package dev.demeng.pluginbase.model
Class BlockPosition
java.lang.Object
dev.demeng.pluginbase.model.BlockPosition
- All Implemented Interfaces:
YamlSerializable
An immutable and serializable Location object with integer values and no yaw nor pitch.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BlockPositiondeserialize(@NotNull org.bukkit.configuration.ConfigurationSection section) static @NotNull BlockPositionof(@NotNull org.bukkit.Location loc) voidserialize(@NotNull org.bukkit.configuration.ConfigurationSection section) Serializes the object into the configuration section.@NotNull org.bukkit.block.BlocktoBlock()Gets the block at the given location.@NotNull org.bukkit.LocationConverts the block position to a BukkitLocation.
-
Constructor Details
-
BlockPosition
public BlockPosition()
-
-
Method Details
-
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 BlockPosition deserialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) -
toLocation
@NotNull public @NotNull org.bukkit.Location toLocation()Converts the block position to a BukkitLocation.- Returns:
- The Bukkit Location
-
toBlock
@NotNull public @NotNull org.bukkit.block.Block toBlock()Gets the block at the given location.- Returns:
- The block at the location
-