summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authort7seven7t <t7seven7t@gmail.com>2015-08-11 10:10:17 -0800
committermd_5 <git@md-5.net>2015-09-15 10:26:02 +1000
commit337128287ac4bd6acaab0443b7c1d112acc8af56 (patch)
tree4dc8c418bf4838989893dd2b1d8f481d4ee7974f /src
parent85cd971fec9ada4d40aecb429ba35a71b620fe2d (diff)
downloadbukkit-337128287ac4bd6acaab0443b7c1d112acc8af56.tar
bukkit-337128287ac4bd6acaab0443b7c1d112acc8af56.tar.gz
bukkit-337128287ac4bd6acaab0443b7c1d112acc8af56.tar.lz
bukkit-337128287ac4bd6acaab0443b7c1d112acc8af56.tar.xz
bukkit-337128287ac4bd6acaab0443b7c1d112acc8af56.zip
SPIGOT-918: Add constructor for DyeColor to Dye
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/material/Dye.java7
-rw-r--r--src/test/java/org/bukkit/DyeColorTest.java1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/material/Dye.java b/src/main/java/org/bukkit/material/Dye.java
index 0857dd86..7174fdbf 100644
--- a/src/main/java/org/bukkit/material/Dye.java
+++ b/src/main/java/org/bukkit/material/Dye.java
@@ -45,6 +45,13 @@ public class Dye extends MaterialData implements Colorable {
}
/**
+ * @param color color of the dye
+ */
+ public Dye(final DyeColor color) {
+ super(Material.INK_SACK, color.getDyeData());
+ }
+
+ /**
* Gets the current color of this dye
*
* @return DyeColor of this dye
diff --git a/src/test/java/org/bukkit/DyeColorTest.java b/src/test/java/org/bukkit/DyeColorTest.java
index 9e30fbfc..3a82df77 100644
--- a/src/test/java/org/bukkit/DyeColorTest.java
+++ b/src/test/java/org/bukkit/DyeColorTest.java
@@ -57,6 +57,7 @@ public class DyeColorTest {
@Test
public void getDyeDyeColor() {
testColorable(new Dye(Material.INK_SACK, dye.getDyeData()));
+ testColorable(new Dye(dye));
}
@Test