Class TileEntityColonyBuilding

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity, com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE, ITickable, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
AbstractTileEntityWareHouse, TileEntityEnchanter, TileEntityStash

public class TileEntityColonyBuilding extends AbstractTileEntityColonyBuilding implements ITickable
Class which handles the tileEntity of our colonyBuildings.
  • Field Details

    • registryName

      public net.minecraft.resources.ResourceLocation registryName
      The name of the building location.
  • Constructor Details

    • TileEntityColonyBuilding

      public TileEntityColonyBuilding(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Default constructor used to create a new TileEntity via reflection. Do not use.
    • TileEntityColonyBuilding

      public TileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Alternative overriden constructor.
      Parameters:
      type - the entity type.
  • Method Details

    • getColonyId

      public int getColonyId()
      Returns the colony ID.
      Specified by:
      getColonyId in class AbstractTileEntityColonyBuilding
      Returns:
      ID of the colony.
    • getColony

      public IColony getColony()
      Returns the colony of the tile entity.
      Specified by:
      getColony in class AbstractTileEntityColonyBuilding
      Returns:
      Colony of the tile entity.
    • getPosition

      public net.minecraft.core.BlockPos getPosition()
      Returns the position of the tile entity.
      Specified by:
      getPosition in class AbstractTileEntityColonyBuilding
      Returns:
      Block Coordinates of the tile entity.
    • getPositionOfChestWithItemStack

      @Nullable public @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.
      Specified by:
      getPositionOfChestWithItemStack in class AbstractTileEntityColonyBuilding
      Parameters:
      itemStackSelectionPredicate - the stack to search for.
      Returns:
      the position or null.
    • setColony

      public void setColony(IColony c)
      Sets the colony of the tile entity.
      Specified by:
      setColony in class AbstractTileEntityColonyBuilding
      Parameters:
      c - Colony to set in references.
    • setChanged

      public void setChanged()
      Overrides:
      setChanged in class TileEntityRack
    • getUpdatePacket

      public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()
      Specified by:
      getUpdatePacket in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
      Overrides:
      getUpdatePacket in class TileEntityRack
    • getUpdateTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag()
      Overrides:
      getUpdateTag in class TileEntityRack
    • handleUpdateTag

      public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      handleUpdateTag in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      handleUpdateTag in class TileEntityRack
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet)
      Specified by:
      onDataPacket in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      onDataPacket in class TileEntityRack
    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface net.minecraftforge.common.extensions.IForgeBlockEntity
    • getBuilding

      public IBuilding getBuilding()
      Returns the building associated with the tile entity.
      Specified by:
      getBuilding in class AbstractTileEntityColonyBuilding
      Returns:
      IBuildingContainer associated with the tile entity.
    • setBuilding

      public void setBuilding(IBuilding b)
      Sets the building associated with the tile entity.
      Specified by:
      setBuilding in class AbstractTileEntityColonyBuilding
      Parameters:
      b - IBuilding to associate with the tile entity.
    • getDisplayName

      @NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
      Overrides:
      getDisplayName in class TileEntityRack
    • getBuildingView

      public IBuildingView getBuildingView()
      Returns the view of the building associated with the tile entity.
      Specified by:
      getBuildingView in class AbstractTileEntityColonyBuilding
      Returns:
      IBuildingView the tile entity is associated with.
    • load

      public void load(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Overrides:
      load in class AbstractTileEntityColonyBuilding
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Overrides:
      saveAdditional in class AbstractTileEntityColonyBuilding
    • tick

      public void tick()
      Description copied from interface: ITickable
      Default parameterless ticking implementation.
      Specified by:
      tick in interface ITickable
    • isUsableByPlayer

      public boolean isUsableByPlayer(@NotNull @NotNull net.minecraft.world.entity.player.Player player)
    • hasAccessPermission

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

      public void setMirror(boolean mirror)
      Set if the entity is mirrored.
      Specified by:
      setMirror in class AbstractTileEntityColonyBuilding
      Parameters:
      mirror - true if so.
    • isMirrored

      public boolean isMirrored()
      Check if building is mirrored.
      Specified by:
      isMirrored in class AbstractTileEntityColonyBuilding
      Returns:
      true if so.
    • getStructurePack

      public com.ldtteam.structurize.storage.StructurePackMeta getStructurePack()
      Getter for the style.
      Specified by:
      getStructurePack in class AbstractTileEntityColonyBuilding
      Returns:
      the string of it.
    • setStructurePack

      public void setStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style)
      Set the style of the tileEntity.
      Specified by:
      setStructurePack in class AbstractTileEntityColonyBuilding
      Parameters:
      style - the style to set.
    • setBlueprintPath

      public void setBlueprintPath(String path)
      Description copied from class: AbstractTileEntityColonyBuilding
      Set the blueprint path of the tileEntity.
      Specified by:
      setBlueprintPath in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
      Specified by:
      setBlueprintPath in class AbstractTileEntityColonyBuilding
      Parameters:
      path - the path to set.
    • setPackName

      public void setPackName(String packName)
      Specified by:
      setPackName in interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
    • getPackName

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

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

      public net.minecraft.resources.ResourceLocation getBuildingName()
      Description copied from class: AbstractTileEntityColonyBuilding
      Get the building name that this AbstractTileEntityColonyBuilding belongs to.
      Specified by:
      getBuildingName in class AbstractTileEntityColonyBuilding
      Returns:
      The buildings name.
    • updateBlockState

      public void updateBlockState()
      Description copied from class: AbstractTileEntityRack
      Update the blockState of the rack. Switch between connected, single, full and empty texture.
      Overrides:
      updateBlockState in class TileEntityRack
    • getCapability

      @NotNull public <T> @NotNull net.minecraftforge.common.util.LazyOptional<T> getCapability(@NotNull @NotNull net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable @Nullable net.minecraft.core.Direction side)
      Specified by:
      getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvider
      Overrides:
      getCapability in class TileEntityRack
    • createMenu

      @Nullable public @Nullable net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull @NotNull net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
      Overrides:
      createMenu in class TileEntityRack
    • reactivate

      public void reactivate()
      Reactivate the hut of this tileEntity. Load the schematic data and set the style correctly.