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.
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
buildingView, colonyView -
Constructor Summary
ConstructorsConstructorDescriptionEntityListModuleView(String id, net.minecraft.network.chat.Component desc, boolean inverted) Create a nw grouped entity list view for the client side. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntity(net.minecraft.resources.ResourceLocation entity) Add entity to the view and notify the server side.voidClear the list of itemsvoiddeserialize(@NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize the data on the client side.net.minecraft.network.chat.ComponentgetDesc()Get the lang string for the title.net.minecraft.resources.ResourceLocationGet the resource location of the icon for the module view.getId()Get the unique id of this group (used to sync with server side).intgetSize()Get the size of allowed items.com.ldtteam.blockui.views.BOWindowGet the matching window for the module.booleanisAllowedEntity(net.minecraft.resources.ResourceLocation entity) Check if an entity is in the list of allowed entities.booleanCheck if the list is enabling or disabling.voidremoveEntity(net.minecraft.resources.ResourceLocation entity) Remove an entity from the view and notify the server side.Methods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
canBeHiredAs, getBuildingView, getColony, getProducer, setBuildingView, setColonyView, setProducerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModuleView
getBuildingView, getColony, getIcon, getProducer, isPageVisible, setBuildingView, setColonyView, setProducer
-
Constructor Details
-
EntityListModuleView
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:IEntityListModuleViewAdd entity to the view and notify the server side.- Specified by:
addEntityin interfaceIEntityListModuleView- Parameters:
entity- the entity to add.
-
isAllowedEntity
public boolean isAllowedEntity(net.minecraft.resources.ResourceLocation entity) Description copied from interface:IEntityListModuleViewCheck if an entity is in the list of allowed entities.- Specified by:
isAllowedEntityin interfaceIEntityListModuleView- Parameters:
entity- the entity to check.- Returns:
- true if so.
-
getSize
public int getSize()Description copied from interface:IEntityListModuleViewGet the size of allowed items.- Specified by:
getSizein interfaceIEntityListModuleView- Returns:
- the size.
-
removeEntity
public void removeEntity(net.minecraft.resources.ResourceLocation entity) Description copied from interface:IEntityListModuleViewRemove an entity from the view and notify the server side.- Specified by:
removeEntityin interfaceIEntityListModuleView- Parameters:
entity- the entity to remove.
-
getId
Description copied from interface:IEntityListModuleViewGet the unique id of this group (used to sync with server side).- Specified by:
getIdin interfaceIEntityListModuleView- Returns:
- the id.
-
isInverted
public boolean isInverted()Description copied from interface:IEntityListModuleViewCheck if the list is enabling or disabling.- Specified by:
isInvertedin interfaceIEntityListModuleView- Returns:
- true if enabling.
-
clearEntities
public void clearEntities()Description copied from interface:IEntityListModuleViewClear the list of items- Specified by:
clearEntitiesin interfaceIEntityListModuleView
-
getDesc
public net.minecraft.network.chat.Component getDesc()Description copied from interface:IBuildingModuleViewGet the lang string for the title.- Specified by:
getDescin interfaceIBuildingModuleView- Returns:
- the lang string.
-
deserialize
public void deserialize(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IBuildingModuleViewDeserialize the data on the client side.- Specified by:
deserializein interfaceIBuildingModuleView- Parameters:
buf- the buffer to read it from.
-
getWindow
public com.ldtteam.blockui.views.BOWindow getWindow()Description copied from interface:IBuildingModuleViewGet the matching window for the module.- Specified by:
getWindowin interfaceIBuildingModuleView- Returns:
- the window.
-
getIconResourceLocation
public net.minecraft.resources.ResourceLocation getIconResourceLocation()Description copied from interface:IBuildingModuleViewGet the resource location of the icon for the module view.- Specified by:
getIconResourceLocationin interfaceIBuildingModuleView- Returns:
- the resource location.
-