YATS/Forge Documentation
|
Public Member Functions | |
Object | GetContents () |
Colours | GetColour () |
void | SetColour (Colours colour) |
ForgeDirection | GetHeading () |
void | SetHeading (ForgeDirection heading) |
ICapsuleRenderer | GetRenderer () |
float | getProgress () |
void | addProgress (float progress) |
void | resetProgress () |
NBTTagCompound | getNBT () |
void | loadFromNBT (NBTTagCompound nbt) |
ICapsule is an interface for capsules which can be transported through YATS tubes.
Capsules should be implemented according to what they are expected to contain, for instance YATS.capsule.ItemCapsule, and rendered in the tubes similarly (YATS.render.ItemCapsuleRenderer).
Tubes will only accept capsules of the same colour or no colour.
A capsule's progress is a float determining how often it advances through a tube from segment to segment.
All capsules must be stored in Minecraft's Named Binary Tag (NBT) format, to be sent to the client and saved between sessions, so this API provides some templates for that as well.
void YATS.api.ICapsule.addProgress | ( | float | progress) |
This is the standard method of increasing a capsule's progress through a tube segment.
progress | A float expressing how much the capsule progresses in a tick. |
Implemented in YATS.capsule.ItemCapsule.
Colours YATS.api.ICapsule.GetColour | ( | ) |
This is the get accessor for the capsule's colour, for rendering and routing purposes.
Implemented in YATS.capsule.ItemCapsule.
Object YATS.api.ICapsule.GetContents | ( | ) |
This is the get accessor for the capsule's contents.
Implemented in YATS.capsule.ItemCapsule.
ForgeDirection YATS.api.ICapsule.GetHeading | ( | ) |
This is the get accessor for the direction the capsule is currently heading.
Implemented in YATS.capsule.ItemCapsule.
NBTTagCompound YATS.api.ICapsule.getNBT | ( | ) |
Sets several data values to store a capsule in NBT.
Implemented in YATS.capsule.ItemCapsule.
float YATS.api.ICapsule.getProgress | ( | ) |
This is the get accessor for a capsule's progress through a segment of tube.
Implemented in YATS.capsule.ItemCapsule.
ICapsuleRenderer YATS.api.ICapsule.GetRenderer | ( | ) |
This is the general method for returning the correct type of renderer for a specific capsule. Makes it easy to treat all capsule varieties with the same tube rendering code.
Implemented in YATS.capsule.ItemCapsule.
void YATS.api.ICapsule.loadFromNBT | ( | NBTTagCompound | nbt) |
Provides a routine to retrieve capsules stored in NBT.
nbt | An NBTTagCompound to be read from NBT, typically a "capsule" compound. |
Implemented in YATS.capsule.ItemCapsule.
void YATS.api.ICapsule.resetProgress | ( | ) |
This method reduces the capsule's progress to 0, usually when it passes into a new tube segment.
Implemented in YATS.capsule.ItemCapsule.
void YATS.api.ICapsule.SetColour | ( | Colours | colour) |
This is the set accessor for the capsule's colour, for rendering and routing purposes.
colour | The Colour to associate with the capsule. |
Implemented in YATS.capsule.ItemCapsule.
void YATS.api.ICapsule.SetHeading | ( | ForgeDirection | heading) |
This is the set accessor for the direction the capsule is heading.
heading | The ForgeDirection the capsule is heading. |
Implemented in YATS.capsule.ItemCapsule.