Class RegisteredStructureManagerView
java.lang.Object
com.minecolonies.core.colony.managers.views.RegisteredStructureManagerView
- All Implemented Interfaces:
ICommonRegisteredStructureManager<IBuildingView,,ITownHallView> IRegisteredStructureManagerView
public class RegisteredStructureManagerView
extends Object
implements IRegisteredStructureManagerView
Client side registered structure manager.
-
Constructor Summary
ConstructorsConstructorDescriptionRegisteredStructureManagerView(ColonyView colonyView) Create a new client side registered structure manager. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeFromView(boolean isNewSubscription, @NotNull net.minecraft.network.FriendlyByteBuf buf) @NotNull List<IBuildingExtension>getBuildingExtensions(Predicate<IBuildingExtension> matcher) Get all the building extensions.@NotNull Map<net.minecraft.core.BlockPos,IBuildingView> Returns a map with all buildings within the colony.Get the colony from the manager.@Nullable ITownHallViewGet the townhall from the colony.void@Nullable IMessagehandleColonyBuildingViewMessage(net.minecraft.core.BlockPos buildingId, @NotNull net.minecraft.network.FriendlyByteBuf buf) Update a ColonyView's buildings given a network data ColonyView update packet.@Nullable IMessagehandleColonyViewRemoveBuildingMessage(net.minecraft.core.BlockPos buildingId) Remove a building from the ColonyView.booleanCheck if the colony has a placed townhall.booleanCheck if the colony has a placed warehouse.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.managers.interfaces.ICommonRegisteredStructureManager
getBestBuilding, getBestBuilding, getBestBuilding, getBestBuilding, getBuilding, getBuilding, getFirstBuildingMatching, getRandomBuilding, hasBuilding
-
Constructor Details
-
RegisteredStructureManagerView
Create a new client side registered structure manager.- Parameters:
colonyView- the colony view it belongs to.
-
-
Method Details
-
getTownHall
Description copied from interface:ICommonRegisteredStructureManagerGet the townhall from the colony.- Specified by:
getTownHallin interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Returns:
- the townhall building.
-
handleColonyViewRemoveBuildingMessage
@Nullable public @Nullable IMessage handleColonyViewRemoveBuildingMessage(net.minecraft.core.BlockPos buildingId) Description copied from interface:IRegisteredStructureManagerViewRemove a building from the ColonyView.- Specified by:
handleColonyViewRemoveBuildingMessagein interfaceIRegisteredStructureManagerView- Parameters:
buildingId- location of the building.- Returns:
- null == no response.
-
handleColonyBuildingViewMessage
@Nullable public @Nullable IMessage handleColonyBuildingViewMessage(net.minecraft.core.BlockPos buildingId, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IRegisteredStructureManagerViewUpdate a ColonyView's buildings given a network data ColonyView update packet. This uses a full-replacement - buildings do not get updated and are instead overwritten.- Specified by:
handleColonyBuildingViewMessagein interfaceIRegisteredStructureManagerView- Parameters:
buildingId- location of the building.buf- buffer containing ColonyBuilding information.- Returns:
- null == no response.
-
handleColonyBuildingExtensionViewUpdateMessage
- Specified by:
handleColonyBuildingExtensionViewUpdateMessagein interfaceIRegisteredStructureManagerView
-
getBuildingExtensions
@NotNull public @NotNull List<IBuildingExtension> getBuildingExtensions(Predicate<IBuildingExtension> matcher) Description copied from interface:ICommonRegisteredStructureManagerGet all the building extensions.- Specified by:
getBuildingExtensionsin interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Parameters:
matcher- the building extension matcher predicate.- Returns:
- an unmodifiable collection of all building extensions.
-
hasTownHall
public boolean hasTownHall()Description copied from interface:ICommonRegisteredStructureManagerCheck if the colony has a placed townhall.- Specified by:
hasTownHallin interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Returns:
- true if so.
-
getColony
Description copied from interface:ICommonRegisteredStructureManagerGet the colony from the manager.- Specified by:
getColonyin interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Returns:
- the IColony colony.
-
hasWarehouse
public boolean hasWarehouse()Description copied from interface:ICommonRegisteredStructureManagerCheck if the colony has a placed warehouse.- Specified by:
hasWarehousein interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Returns:
- true if so.
-
getBuildings
Description copied from interface:ICommonRegisteredStructureManagerReturns a map with all buildings within the colony. Key is ID (Coordinates), value is building object.- Specified by:
getBuildingsin interfaceICommonRegisteredStructureManager<IBuildingView,ITownHallView> - Returns:
- Map with ID (coordinates) as key, and buildings as value.
-
deserializeFromView
public void deserializeFromView(boolean isNewSubscription, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) - Specified by:
deserializeFromViewin interfaceIRegisteredStructureManagerView
-