public class CoreData extends java.lang.Object implements HasID, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
static CustomBlocks |
getFactory() |
byte |
getHealth() |
byte |
getId()
returns the id of a object
|
static CoreData |
getInstance(byte id)
Use for creating new objects.
|
static CoreData |
getInstance(byte id,
byte value)
Use for creating new objects.
|
float |
getLightlevel()
How bright is the object?
|
java.lang.String |
getName()
get the name of a combination of id and value
|
byte |
getValue()
Get the value.
|
boolean |
hasSides()
Creates a new instance of
RenderBlock to check if it has sides. |
boolean |
isLiquid()
Check if the block is liquid.
|
boolean |
isObstacle()
Is this object an obstacle or can you pass through?
|
boolean |
isTransparent()
Can light travel through object?
|
static void |
setCustomBlockFactory(CustomBlocks customBlockFactory)
If you want to define custom id's >39
|
void |
setHealth(byte health)
value between 0-100.
|
void |
setHealth(Coordinate coord,
byte health)
value between 0-100
|
void |
setLightlevel(float lightlevel)
Set the brightness of the object.
|
void |
setValue(byte value) |
RenderBlock |
toBlock()
creates a new RenderBlock instance based on he data
|
public static void setCustomBlockFactory(CustomBlocks customBlockFactory)
customBlockFactory
- new value of customBlockFactorypublic static CustomBlocks getFactory()
public static CoreData getInstance(byte id)
id
- public static CoreData getInstance(byte id, byte value)
id
- value
- public byte getId()
HasID
public byte getValue()
HasID
getValue
in interface HasID
AbstractGameObject.VALUESNUM
]. Is -1 if about to destroyed.public void setValue(byte value)
public void setHealth(Coordinate coord, byte health)
coord
- health
- public void setHealth(byte health)
health
- public byte getHealth()
public RenderBlock toBlock()
public boolean isObstacle()
HasID
isObstacle
in interface HasID
public boolean isTransparent()
HasID
isTransparent
in interface HasID
public boolean isLiquid()
public float getLightlevel()
HasID
getLightlevel
in interface HasID
public void setLightlevel(float lightlevel)
HasID
setLightlevel
in interface HasID
lightlevel
- 1 is default bright. 0 is black.public java.lang.String getName()
public boolean hasSides()
RenderBlock
to check if it has sides. You should prefer the hasSides call to a RenderBlock
object.RenderBlock.hasSides()