mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-01 21:03:52 -07:00
44
paper-api/src/main/java/org/bukkit/material/Dye.java
Normal file
44
paper-api/src/main/java/org/bukkit/material/Dye.java
Normal 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());
|
||||
}
|
||||
}
|
44
paper-api/src/main/java/org/bukkit/material/Wool.java
Normal file
44
paper-api/src/main/java/org/bukkit/material/Wool.java
Normal 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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user