001 package org.bukkit.material;
002
003 import org.bukkit.CoalType;
004 import org.bukkit.Material;
005
006 /**
007 * Represents the different types of coals.
008 */
009 public class Coal extends MaterialData {
010 public Coal() {
011 super(Material.COAL);
012 }
013
014 public Coal(CoalType type) {
015 this();
016 setType(type);
017 }
018
019 /**
020 *
021 * @deprecated Magic value
022 */
023 @Deprecated
024 public Coal(final int type) {
025 super(type);
026 }
027
028 public Coal(final Material type) {
029 super(type);
030 }
031
032 /**
033 *
034 * @deprecated Magic value
035 */
036 @Deprecated
037 public Coal(final int type, final byte data) {
038 super(type, data);
039 }
040
041 /**
042 *
043 * @deprecated Magic value
044 */
045 @Deprecated
046 public Coal(final Material type, final byte data) {
047 super(type, data);
048 }
049
050 /**
051 * Gets the current type of this coal
052 *
053 * @return CoalType of this coal
054 */
055 public CoalType getType() {
056 return CoalType.getByData(getData());
057 }
058
059 /**
060 * Sets the type of this coal
061 *
062 * @param type New type of this coal
063 */
064 public void setType(CoalType type) {
065 setData(type.getData());
066 }
067
068 @Override
069 public String toString() {
070 return getType() + " " + super.toString();
071 }
072
073 @Override
074 public Coal clone() {
075 return (Coal) super.clone();
076 }
077 }