|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITurtleAccess
The interface passed to upgrades by turtles, providing methods that they can call. This should not be implemented by your classes. Do not interact with turtles except via this interface and ITurtleUpgrade.
Method Summary | |
---|---|
boolean |
attackWithItemStack(net.minecraft.item.ItemStack stack,
int dir,
float damageMultiplier)
Tries to "attack" entities with an item stack in the direction specified. |
boolean |
consumeFuel(int fuel)
Removes some fuel from the turtles fuel supply. |
boolean |
deployWithItemStack(net.minecraft.item.ItemStack stack,
int dir)
"Deploys" an item stack in the direction specified. |
boolean |
dropItemStack(net.minecraft.item.ItemStack stack,
int dir)
Drops an item stack from the turtle onto the floor, or into an inventory is there is one adjacent to the turtle in the direction specified. |
int |
getFacingDir()
Returns the world direction the turtle is currently facing. |
int |
getFuelLevel()
Returns the current fuel level of the turtle, this is the same integer returned by turtle.getFuelLevel(), that decreases by 1 every time the turtle moves. |
int |
getInventorySize()
Returns the size of the turtles inventory, in number of slots. |
IHostedPeripheral |
getPeripheral(TurtleSide side)
Returns the peripheral created by the upgrade on the specified side of the turtle, if there is one. |
net.minecraft.util.Vec3 |
getPosition()
Returns a vector containing the integer block co-ordinates at which the turtle resides. |
int |
getSelectedSlot()
Returns which slot the turtle currently has selected in its inventory using turtle.select(). |
net.minecraft.item.ItemStack |
getSlotContents(int index)
Returns the item stack that the turtle has in one of its inventory slots. |
ITurtleUpgrade |
getUpgrade(TurtleSide side)
Returns the upgrade on the specified side of the turtle, if there is one. |
net.minecraft.util.Vec3 |
getVisualPosition(float f)
Returns a vector containing the co-ordinates at which the turtle is rendered. |
net.minecraft.world.World |
getWorld()
Returns the world in which the turtle resides. |
int |
issueCommand(ITurtleCommandHandler handler)
Adds a custom command to the turtles command queue. |
boolean |
refuelWithItemStack(net.minecraft.item.ItemStack stack)
Tries to increase the fuel level of a turtle by burning an item stack. |
void |
setSlotContents(int index,
net.minecraft.item.ItemStack stack)
Changes the item stack that the turtle has in one of its inventory slots. |
boolean |
storeItemStack(net.minecraft.item.ItemStack stack)
Tries to store an item stack into the turtles current inventory, starting from the turtles currently selected inventory slot. |
Method Detail |
---|
net.minecraft.world.World getWorld()
net.minecraft.util.Vec3 getPosition()
net.minecraft.util.Vec3 getVisualPosition(float f)
f
- The subframe fraction
int getFacingDir()
int getInventorySize()
int getSelectedSlot()
net.minecraft.item.ItemStack getSlotContents(int index)
index
- which inventory slot to retreive, should be between 0 and getInventorySize() - 1
void setSlotContents(int index, net.minecraft.item.ItemStack stack)
index
- which inventory slot to change, should be between 0 and getInventorySize() - 1stack
- an item stack to put in the slot. May be null.boolean storeItemStack(net.minecraft.item.ItemStack stack)
stack
- The item stack to try and store.
boolean dropItemStack(net.minecraft.item.ItemStack stack, int dir)
stack
- The item stack to drop.dir
- The world direction to drop the item
boolean deployWithItemStack(net.minecraft.item.ItemStack stack, int dir)
stack
- The item stack to deploydir
- The world direction to deploy the item
boolean attackWithItemStack(net.minecraft.item.ItemStack stack, int dir, float damageMultiplier)
stack
- The item stack to attack withdir
- The world direction to attack with the item
int getFuelLevel()
boolean refuelWithItemStack(net.minecraft.item.ItemStack stack)
stack
- The stack to try to refuel with
boolean consumeFuel(int fuel)
int issueCommand(ITurtleCommandHandler handler)
handler
- an object which will execute the custom command when its point in the queue is reached
ITurtleCommandHandler
ITurtleUpgrade getUpgrade(TurtleSide side)
IHostedPeripheral getPeripheral(TurtleSide side)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |