Class BlueprintTagUtils
java.lang.Object
com.ldtteam.structurize.blueprints.v1.BlueprintTagUtils
Utilities for locating tags in a blueprint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBlueprintTags(Blueprint blueprint) Gets the tag map from the given blueprint.static @Nullable net.minecraft.core.BlockPosgetFirstPosForTag(Blueprint blueprint, String tagName) Get the first pos for the given tagstatic intgetGroundAnchorOffset(@NotNull Blueprint blueprint, int defaultGroundOffset) Gets the relative height difference between the blueprint's anchor position and the 'ground' (or water, for ships).static intgetGroundAnchorOffsetFromGroundLevels(@NotNull Blueprint blueprint, int groundLevels) For a given blueprint, converts a "number of ground levels" value to a ground-anchor relative height offset.static intgetNumberOfGroundLevels(@NotNull Blueprint blueprint, int defaultGroundLevels) Gets the number of layers at the bottom of the blueprint that are considered 'ground' (or water, for ships).static booleanisInvisible(Blueprint blueprint) A blueprint may hide itself from the build tool list in one of two ways: 1.
-
Constructor Details
-
BlueprintTagUtils
public BlueprintTagUtils()
-
-
Method Details
-
getBlueprintTags
Gets the tag map from the given blueprint.- Parameters:
blueprint- the blueprint- Returns:
- the tag map, relative to the anchor block
-
isInvisible
A blueprint may hide itself from the build tool list in one of two ways: 1. the anchor block implements IInvisibleBlueprintAnchorBlock and returns true when asked 2. the anchor block implements IBlueprintDataProviderBE and is directly tagged "invisible"- Parameters:
blueprint- the blueprint to check- Returns:
- true if this blueprint should be hidden from normal players
-
getFirstPosForTag
@Nullable public static @Nullable net.minecraft.core.BlockPos getFirstPosForTag(Blueprint blueprint, String tagName) Get the first pos for the given tag- Parameters:
blueprint- rotated/mirrored blueprinttagName- tag name- Returns:
- found position or null
-
getNumberOfGroundLevels
public static int getNumberOfGroundLevels(@NotNull @NotNull Blueprint blueprint, int defaultGroundLevels) Gets the number of layers at the bottom of the blueprint that are considered 'ground' (or water, for ships).- Parameters:
blueprint- The blueprint to querydefaultGroundLevels- The number of levels to assume if there is no tag- Returns:
- The number of levels, e.g. 1 means that the bottom layer of the blueprint is ground and 3 means the bottom 3 layers are ground.
-
getGroundAnchorOffset
public static int getGroundAnchorOffset(@NotNull @NotNull Blueprint blueprint, int defaultGroundOffset) Gets the relative height difference between the blueprint's anchor position and the 'ground' (or water, for ships).- Parameters:
blueprint- The blueprint to querydefaultGroundOffset- The height difference to assume if there is no tag- Returns:
- The height difference, e.g. 1 means that the ground level is 1 block below the anchor position. The value may be negative (if the anchor is underground) or indicate a position outside the blueprint.
-
getGroundAnchorOffsetFromGroundLevels
public static int getGroundAnchorOffsetFromGroundLevels(@NotNull @NotNull Blueprint blueprint, int groundLevels) For a given blueprint, converts a "number of ground levels" value to a ground-anchor relative height offset.- Parameters:
blueprint- The associated blueprintgroundLevels- The number of levels at the bottom of the blueprint that are 'ground'- Returns:
- The number of levels below the anchor at which 'ground" starts. This might be negative if the anchor is underground.
-