Contents
Class CustomTemplateConnectedBlockPattern
java.lang.Object
com.hypixel.hytale.server.core.universe.world.connectedblocks.CustomTemplateConnectedBlockPattern
- Direct Known Subclasses:
CustomConnectedBlockPattern
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final CodecMapCodec<CustomTemplateConnectedBlockPattern> The codec used to parseCustomTemplateConnectedBlockPatterninstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConnectedBlockTypeKey(String shapeName, ChunkStore chunkStore, org.joml.Vector3ic coordinate, CustomTemplateConnectedBlockRuleSet ruleSet, BlockType blockType, int rotation, 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.
-
Field Details
-
CODEC
The codec used to parseCustomTemplateConnectedBlockPatterninstances.
-
-
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 onruleSetonce a match is found.chunkStore- TheChunkStorefor chunk component and data access.coordinate- The world coordinate of the block being evaluated.ruleSet- 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 when not being placed.isPlacement- Indicates whether the block is being placed (as opposed to updated).- Returns:
- an
Optionalcontaining theConnectedBlocksUtil.ConnectedBlockResultif the pattern matched, or an emptyOptionalif it did not.
-