From ab747e99f02f391a9042aa6e1930c4bdb1e3fed4 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot <noreply+git-craftbukkit@papermc.io> Date: Sat, 1 Jan 2011 07:05:05 +0000 Subject: [PATCH] Fixed Material By: Dinnerbone <dinnerbone@dinnerbone.com> --- .../org/bukkit/craftbukkit/CraftBlock.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftBlock.java b/paper-server/src/org/bukkit/craftbukkit/CraftBlock.java index 351f4a7bea..f67d14bfed 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftBlock.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftBlock.java @@ -86,22 +86,40 @@ public class CraftBlock implements Block { return data; } + /** + * 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; }