Class ProgWidgetForEachCoordinate
java.lang.Object
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidgetAreaItemBase
me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidgetForEachCoordinate
- All Implemented Interfaces:
IProgWidgetBase,IAreaProvider,IEntityProvider,IItemFiltering,IJump,IJumpBackWidget,IProgWidget,IVariableSetWidget,IVariableWidget
public class ProgWidgetForEachCoordinate
extends ProgWidgetAreaItemBase
implements IJumpBackWidget, IJump, IVariableSetWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IProgWidget
IProgWidget.WidgetDifficulty -
Field Summary
Fields inherited from class me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidgetAreaItemBase
aiManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariables(Set<String> variables) booleancanBeRunByComputers(IDroneBase drone, IProgWidget widget) booleancanSetParameter(int index) net.minecraft.world.item.DyeColorgetColor()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.List<ProgWidgetType<?>>Get the types of the widgets which connect to this widget on the right, in order (top to bottom).net.minecraft.resources.ResourceLocationnet.minecraft.world.entity.ai.goal.GoalgetWidgetAI(IDroneBase drone, IProgWidget widget) Get the AI for this progwidgetbooleanisValidPosition(net.minecraft.core.BlockPos pos) voidreadFromNBT(net.minecraft.nbt.CompoundTag tag) voidreadFromPacket(net.minecraft.network.FriendlyByteBuf buf) 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.drone.progwidgets.ProgWidgetAreaItemBase
addErrors, getArea, getArea, getAreaExtents, getCachedAreaList, getCachedAreaSet, getChunkCache, getEntitiesInArea, getEntitiesInArea, getValidEntities, hasStepInput, invalidateAreaCache, isEntityValid, isItemFilterEmpty, isItemValidForFilters, isItemValidForFilters, returnType, setAIManagerMethods inherited from class me.desht.pneumaticcraft.common.drone.progwidgets.ProgWidget
addWarnings, copy, fromNBT, fromPacket, getConnectedParameters, getHeight, getMaxUV, getOutputWidget, getParent, getTooltip, 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.drone.progwidgets.IEntityProvider
getEntityFilterPositionMethods inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IProgWidget
freeToUse, getTranslationKey, isDifficultyOKMethods inherited from interface me.desht.pneumaticcraft.common.drone.progwidgets.IVariableWidget
setAIManager
-
Constructor Details
-
ProgWidgetForEachCoordinate
public ProgWidgetForEachCoordinate()
-
-
Method Details
-
getColor
public net.minecraft.world.item.DyeColor getColor()- Specified by:
getColorin interfaceIProgWidget
-
getTexture
public net.minecraft.resources.ResourceLocation getTexture()- Specified by:
getTexturein interfaceIProgWidget
-
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- Overrides:
getParametersin classProgWidgetAreaItemBase- Returns:
- a list of widget types, or an empty list if no widgets can be added to the side of this widget
-
addVariables
- Specified by:
addVariablesin interfaceIVariableWidget- Overrides:
addVariablesin classProgWidgetAreaItemBase
-
getVariable
- Specified by:
getVariablein interfaceIVariableSetWidget
-
setVariable
- Specified by:
setVariablein interfaceIVariableSetWidget
-
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
-
getDifficulty
- Specified by:
getDifficultyin interfaceIProgWidget- Overrides:
getDifficultyin classProgWidgetAreaItemBase
-
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
-
getPossibleJumpLocations
- Specified by:
getPossibleJumpLocationsin interfaceIJump
-
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
-
isValidPosition
public boolean isValidPosition(net.minecraft.core.BlockPos pos) -
canBeRunByComputers
- Specified by:
canBeRunByComputersin interfaceIProgWidget- Overrides:
canBeRunByComputersin classProgWidget
-
getExtraStringInfo
- Specified by:
getExtraStringInfoin interfaceIProgWidget- Overrides:
getExtraStringInfoin classProgWidget
-
canSetParameter
public boolean canSetParameter(int index) - Specified by:
canSetParameterin interfaceIProgWidget- Overrides:
canSetParameterin classProgWidget
-