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 TypeMethodDescriptioncreateColony(@NotNull net.minecraft.world.level.Level 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.world.level.Level 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.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, @NotNull net.minecraft.world.entity.player.Player owner) Side neutral method to get colony.@Nullable IColonygetIColonyByOwner(@NotNull net.minecraft.world.level.Level w, UUID 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.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView#handleColonyBuildingViewMessage(BlockPos, FriendlyByteBuf)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewCitizensMessage(int colonyId, int citizenId, net.minecraft.network.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewCitizensMessage(int, FriendlyByteBuf)ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandleColonyViewMessage(int colonyId, @NotNull net.minecraft.network.FriendlyByteBuf colonyData, @NotNull net.minecraft.world.level.Level world, 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 ofIColonyView#handleColonyViewRemoveBuildingMessage(BlockPos)ifIColonyManager.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.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Returns result ofIColonyView.handleColonyViewWorkOrderMessage(FriendlyByteBuf)(int, ByteBuf)} ifIColonyManager.getColonyView(int, ResourceKey)gives a not-null result.voidhandlePermissionsViewMessage(int colonyID, @NotNull net.minecraft.network.FriendlyByteBuf 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.minecraftforge.event.TickEvent.ClientTickEvent event) On Client tick, clears views when player left.voidonServerTick(net.minecraftforge.event.TickEvent.ServerTickEvent event) On server tick, tick every Colony.voidonWorldLoad(@NotNull net.minecraft.world.level.Level world) When a world is loaded, Colonies in that world need to grab the reference to the World.voidonWorldTick(@NotNull net.minecraftforge.event.TickEvent.LevelTickEvent 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(@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.voidSets the cap for this world to loadedvoidsetSchematicDownloaded(boolean downloaded) Set the schematic downloadedvoidwrite(@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.world.level.Level 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.world.level.Level 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.minecraftforge.event.TickEvent.ServerTickEvent event) Description copied from interface:IColonyManagerOn server tick, tick every Colony. NOTE: Review this for performance.- Specified by:
onServerTickin interfaceIColonyManager- Parameters:
event-TickEvent.ServerTickEvent
-
write
public void write(@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(@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.minecraftforge.event.TickEvent.ClientTickEvent event) Description copied from interface:IColonyManagerOn Client tick, clears views when player left.- Specified by:
onClientTickin interfaceIColonyManager- Parameters:
event-TickEvent.ClientTickEvent.
-
onWorldTick
public void onWorldTick(@NotNull net.minecraftforge.event.TickEvent.LevelTickEvent 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 world) 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:
world- World.
-
setCapLoaded
public void setCapLoaded()Description copied from interface:IColonyManagerSets the cap for this world to loaded- Specified by:
setCapLoadedin interfaceIColonyManager
-
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.FriendlyByteBuf colonyData, @NotNull @NotNull net.minecraft.world.level.Level world, 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-FriendlyByteBufwith colony data.world- the world it is in.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.FriendlyByteBuf data, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handlePermissionsViewMessage(FriendlyByteBuf)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-FriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewCitizensMessage
public void handleColonyViewCitizensMessage(int colonyId, int citizenId, net.minecraft.network.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewCitizensMessage(int, FriendlyByteBuf)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-FriendlyByteBufwith colony data.dim- the dimension.
-
handleColonyViewWorkOrderMessage
public void handleColonyViewWorkOrderMessage(int colonyId, net.minecraft.network.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView.handleColonyViewWorkOrderMessage(FriendlyByteBuf)(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-FriendlyByteBufwith 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.FriendlyByteBuf buf, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) Description copied from interface:IColonyManagerReturns result ofIColonyView#handleColonyBuildingViewMessage(BlockPos, FriendlyByteBuf)ifIColonyManager.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-FriendlyByteBufwith 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 ofIColonyView#handleColonyViewRemoveBuildingMessage(BlockPos)ifIColonyManager.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
-