Contents
Class CustomConnectedBlockPattern
java.lang.Object
com.hypixel.hytale.server.core.universe.world.connectedblocks.CustomTemplateConnectedBlockPattern
com.hypixel.hytale.server.core.universe.world.connectedblocks.CustomConnectedBlockPattern
Represents a pattern for connected blocks to query multiple properties of blocks in 3d space
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<CustomConnectedBlockPattern> The codec used to parse aCustomConnectedBlockPatterninstance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConnectedBlockTypeKey(String shapeName, ChunkStore chunkStore, org.joml.Vector3ic coordinate, CustomTemplateConnectedBlockRuleSet connectedBlockRuleset, BlockType blockType, int rotation, org.joml.Vector3ic placementNormal, boolean isPlacement) Evaluates this pattern against the world, iterating through each allowed pattern transformation (rotation / mirror) until one matches all rules, then assembles the resulting block type and rotation to apply.
-
Field Details
-
CODEC
The codec used to parse aCustomConnectedBlockPatterninstance.
-
-
Constructor Details
-
CustomConnectedBlockPattern
public CustomConnectedBlockPattern()
-
-
Method Details
-
getConnectedBlockTypeKey
@Nonnull public Optional<ConnectedBlocksUtil.ConnectedBlockResult> getConnectedBlockTypeKey(@Nonnull String shapeName, @Nonnull ChunkStore chunkStore, @Nonnull org.joml.Vector3ic coordinate, @Nonnull CustomTemplateConnectedBlockRuleSet connectedBlockRuleset, @Nonnull BlockType blockType, int rotation, @Nonnull org.joml.Vector3ic placementNormal, boolean isPlacement) Evaluates this pattern against the world, iterating through each allowed pattern transformation (rotation / mirror) until one matches all rules, then assembles the resulting block type and rotation to apply.- Specified by:
getConnectedBlockTypeKeyin classCustomTemplateConnectedBlockPattern- Parameters:
shapeName- The name of the shape this pattern belongs to; used to look up the resultBlockPatternonconnectedBlockRulesetonce a match is found.chunkStore- TheChunkStorefor chunk component and data access.coordinate- The world coordinate of the block being evaluated.connectedBlockRuleset- The rule set that owns this pattern.blockType- TheBlockTypeof 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 for non-placement updates.isPlacement- Indicates whether the block is being placed (as opposed to updated).- Returns:
- the matching result, or an empty
Optionalif no transformation matched or the chunk being probed is not loaded/ticking.
-