Package com.minecolonies.core.colony
Class ColonyManager
java.lang.Object
com.minecolonies.core.colony.ColonyManager
- All Implemented Interfaces:
IColonyManager
Singleton class that links colonies to minecraft.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClaimData(IColony colony, it.unimi.dsi.fastutil.longs.Long2ObjectMap<ChunkClaimData> claimData) Add claim data of a colony.voidaddColonyDirect(IColony colony, net.minecraft.server.level.ServerLevel world) Adds colony directly to cap.voidaddNewChunk(Colony colony, net.minecraft.world.level.ChunkPos pos, ChunkClaimData chunkClaimData) New chunk to track claim of.createColony(@NotNull net.minecraft.server.level.ServerLevel w, net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.entity.player.Player player, @NotNull String colonyName, @NotNull String pack) Create a new Colony in the given world and at that location.voiddeleteColonyByDimension(int id, boolean canDestroy, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Delete the colony by dimension.voiddeleteColonyByWorld(int id, boolean canDestroy, net.minecraft.server.level.ServerLevel world) Delete the colony in a world.Get all colonies in all worlds.getBuilding(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Get a AbstractBuilding by a World and coordinates.getBuildingView(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, net.minecraft.core.BlockPos pos) Get a AbstractBuilding by position.Map<net.minecraft.world.level.ChunkPos, IChunkClaimData> getClaimData(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Get the claim data for the whole dimension.@Nullable IChunkClaimDatagetClaimData(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, net.minecraft.world.level.ChunkPos pos) Get the claim data for a dimension and pos.getClosestColony(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Get closest colony by x,y,z.@Nullable IColonyViewgetClosestColonyView(@Nullable net.minecraft.world.level.Level w, @Nullable net.minecraft.core.BlockPos pos) Returns the closest viewIColonyManager.getColonyView(net.minecraft.world.level.Level, net.minecraft.core.BlockPos).@Nullable IColonygetClosestIColony(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Side neutral method to get colony.getColonies(@NotNull net.minecraft.world.level.Level w) Get all colonies in this world.getColoniesAbandonedSince(int abandonedSince) Get all colonies in all worlds.@Nullable IColonygetColonyByDimension(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> registryKey) Get Colony by UUID.getColonyByPosFromDim(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> registryKey, @NotNull net.minecraft.core.BlockPos pos) Get colony that contains a given coordinate from dimension.getColonyByPosFromWorld(@Nullable net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Get colony that contains a given coordinate from world.@Nullable IColonygetColonyByWorld(int id, net.minecraft.world.level.Level world) Get Colony by UUID.getColonyView(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Get IColonyView by ID.getColonyView(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Get Colony that contains a given (x, y, z).@NotNull List<IColonyView> getColonyViews(@NotNull net.minecraft.world.level.Level w) Get all colony views in this world known to the current player.Get an instance of the compatibilityManager.getIColonies(@NotNull net.minecraft.world.level.Level w) Get all colonies in this world.@Nullable IColonygetIColony(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Side neutral method to get colony.@Nullable IColonygetIColonyByOwner(@NotNull net.minecraft.world.level.Level w, UUID owner) Side neutral method to get colony.@Nullable IColonygetIColonyByOwner(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.world.entity.player.Player owner) Side neutral method to get colony.intReturns the minimum distance between two town halls, to not make colonies collide.Getter for the recipeManager.intGet the top colony id of all colonies.voidhandleColonyBuildingViewMessage(int colonyId, net.minecraft.core.BlockPos buildingId, @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofifinvalid reference
IColonyView#handleColonyBuildingViewMessage(BlockPos, RegistryFriendlyByteBuf)IColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewCitizensMessage(int colonyId, int citizenId, net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewCitizensMessage(int, RegistryFriendlyByteBuf)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewMessage(int colonyId, @NotNull net.minecraft.network.RegistryFriendlyByteBuf colonyData, boolean isNewSubscription, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Sends view message to the right view.voidhandleColonyViewRemoveBuildingMessage(int colonyId, net.minecraft.core.BlockPos buildingId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofifinvalid reference
IColonyView#handleColonyViewRemoveBuildingMessage(BlockPos)IColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewRemoveCitizenMessage(int colonyId, int citizenId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewRemoveCitizenMessage(int)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewRemoveWorkOrderMessage(int colonyId, int workOrderId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewRemoveWorkOrderMessage(int)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewWorkOrderMessage(int colonyId, net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewWorkOrderMessage(RegistryFriendlyByteBuf)(int, ByteBuf)} ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandlePermissionsViewMessage(int colonyID, @NotNull net.minecraft.network.RegistryFriendlyByteBuf data, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) booleanisCoordinateInAnyColony(@NotNull net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Check if a given coordinate is inside any other colony.booleanisFarEnoughFromColonies(@NotNull net.minecraft.world.level.Level w, @NotNull net.minecraft.core.BlockPos pos) Check if a position is too close to another colony to found a new colony.booleanWhether or not a new schematic have been downloaded.voidonClientTick(net.neoforged.neoforge.client.event.ClientTickEvent.Pre event) On Client tick, clears views when player left.voidonServerTick(net.neoforged.neoforge.event.tick.ServerTickEvent.Pre event) On server tick, tick every Colony.voidonWorldLoad(@NotNull net.minecraft.world.level.Level w) When a world is loaded, Colonies in that world need to grab the reference to the World.voidonWorldTick(net.neoforged.neoforge.event.tick.LevelTickEvent.Pre event) On world tick, tick every Colony in that world.voidonWorldUnload(@NotNull net.minecraft.world.level.Level world) When a world unloads, all colonies in that world are informed.voidopenReactivationWindow(net.minecraft.core.BlockPos pos) Open the new reactivation window.voidread(net.minecraft.core.HolderLookup.Provider provider, @NotNull net.minecraft.nbt.CompoundTag compound) Read Colonies from saved NBT data.voidremoveColonyView(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Removes a colony viewvoidReset all colony views on login to new world.voidsetSchematicDownloaded(boolean downloaded) Set the schematic downloadedvoidwrite(net.minecraft.core.HolderLookup.Provider provider, @NotNull net.minecraft.nbt.CompoundTag compound) Write colonies to NBT data for saving.
-
Constructor Details
-
ColonyManager
public ColonyManager()
-
-
Method Details
-
createColony
public IColony createColony(@NotNull @NotNull net.minecraft.server.level.ServerLevel w, net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.entity.player.Player player, @NotNull @NotNull String colonyName, @NotNull @NotNull String pack) Description copied from interface:IColonyManagerCreate a new Colony in the given world and at that location.- Specified by:
createColonyin interfaceIColonyManager- Parameters:
w- World of the colony.pos- Coordinate of the center of the colony.player- the player that creates the colony - owner.colonyName- the initial colony name.pack- the default pack of the colony.- Returns:
- the created colony instance.
-
deleteColonyByWorld
public void deleteColonyByWorld(int id, boolean canDestroy, net.minecraft.server.level.ServerLevel world) Description copied from interface:IColonyManagerDelete the colony in a world.- Specified by:
deleteColonyByWorldin interfaceIColonyManager- Parameters:
id- the id of it.canDestroy- if can destroy the buildings.world- the world.
-
deleteColonyByDimension
public void deleteColonyByDimension(int id, boolean canDestroy, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Description copied from interface:IColonyManagerDelete the colony by dimension.- Specified by:
deleteColonyByDimensionin interfaceIColonyManager- Parameters:
id- the id of it.canDestroy- if can destroy the buildings.dimension- the dimension.
-
removeColonyView
public void removeColonyView(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Description copied from interface:IColonyManagerRemoves a colony view- Specified by:
removeColonyViewin interfaceIColonyManager- Parameters:
id- the id of the colony.dimension- the dimension it is in.
-
getColonyByWorld
Description copied from interface:IColonyManagerGet Colony by UUID.- Specified by:
getColonyByWorldin interfaceIColonyManager- Parameters:
id- ID of colony.world- the world it is in.- Returns:
- Colony with given ID.
-
getColonyByDimension
@Nullable public @Nullable IColony getColonyByDimension(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> registryKey) Description copied from interface:IColonyManagerGet Colony by UUID.- Specified by:
getColonyByDimensionin interfaceIColonyManager- Parameters:
id- ID of colony.registryKey- the dimension it is in.- Returns:
- Colony with given ID.
-
getBuilding
public IBuilding getBuilding(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerGet a AbstractBuilding by a World and coordinates.- Specified by:
getBuildingin interfaceIColonyManager- Parameters:
w- World.pos- Block position.- Returns:
- AbstractBuilding at the given location.
-
getColonyByPosFromWorld
public IColony getColonyByPosFromWorld(@Nullable @Nullable net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerGet colony that contains a given coordinate from world.- Specified by:
getColonyByPosFromWorldin interfaceIColonyManager- Parameters:
w- World.pos- coordinates.- Returns:
- Colony at the given location.
-
getColonyByPosFromDim
public IColony getColonyByPosFromDim(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> registryKey, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerGet colony that contains a given coordinate from dimension.- Specified by:
getColonyByPosFromDimin interfaceIColonyManager- Parameters:
registryKey- the dimension.pos- coordinates.- Returns:
- Colony at the given location.
-
isFarEnoughFromColonies
public boolean isFarEnoughFromColonies(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerCheck if a position is too close to another colony to found a new colony.- Specified by:
isFarEnoughFromColoniesin interfaceIColonyManager- Parameters:
w- World.pos- coordinates.- Returns:
- true if so.
-
getColonies
@NotNull public @NotNull List<IColony> getColonies(@NotNull @NotNull net.minecraft.world.level.Level w) Description copied from interface:IColonyManagerGet all colonies in this world.- Specified by:
getColoniesin interfaceIColonyManager- Parameters:
w- World.- Returns:
- a list of colonies.
-
getAllColonies
Description copied from interface:IColonyManagerGet all colonies in all worlds.- Specified by:
getAllColoniesin interfaceIColonyManager- Returns:
- a list of colonies.
-
getColoniesAbandonedSince
Description copied from interface:IColonyManagerGet all colonies in all worlds.- Specified by:
getColoniesAbandonedSincein interfaceIColonyManager- Parameters:
abandonedSince- time in hours since the last contact.- Returns:
- a list of colonies.
-
getBuildingView
public IBuildingView getBuildingView(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerGet a AbstractBuilding by position.- Specified by:
getBuildingViewin interfaceIColonyManager- Parameters:
dimension- the dimension it is in.pos- Block position.- Returns:
- Returns the view belonging to the building at (x, y, z).
-
getIColonies
@NotNull public @NotNull List<IColony> getIColonies(@NotNull @NotNull net.minecraft.world.level.Level w) Description copied from interface:IColonyManagerGet all colonies in this world. (Side neutral; on clients it returns the subset of views known to the player.)- Specified by:
getIColoniesin interfaceIColonyManager- Parameters:
w- World.- Returns:
- a list of colonies.
-
getIColony
@Nullable public @Nullable IColony getIColony(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerSide neutral method to get colony. On clients it returns the view. On servers it returns the colony itself.- Specified by:
getIColonyin interfaceIColonyManager- Parameters:
w- World.pos- coordinates.- Returns:
- View of colony or colony itself depending on side.
-
openReactivationWindow
public void openReactivationWindow(net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerOpen the new reactivation window.- Specified by:
openReactivationWindowin interfaceIColonyManager- Parameters:
pos- the pos to open it at.
-
getColonyViews
@NotNull public @NotNull List<IColonyView> getColonyViews(@NotNull @NotNull net.minecraft.world.level.Level w) Description copied from interface:IColonyManagerGet all colony views in this world known to the current player.- Specified by:
getColonyViewsin interfaceIColonyManager- Parameters:
w- World.- Returns:
- a list of colony views.
-
getColonyView
public IColonyView getColonyView(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Get Colony that contains a given (x, y, z).- Specified by:
getColonyViewin interfaceIColonyManager- Parameters:
w- World.pos- coordinates.- Returns:
- returns the view belonging to the colony at x, y, z.
-
getClosestIColony
@Nullable public @Nullable IColony getClosestIColony(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerSide neutral method to get colony. On clients it returns the view. On servers it returns the colony itself.IColonyManager.getClosestColony(Level, BlockPos)- Specified by:
getClosestIColonyin interfaceIColonyManager- Parameters:
w- World.pos- Block position.- Returns:
- View of colony or colony itself depending on side, closest to coordinates.
-
getClosestColonyView
@Nullable public @Nullable IColonyView getClosestColonyView(@Nullable @Nullable net.minecraft.world.level.Level w, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerReturns the closest viewIColonyManager.getColonyView(net.minecraft.world.level.Level, net.minecraft.core.BlockPos).- Specified by:
getClosestColonyViewin interfaceIColonyManager- Parameters:
w- World.pos- Block Position.- Returns:
- View of the closest colony.
-
getClosestColony
public IColony getClosestColony(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerGet closest colony by x,y,z.- Specified by:
getClosestColonyin interfaceIColonyManager- Parameters:
w- World.pos- coordinates.- Returns:
- Colony closest to coordinates.
-
getIColonyByOwner
@Nullable public @Nullable IColony getIColonyByOwner(@NotNull @NotNull net.minecraft.world.level.Level w, @NotNull @NotNull net.minecraft.world.entity.player.Player owner) Description copied from interface:IColonyManagerSide neutral method to get colony. On clients it returns the view. On servers it returns the colony itself.Returns a colony or view with the given Player as owner.
- Specified by:
getIColonyByOwnerin interfaceIColonyManager- Parameters:
w- World.owner- Entity Player.- Returns:
- IColony belonging to specific player.
-
getIColonyByOwner
@Nullable public @Nullable IColony getIColonyByOwner(@NotNull @NotNull net.minecraft.world.level.Level w, UUID owner) Description copied from interface:IColonyManagerSide neutral method to get colony. On clients it returns the view. On servers it returns the colony itself.Returns a colony or view with given Player as owner.
- Specified by:
getIColonyByOwnerin interfaceIColonyManager- Parameters:
w- Worldowner- UUID of the owner.- Returns:
- IColony belonging to specific player.
-
getMinimumDistanceBetweenTownHalls
public int getMinimumDistanceBetweenTownHalls()Description copied from interface:IColonyManagerReturns the minimum distance between two town halls, to not make colonies collide.- Specified by:
getMinimumDistanceBetweenTownHallsin interfaceIColonyManager- Returns:
- Minimum town hall distance.
-
onServerTick
public void onServerTick(@NotNull net.neoforged.neoforge.event.tick.ServerTickEvent.Pre event) Description copied from interface:IColonyManagerOn server tick, tick every Colony. NOTE: Review this for performance.- Specified by:
onServerTickin interfaceIColonyManager- Parameters:
event-ServerTickEvent
-
write
public void write(net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IColonyManagerWrite colonies to NBT data for saving.- Specified by:
writein interfaceIColonyManager- Parameters:
compound- NBT-Tag.
-
read
public void read(net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IColonyManagerRead Colonies from saved NBT data.- Specified by:
readin interfaceIColonyManager- Parameters:
compound- NBT Tag.
-
onClientTick
public void onClientTick(@NotNull net.neoforged.neoforge.client.event.ClientTickEvent.Pre event) Description copied from interface:IColonyManagerOn Client tick, clears views when player left.- Specified by:
onClientTickin interfaceIColonyManager- Parameters:
event-ClientTickEvent.
-
onWorldTick
public void onWorldTick(@NotNull net.neoforged.neoforge.event.tick.LevelTickEvent.Pre event) Description copied from interface:IColonyManagerOn world tick, tick every Colony in that world. NOTE: Review this for performance.- Specified by:
onWorldTickin interfaceIColonyManager
-
onWorldLoad
public void onWorldLoad(@NotNull @NotNull net.minecraft.world.level.Level w) Description copied from interface:IColonyManagerWhen a world is loaded, Colonies in that world need to grab the reference to the World. Additionally, when loading the first world, load the manager data.- Specified by:
onWorldLoadin interfaceIColonyManager- Parameters:
w- World.
-
onWorldUnload
public void onWorldUnload(@NotNull @NotNull net.minecraft.world.level.Level world) Description copied from interface:IColonyManagerWhen a world unloads, all colonies in that world are informed. Additionally, when the last world is unloaded, delete all colonies.- Specified by:
onWorldUnloadin interfaceIColonyManager- Parameters:
world- World.
-
handleColonyViewMessage
public void handleColonyViewMessage(int colonyId, @NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf colonyData, boolean isNewSubscription, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerSends view message to the right view.- Specified by:
handleColonyViewMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.colonyData-RegistryFriendlyByteBufwith colony data.isNewSubscription- whether this is a new subscription or not.dim- the dimension.
-
getColonyView
public IColonyView getColonyView(int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Description copied from interface:IColonyManagerGet IColonyView by ID.- Specified by:
getColonyViewin interfaceIColonyManager- Parameters:
id- ID of colony.dimension- the dimension id.- Returns:
- The IColonyView belonging to the colony.
-
handlePermissionsViewMessage
public void handlePermissionsViewMessage(int colonyID, @NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf data, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handlePermissionsViewMessage(RegistryFriendlyByteBuf)ifIColonyManager.getColonyView(int, ResourceKey). gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handlePermissionsViewMessagein interfaceIColonyManager- Parameters:
colonyID- ID of the colony.data-RegistryFriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewCitizensMessage
public void handleColonyViewCitizensMessage(int colonyId, int citizenId, net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewCitizensMessage(int, RegistryFriendlyByteBuf)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyViewCitizensMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.citizenId- ID of the citizen.buf-RegistryFriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewWorkOrderMessage
public void handleColonyViewWorkOrderMessage(int colonyId, net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewWorkOrderMessage(RegistryFriendlyByteBuf)(int, ByteBuf)} ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyViewWorkOrderMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.buf-RegistryFriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewRemoveCitizenMessage
public void handleColonyViewRemoveCitizenMessage(int colonyId, int citizenId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewRemoveCitizenMessage(int)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyViewRemoveCitizenMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.citizenId- ID of the citizen.dim- the dimension.
-
handleColonyBuildingViewMessage
public void handleColonyBuildingViewMessage(int colonyId, net.minecraft.core.BlockPos buildingId, @NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofifinvalid reference
IColonyView#handleColonyBuildingViewMessage(BlockPos, RegistryFriendlyByteBuf)IColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyBuildingViewMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.buildingId- ID of the building.buf-RegistryFriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewRemoveBuildingMessage
public void handleColonyViewRemoveBuildingMessage(int colonyId, net.minecraft.core.BlockPos buildingId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofifinvalid reference
IColonyView#handleColonyViewRemoveBuildingMessage(BlockPos)IColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyViewRemoveBuildingMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.buildingId- ID of the building.dim- the dimension.
-
handleColonyViewRemoveWorkOrderMessage
public void handleColonyViewRemoveWorkOrderMessage(int colonyId, int workOrderId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewRemoveWorkOrderMessage(int)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result. IfIColonyManager.getColonyView(int, ResourceKey)is null, returns null.- Specified by:
handleColonyViewRemoveWorkOrderMessagein interfaceIColonyManager- Parameters:
colonyId- ID of the colony.workOrderId- ID of the workOrder.dim- the dimension.
-
isSchematicDownloaded
public boolean isSchematicDownloaded()Description copied from interface:IColonyManagerWhether or not a new schematic have been downloaded.- Specified by:
isSchematicDownloadedin interfaceIColonyManager- Returns:
- True if a new schematic have been received.
-
setSchematicDownloaded
public void setSchematicDownloaded(boolean downloaded) Description copied from interface:IColonyManagerSet the schematic downloaded- Specified by:
setSchematicDownloadedin interfaceIColonyManager- Parameters:
downloaded- True if a new schematic have been received.
-
isCoordinateInAnyColony
public boolean isCoordinateInAnyColony(@NotNull @NotNull net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Description copied from interface:IColonyManagerCheck if a given coordinate is inside any other colony.- Specified by:
isCoordinateInAnyColonyin interfaceIColonyManager- Parameters:
world- the world to check in.pos- the position to check.- Returns:
- true if a colony has been found.
-
getCompatibilityManager
Description copied from interface:IColonyManagerGet an instance of the compatibilityManager.- Specified by:
getCompatibilityManagerin interfaceIColonyManager- Returns:
- the manager.
-
getRecipeManager
Description copied from interface:IColonyManagerGetter for the recipeManager.- Specified by:
getRecipeManagerin interfaceIColonyManager- Returns:
- an IRecipeManager.
-
getTopColonyId
public int getTopColonyId()Description copied from interface:IColonyManagerGet the top colony id of all colonies.- Specified by:
getTopColonyIdin interfaceIColonyManager- Returns:
- the top id.
-
resetColonyViews
public void resetColonyViews()Description copied from interface:IColonyManagerReset all colony views on login to new world.- Specified by:
resetColonyViewsin interfaceIColonyManager
-
addColonyDirect
Description copied from interface:IColonyManagerAdds colony directly to cap. Use only during loading!- Specified by:
addColonyDirectin interfaceIColonyManager- Parameters:
colony- loaded colony
-
addClaimData
public void addClaimData(IColony colony, it.unimi.dsi.fastutil.longs.Long2ObjectMap<ChunkClaimData> claimData) Description copied from interface:IColonyManagerAdd claim data of a colony.- Specified by:
addClaimDatain interfaceIColonyManager- Parameters:
colony- the colony from which to add the claim data.claimData- the claim data to add.
-
getClaimData
public Map<net.minecraft.world.level.ChunkPos,IChunkClaimData> getClaimData(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Description copied from interface:IColonyManagerGet the claim data for the whole dimension.- Specified by:
getClaimDatain interfaceIColonyManager- Parameters:
dimension- the dim.- Returns:
- the claim data.
-
getClaimData
@Nullable public @Nullable IChunkClaimData getClaimData(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, net.minecraft.world.level.ChunkPos pos) Description copied from interface:IColonyManagerGet the claim data for a dimension and pos.- Specified by:
getClaimDatain interfaceIColonyManager- Parameters:
dimension- the dim.pos- the pos.- Returns:
- the claim data.
-
addNewChunk
public void addNewChunk(Colony colony, net.minecraft.world.level.ChunkPos pos, ChunkClaimData chunkClaimData) Description copied from interface:IColonyManagerNew chunk to track claim of.- Specified by:
addNewChunkin interfaceIColonyManager- Parameters:
colony- the colony claiming it.pos- the chunk pos.chunkClaimData- the claim data to track.
-