Added Wool + Dyes

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2011-01-14 00:20:00 +00:00
parent 211a846f97
commit 800a8d089b
5 changed files with 125 additions and 27 deletions

View File

@@ -0,0 +1,44 @@
package org.bukkit.material;
import org.bukkit.DyeColor;
import org.bukkit.Material;
/**
* Represents dye
*/
public class Dye extends MaterialData {
public Dye(final int type) {
super(type);
}
public Dye(final Material type) {
super(type);
}
public Dye(final int type, final byte data) {
super(type, data);
}
public Dye(final Material type, final byte data) {
super(type, data);
}
/**
* Gets the current color of this dye
*
* @return DyeColor of this dye
*/
public DyeColor getColor() {
return DyeColor.getByData(getData());
}
/**
* Sets the color of this dye
*
* @param color New color of this dye
*/
public void setColor(DyeColor color) {
setData(color.getData());
}
}

View File

@@ -0,0 +1,44 @@
package org.bukkit.material;
import org.bukkit.DyeColor;
import org.bukkit.Material;
/**
* Represents a Wool/Cloth block
*/
public class Wool extends MaterialData {
public Wool(final int type) {
super(type);
}
public Wool(final Material type) {
super(type);
}
public Wool(final int type, final byte data) {
super(type, data);
}
public Wool(final Material type, final byte data) {
super(type, data);
}
/**
* Gets the current color of this dye
*
* @return DyeColor of this dye
*/
public DyeColor getColor() {
return DyeColor.getByData(getData());
}
/**
* Sets the color of this dye
*
* @param color New color of this dye
*/
public void setColor(DyeColor color) {
setData(color.getData());
}
}