Class ProgWidget
java.lang.Object
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidget
- All Implemented Interfaces:
IProgWidgetBase,IProgWidget
- Direct Known Subclasses:
ProgWidgetArea,ProgWidgetAreaItemBase,ProgWidgetConditionBase,ProgWidgetCoordinate,ProgWidgetCoordinateOperator,ProgWidgetCrafting,ProgWidgetEmitRedstone,ProgWidgetEntityAttack,ProgWidgetEntityImport,ProgWidgetEntityRightClick,ProgWidgetForEachItem,ProgWidgetGoToLocation,ProgWidgetItemAssign,ProgWidgetItemFilter,ProgWidgetJump,ProgWidgetLabel,ProgWidgetLiquidFilter,ProgWidgetRename,ProgWidgetStandby,ProgWidgetStart,ProgWidgetSuicide,ProgWidgetText,ProgWidgetVoidItem,ProgWidgetVoidLiquid,ProgWidgetWait
-
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) voidaddWarnings(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) booleancanBeRunByComputers(IDroneBase drone, IProgWidget widget) booleancanSetParameter(int index) copy()static IProgWidgetfromNBT(net.minecraft.nbt.CompoundTag widgetTag) static IProgWidgetfromPacket(net.minecraft.network.FriendlyByteBuf buf) List<net.minecraft.network.chat.Component>intgetMaxUV()Get the next widget in the program; the widget attached to the bottom of this one.getOutputWidget(IDroneBase drone, List<IProgWidget> allWidgets) Get the next widget in the program, which may or may not be the widget attached to the bottom of this one.voidgetTooltip(List<net.minecraft.network.chat.Component> curTooltip) getType()net.minecraft.resources.ResourceLocationnet.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 progwidgetintgetWidth()intgetX()intgetY()protected booleanbooleanCan another widget be connected below this widget?booleanIs this widget currently available in this world? i.e.voidreadFromNBT(net.minecraft.nbt.CompoundTag tag) voidreadFromPacket(net.minecraft.network.FriendlyByteBuf buf) voidsetOutputWidget(IProgWidget widget) Set the output widget for this widget, i.e.voidsetParameter(int index, IProgWidget parm) voidsetParent(IProgWidget widget) voidsetX(int x) voidsetY(int y) voidwriteToNBT(net.minecraft.nbt.CompoundTag tag) At least dotag.putString("name", getTypeID().toString());voidwriteToPacket(net.minecraft.network.FriendlyByteBuf buf) Methods 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.IProgWidget
freeToUse, getColor, getDifficulty, getParameters, getTexture, getTranslationKey, hasStepInput, isDifficultyOK, returnType
-
Constructor Details
-
ProgWidget
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceIProgWidget
-
getTypeID
public net.minecraft.resources.ResourceLocation getTypeID()- Specified by:
getTypeIDin interfaceIProgWidget
-
getTooltip
- Specified by:
getTooltipin interfaceIProgWidget
-
getExtraStringInfo
- Specified by:
getExtraStringInfoin interfaceIProgWidget
-
addWarnings
public void addWarnings(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) - Specified by:
addWarningsin interfaceIProgWidget
-
addErrors
public void addErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) - Specified by:
addErrorsin interfaceIProgWidget
-
isAvailable
public boolean isAvailable()Description copied from interface:IProgWidgetIs this widget currently available in this world? i.e. make sure it's not blacklisted by server admin, and any mod dependencies are loaded- Specified by:
isAvailablein interfaceIProgWidget- Returns:
- true if the widget is available for use by players
-
getX
public int getX()- Specified by:
getXin interfaceIProgWidget
-
getY
public int getY()- Specified by:
getYin interfaceIProgWidget
-
setX
public void setX(int x) - Specified by:
setXin interfaceIProgWidget
-
setY
public void setY(int y) - Specified by:
setYin interfaceIProgWidget
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceIProgWidget
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceIProgWidget
-
setParent
- Specified by:
setParentin interfaceIProgWidget
-
getParent
- Specified by:
getParentin interfaceIProgWidget
-
getMaxUV
- Specified by:
getMaxUVin interfaceIProgWidget
-
hasStepOutput
public boolean hasStepOutput()Description copied from interface:IProgWidgetCan another widget be connected below this widget?- Specified by:
hasStepOutputin interfaceIProgWidget- Returns:
- true if it can, false otherwise
-
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- Parameters:
drone- the dronewidget- Will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)- Returns:
- widget targeting AI
-
getWidgetAI
Description copied from interface:IProgWidgetGet the AI for this progwidget- Specified by:
getWidgetAIin interfaceIProgWidget- Parameters:
drone- the dronewidget- will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)- Returns:
- widget AI
-
setParameter
- Specified by:
setParameterin interfaceIProgWidget
-
canSetParameter
public boolean canSetParameter(int index) - Specified by:
canSetParameterin interfaceIProgWidget
-
hasBlacklist
protected boolean hasBlacklist() -
getConnectedParameters
- Specified by:
getConnectedParametersin interfaceIProgWidget
-
setOutputWidget
Description copied from interface:IProgWidgetSet the output widget for this widget, i.e. next in the program. Called when building the program.- Specified by:
setOutputWidgetin interfaceIProgWidget- Parameters:
widget- the next widget in the program
-
getOutputWidget
Description copied from interface:IProgWidgetGet the next widget in the program; the widget attached to the bottom of this one.- Specified by:
getOutputWidgetin interfaceIProgWidget- Returns:
- the next widget to run
-
getOutputWidget
Description copied from interface:IProgWidgetGet the next widget in the program, which may or may not be the widget attached to the bottom of this one. This method variant is called when running in a live program, and has access to the drone context and a view of the full program so it can deal with special conditions like jumps etc.- Specified by:
getOutputWidgetin interfaceIProgWidget- Parameters:
drone- the droneallWidgets- a list of widgets- Returns:
- the next widget to run
-
copy
- Specified by:
copyin interfaceIProgWidget
-
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- Parameters:
tag- NBT tag to write to
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
readFromNBTin interfaceIProgWidget
-
writeToPacket
public void writeToPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
writeToPacketin interfaceIProgWidget
-
readFromPacket
public void readFromPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
readFromPacketin interfaceIProgWidget
-
fromPacket
-
fromNBT
-
canBeRunByComputers
- Specified by:
canBeRunByComputersin interfaceIProgWidget
-