Class EntityListModule

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.EntityListModule
All Implemented Interfaces:
IBuildingModule, IEntityListModule, IPersistentModule, IHasDirty

public class EntityListModule extends AbstractBuildingModule implements IEntityListModule, IPersistentModule
Class for all buildings that need a list of mobs to toggle for various reasons.
  • Constructor Details

    • EntityListModule

      public EntityListModule(String id)
      Construct a new grouped itemlist module with the unique list identifier.
      Parameters:
      id - the list id.
  • Method Details

    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • serializeNBT

      public void serializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • addEntity

      public void addEntity(net.minecraft.resources.ResourceLocation item)
      Description copied from interface: IEntityListModule
      Add an entity to the list.
      Specified by:
      addEntity in interface IEntityListModule
      Parameters:
      item - the entity to add.
    • isEntityInList

      public boolean isEntityInList(net.minecraft.resources.ResourceLocation entity)
      Description copied from interface: IEntityListModule
      Check if the entity is an allowed item.
      Specified by:
      isEntityInList in interface IEntityListModule
      Parameters:
      entity - the entity to check.
      Returns:
      true if so.
    • removeEntity

      public void removeEntity(net.minecraft.resources.ResourceLocation item)
      Description copied from interface: IEntityListModule
      Remove an entity from the list.
      Specified by:
      removeEntity in interface IEntityListModule
      Parameters:
      item - the item to remove.
    • getList

      public com.google.common.collect.ImmutableList<net.minecraft.resources.ResourceLocation> getList()
      Description copied from interface: IEntityListModule
      Get a specific entitylist.
      Specified by:
      getList in interface IEntityListModule
      Returns:
      a copy of the list at ID, or an empty list.
    • getListIdentifier

      public String getListIdentifier()
      Description copied from interface: IEntityListModule
      Get the string identifier of the list.
      Specified by:
      getListIdentifier in interface IEntityListModule
      Returns:
      the string.
    • serializeToView

      public void serializeToView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: IBuildingModule
      Serialization method to send the module data to the client side.
      Specified by:
      serializeToView in interface IBuildingModule
      Parameters:
      buf - the buffer to write it to.
    • getId

      public String getId()
      Description copied from interface: IEntityListModule
      Get the unique id of this module.
      Specified by:
      getId in interface IEntityListModule
      Returns:
      the id.