Class CustomTemplateConnectedBlockPattern

java.lang.Object
com.hypixel.hytale.server.core.universe.world.connectedblocks.CustomTemplateConnectedBlockPattern
Direct Known Subclasses:
CustomConnectedBlockPattern

public abstract class CustomTemplateConnectedBlockPattern extends Object
A class that represents a custom template connected block pattern.

Used to determine the connected block type based on a set of rules defined in a CustomTemplateConnectedBlockRuleSet.

  • Field Details

  • Constructor Details

    • CustomTemplateConnectedBlockPattern

      public CustomTemplateConnectedBlockPattern()
  • Method Details

    • getConnectedBlockTypeKey

      @Nonnull public abstract Optional<ConnectedBlocksUtil.ConnectedBlockResult> getConnectedBlockTypeKey(@Nonnull String shapeName, @Nonnull ChunkStore chunkStore, @Nonnull org.joml.Vector3ic coordinate, @Nonnull CustomTemplateConnectedBlockRuleSet ruleSet, @Nonnull BlockType blockType, int rotation, @Nonnull org.joml.Vector3ic placementNormal, boolean isPlacement)
      Called to evaluate this pattern at the given world coordinate and, if it matches, produce the resulting block type for the given shape.
      Parameters:
      shapeName - The name of the shape this pattern belongs to. Used to look up the result block pattern on ruleSet once a match is found.
      chunkStore - The ChunkStore for chunk component and data access.
      coordinate - The world coordinate of the block being evaluated.
      ruleSet - The rule set that owns this pattern.
      blockType - The BlockType of the block being placed or updated.
      rotation - The rotation index of the block being placed or updated.
      placementNormal - The face normal of the block being placed against, or the zero vector when not being placed.
      isPlacement - Indicates whether the block is being placed (as opposed to updated).
      Returns:
      an Optional containing the ConnectedBlocksUtil.ConnectedBlockResult if the pattern matched, or an empty Optional if it did not.