Class ColonyUtils

java.lang.Object
com.minecolonies.api.util.ColonyUtils

public final class ColonyUtils extends Object
Contains colony specific utility.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos>
    calculateCorners(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.api.RotationMirror rotMir)
    Calculated the corner of a building.
    static net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos>
    calculateCorners(@NotNull net.minecraft.world.phys.AABB box)
    Reports the block corners from a bounding box.
    static Map<Integer,Set<net.minecraft.core.BlockPos>>
    getAllClaimingBuildings(net.minecraft.world.level.chunk.ChunkAccess chunk)
    Get all claiming buildings from the chunk.
    static @Nullable ChunkCapData
    getChunkCapData(net.minecraft.world.level.chunk.ChunkAccess chunk)
    Get comprehensive chunk ownership data.
    static int
    getOwningColony(net.minecraft.world.level.chunk.ChunkAccess chunk)
    Get the owning colony from a chunk.
    static List<Integer>
    getStaticClaims(net.minecraft.world.level.chunk.ChunkAccess chunk)
    Get all static claims from a chunk.
    static CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint>
    queueBlueprintLoad(net.minecraft.world.level.Level world, String structurePack, String structurePath, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad)
    Queues a blueprint load to the right side
    static CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint>
    queueBlueprintLoad(net.minecraft.world.level.Level world, String structurePack, String structurePath, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad, Consumer<String> errorHandler)
    Queues a blueprint load to the right side

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • queueBlueprintLoad

      public static CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint> queueBlueprintLoad(net.minecraft.world.level.Level world, String structurePack, String structurePath, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad)
      Queues a blueprint load to the right side
      Parameters:
      world -
      structurePack -
      structurePath -
      afterLoad -
    • queueBlueprintLoad

      public static CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint> queueBlueprintLoad(net.minecraft.world.level.Level world, String structurePack, String structurePath, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad, Consumer<String> errorHandler)
      Queues a blueprint load to the right side
      Parameters:
      world -
      structurePack -
      structurePath -
      afterLoad -
    • calculateCorners

      public static net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> calculateCorners(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.api.RotationMirror rotMir)
      Calculated the corner of a building. Also rotates the blueprint accordingly.
      Parameters:
      pos - the central position.
      world - the world.
      blueprint - the structureWrapper.
      rotMir - the rotation and mirror.
      Returns:
      a tuple with the required corners.
    • calculateCorners

      public static net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> calculateCorners(@NotNull @NotNull net.minecraft.world.phys.AABB box)
      Reports the block corners from a bounding box.
      Parameters:
      box - the bounding box.
      Returns:
      the corners.
    • getOwningColony

      public static int getOwningColony(net.minecraft.world.level.chunk.ChunkAccess chunk)
      Get the owning colony from a chunk.
      Parameters:
      chunk - the chunk to check.
      Returns:
      the colony id.
    • getAllClaimingBuildings

      public static Map<Integer,Set<net.minecraft.core.BlockPos>> getAllClaimingBuildings(net.minecraft.world.level.chunk.ChunkAccess chunk)
      Get all claiming buildings from the chunk.
      Parameters:
      chunk - the chunk they are at.
      Returns:
      the map from colony to building claims.
    • getStaticClaims

      public static List<Integer> getStaticClaims(net.minecraft.world.level.chunk.ChunkAccess chunk)
      Get all static claims from a chunk.
      Parameters:
      chunk - the chunk to get it from.
      Returns:
      the list.
    • getChunkCapData

      @Nullable public static @Nullable ChunkCapData getChunkCapData(net.minecraft.world.level.chunk.ChunkAccess chunk)
      Get comprehensive chunk ownership data.
      Parameters:
      chunk - the chunk to get it from.
      Returns:
      the ownership data, or null.