YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
YATS.api.ICapsule Interface Reference
Inheritance diagram for YATS.api.ICapsule:
YATS.capsule.ItemCapsule

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)
 

Detailed Description

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.

Member Function Documentation

void YATS.api.ICapsule.addProgress ( float  progress)

This is the standard method of increasing a capsule's progress through a tube segment.

Parameters
progressA 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.

Returns
The Colour of the capsule.

Implemented in YATS.capsule.ItemCapsule.

Object YATS.api.ICapsule.GetContents ( )

This is the get accessor for the capsule's contents.

Returns
A stack consisting of things the capsule contains.

Implemented in YATS.capsule.ItemCapsule.

ForgeDirection YATS.api.ICapsule.GetHeading ( )

This is the get accessor for the direction the capsule is currently heading.

Returns
The ForgeDirection 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.

Returns
An NBTTagCompound which may be written to 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.

Returns
A float expressing how much progress the capsule has made through a tube segment.

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.

Returns
A renderer class unique to the type of capsule being rendered.

Implemented in YATS.capsule.ItemCapsule.

void YATS.api.ICapsule.loadFromNBT ( NBTTagCompound  nbt)

Provides a routine to retrieve capsules stored in NBT.

Parameters
nbtAn 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.

Parameters
colourThe 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.

Parameters
headingThe ForgeDirection the capsule is heading.

Implemented in YATS.capsule.ItemCapsule.


The documentation for this interface was generated from the following file: