Interface IBuildingView
- All Superinterfaces:
ICommonBuilding,IModuleContainerView,IRequester
- All Known Subinterfaces:
IBuildingWorkerView,ITownHallView
- All Known Implementing Classes:
AbstractBuildingBuilderView,AbstractBuildingGuards.View,AbstractBuildingView,BuildingBarracks.View,BuildingBeekeeper.View,BuildingBuilder.View,BuildingCook.View,BuildingGateHouse.View,BuildingGuardTower.View,BuildingLumberjack.View,BuildingMysticalSite.View,BuildingTownHall.View,BuildingWareHouse.View,EmptyView,HomeBuildingModule.View,LivingBuildingView,PostBox.View,TavernBuildingModule.View
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the building currently allows assignment of citizens.voiddeserialize(@NotNull net.minecraft.network.FriendlyByteBuf buf) Read this view from aFriendlyByteBuf.Get the citizen ids of all assigned citizens to this building.default StringGets the display name (either the custom name or a type-based name).intGet the delivery priority of the building.intGet the max level of the building.intGet the claim radius for the building.Gets the ColonyView that this building belongs to.intGet the current work order level.Getter for the custom building name.default StringGet lang key of pre-upgrade warning for building level.@NotNull net.minecraft.core.BlockPosgetID()Gets the id for this building.com.google.common.collect.ImmutableList<IRequest<?>>getOpenRequests(@NotNull ICitizenDataView data) Map<Integer,Collection<IToken<?>>> com.google.common.collect.ImmutableList<IRequest<?>><R> com.google.common.collect.ImmutableList<IRequest<? extends R>>getOpenRequestsOfType(@NotNull ICitizenDataView citizenData, Class<R> requestType) <R> com.google.common.collect.ImmutableList<IRequest<? extends R>>getOpenRequestsOfTypeFiltered(@NotNull ICitizenDataView citizenData, Class<R> requestType, Predicate<IRequest<? extends R>> filter) net.minecraft.core.BlockPosGet the parent buildingdefault intgetRange()Get functional range around building.com.google.common.collect.ImmutableCollection<IToken<?>>intGetter for the rotation.Getter for the style.Getter for the schematic name.@NotNull com.ldtteam.blockui.views.BOWindowWill return the window if this building has an associated blockui window.booleanGet the current work order level.booleanCheck if the building is current being built.booleanChecks if this building is at its max level.booleanCheck if the building was deconstructed.booleanCheck if the building is currently being deconstructed..booleanGetter for the mirror.booleanCheck if the building is currently being repaired.voidopenGui(boolean shouldOpenInv) Open the associated blockui window for this building.voidsetBuildingType(BuildingEntry buildingType) Set the building typevoidsetCustomName(String name) Setter for the custom name.Methods inherited from interface com.minecolonies.api.colony.buildings.ICommonBuilding
getBuildingLevel, getBuildingLevelEquivalent, getBuildingType, getContainers, getPosition, getPrestigeMethods inherited from interface com.minecolonies.api.colony.buildings.views.IModuleContainerView
getAllModuleViews, getModuleView, getModuleView, getModuleViewByType, getModuleViewMatching, getModuleViews, hasModuleView, registerModuleMethods inherited from interface com.minecolonies.api.colony.requestsystem.requester.IRequester
getId, getLocation, getRequesterDisplayName, onRequestedRequestCancelled, onRequestedRequestComplete
-
Method Details
-
getID
@NotNull @NotNull net.minecraft.core.BlockPos getID()Gets the id for this building.- Returns:
- A BlockPos because the building ID is its location.
-
getParent
net.minecraft.core.BlockPos getParent()Get the parent building- Returns:
-
getBuildingMaxLevel
int getBuildingMaxLevel()Get the max level of the building.- Returns:
- AbstractBuilding max level.
-
isBuildingMaxLevel
boolean isBuildingMaxLevel()Checks if this building is at its max level.- Returns:
- true if the building is at its max level.
-
getCurrentWorkOrderLevel
int getCurrentWorkOrderLevel()Get the current work order level.- Returns:
- 0 if none, othewise the current level worked on
-
getStructurePath
String getStructurePath()Getter for the schematic name.- Returns:
- the schematic name.
-
getCustomName
String getCustomName()Getter for the custom building name.- Returns:
- the name.
-
getBuildingDisplayName
Gets the display name (either the custom name or a type-based name).- Returns:
- the name (or translation key).
-
getStructurePack
String getStructurePack()Getter for the style.- Returns:
- the style string.
-
getRotation
int getRotation()Getter for the rotation.- Returns:
- the rotation.
-
isMirrored
boolean isMirrored()Getter for the mirror.- Returns:
- true if mirrored.
-
hasWorkOrder
boolean hasWorkOrder()Get the current work order level.- Returns:
- 0 if none, othewise the current level worked on
-
isBuilding
boolean isBuilding()Check if the building is current being built.- Returns:
- true if so.
-
isRepairing
boolean isRepairing()Check if the building is currently being repaired.- Returns:
- true if so.
-
isDeconstructing
boolean isDeconstructing()Check if the building is currently being deconstructed..- Returns:
- true if so.
-
getClaimRadius
int getClaimRadius()Get the claim radius for the building.- Returns:
- the radius.
-
openGui
void openGui(boolean shouldOpenInv) Open the associated blockui window for this building. If the player is sneaking open the inventory else open the GUI directly.- Parameters:
shouldOpenInv- if the player is sneaking.
-
getWindow
@NotNull @NotNull com.ldtteam.blockui.views.BOWindow getWindow()Will return the window if this building has an associated blockui window.- Returns:
- blockui window.
-
deserialize
void deserialize(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Read this view from aFriendlyByteBuf.- Parameters:
buf- The buffer to read this view from.
-
getOpenRequestsByCitizen
Map<Integer,Collection<IToken<?>>> getOpenRequestsByCitizen() -
getOpenRequestsOfType
<R> com.google.common.collect.ImmutableList<IRequest<? extends R>> getOpenRequestsOfType(@NotNull @NotNull ICitizenDataView citizenData, Class<R> requestType) -
getOpenRequests
com.google.common.collect.ImmutableList<IRequest<?>> getOpenRequests(@NotNull @NotNull ICitizenDataView data) -
getOpenRequestsOfBuilding
com.google.common.collect.ImmutableList<IRequest<?>> getOpenRequestsOfBuilding() -
getColony
IColonyView getColony()Gets the ColonyView that this building belongs to.- Specified by:
getColonyin interfaceICommonBuilding- Returns:
- ColonyView, client side interpretations of Colony.
-
getOpenRequestsOfTypeFiltered
<R> com.google.common.collect.ImmutableList<IRequest<? extends R>> getOpenRequestsOfTypeFiltered(@NotNull @NotNull ICitizenDataView citizenData, Class<R> requestType, Predicate<IRequest<? extends R>> filter) -
getBuildingDmPrio
int getBuildingDmPrio()Get the delivery priority of the building.- Returns:
- int, delivery priority.
-
getResolverIds
com.google.common.collect.ImmutableCollection<IToken<?>> getResolverIds() -
setCustomName
Setter for the custom name. Sets the name on the client side and sends it to the server.- Parameters:
name- the new name.
-
isDeconstructed
boolean isDeconstructed()Check if the building was deconstructed.- Returns:
- true if so.
-
setBuildingType
Set the building type- Parameters:
buildingType-
-
getAllAssignedCitizens
Get the citizen ids of all assigned citizens to this building.- Returns:
- the set of ids.
-
allowsAssignment
boolean allowsAssignment()Check if the building currently allows assignment of citizens.- Returns:
- true if so.
-
getRange
default int getRange()Get functional range around building.- Returns:
- the range.
-
getHoverWarningForLevel
Get lang key of pre-upgrade warning for building level.- Returns:
- empty-string by default. Override for respective building.
-