net.morbz.minecraft.blocks
Class RailBlock

java.lang.Object
  extended by net.morbz.minecraft.blocks.RailBlock
All Implemented Interfaces:
IBlock

public class RailBlock
extends java.lang.Object
implements IBlock

The class for basic rails. There are straight, curved and sloped rails that can be created via the makeStraight(), makeCurved() and makeSloped() methods.

Author:
MorbZ

Nested Class Summary
static class RailBlock.RailCurve
           
 
Method Summary
 byte getBlockData()
          Returns the block data.
 byte getBlockId()
          Returns the block ID.
 int getTransparency()
          Returns the transparency level of this block. 0 means fully opaque, 1 means fully transparent and values > 1 mean transparent but the light level is decreased by n at this block.
static RailBlock makeCurved(RailBlock.RailCurve curve)
          Creates curved, flat rails.
static RailBlock makeSloped(Facing4State facing)
          Creates straight rails that are sloped.
static RailBlock makeStraight(Facing2State facing)
          Creates straight, flat rails going either in north/south or east/west direction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeStraight

public static RailBlock makeStraight(Facing2State facing)
Creates straight, flat rails going either in north/south or east/west direction.

Parameters:
facing - The direction of the rails
Returns:
A new rails block

makeSloped

public static RailBlock makeSloped(Facing4State facing)
Creates straight rails that are sloped.

Parameters:
facing - The direction in which the rails are ascending
Returns:
A new rails block

makeCurved

public static RailBlock makeCurved(RailBlock.RailCurve curve)
Creates curved, flat rails.

Parameters:
curve - The type of the curve
Returns:
A new rails block

getBlockId

public byte getBlockId()
Returns the block ID. That is the basic ID of the material without additional data.

Specified by:
getBlockId in interface IBlock
Returns:
The block ID

getBlockData

public byte getBlockData()
Returns the block data. It can hold additional information about the block depending on the material.

Specified by:
getBlockData in interface IBlock
Returns:
The block data. Only the 4 rightmost bits are relevant.

getTransparency

public int getTransparency()
Returns the transparency level of this block. 0 means fully opaque, 1 means fully transparent and values > 1 mean transparent but the light level is decreased by n at this block.

Specified by:
getTransparency in interface IBlock
Returns:
The transparency level