Class ProgWidgetEntityAttack
java.lang.Object
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidgetEntityAttack
- All Implemented Interfaces:
IProgWidgetBase,IAreaProvider,IEntityProvider,IMaxActions,IProgWidget
public class ProgWidgetEntityAttack
extends ProgWidget
implements IAreaProvider, IEntityProvider, IMaxActions
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IProgWidget
IProgWidget.WidgetDifficulty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) voidstatic voidgetArea(Set<net.minecraft.core.BlockPos> area, ProgWidgetArea whitelistWidget, ProgWidgetArea blacklistWidget) net.minecraft.world.item.DyeColorgetColor()me.desht.pneumaticcraft.common.drone.progwidgets.EntityFilterPair<ProgWidgetEntityAttack>intList<ProgWidgetType<?>>Get the types of the widgets which connect to this widget on the right, in order (top to bottom).net.minecraft.resources.ResourceLocationList<net.minecraft.world.entity.Entity>getValidEntities(net.minecraft.world.level.Level world) net.minecraft.world.entity.ai.goal.GoalgetWidgetAI(IDroneBase drone, IProgWidget widget) Get the AI for this progwidgetnet.minecraft.world.entity.ai.goal.GoalgetWidgetTargetAI(IDroneBase drone, IProgWidget widget) Get the targeting AI for this progwidgetbooleanCan this widget connect to a widget above?booleanbooleanisEntityValid(net.minecraft.world.entity.Entity entity) voidreadFromNBT(net.minecraft.nbt.CompoundTag tag) voidreadFromPacket(net.minecraft.network.FriendlyByteBuf buf) For parameter widgets that are added onto the left or right of another widget, get the type of the widget being connected to.voidsetCheckSight(boolean checkSight) voidsetMaxActions(int maxActions) voidsetUseMaxActions(boolean useMaxActions) booleanvoidwriteToNBT(net.minecraft.nbt.CompoundTag tag) At least dotag.putString("name", getTypeID().toString());voidwriteToPacket(net.minecraft.network.FriendlyByteBuf buf) Methods inherited from class me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidget
addWarnings, canBeRunByComputers, canSetParameter, copy, fromNBT, fromPacket, getConnectedParameters, getExtraStringInfo, getHeight, getMaxUV, getOutputWidget, getOutputWidget, getParent, getTooltip, getType, getTypeID, getWidth, getX, getY, hasBlacklist, hasStepOutput, isAvailable, setOutputWidget, setParameter, setParent, setX, setYMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IEntityProvider
getEntityFilterPositionMethods inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IMaxActions
supportsMaxActionsMethods inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IProgWidget
freeToUse, getTranslationKey, isDifficultyOK
-
Constructor Details
-
ProgWidgetEntityAttack
public ProgWidgetEntityAttack()
-
-
Method Details
-
addErrors
public void addErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) - Specified by:
addErrorsin interfaceIProgWidget- Overrides:
addErrorsin classProgWidget
-
hasStepInput
public boolean hasStepInput()Description copied from interface:IProgWidgetCan this widget connect to a widget above?- Specified by:
hasStepInputin interfaceIProgWidget- Returns:
- true if it can, false otherwise
-
getWidgetAI
Description copied from interface:IProgWidgetGet the AI for this progwidget- Specified by:
getWidgetAIin interfaceIProgWidget- Overrides:
getWidgetAIin classProgWidget- Parameters:
drone- the dronewidget- will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)- Returns:
- widget AI
-
getWidgetTargetAI
public net.minecraft.world.entity.ai.goal.Goal getWidgetTargetAI(IDroneBase drone, IProgWidget widget) Description copied from interface:IProgWidgetGet the targeting AI for this progwidget- Specified by:
getWidgetTargetAIin interfaceIProgWidget- Overrides:
getWidgetTargetAIin classProgWidget- Parameters:
drone- the dronewidget- Will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)- Returns:
- widget targeting AI
-
returnType
Description copied from interface:IProgWidgetFor parameter widgets that are added onto the left or right of another widget, get the type of the widget being connected to.- Specified by:
returnTypein interfaceIProgWidget- Returns:
- the widget being connected to, or null if this widget isn't a parameter widget.
-
getParameters
Description copied from interface:IProgWidgetGet the types of the widgets which connect to this widget on the right, in order (top to bottom). Note that the length of the widget array returned byIProgWidget.getConnectedParameters()will be double the length of this list, since these widgets can be added on both the right (whitelist) and left (blacklist) sides.- Specified by:
getParametersin interfaceIProgWidget- Returns:
- a list of widget types, or an empty list if no widgets can be added to the side of this widget
-
getTexture
public net.minecraft.resources.ResourceLocation getTexture()- Specified by:
getTexturein interfaceIProgWidget
-
getValidEntities
public List<net.minecraft.world.entity.Entity> getValidEntities(net.minecraft.world.level.Level world) - Specified by:
getValidEntitiesin interfaceIEntityProvider
-
isEntityValid
public boolean isEntityValid(net.minecraft.world.entity.Entity entity) - Specified by:
isEntityValidin interfaceIEntityProvider
-
getEntityFilters
public me.desht.pneumaticcraft.common.drone.progwidgets.EntityFilterPair<ProgWidgetEntityAttack> getEntityFilters() -
getArea
- Specified by:
getAreain interfaceIAreaProvider
-
getArea
public static void getArea(Set<net.minecraft.core.BlockPos> area, ProgWidgetArea whitelistWidget, ProgWidgetArea blacklistWidget) -
getDifficulty
- Specified by:
getDifficultyin interfaceIProgWidget
-
getColor
public net.minecraft.world.item.DyeColor getColor()- Specified by:
getColorin interfaceIProgWidget
-
setMaxActions
public void setMaxActions(int maxActions) - Specified by:
setMaxActionsin interfaceIMaxActions
-
getMaxActions
public int getMaxActions()- Specified by:
getMaxActionsin interfaceIMaxActions
-
setUseMaxActions
public void setUseMaxActions(boolean useMaxActions) - Specified by:
setUseMaxActionsin interfaceIMaxActions
-
useMaxActions
public boolean useMaxActions()- Specified by:
useMaxActionsin interfaceIMaxActions
-
setCheckSight
public void setCheckSight(boolean checkSight) -
isCheckSight
public boolean isCheckSight() -
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag tag) Description copied from interface:IProgWidgetAt least dotag.putString("name", getTypeID().toString());Note that the base implementation
ProgWidgetdoes this.- Specified by:
writeToNBTin interfaceIProgWidget- Overrides:
writeToNBTin classProgWidget- Parameters:
tag- NBT tag to write to
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
readFromNBTin interfaceIProgWidget- Overrides:
readFromNBTin classProgWidget
-
writeToPacket
public void writeToPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
writeToPacketin interfaceIProgWidget- Overrides:
writeToPacketin classProgWidget
-
readFromPacket
public void readFromPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
readFromPacketin interfaceIProgWidget- Overrides:
readFromPacketin classProgWidget
-