Package com.minecolonies.api.util
Class ColonyUtils
java.lang.Object
com.minecolonies.api.util.ColonyUtils
Contains colony specific utility.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 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, int rotation, boolean isMirrored) Calculated the corner of a building.getAllClaimingBuildings(net.minecraft.world.level.chunk.LevelChunk chunk) Get all claiming buildings from the chunk.static @Nullable ChunkCapDatagetChunkCapData(net.minecraft.world.level.chunk.LevelChunk chunk) Get comprehensive chunk ownership data.static intgetOwningColony(net.minecraft.world.level.chunk.LevelChunk chunk) Get the owning colony from a chunk.getStaticClaims(net.minecraft.world.level.chunk.LevelChunk 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 sidestatic 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
-
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, int rotation, boolean isMirrored) Calculated the corner of a building. Also rotates the blueprint accordingly.- Parameters:
pos- the central position.world- the world.blueprint- the structureWrapper.rotation- the rotation.isMirrored- if its mirrored.- 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.LevelChunk 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.LevelChunk chunk) Get all claiming buildings from the chunk.- Parameters:
chunk- the chunk they are at.- Returns:
- the map from colony to building claims.
-
getStaticClaims
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.LevelChunk chunk) Get comprehensive chunk ownership data.- Parameters:
chunk- the chunk to get it from.- Returns:
- the ownership data, or null.
-