public interface ITurtleUpgrade
dan200.computercraft.api.ComputerCraftAPI#registerUpgrade( ITurtleUpgrade )
Modifier and Type | Method and Description |
---|---|
IPeripheral |
createPeripheral(ITurtleAccess turtle,
TurtleSide side)
Will only be called for Peripheral turtle.
|
java.lang.String |
getAdjective()
Return a String to describe this type of turtle in turtle item names.
|
ItemStack |
getCraftingItem()
Return an item stack representing the type of item that a turtle must be crafted
with to create a turtle which holds this turtle.
|
Icon |
getIcon(ITurtleAccess turtle,
TurtleSide side)
Called to obtain the Icon to be used when rendering a turtle peripheral.
|
TurtleUpgradeType |
getType()
Return whether this turtle adds a tool or a peripheral to the turtle.
|
int |
getUpgradeID()
Gets a unique numerical identifier representing this type of turtle turtle.
|
void |
update(ITurtleAccess turtle,
TurtleSide side)
TODO: Document me
|
TurtleCommandResult |
useTool(ITurtleAccess turtle,
TurtleSide side,
TurtleVerb verb,
int direction)
Will only be called for Tool turtle.
|
int getUpgradeID()
dan200.computercraft.api.ComputerCraftAPI#registerUpgrade( ITurtleUpgrade )
java.lang.String getAdjective()
TurtleUpgradeType getType()
for the differences between the two.
ItemStack getCraftingItem()
IPeripheral createPeripheral(ITurtleAccess turtle, TurtleSide side)
turtle
- Access to the turtle that the peripheral is being created for.side
- Which side of the turtle (left or right) that the turtle resides on.TurtleCommandResult useTool(ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, int direction)
turtle
- Access to the turtle that the tool resides on.side
- Which side of the turtle (left or right) the tool resides on.verb
- Which action (dig or attack) the turtle is being called on to perform.direction
- Which world direction the action should be performed in, relative to the turtles
position. This will either be up, down, or the direction the turtle is facing, depending on
whether dig, digUp or digDown was called.Icon getIcon(ITurtleAccess turtle, TurtleSide side)
turtle
- Access to the turtle that the peripheral resides on.side
- Which side of the turtle (left or right) the peripheral resides on.void update(ITurtleAccess turtle, TurtleSide side)