net.morbz.minecraft.blocks
Class DoorBlock

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

public class DoorBlock
extends java.lang.Object
implements IBlock

The class for doors of all materials. A door consists of an upper and a lower block. Both can be can be created via the makeUpper() and makeLower() methods.

Author:
MorbZ

Nested Class Summary
static class DoorBlock.DoorMaterial
          The material of which the door consists.
static class DoorBlock.HingeSide
          The site on which the hinge is.
 
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 DoorBlock makeLower(DoorBlock.DoorMaterial material, Facing4State facing, boolean isOpen)
          Creates the lower part of a door.
static DoorBlock makeUpper(DoorBlock.DoorMaterial material, DoorBlock.HingeSide hinge)
          Creates the upper part of a door.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeUpper

public static DoorBlock makeUpper(DoorBlock.DoorMaterial material,
                                  DoorBlock.HingeSide hinge)
Creates the upper part of a door.

Parameters:
material - The material of which the door consists
hinge - Whether the hinge is on the left or right side
Returns:
A new door block

makeLower

public static DoorBlock makeLower(DoorBlock.DoorMaterial material,
                                  Facing4State facing,
                                  boolean isOpen)
Creates the lower part of a door.

Parameters:
material - The material of which the door consists
facing - The direction in which the door is facing
isOpen - Whether the door is open
Returns:
A new door 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