Class AbstractSchematicProvider

java.lang.Object
com.minecolonies.core.colony.buildings.AbstractSchematicProvider
All Implemented Interfaces:
IBuilding, IBuildingContainer, ICommonBuilding, ISchematicProvider, IBuildingModuleContainer, IModuleContainer<IBuildingModule>, IRequester, IRequestResolverProvider, IItemHandlerCapProvider, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
AbstractBuildingContainer

public abstract class AbstractSchematicProvider extends Object implements ISchematicProvider, IBuilding
  • Field Details

    • colony

      protected final IColony colony
      The Colony for this schematic Provider
  • Constructor Details

    • AbstractSchematicProvider

      public AbstractSchematicProvider(net.minecraft.core.BlockPos pos, IColony colony)
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • isDeconstructed

      public boolean isDeconstructed()
      Description copied from interface: ISchematicProvider
      Check if the building was deconstructed.
      Specified by:
      isDeconstructed in interface ISchematicProvider
      Returns:
      true if so.
    • setDeconstructed

      public void setDeconstructed()
      Description copied from interface: ISchematicProvider
      Set the building as deconstructed.
      Specified by:
      setDeconstructed in interface ISchematicProvider
    • getBlueprintPath

      public String getBlueprintPath()
      Description copied from interface: ISchematicProvider
      Returns the blueprint path of the current building.
      Specified by:
      getBlueprintPath in interface ISchematicProvider
      Returns:
      String representation of the current blueprint-path
    • setBlueprintPath

      public void setBlueprintPath(String path)
      Description copied from interface: ISchematicProvider
      Sets the blueprint path of the building.
      Specified by:
      setBlueprintPath in interface ISchematicProvider
      Parameters:
      path - String value of the blueprint-path.
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • getColony

      public IColony getColony()
      Description copied from interface: ICommonBuilding
      Get the colony from a building.
      Specified by:
      getColony in interface ICommonBuilding
      Returns:
      the colony it belongs to.
    • getPosition

      public net.minecraft.core.BlockPos getPosition()
      Description copied from interface: ICommonBuilding
      Gets the location of this building.
      Specified by:
      getPosition in interface ICommonBuilding
      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: ISchematicProvider
      Sets the corners of the building based on the schematic.
      Specified by:
      setCorners in interface ISchematicProvider
      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: ISchematicProvider
      Get 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:
      getCorners in interface ISchematicProvider
      Returns:
      the corners.
    • getID

      public net.minecraft.core.BlockPos getID()
      Description copied from interface: ISchematicProvider
      Returns the BlockPos of the current object, also used as ID.
      Specified by:
      getID in interface ISchematicProvider
      Returns:
      BlockPos of the current object.
    • getParent

      public net.minecraft.core.BlockPos getParent()
      Description copied from interface: ISchematicProvider
      Get the parent building position
      Specified by:
      getParent in interface ISchematicProvider
      Returns:
    • hasParent

      public boolean hasParent()
      Description copied from interface: ISchematicProvider
      Whether we have a parent
      Specified by:
      hasParent in interface ISchematicProvider
      Returns:
      true if there is a parent building
    • setParent

      public void setParent(net.minecraft.core.BlockPos pos)
      Description copied from interface: ISchematicProvider
      Set the parent building position
      Specified by:
      setParent in interface ISchematicProvider
      Parameters:
      pos -
    • getChildren

      public Set<net.minecraft.core.BlockPos> getChildren()
      Description copied from interface: ISchematicProvider
      Get the child building positions
      Specified by:
      getChildren in interface ISchematicProvider
      Returns:
    • safeUpdateTEDataFromSchematic

      public void safeUpdateTEDataFromSchematic()
      Load updated TE data from the schematic if missing.
    • onColonyTick

      public void onColonyTick(IColony colony)
      Description copied from interface: IBuilding
      On tick of the colony.
      Specified by:
      onColonyTick in interface IBuilding
    • asyncPrestigeRecalc

      public void asyncPrestigeRecalc()
      Description copied from interface: IBuilding
      Trigger for async prestige recalculation.
      Specified by:
      asyncPrestigeRecalc in interface IBuilding
    • getStructurePack

      public String getStructurePack()
      Description copied from interface: ISchematicProvider
      Returns the style of the current building.
      Specified by:
      getStructurePack in interface ISchematicProvider
      Returns:
      String representation of the current building-style
    • setStructurePack

      public void setStructurePack(String pack)
      Description copied from interface: ISchematicProvider
      Sets the style of the building.
      Specified by:
      setStructurePack in interface ISchematicProvider
      Parameters:
      pack - String value of the style.
    • getBuildingLevel

      public int getBuildingLevel()
      Description copied from interface: ICommonBuilding
      Get the current level of the building.
      Specified by:
      getBuildingLevel in interface ICommonBuilding
      Returns:
      AbstractBuilding current level.
    • setBuildingLevel

      public void setBuildingLevel(int level)
      Description copied from interface: ISchematicProvider
      Sets the current level of the building.
      Specified by:
      setBuildingLevel in interface ISchematicProvider
      Parameters:
      level - Level of the building.
    • setRotationMirror

      public void setRotationMirror(com.ldtteam.structurize.api.RotationMirror rotMir)
      Specified by:
      setRotationMirror in interface ISchematicProvider
      Parameters:
      rotMir - rotation and mirror of schematic
    • getRotationMirror

      public com.ldtteam.structurize.api.RotationMirror getRotationMirror()
      Specified by:
      getRotationMirror in interface ISchematicProvider
      Returns:
      rotation and mirror of schematic
    • isInBuilding

      public boolean isInBuilding(@NotNull @NotNull net.minecraft.core.BlockPos positionVec)
      Description copied from interface: IBuilding
      Check if a certain vec is within this building.
      Specified by:
      isInBuilding in interface IBuilding
      Parameters:
      positionVec - the pos to check.
      Returns:
      true if so.
    • upgradeBuildingLevelToSchematicData

      public void upgradeBuildingLevelToSchematicData()
      Description copied from interface: IBuilding
      Upgrades the buildings level to fit its schematic data
      Specified by:
      upgradeBuildingLevelToSchematicData in interface IBuilding
    • onUpgradeSchematicTo

      public void onUpgradeSchematicTo(String oldSchematic, String newSchematic, com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE blueprintDataProvider)
      Description copied from interface: ISchematicProvider
      Called when the old schematic is updated to a new one
      Specified by:
      onUpgradeSchematicTo in interface ISchematicProvider
      Parameters:
      oldSchematic -
      newSchematic -
    • getBuildingType

      public final BuildingEntry getBuildingType()
      Description copied from interface: ICommonBuilding
      Get the Building type
      Specified by:
      getBuildingType in interface ICommonBuilding
      Returns:
      building type
    • setBuildingType

      public void setBuildingType(BuildingEntry buildingType)
      Description copied from interface: IBuilding
      Set the building type
      Specified by:
      setBuildingType in interface IBuilding
      Parameters:
      buildingType -