Class ColonyBorderMapping
java.lang.Object
com.minecolonies.core.compatibility.journeymap.v6.ColonyBorderMapping
Utility class to manage colony border mapping.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReport the colony that the current player is in, if any.static voidload(@NotNull Journeymap jmap, @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Loads cached colony data, if any.static voidunload(@NotNull Journeymap jmap, @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Stops tracking data for a dimension and clears any related overlays.static voidupdateChunk(@NotNull Journeymap jmap, @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @NotNull net.minecraft.world.level.chunk.LevelChunk chunk) Flags the colony border overlay for update, if needed for a single just-loaded chunk.static voidupdateChunksAroundPlayer(@NotNull Journeymap jmap, @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Flags the colony border overlay for update, if needed for all chunks near the player.static voidupdatePending(@NotNull Journeymap jmap, @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Check if any colony border overlays need to be updated.
-
Method Details
-
getCurrentColony
Report the colony that the current player is in, if any.- Returns:
- The colony name, or an empty string.
-
load
public static void load(@NotNull @NotNull Journeymap jmap, @NotNull @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Loads cached colony data, if any. Also starts tracking data for a dimension. -
unload
public static void unload(@NotNull @NotNull Journeymap jmap, @NotNull @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Stops tracking data for a dimension and clears any related overlays. -
updateChunksAroundPlayer
public static void updateChunksAroundPlayer(@NotNull @NotNull Journeymap jmap, @NotNull @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Flags the colony border overlay for update, if needed for all chunks near the player.- Parameters:
jmap- The JourneyMap APIdimension- The dimension of the world. Nothing happens unless this is the client world.
-
updateChunk
public static void updateChunk(@NotNull @NotNull Journeymap jmap, @NotNull @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @NotNull @NotNull net.minecraft.world.level.chunk.LevelChunk chunk) Flags the colony border overlay for update, if needed for a single just-loaded chunk.- Parameters:
jmap- The JourneyMap APIdimension- The dimension of the world. Nothing happens unless this is the client world.chunk- The chunk that was just loaded.
-
updatePending
public static void updatePending(@NotNull @NotNull Journeymap jmap, @NotNull @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Check if any colony border overlays need to be updated.- Parameters:
jmap- The Journeymap APIdimension- The dimension to check
-