Class BlueprintTagUtils

java.lang.Object
com.ldtteam.structurize.blueprints.v1.BlueprintTagUtils

public class BlueprintTagUtils extends Object
Utilities for locating tags in a blueprint
  • Constructor Details

    • BlueprintTagUtils

      public BlueprintTagUtils()
  • Method Details

    • getBlueprintTags

      public static Map<net.minecraft.core.BlockPos,List<String>> getBlueprintTags(Blueprint blueprint)
      Gets the tag map from the given blueprint.
      Parameters:
      blueprint - the blueprint
      Returns:
      the tag map, relative to the anchor block
    • isInvisible

      public static boolean isInvisible(Blueprint blueprint)
      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 blueprint
      tagName - 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 query
      defaultGroundLevels - 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 query
      defaultGroundOffset - 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 blueprint
      groundLevels - 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.