Class ColonyPackageManager
java.lang.Object
com.minecolonies.core.colony.managers.ColonyPackageManager
- All Implemented Interfaces:
IColonyPackageManager
-
Constructor Summary
ConstructorsConstructorDescriptionColonyPackageManager(Colony colony) Creates the ColonyPackageManager for a colony. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseSubscriber(@NotNull net.minecraft.server.level.ServerPlayer subscriber) Add a new subscriber to the colony.voidaddImportantColonyPlayer(@NotNull net.minecraft.server.level.ServerPlayer subscriber) On login we're adding global subscribers.Set<net.minecraft.server.level.ServerPlayer>Get all subscribers.Set<net.minecraft.server.level.ServerPlayer>Returns the list of online global subscribers of the colony.intGet the last contact in hours from the colony.voidremoveCloseSubscriber(@NotNull net.minecraft.server.level.ServerPlayer player) Remove a subscriber from the colony.voidremoveImportantColonyPlayer(@NotNull net.minecraft.server.level.ServerPlayer subscriber) On logoff we're removing global subscribers.voidUpdate the colony view.voidSends packages to update the permissions.voidSends packages to update the workOrders.voidsetDirty()Mark the package manager dirty.voidsetLastContactInHours(int lastContactInHours) Set the last contact in hours.voidUpdates the away timer for the colony.voidUpdate the closeSubscribers of the colony.voidUpdate Subscribers with Colony, Citizen, and AbstractBuilding Views.
-
Constructor Details
-
ColonyPackageManager
Creates the ColonyPackageManager for a colony.- Parameters:
colony- the colony.
-
-
Method Details
-
getLastContactInHours
public int getLastContactInHours()Description copied from interface:IColonyPackageManagerGet the last contact in hours from the colony.- Specified by:
getLastContactInHoursin interfaceIColonyPackageManager- Returns:
- the integer.
-
setLastContactInHours
public void setLastContactInHours(int lastContactInHours) Description copied from interface:IColonyPackageManagerSet the last contact in hours.- Specified by:
setLastContactInHoursin interfaceIColonyPackageManager- Parameters:
lastContactInHours- the number to set.
-
getCloseSubscribers
Description copied from interface:IColonyPackageManagerGet all subscribers.- Specified by:
getCloseSubscribersin interfaceIColonyPackageManager- Returns:
- a copy of the hashset.
-
updateSubscribers
public void updateSubscribers()Description copied from interface:IColonyPackageManagerUpdate Subscribers with Colony, Citizen, and AbstractBuilding Views.- Specified by:
updateSubscribersin interfaceIColonyPackageManager
-
updateAwayTime
public void updateAwayTime()Updates the away timer for the colony.- Specified by:
updateAwayTimein interfaceIColonyPackageManager
-
updateColonyViews
public void updateColonyViews()Update the closeSubscribers of the colony. -
sendColonyViewPackets
public void sendColonyViewPackets()Description copied from interface:IColonyPackageManagerUpdate the colony view.- Specified by:
sendColonyViewPacketsin interfaceIColonyPackageManager
-
sendPermissionsPackets
public void sendPermissionsPackets()Description copied from interface:IColonyPackageManagerSends packages to update the permissions.- Specified by:
sendPermissionsPacketsin interfaceIColonyPackageManager
-
sendWorkOrderPackets
public void sendWorkOrderPackets()Description copied from interface:IColonyPackageManagerSends packages to update the workOrders.- Specified by:
sendWorkOrderPacketsin interfaceIColonyPackageManager
-
setDirty
public void setDirty()Description copied from interface:IColonyPackageManagerMark the package manager dirty.- Specified by:
setDirtyin interfaceIColonyPackageManager
-
addCloseSubscriber
public void addCloseSubscriber(@NotNull @NotNull net.minecraft.server.level.ServerPlayer subscriber) Description copied from interface:IColonyPackageManagerAdd a new subscriber to the colony.- Specified by:
addCloseSubscriberin interfaceIColonyPackageManager- Parameters:
subscriber- the subscriber to add.
-
removeCloseSubscriber
public void removeCloseSubscriber(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player) Description copied from interface:IColonyPackageManagerRemove a subscriber from the colony.- Specified by:
removeCloseSubscriberin interfaceIColonyPackageManager- Parameters:
player- the subscriber to remove.
-
addImportantColonyPlayer
public void addImportantColonyPlayer(@NotNull @NotNull net.minecraft.server.level.ServerPlayer subscriber) On login we're adding global subscribers.- Specified by:
addImportantColonyPlayerin interfaceIColonyPackageManager- Parameters:
subscriber- the subscriber to add.
-
removeImportantColonyPlayer
public void removeImportantColonyPlayer(@NotNull @NotNull net.minecraft.server.level.ServerPlayer subscriber) On logoff we're removing global subscribers.- Specified by:
removeImportantColonyPlayerin interfaceIColonyPackageManager- Parameters:
subscriber- the subscriber to remove.
-
getImportantColonyPlayers
Returns the list of online global subscribers of the colony.- Specified by:
getImportantColonyPlayersin interfaceIColonyPackageManager- Returns:
- global subscribers
-