public interface IProgWidget extends IProgWidgetBase
| Modifier and Type | Interface and Description |
|---|---|
static class |
IProgWidget.WidgetDifficulty |
| Modifier and Type | Method and Description |
|---|---|
void |
addErrors(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
java.util.List<IProgWidget> widgets) |
void |
addWarnings(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
java.util.List<IProgWidget> widgets) |
boolean |
canBeRunByComputers(IDroneBase drone,
IProgWidget widget) |
boolean |
canSetParameter(int index) |
IProgWidget |
copy() |
static IProgWidget |
create(ProgWidgetType<?> type)
Cast from the API interface to our internal interface.
|
default boolean |
freeToUse() |
net.minecraft.item.DyeColor |
getColor() |
IProgWidget[] |
getConnectedParameters() |
IProgWidget.WidgetDifficulty |
getDifficulty() |
java.util.List<net.minecraft.util.text.ITextComponent> |
getExtraStringInfo() |
int |
getHeight() |
org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> |
getMaxUV() |
IProgWidget |
getOutputWidget()
Get the next widget in the program; the widget attached to the bottom of this one.
|
IProgWidget |
getOutputWidget(IDroneBase drone,
java.util.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.
|
java.util.List<ProgWidgetType<?>> |
getParameters()
Get the types of the widgets which connect to this widget on the right, in order (top to bottom).
|
IProgWidget |
getParent() |
net.minecraft.util.ResourceLocation |
getTexture() |
int |
getTextureSize() |
void |
getTooltip(java.util.List<net.minecraft.util.text.ITextComponent> curTooltip) |
default java.lang.String |
getTranslationKey() |
ProgWidgetType<?> |
getType() |
net.minecraft.util.ResourceLocation |
getTypeID() |
net.minecraft.entity.ai.goal.Goal |
getWidgetAI(IDroneBase drone,
IProgWidget widget)
Get the AI for this progwidget
|
net.minecraft.entity.ai.goal.Goal |
getWidgetTargetAI(IDroneBase drone,
IProgWidget widget)
Get the targeting AI for this progwidget
|
int |
getWidth() |
int |
getX() |
int |
getY() |
boolean |
hasStepInput()
Can this widget connect to a widget above?
|
boolean |
hasStepOutput()
Can another widget be connected below this widget?
|
boolean |
isAvailable()
Is this widget currently available in this world? i.e.
|
default boolean |
isDifficultyOK(IProgWidget.WidgetDifficulty difficulty) |
void |
readFromNBT(net.minecraft.nbt.CompoundNBT tag) |
void |
readFromPacket(net.minecraft.network.PacketBuffer buf) |
ProgWidgetType<?> |
returnType()
For "auxiliary" widgets that are added onto the left or right of another widget, get the type of the widget
being connected to.
|
void |
setOutputWidget(IProgWidget widget)
Set the output widget for this widget, i.e.
|
void |
setParameter(int index,
IProgWidget parm) |
void |
setParent(IProgWidget widget) |
void |
setX(int x) |
void |
setY(int y) |
void |
writeToNBT(net.minecraft.nbt.CompoundNBT tag)
At least do
tag.putString("name", getTypeID().toString()); |
void |
writeToPacket(net.minecraft.network.PacketBuffer buf) |
int getX()
int getY()
void setX(int x)
void setY(int y)
int getWidth()
int getHeight()
net.minecraft.util.ResourceLocation getTexture()
org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> getMaxUV()
int getTextureSize()
void getTooltip(java.util.List<net.minecraft.util.text.ITextComponent> curTooltip)
void addWarnings(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
java.util.List<IProgWidget> widgets)
void addErrors(java.util.List<net.minecraft.util.text.ITextComponent> curInfo,
java.util.List<IProgWidget> widgets)
boolean hasStepInput()
boolean hasStepOutput()
default boolean freeToUse()
net.minecraft.entity.ai.goal.Goal getWidgetAI(IDroneBase drone, IProgWidget widget)
drone - the dronewidget - will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)net.minecraft.entity.ai.goal.Goal getWidgetTargetAI(IDroneBase drone, IProgWidget widget)
drone - the dronewidget - Will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)void setOutputWidget(IProgWidget widget)
widget - the next widget in the programIProgWidget getOutputWidget()
IProgWidget getOutputWidget(IDroneBase drone, java.util.List<IProgWidget> allWidgets)
drone - the droneallWidgets - a list of widgetsProgWidgetType<?> returnType()
@Nonnull java.util.List<ProgWidgetType<?>> getParameters()
getConnectedParameters() will be double the length of this list,
since these widgets can be added on both the right (whitelist) and left (blacklist) sides.void setParameter(int index,
IProgWidget parm)
boolean canSetParameter(int index)
IProgWidget[] getConnectedParameters()
void setParent(IProgWidget widget)
IProgWidget getParent()
net.minecraft.util.ResourceLocation getTypeID()
default java.lang.String getTranslationKey()
net.minecraft.item.DyeColor getColor()
boolean isAvailable()
void writeToNBT(net.minecraft.nbt.CompoundNBT tag)
tag.putString("name", getTypeID().toString());
Note that the base implementation ProgWidget does this.
tag - NBT tag to write tovoid readFromNBT(net.minecraft.nbt.CompoundNBT tag)
IProgWidget copy()
boolean canBeRunByComputers(IDroneBase drone, IProgWidget widget)
default boolean isDifficultyOK(IProgWidget.WidgetDifficulty difficulty)
IProgWidget.WidgetDifficulty getDifficulty()
ProgWidgetType<?> getType()
void readFromPacket(net.minecraft.network.PacketBuffer buf)
void writeToPacket(net.minecraft.network.PacketBuffer buf)
@Nonnull java.util.List<net.minecraft.util.text.ITextComponent> getExtraStringInfo()
static IProgWidget create(ProgWidgetType<?> type)
type - type of the progwidget