mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Added Colorable interface, and made Sheep, Wool and Dye implement it.
Inspired by xpansive By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.bukkit.entity;
|
package org.bukkit.entity;
|
||||||
|
import org.bukkit.material.Colorable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Sheep.
|
* Represents a Sheep.
|
||||||
@@ -9,6 +10,6 @@ package org.bukkit.entity;
|
|||||||
* @author Cogito
|
* @author Cogito
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface Sheep extends Animals {
|
public interface Sheep extends Animals, Colorable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
27
paper-api/src/main/java/org/bukkit/material/Colorable.java
Normal file
27
paper-api/src/main/java/org/bukkit/material/Colorable.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package org.bukkit.material;
|
||||||
|
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An object that can be colored.
|
||||||
|
*
|
||||||
|
* @author Cogito
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface Colorable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the color of this object.
|
||||||
|
*
|
||||||
|
* @return The DyeColor of this object.
|
||||||
|
*/
|
||||||
|
public DyeColor getColor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the color of this object to the specified DyeColor.
|
||||||
|
*
|
||||||
|
* @param color The color of the object, as a DyeColor.
|
||||||
|
*/
|
||||||
|
public void setColor(DyeColor color);
|
||||||
|
|
||||||
|
}
|
@@ -7,7 +7,7 @@ import org.bukkit.Material;
|
|||||||
/**
|
/**
|
||||||
* Represents dye
|
* Represents dye
|
||||||
*/
|
*/
|
||||||
public class Dye extends MaterialData {
|
public class Dye extends MaterialData implements Colorable {
|
||||||
public Dye(final int type) {
|
public Dye(final int type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ import org.bukkit.Material;
|
|||||||
/**
|
/**
|
||||||
* Represents a Wool/Cloth block
|
* Represents a Wool/Cloth block
|
||||||
*/
|
*/
|
||||||
public class Wool extends MaterialData {
|
public class Wool extends MaterialData implements Colorable {
|
||||||
public Wool(final int type) {
|
public Wool(final int type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user