diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-01 07:05:05 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-01 07:05:05 +0000 |
commit | 49b225ac08cacb3055f322ea066b34014876692b (patch) | |
tree | 022ba9764334279c8d1464f5b3f279dc58915d76 /src/org | |
parent | c7d680163f0757bafc7e9cd00ea8a29305729639 (diff) | |
download | craftbukkit-49b225ac08cacb3055f322ea066b34014876692b.tar craftbukkit-49b225ac08cacb3055f322ea066b34014876692b.tar.gz craftbukkit-49b225ac08cacb3055f322ea066b34014876692b.tar.lz craftbukkit-49b225ac08cacb3055f322ea066b34014876692b.tar.xz craftbukkit-49b225ac08cacb3055f322ea066b34014876692b.zip |
Fixed Material
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/bukkit/craftbukkit/CraftBlock.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/org/bukkit/craftbukkit/CraftBlock.java b/src/org/bukkit/craftbukkit/CraftBlock.java index 351f4a7b..f67d14bf 100644 --- a/src/org/bukkit/craftbukkit/CraftBlock.java +++ b/src/org/bukkit/craftbukkit/CraftBlock.java @@ -87,21 +87,39 @@ public class CraftBlock implements Block { } /** + * Sets the type of this block + * + * @param type Material to change this block to + */ + public void setType(final Material type) { + setTypeID(type.getID()); + } + + /** * Sets the type-ID of this block * * @param type Type-ID to change this block to */ - public void setType(final int type) { + public void setTypeID(final int type) { this.type = type; world.getHandle().d(x, y, z, type); } /** + * Gets the type of this block + * + * @return block type + */ + public Material getType() { + return Material.getMaterial(getTypeID()); + } + + /** * Gets the type-ID of this block * * @return block type-ID */ - public int getType() { + public int getTypeID() { return type; } |