|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBlock
public class Block extends java.lang.Object
Block.java - Provides some way of making/editing blocks
Modifier and Type | Class and Description |
---|---|
static class |
Block.Face
Face - Used for what face of the block was clicked |
static class |
Block.Type
Type - Used to identify blocks |
Modifier and Type | Field and Description |
---|---|
Block.Type |
blockType
|
Constructor and Description |
---|
Block()
Create a block with no type, x, y or z. |
Block(int type)
Creates a block of specified type |
Block(int type,
int x,
int y,
int z)
Creates a block of specified type and specified x, y and z |
Block(int type,
int x,
int y,
int z,
int data)
Creates a block of specified type and specified x, y and z |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Tests the given object to see if it equals this object |
int |
getData()
Returns this block's data |
Block |
getFace(Block.Face face)
Returns the block at the given Face |
Block.Face |
getFaceClicked()
If this block was clicked, this will return the face that was clicked. |
Block |
getRelative(int x,
int y,
int z)
Finds a Block relative to this Block |
int |
getStatus()
Returns the destruction status of this block. |
int |
getType()
Type of block |
int |
getX()
Gets X location |
int |
getY()
Gets Y location |
int |
getZ()
Gets Z location |
int |
hashCode()
Returns a semi-unique hashcode for this block |
boolean |
isIndirectlyPowered()
Checks if this block is being indirectly powered through redstone |
boolean |
isPowered()
Checks if this block is being powered through redstone |
void |
refresh()
Synchronises this Block with the server, abandoning all local changes and refreshing the data with the current actual values |
void |
setData(int data)
Sets this block's data |
void |
setFaceClicked(Block.Face faceClicked)
Sets the face that was clicked |
void |
setStatus(int status)
Sets the current destruction status of this block. |
void |
setType(int type)
Set type of block |
void |
setX(int x)
Sets X location |
void |
setY(int y)
Sets Y location |
void |
setZ(int z)
Sets Z location |
java.lang.String |
toString()
Returns a String value representing this Block |
void |
update()
Updates this block to the server. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Block.Type blockType
Constructor Detail |
---|
public Block()
public Block(int type)
type
- public Block(int type, int x, int y, int z)
type
- Type of blockx
- y
- z
- public Block(int type, int x, int y, int z, int data)
type
- Type of blockx
- y
- z
- data
- Method Detail |
---|
public int getType()
public void setType(int type)
type
- public int getX()
public void setX(int x)
x
- public int getY()
public void setY(int y)
y
- public int getZ()
public void setZ(int z)
z
- public Block.Face getFaceClicked()
public void setFaceClicked(Block.Face faceClicked)
faceClicked
- face clickedpublic int getStatus()
public void setStatus(int status)
status
- public int getData()
public void setData(int data)
data
- public void update()
public Block getFace(Block.Face face)
face
- the block face of which to returnpublic void refresh()
public Block getRelative(int x, int y, int z)
x
- amount to shift the x coordinatey
- amount to shift the y coordinatez
- amount to shift the z coordinatepublic boolean isPowered()
public boolean isIndirectlyPowered()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to testpublic int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |