Class EntityListModuleView

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
com.minecolonies.core.colony.buildings.moduleviews.EntityListModuleView
All Implemented Interfaces:
IBuildingModuleView, IEntityListModuleView

public class EntityListModuleView extends AbstractBuildingModuleView implements IEntityListModuleView
Client side version of the abstract class for all buildings which require a filterable list of allowed entities.
  • Constructor Details

    • EntityListModuleView

      public EntityListModuleView(String id, net.minecraft.network.chat.Component desc, boolean inverted)
      Create a nw grouped entity list view for the client side.
      Parameters:
      id - the id.
      desc - desc lang string.
      inverted - enabling or disabling.
  • Method Details

    • addEntity

      public void addEntity(net.minecraft.resources.ResourceLocation entity)
      Description copied from interface: IEntityListModuleView
      Add entity to the view and notify the server side.
      Specified by:
      addEntity in interface IEntityListModuleView
      Parameters:
      entity - the entity to add.
    • isAllowedEntity

      public boolean isAllowedEntity(net.minecraft.resources.ResourceLocation entity)
      Description copied from interface: IEntityListModuleView
      Check if an entity is in the list of allowed entities.
      Specified by:
      isAllowedEntity in interface IEntityListModuleView
      Parameters:
      entity - the entity to check.
      Returns:
      true if so.
    • getSize

      public int getSize()
      Description copied from interface: IEntityListModuleView
      Get the size of allowed items.
      Specified by:
      getSize in interface IEntityListModuleView
      Returns:
      the size.
    • removeEntity

      public void removeEntity(net.minecraft.resources.ResourceLocation entity)
      Description copied from interface: IEntityListModuleView
      Remove an entity from the view and notify the server side.
      Specified by:
      removeEntity in interface IEntityListModuleView
      Parameters:
      entity - the entity to remove.
    • getId

      public String getId()
      Description copied from interface: IEntityListModuleView
      Get the unique id of this group (used to sync with server side).
      Specified by:
      getId in interface IEntityListModuleView
      Returns:
      the id.
    • isInverted

      public boolean isInverted()
      Description copied from interface: IEntityListModuleView
      Check if the list is enabling or disabling.
      Specified by:
      isInverted in interface IEntityListModuleView
      Returns:
      true if enabling.
    • clearEntities

      public void clearEntities()
      Description copied from interface: IEntityListModuleView
      Clear the list of items
      Specified by:
      clearEntities in interface IEntityListModuleView
    • getDesc

      public net.minecraft.network.chat.Component getDesc()
      Description copied from interface: IBuildingModuleView
      Get the lang string for the title.
      Specified by:
      getDesc in interface IBuildingModuleView
      Returns:
      the lang string.
    • deserialize

      public void deserialize(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IBuildingModuleView
      Deserialize the data on the client side.
      Specified by:
      deserialize in interface IBuildingModuleView
      Parameters:
      buf - the buffer to read it from.
    • getWindow

      public com.ldtteam.blockui.views.BOWindow getWindow()
      Description copied from interface: IBuildingModuleView
      Get the matching window for the module.
      Specified by:
      getWindow in interface IBuildingModuleView
      Returns:
      the window.
    • getIconResourceLocation

      public net.minecraft.resources.ResourceLocation getIconResourceLocation()
      Description copied from interface: IBuildingModuleView
      Get the resource location of the icon for the module view.
      Specified by:
      getIconResourceLocation in interface IBuildingModuleView
      Returns:
      the resource location.