Class ConnectedBlocksUtil.ConnectedBlockResult

java.lang.Object
com.hypixel.hytale.server.core.universe.world.connectedblocks.ConnectedBlocksUtil.ConnectedBlockResult
Enclosing class:
ConnectedBlocksUtil

public static final class ConnectedBlocksUtil.ConnectedBlockResult extends Object
The outcome of evaluating a ConnectedBlockRuleSet: the block type and rotation that should be applied at the evaluated position, plus any additional blocks that should be set at relative offsets (used by multi-block shapes like wide stairs).
  • Constructor Details

    • ConnectedBlockResult

      public ConnectedBlockResult(@Nonnull String blockTypeKey, int rotationIndex)
  • Method Details

    • blockTypeKey

      @Nonnull public String blockTypeKey()
      Returns:
      the asset id of the resulting block type.
    • rotationIndex

      public int rotationIndex()
      Returns:
      the rotation index to apply to the resulting block.
    • getAdditionalConnectedBlocks

      @Nonnull public Map<org.joml.Vector3i, it.unimi.dsi.fastutil.objects.ObjectIntPair<String>> getAdditionalConnectedBlocks()
      Returns:
      the additional blocks to set at relative offsets from the evaluated position.
    • addAdditionalBlock

      public void addAdditionalBlock(@Nonnull org.joml.Vector3i offset, @Nonnull String blockTypeKey, int rotationIndex)
      Adds an additional block to be set at a relative offset from the evaluated position.
      Parameters:
      offset - The offset, relative to the evaluated position, at which to set the block.
      blockTypeKey - The asset id of the block to set.
      rotationIndex - The rotation index to apply to the block.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object