dan200.computer.api
Interface IHostedPeripheral

All Superinterfaces:
IPeripheral

public interface IHostedPeripheral
extends IPeripheral

A subclass of IPeripheral specifically for peripherals created by ITurtleUpgrade's of type Peripheral. When an IHostedPeripheral is created, its IPeripheral methods will be called just as if the peripheral was a seperate adjacent block in the world, and update() will be called once per tick.

See Also:
ITurtleUpgrade

Method Summary
 void readFromNBT(net.minecraft.nbt.NBTTagCompound nbttagcompound)
          A method called whenever data is read from the Turtle's NBTTag, over the lifetime of the turtle.
 void update()
          A method called on each hosted peripheral once per tick, on the main thread over the lifetime of the turtle or block.
 void writeToNBT(net.minecraft.nbt.NBTTagCompound nbttagcompound)
          A method called whenever data is written to the Turtle's NBTTag, over the lifetime of the turtle.
 
Methods inherited from interface dan200.computer.api.IPeripheral
attach, callMethod, canAttachToSide, detach, getMethodNames, getType
 

Method Detail

update

void update()
A method called on each hosted peripheral once per tick, on the main thread over the lifetime of the turtle or block. May be used to update the state of the peripheral, and may interact with IComputerAccess or ITurtleAccess however it likes at this time.


readFromNBT

void readFromNBT(net.minecraft.nbt.NBTTagCompound nbttagcompound)
A method called whenever data is read from the Turtle's NBTTag, over the lifetime of the turtle. You should only use this for reading data you want to stay with the peripheral.

Parameters:
nbttagcompound - The peripheral's NBTTag

writeToNBT

void writeToNBT(net.minecraft.nbt.NBTTagCompound nbttagcompound)
A method called whenever data is written to the Turtle's NBTTag, over the lifetime of the turtle. You should only use this for writing data you want to stay with the peripheral.

Parameters:
nbttagcompound - The peripheral's NBTTag.
ID - The turtle's ID.