Class Block

java.lang.Object
xyz.calcugames.levelz.Block

public final class Block extends Object
Represents a Block in a Level.
  • Constructor Details

    • Block

      public Block(@NotNull @NotNull String name)
      Creates a new Block with the given name and empty properties.
      Parameters:
      name - Block Name
    • Block

      public Block(@NotNull @NotNull String name, @NotNull @NotNull Map<String,Object> properties)
      Creates a new Block with the given name and properties.
      Parameters:
      name - Block Name
      properties - Block Properties
  • Method Details

    • getName

      @NotNull public @NotNull String getName()
      Gets the name of this block.
      Returns:
      Block Name
    • getProperties

      @NotNull public @Unmodifiable @NotNull Map<String,Object> getProperties()
      Gets an immutable copy of the properties for this block.
      Returns:
      Block Properties
    • withName

      @NotNull public @NotNull Block withName(@NotNull @NotNull String name)
      Creates a new Block with the given name and these properties.
      Parameters:
      name - Block Name
      Returns:
      New Block
    • withProperties

      @NotNull public @NotNull Block withProperties(@NotNull @NotNull Map<String,Object> properties)
      Creates a new Block with this name and the given properties.
      Parameters:
      properties - Block Properties
      Returns:
      New Block
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object