Class BlockPosition

java.lang.Object
dev.demeng.pluginbase.model.BlockPosition
All Implemented Interfaces:
YamlSerializable

public class BlockPosition extends Object implements YamlSerializable
An immutable and serializable Location object with integer values and no yaw nor pitch.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull BlockPosition
    deserialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
     
    static @NotNull BlockPosition
    of(@NotNull org.bukkit.Location loc)
     
    void
    serialize(@NotNull org.bukkit.configuration.ConfigurationSection section)
    Serializes the object into the configuration section.
    @NotNull org.bukkit.block.Block
    Gets the block at the given location.
    @NotNull org.bukkit.Location
    Converts the block position to a Bukkit Location.

    Methods inherited from class java.lang.Object

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

    • BlockPosition

      public BlockPosition()
  • Method Details

    • of

      @NotNull public static @NotNull BlockPosition of(@NotNull @NotNull org.bukkit.Location loc)
    • serialize

      public void serialize(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section)
      Description copied from interface: YamlSerializable
      Serializes the object into the configuration section. The configuration file is not saved after serialization.
      Specified by:
      serialize in interface YamlSerializable
      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 Bukkit Location.
      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