Class Block

java.lang.Object
fr.hytale.loader.api.Block

public class Block extends Object
Represents a block in the world.

This class acts as a wrapper around coordinates and a world reference. It allows object-oriented manipulation of blocks.

Since:
1.0.5
Version:
1.0.6
Author:
HytaleLoader
  • Constructor Details

    • Block

      public Block(World world, int x, int y, int z)
      Creates a new Block reference.
      Parameters:
      world - The world containing the block
      x - The X coordinate
      y - The Y coordinate
      z - The Z coordinate
  • Method Details

    • getWorld

      public World getWorld()
      Gets the world this block is in.
      Returns:
      The world
    • getX

      public int getX()
      Gets the X coordinate.
      Returns:
      The X coordinate
    • getY

      public int getY()
      Gets the Y coordinate.
      Returns:
      The Y coordinate
    • getZ

      public int getZ()
      Gets the Z coordinate.
      Returns:
      The Z coordinate
    • getLocation

      public Location getLocation()
      Gets the location of this block.
      Returns:
      A new Location object representing this block's position
    • getType

      public String getType()
      Gets the identifier (type) of this block.
      Returns:
      The block identifier string (e.g. "Rock_Magma_Cooled") or "Empty"
    • setType

      public void setType(String identifier)
      Sets the type of this block.
      Parameters:
      identifier - The new block identifier (e.g. "Rock_Magma_Cooled")
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object