Class AbstractTileEntityColonyBuilding

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity, com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE, IItemHandlerCapProvider, net.minecraft.world.Clearable, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension
Direct Known Subclasses:
TileEntityColonyBuilding

public abstract class AbstractTileEntityColonyBuilding extends TileEntityRack implements com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
  • Constructor Details

    • AbstractTileEntityColonyBuilding

      public AbstractTileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • isInTileEntity

      public static boolean isInTileEntity(IItemHandlerCapProvider entity, @NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate)
      Finds the first @see ItemStack the type of is. It will be taken from the chest and placed in the worker inventory. Make sure that the worker stands next the chest to not break immersion. Also make sure to have inventory space for the stack.
      Parameters:
      entity - the tileEntity chest or building.
      itemStackSelectionPredicate - the itemStack predicate.
      Returns:
      true if found the stack.
    • getColonyId

      public abstract int getColonyId()
      Returns the colony ID.
      Returns:
      ID of the colony.
    • getColony

      public abstract IColony getColony()
      Returns the colony of the tile entity.
      Returns:
      Colony of the tile entity.
    • setColony

      public abstract void setColony(IColony c)
      Sets the colony of the tile entity.
      Parameters:
      c - Colony to set in references.
    • getPosition

      public abstract net.minecraft.core.BlockPos getPosition()
      Returns the position of the tile entity.
      Returns:
      Block Coordinates of the tile entity.
    • getPositionOfChestWithItemStack

      @Nullable public abstract @Nullable net.minecraft.core.BlockPos getPositionOfChestWithItemStack(@NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate)
      Check for a certain item and return the position of the chest containing it.
      Parameters:
      itemStackSelectionPredicate - the stack to search for.
      Returns:
      the position or null.
    • getBuilding

      public abstract IBuilding getBuilding()
      Returns the building associated with the tile entity.
      Returns:
      IBuildingContainer associated with the tile entity.
    • setBuilding

      public abstract void setBuilding(IBuilding b)
      Sets the building associated with the tile entity.
      Parameters:
      b - IBuildingContainer to associate with the tile entity.
    • getBuildingView

      public abstract IBuildingView getBuildingView()
      Returns the view of the building associated with the tile entity.
      Returns:
      IBuildingView the tile entity is associated with.
    • hasAccessPermission

      public abstract boolean hasAccessPermission(net.minecraft.world.entity.player.Player player)
      Checks if the player has permission to access the hut.
      Parameters:
      player - Player to check permission of.
      Returns:
      True when player has access, or building doesn't exist, otherwise false.
    • setRotationMirror

      public abstract void setRotationMirror(com.ldtteam.structurize.api.RotationMirror rotationMirror)
      Parameters:
      rotationMirror - rotation and mirror of the entity.
    • getRotationMirror

      public abstract com.ldtteam.structurize.api.RotationMirror getRotationMirror()
      Returns:
      rotation and mirror of the entity.
    • getStructurePack

      public abstract com.ldtteam.structurize.storage.StructurePackMeta getStructurePack()
      Getter for the style.
      Returns:
      the pack of it.
    • setStructurePack

      public abstract void setStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style)
      Set the pack of the tileEntity.
      Parameters:
      style - the pack to set.
    • setBlueprintPath

      public abstract void setBlueprintPath(String path)
      Set the blueprint path of the tileEntity.
      Specified by:
      setBlueprintPath in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
      Parameters:
      path - the path to set.
    • getBlueprintPath

      public abstract String getBlueprintPath()
      Get the blueprint path of the tileEntity.
      Specified by:
      getBlueprintPath in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
      Returns:
      path the path to get.
    • getBuildingName

      public abstract net.minecraft.resources.ResourceLocation getBuildingName()
      Get the building name that this AbstractTileEntityColonyBuilding belongs to.
      Returns:
      The buildings name.
    • getSchematicName

      public String getSchematicName()
      Specified by:
      getSchematicName in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • setSchematicName

      public void setSchematicName(String name)
      Specified by:
      setSchematicName in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • getPositionedTags

      public Map<net.minecraft.core.BlockPos,List<String>> getPositionedTags()
      Specified by:
      getPositionedTags in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • getWorldTagNamePosMap

      public Map<String,Set<net.minecraft.core.BlockPos>> getWorldTagNamePosMap()
      Specified by:
      getWorldTagNamePosMap in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • getCachedWorldTagNamePosMap

      public Map<String,List<net.minecraft.core.BlockPos>> getCachedWorldTagNamePosMap()
      Get a list version of the positioned tags, mapped from tag name to position.
      Returns:
      the list version.
    • setPositionedTags

      public void setPositionedTags(Map<net.minecraft.core.BlockPos,List<String>> positionedTags)
      Specified by:
      setPositionedTags in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • getSchematicCorners

      public net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getSchematicCorners()
      Specified by:
      getSchematicCorners in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • setSchematicCorners

      public void setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2)
      Specified by:
      setSchematicCorners in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • loadAdditional

      public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      loadAdditional in class TileEntityRack
    • readSchematicDataFromNBT

      public void readSchematicDataFromNBT(net.minecraft.nbt.CompoundTag originalCompound)
      Specified by:
      readSchematicDataFromNBT in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      saveAdditional in class TileEntityRack
    • getTilePos

      public net.minecraft.core.BlockPos getTilePos()
      Specified by:
      getTilePos in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • isOutdated

      public boolean isOutdated()
      Check if the TE is on an old data version.
      Returns:
      true if so.