Class FluidPatternHelper

java.lang.Object
com.hypixel.hytale.builtin.buildertools.utils.FluidPatternHelper

public final class FluidPatternHelper extends Object
Utility class for detecting and extracting fluid information from item patterns.

This helper checks if an item has a PlaceFluidInteraction on its Secondary interaction, which indicates it's a fluid-placing item (like Fluid_Water).

  • Method Details

    • getFluidInfo

      @Nullable public static FluidPatternHelper.FluidInfo getFluidInfo(@Nonnull String itemKey)
      Checks if the given item key corresponds to a fluid-placing item.

      This looks up the item by key, checks its Secondary interaction, and determines if it contains a PlaceFluidInteraction.

      Parameters:
      itemKey - the item/block type key to check
      Returns:
      the fluid info if this is a fluid item, null otherwise
    • isFluidItem

      public static boolean isFluidItem(@Nonnull String itemKey)
      Checks if the given item key is a fluid-placing item.
      Parameters:
      itemKey - the item/block type key to check
      Returns:
      true if this item places a fluid, false otherwise
    • getFluidInfoFromBlockType

      @Nullable public static FluidPatternHelper.FluidInfo getFluidInfoFromBlockType(@Nonnull String blockTypeKey)
      Gets fluid info for a block type ID by looking up its corresponding item.

      This is useful when working with resolved block IDs from patterns.

      Parameters:
      blockTypeKey - the block type key
      Returns:
      the fluid info if this block type corresponds to a fluid item, null otherwise