Class AbstractSchematicProvider
java.lang.Object
com.minecolonies.core.colony.buildings.AbstractSchematicProvider
- All Implemented Interfaces:
IBuilding,IBuildingContainer,ICommonBuilding,ISchematicProvider,IBuildingModuleContainer,IModuleContainer<IBuildingModule>,IRequester,IRequestResolverProvider,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
AbstractBuildingContainer
public abstract class AbstractSchematicProvider
extends Object
implements ISchematicProvider, IBuilding
-
Field Summary
FieldsModifier and TypeFieldDescriptionintCached rotation.protected final IColonyThe Colony for this schematic ProviderFields inherited from interface com.minecolonies.api.colony.buildings.IBuilding
WOOD_HUT_LEVEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTrigger for async prestige recalculation.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) booleanReturns the blueprint path of the current building.intGet the current level of the building.final BuildingEntryGet the Building typeSet<net.minecraft.core.BlockPos>Get the child building positionsGet the colony from a building.net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> Get all the corners of the building based on the schematic.net.minecraft.core.BlockPosgetID()Returns theBlockPosof the current object, also used as ID.net.minecraft.core.BlockPosGet the parent building positionnet.minecraft.core.BlockPosGets the location of this building.intReturns the rotation of the current building.Returns the style of the current building.inthashCode()booleanWhether we have a parentbooleanCheck if the building was deconstructed.booleanisInBuilding(@NotNull net.minecraft.core.BlockPos positionVec) Check if a certain vec is within this building.booleanReturns the mirror of the current building.voidonColonyTick(IColony colony) On tick of the colony.voidonUpgradeSchematicTo(String oldSchematic, String newSchematic, com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE blueprintDataProvider) Called when the old schematic is updated to a new onevoidLoad updated TE data from the schematic if missing.net.minecraft.nbt.CompoundTagvoidsetBlueprintPath(String path) Sets the blueprint path of the building.voidsetBuildingLevel(int level) Sets the current level of the building.voidsetBuildingType(BuildingEntry buildingType) Set the building typevoidsetCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Sets the corners of the building based on the schematic.voidSet the building as deconstructed.voidsetIsMirrored(boolean isMirrored) Sets the mirror of the current building.voidsetParent(net.minecraft.core.BlockPos pos) Set the parent building positionvoidsetStructurePack(String pack) Sets the style of the building.voidUpgrades the buildings level to fit its schematic dataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.IBuilding
buildingRequiresCertainAmountOfItem, buildingRequiresCertainAmountOfItem, calculateCorners, calculatePrestige, canAssignCitizens, canBeBuiltByBuilder, canBeGathered, cancelAllRequestsOfCitizenOrBuilding, canEat, canSort, createPickupRequest, createRequest, createRequest, createResolvers, deconstruct, destroy, forceTransferStack, getAllAssignedCitizen, getBuildingDisplayName, getCitizenForRequest, getClaimRadius, getCompletedRequestsOfCitizenOrBuilding, getCompletedRequestsOfType, getCompletedRequestsOfTypeFiltered, getCustomName, getHandlers, getLocationsFromTag, getMaxEquipmentLevel, getOpenRequests, getOpenRequestsByRequestableType, getOpenRequestsOfType, getOpenRequestsOfTypeFiltered, getRequester, getRequiredItemsAndAmount, getResolvers, getSetting, getSettingValueOrDefault, hasCitizenCompletedRequests, hasCitizenCompletedRequestsToPickup, hasOpenSyncRequest, hasWorkerOpenRequests, hasWorkerOpenRequestsFiltered, hasWorkerOpenRequestsOfType, isBuilt, isGuardBuildingNear, isItemStackInRequest, isMatchingBlock, isPendingConstruction, markDirty, markRequestAsAccepted, onCleanUp, onDestroyed, onPlacement, onPlayerEnterBuilding, onPlayerEnterNearby, onRestart, onUpgradeComplete, onWakeUp, overruleNextOpenRequestOfCitizenWithStack, overruleNextOpenRequestWithStack, pickUp, processOfflineTime, removeWorkOrder, requestRemoval, requestRepair, requestUpgrade, reservedStacksExcluding, resetGuardBuildingNear, serializeToView, setCustomBuildingName, sortMethods inherited from interface com.minecolonies.api.colony.buildings.IBuildingContainer
addContainerPosition, alterPickUpPriority, getCapability, getContainers, getPickUpPriority, getTileEntity, registerBlockPosition, registerBlockPosition, removeContainerPosition, setTileEntityMethods inherited from interface com.minecolonies.api.colony.modules.IBuildingModuleContainer
getModule, getModule, hasModule, registerModuleMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface com.minecolonies.api.colony.buildings.ICommonBuilding
getBuildingLevelEquivalent, getContainers, getPrestigeMethods inherited from interface com.minecolonies.api.colony.modules.IModuleContainer
getClassType, getFirstModuleOccurance, getModule, getModule, getModule, getModuleMatching, getModules, getModules, getModules, getModules, getModulesByType, hasModule, hasModule, hasModuleMethods inherited from interface com.minecolonies.api.colony.requestsystem.requester.IRequester
getId, getLocation, getRequesterDisplayName, onRequestedRequestCancelled, onRequestedRequestCompleteMethods inherited from interface com.minecolonies.api.colony.requestsystem.resolver.IRequestResolverProvider
getIdMethods inherited from interface com.minecolonies.api.colony.buildings.ISchematicProvider
clearDirty, getMaxBuildingLevel, getSchematicName, isDirty
-
Field Details
-
colony
The Colony for this schematic Provider -
cachedRotation
public int cachedRotationCached rotation.
-
-
Constructor Details
-
AbstractSchematicProvider
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
isDeconstructed
public boolean isDeconstructed()Description copied from interface:ISchematicProviderCheck if the building was deconstructed.- Specified by:
isDeconstructedin interfaceISchematicProvider- Returns:
- true if so.
-
setDeconstructed
public void setDeconstructed()Description copied from interface:ISchematicProviderSet the building as deconstructed.- Specified by:
setDeconstructedin interfaceISchematicProvider
-
getBlueprintPath
Description copied from interface:ISchematicProviderReturns the blueprint path of the current building.- Specified by:
getBlueprintPathin interfaceISchematicProvider- Returns:
- String representation of the current blueprint-path
-
setBlueprintPath
Description copied from interface:ISchematicProviderSets the blueprint path of the building.- Specified by:
setBlueprintPathin interfaceISchematicProvider- Parameters:
path- String value of the blueprint-path.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfaceIBuildingContainer- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfaceIBuildingContainer- Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
getColony
Description copied from interface:ICommonBuildingGet the colony from a building.- Specified by:
getColonyin interfaceICommonBuilding- Returns:
- the colony it belongs to.
-
getPosition
public net.minecraft.core.BlockPos getPosition()Description copied from interface:ICommonBuildingGets the location of this building.- Specified by:
getPositionin interfaceICommonBuilding- Returns:
- A BlockPos, where this building is.
-
setCorners
public void setCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Description copied from interface:ISchematicProviderSets the corners of the building based on the schematic.- Specified by:
setCornersin interfaceISchematicProvider- Parameters:
pos1- the first corner.pos2- the second corner.
-
getCorners
public net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getCorners()Description copied from interface:ISchematicProviderGet all the corners of the building based on the schematic. This is the lowest corner (x,y,z) and the highest corner (x,y,z).- Specified by:
getCornersin interfaceISchematicProvider- Returns:
- the corners.
-
getID
public net.minecraft.core.BlockPos getID()Description copied from interface:ISchematicProviderReturns theBlockPosof the current object, also used as ID.- Specified by:
getIDin interfaceISchematicProvider- Returns:
BlockPosof the current object.
-
getParent
public net.minecraft.core.BlockPos getParent()Description copied from interface:ISchematicProviderGet the parent building position- Specified by:
getParentin interfaceISchematicProvider- Returns:
-
hasParent
public boolean hasParent()Description copied from interface:ISchematicProviderWhether we have a parent- Specified by:
hasParentin interfaceISchematicProvider- Returns:
- true if there is a parent building
-
setParent
public void setParent(net.minecraft.core.BlockPos pos) Description copied from interface:ISchematicProviderSet the parent building position- Specified by:
setParentin interfaceISchematicProvider
-
getChildren
Description copied from interface:ISchematicProviderGet the child building positions- Specified by:
getChildrenin interfaceISchematicProvider- Returns:
-
getRotation
public int getRotation()Description copied from interface:ISchematicProviderReturns the rotation of the current building.- Specified by:
getRotationin interfaceISchematicProvider- Returns:
- integer value of the rotation.
-
safeUpdateTEDataFromSchematic
public void safeUpdateTEDataFromSchematic()Load updated TE data from the schematic if missing. -
onColonyTick
Description copied from interface:IBuildingOn tick of the colony.- Specified by:
onColonyTickin interfaceIBuilding
-
asyncPrestigeRecalc
public void asyncPrestigeRecalc()Description copied from interface:IBuildingTrigger for async prestige recalculation.- Specified by:
asyncPrestigeRecalcin interfaceIBuilding
-
getStructurePack
Description copied from interface:ISchematicProviderReturns the style of the current building.- Specified by:
getStructurePackin interfaceISchematicProvider- Returns:
- String representation of the current building-style
-
setStructurePack
Description copied from interface:ISchematicProviderSets the style of the building.- Specified by:
setStructurePackin interfaceISchematicProvider- Parameters:
pack- String value of the style.
-
getBuildingLevel
public int getBuildingLevel()Description copied from interface:ICommonBuildingGet the current level of the building.- Specified by:
getBuildingLevelin interfaceICommonBuilding- Returns:
- AbstractBuilding current level.
-
setBuildingLevel
public void setBuildingLevel(int level) Description copied from interface:ISchematicProviderSets the current level of the building.- Specified by:
setBuildingLevelin interfaceISchematicProvider- Parameters:
level- Level of the building.
-
setIsMirrored
public void setIsMirrored(boolean isMirrored) Description copied from interface:ISchematicProviderSets the mirror of the current building.- Specified by:
setIsMirroredin interfaceISchematicProvider
-
isMirrored
public boolean isMirrored()Description copied from interface:ISchematicProviderReturns the mirror of the current building.- Specified by:
isMirroredin interfaceISchematicProvider- Returns:
- boolean value of the mirror.
-
isInBuilding
public boolean isInBuilding(@NotNull @NotNull net.minecraft.core.BlockPos positionVec) Description copied from interface:IBuildingCheck if a certain vec is within this building.- Specified by:
isInBuildingin interfaceIBuilding- Parameters:
positionVec- the pos to check.- Returns:
- true if so.
-
upgradeBuildingLevelToSchematicData
public void upgradeBuildingLevelToSchematicData()Description copied from interface:IBuildingUpgrades the buildings level to fit its schematic data- Specified by:
upgradeBuildingLevelToSchematicDatain interfaceIBuilding
-
onUpgradeSchematicTo
public void onUpgradeSchematicTo(String oldSchematic, String newSchematic, com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE blueprintDataProvider) Description copied from interface:ISchematicProviderCalled when the old schematic is updated to a new one- Specified by:
onUpgradeSchematicToin interfaceISchematicProvider
-
getBuildingType
Description copied from interface:ICommonBuildingGet the Building type- Specified by:
getBuildingTypein interfaceICommonBuilding- Returns:
- building type
-
setBuildingType
Description copied from interface:IBuildingSet the building type- Specified by:
setBuildingTypein interfaceIBuilding
-