Class ProgWidgetCondition
java.lang.Object
me.desht.pneumaticcraft.common.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetAreaItemBase
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetInventoryBase
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetCondition
- All Implemented Interfaces:
IProgWidgetBase,IAreaProvider,ICondition,ICountWidget,IEntityProvider,IItemFiltering,IJump,IProgWidget,ISidedWidget,IVariableSetWidget,IVariableWidget
- Direct Known Subclasses:
ProgWidgetBlockCondition,ProgWidgetEnergyCondition,ProgWidgetEntityCondition,ProgWidgetItemInventoryCondition,ProgWidgetLightCondition,ProgWidgetLiquidInventoryCondition,ProgWidgetPressureCondition,ProgWidgetRedstoneCondition
public abstract class ProgWidgetCondition
extends ProgWidgetInventoryBase
implements ICondition, IJump, IVariableSetWidget
Base class for in-world conditions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.progwidgets.ICondition
ICondition.OperatorNested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.progwidgets.IProgWidget
IProgWidget.WidgetDifficulty -
Field Summary
Fields inherited from class me.desht.pneumaticcraft.common.progwidgets.ProgWidgetAreaItemBase
aiManagerFields inherited from interface me.desht.pneumaticcraft.common.progwidgets.ISidedWidget
ALL_SIDES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) voidaddVariables(Set<String> variables) booleanevaluate(IDroneBase drone, IProgWidget widget) Used in the CC compatibility.net.minecraft.world.item.DyeColorgetColor()protected abstract DroneAIBlockConditiongetEvaluator(IDroneBase drone, IProgWidget widget) List<net.minecraft.network.chat.Component>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.intvoidgetTooltip(List<net.minecraft.network.chat.Component> curTooltip) net.minecraft.world.entity.ai.goal.GoalgetWidgetAI(IDroneBase drone, IProgWidget widget) Get the AI for this progwidgetbooleanprotected booleanvoidreadFromNBT(net.minecraft.nbt.CompoundTag tag) voidreadFromPacket(net.minecraft.network.FriendlyByteBuf buf) voidsetAndFunction(boolean isAndFunction) voidsetMeasureVar(String measureVar) voidsetOperator(ICondition.Operator operator) voidsetRequiredCount(int count) voidsetVariable(String variable) voidwriteToNBT(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.progwidgets.ProgWidgetInventoryBase
getCount, getSides, setCount, setSides, setUseCount, useCountMethods inherited from class me.desht.pneumaticcraft.common.progwidgets.ProgWidgetAreaItemBase
getArea, getArea, getAreaExtents, getCachedAreaList, getCachedAreaSet, getChunkCache, getEntitiesInArea, getEntitiesInArea, getParameters, getValidEntities, hasStepInput, invalidateAreaCache, isEntityValid, isItemFilterEmpty, isItemValidForFilters, isItemValidForFilters, returnType, setAIManagerMethods inherited from class me.desht.pneumaticcraft.common.progwidgets.ProgWidget
addWarnings, canBeRunByComputers, canSetParameter, copy, fromNBT, fromPacket, getConnectedParameters, getHeight, getMaxUV, getOutputWidget, getParent, getType, getTypeID, getWidgetTargetAI, 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.progwidgets.ICondition
maybeRecordMeasuredValMethods inherited from interface me.desht.pneumaticcraft.common.progwidgets.IEntityProvider
getEntityFilterPositionMethods inherited from interface me.desht.pneumaticcraft.common.progwidgets.IProgWidget
freeToUse, getTexture, getTranslationKey, isDifficultyOKMethods inherited from interface me.desht.pneumaticcraft.common.progwidgets.ISidedWidget
isSideSelectedMethods inherited from interface me.desht.pneumaticcraft.common.progwidgets.IVariableWidget
setAIManager
-
Constructor Details
-
ProgWidgetCondition
-
-
Method Details
-
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
-
getEvaluator
-
getMeasureVar
- Specified by:
getMeasureVarin interfaceICondition
-
setMeasureVar
- Specified by:
setMeasureVarin interfaceICondition
-
getTooltip
- Specified by:
getTooltipin interfaceIProgWidget- Overrides:
getTooltipin classProgWidgetInventoryBase
-
addErrors
public void addErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets) - Specified by:
addErrorsin interfaceIProgWidget- Overrides:
addErrorsin classProgWidgetInventoryBase
-
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- Overrides:
getOutputWidgetin classProgWidget- Parameters:
drone- the droneallWidgets- a list of widgets- Returns:
- the next widget to run
-
evaluate
Description copied from interface:IConditionUsed in the CC compatibility.- Specified by:
evaluatein interfaceICondition- Parameters:
drone- the drone- Returns:
- evaluation result
-
isAndFunction
public boolean isAndFunction()- Specified by:
isAndFunctionin interfaceICondition
-
setAndFunction
public void setAndFunction(boolean isAndFunction) - Specified by:
setAndFunctionin interfaceICondition
-
getDifficulty
- Specified by:
getDifficultyin interfaceIProgWidget- Overrides:
getDifficultyin classProgWidgetAreaItemBase
-
getPossibleJumpLocations
- Specified by:
getPossibleJumpLocationsin interfaceIJump
-
getRequiredCount
public int getRequiredCount()- Specified by:
getRequiredCountin interfaceICondition
-
setRequiredCount
public void setRequiredCount(int count) - Specified by:
setRequiredCountin interfaceICondition
-
getOperator
- Specified by:
getOperatorin interfaceICondition
-
setOperator
- Specified by:
setOperatorin interfaceICondition
-
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 classProgWidgetInventoryBase- Parameters:
tag- NBT tag to write to
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
readFromNBTin interfaceIProgWidget- Overrides:
readFromNBTin classProgWidgetInventoryBase
-
writeToPacket
public void writeToPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
writeToPacketin interfaceIProgWidget- Overrides:
writeToPacketin classProgWidgetInventoryBase
-
readFromPacket
public void readFromPacket(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
readFromPacketin interfaceIProgWidget- Overrides:
readFromPacketin classProgWidgetInventoryBase
-
isUsingSides
protected boolean isUsingSides()- Overrides:
isUsingSidesin classProgWidgetInventoryBase
-
getExtraStringInfo
- Specified by:
getExtraStringInfoin interfaceIProgWidget- Overrides:
getExtraStringInfoin classProgWidgetInventoryBase
-
getColor
public net.minecraft.world.item.DyeColor getColor()- Specified by:
getColorin interfaceIProgWidget
-
addVariables
- Specified by:
addVariablesin interfaceIVariableWidget- Overrides:
addVariablesin classProgWidgetAreaItemBase
-
getVariable
- Specified by:
getVariablein interfaceIVariableSetWidget
-
setVariable
- Specified by:
setVariablein interfaceIVariableSetWidget
-