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

Public Member Functions

 ItemCapsule ()
 
 ItemCapsule (ItemStack stack, Colours tag, ForgeDirection heading)
 
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

The ItemCapsule implements the ICapsule API in a way that optimizes the transportation of items.

Constructor & Destructor Documentation

YATS.capsule.ItemCapsule.ItemCapsule ( )
YATS.capsule.ItemCapsule.ItemCapsule ( ItemStack  stack,
Colours  tag,
ForgeDirection  heading 
)

Constructor for an ItemCapsule to carry items in a capsule. We do what we can to make this easy.

Parameters
stackAn ItemStack listing all items to be contained in the new capsule.
tagA Colour to be associated with the capsule. See ICapsule for explanation.
headingThe ForgeDirection in which the capsule is to travel initially.

Member Function Documentation

void YATS.capsule.ItemCapsule.addProgress ( float  progress)

Override of ICapsule's addProgress(); increases the capsule's progress through a tube segment.

Parameters
progressA float expressing how much the capsule progresses in a tick.

Implements YATS.api.ICapsule.

Colours YATS.capsule.ItemCapsule.GetColour ( )

Override of ICapsule's GetColour(), the get accessor for the capsule's colour.

Returns
The Colour associated with the capsule.

Implements YATS.api.ICapsule.

Object YATS.capsule.ItemCapsule.GetContents ( )

Override of ICapsule's GetContents(), the get accessor for the capsule's contents.

Returns
An ItemStack of things the capsule contains.

Implements YATS.api.ICapsule.

ForgeDirection YATS.capsule.ItemCapsule.GetHeading ( )

Override of ICapsule's GetHeading(), the get accessor for the capsule's heading.

Returns
The ForgeDirection the capsule is heading.

Implements YATS.api.ICapsule.

NBTTagCompound YATS.capsule.ItemCapsule.getNBT ( )

Implementation of ICapsule's getNBT(); sets several values for NBT, including the capsule's heading, colour, progress, and whether the capsule has contents. If it does contain things, the contents are also written.

Returns
An NBTTagCompound for storage in NBT.

Implements YATS.api.ICapsule.

float YATS.capsule.ItemCapsule.getProgress ( )

Override of ICapsule's getProgress(), the get accessor for the capsule's progress through its current segment.

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

Implements YATS.api.ICapsule.

ICapsuleRenderer YATS.capsule.ItemCapsule.GetRenderer ( )

Override of ICapsule's GetRenderer(); provides for the correct rendering of item capsules.

Returns
An ItemCapsuleRenderer specified to render ItemCapsules.

Implements YATS.api.ICapsule.

void YATS.capsule.ItemCapsule.loadFromNBT ( NBTTagCompound  nbt)

Implementation of ICapsule's loadFromNBT(). Loads a capsule from NBT, reads contents (if any) and stores them; and sets the heading, colour, and progress of the NBT-stored capsule.

Parameters
nbtAn NBTTagCompound to be read from NBT, typically a "capsule" compound.

Implements YATS.api.ICapsule.

void YATS.capsule.ItemCapsule.resetProgress ( )

Override of ICapsule's resetProgress(); returns the capsule's progress through a tube segment to 0 (generally because the capsule has passed into a new tube segment).

Implements YATS.api.ICapsule.

void YATS.capsule.ItemCapsule.SetColour ( Colours  colour)

Override of ICapsule's SetColour(), the set accessor for the capsule's colour.

Parameters
colourThe Colour to associate with the capsule.

Implements YATS.api.ICapsule.

void YATS.capsule.ItemCapsule.SetHeading ( ForgeDirection  heading)

Override of ICapsule's SetHeading(), the set accessor for the capsule's heading.

Parameters
headingThe ForgeDirection the capsule is heading.

Implements YATS.api.ICapsule.


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