Contents
Class FluidPatternHelper
java.lang.Object
com.hypixel.hytale.builtin.buildertools.utils.FluidPatternHelper
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHolds information about a fluid to be placed. -
Method Summary
Modifier and TypeMethodDescriptionstatic FluidPatternHelper.FluidInfogetFluidInfo(String itemKey) Checks if the given item key corresponds to a fluid-placing item.static FluidPatternHelper.FluidInfogetFluidInfoFromBlockType(String blockTypeKey) Gets fluid info for a block type ID by looking up its corresponding item.static booleanisFluidItem(String itemKey) Checks if the given item key is a fluid-placing item.
-
Method Details
-
getFluidInfo
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
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
-