public class Block extends SidedComponentProvider implements Identifiable, Translatable
| Modifier and Type | Class and Description |
|---|---|
static class |
Block.DropEvent
The event that is called when the block is broken and it is time to drop it as an item.
|
static class |
Block.LeftClickEvent
The event that is called when the block is left clicked.
|
static class |
Block.NeighborChangeEvent
The event that is called when a block next to this one changes (removed, placed, etc...).
|
static class |
Block.PlaceEvent
The event that is called when the block is placed.
|
static class |
Block.RemoveEvent
The event that is called when the block is about to be removed.
|
static class |
Block.RightClickEvent
The event that is called when the block is right clicked.
|
ComponentProvider.ComponentAdded, ComponentProvider.ComponentRemovedcomponents, events| Constructor and Description |
|---|
Block() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReplace()
Checks if this block can be replaced.
|
BlockFactory |
getFactory()
Called to get the
BlockFactory that refers to this Block class. |
double |
getHardness()
Gets the breaking difficulty for the block. 1 is the standard, regular
block hardness of the game.
|
java.lang.String |
getID()
Get the ID to identify this object by
|
ItemFactory |
getItemFactory()
Called to get the
ItemFactory that refers to this Block instance. |
java.lang.String |
getLocalizedName()
Gets the localized name of this object.
|
double |
getResistance()
Gets the explosion resistance for the block. 1 is the standard, regular
resistance of the game.
|
java.lang.String |
getUnlocalizedName()
Gets the unlocalized name of this object.
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
position()
Gets the position of this block in the world.
|
boolean |
shouldDisplacePlacement()
Called when an ItemBlock tries to place a block in this position whether to displace the place position or not.
|
BlockTransform |
transform()
Gets the block transformation data.
|
World |
world()
Gets the world that this block resides in.
|
long |
x()
Get the
X coordinate of this block. |
long |
y()
Get the
Y coordinate of this block. |
long |
z()
Get the
Z coordinate of this block. |
sidedComponents, unsidedComponentscomponents, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsameTypegetReplacementspublic ItemFactory getItemFactory()
ItemFactory that refers to this Block instance.ItemFactory that refers to this Block instance.public final BlockFactory getFactory()
BlockFactory that refers to this Block class.BlockFactory that refers to this Block class.public final java.lang.String getID()
IdentifiablegetID in interface Identifiablepublic java.lang.String getUnlocalizedName()
TranslatablegetUnlocalizedName in interface Translatablepublic java.lang.String getLocalizedName()
TranslatablegetLocalizedName in interface Translatablepublic final BlockTransform transform()
public final World world()
public final org.apache.commons.math3.geometry.euclidean.threed.Vector3D position()
public final long x()
X coordinate of this block.X coordinate of this blockpublic final long y()
Y coordinate of this block.Y coordinate of this blockpublic final long z()
Z coordinate of this block.Z coordinate of this blockpublic double getHardness()
Double.infinity is unbreakable.public double getResistance()
Double.infinity is unexplodeable.public boolean canReplace()
public boolean shouldDisplacePlacement()