Added LeatherArmorMeta getter for color

This commit is contained in:
Felix Cravic 2020-08-01 04:03:17 +02:00
parent 6cc315fe78
commit 4c10418bf8
2 changed files with 42 additions and 1 deletions

View File

@ -132,7 +132,9 @@ public class ChatHoverEvent {
{
if (hasMeta && itemMeta instanceof LeatherArmorMeta) {
final LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) itemMeta;
// TODO: Color
if (leatherArmorMeta.isModified()) {
// TODO: Color
}
}
}

View File

@ -25,9 +25,48 @@ public class LeatherArmorMeta implements ItemMeta {
* Reset the color to the default leather one
*/
public void reset() {
this.r = 0;
this.g = 0;
this.b = 0;
this.modified = false;
}
/**
* Get the red component
*
* @return the red component
*/
public int getRed() {
return r;
}
/**
* Get the green component
*
* @return the green component
*/
public int getGreen() {
return g;
}
/**
* Get the blue component
*
* @return the blue component
*/
public int getBlue() {
return b;
}
/**
* Get if the color of this armor piece have been changed
*
* @return true if the color has been changed, false otherwise
*/
public boolean isModified() {
return modified;
}
@Override
public boolean hasNbt() {
return modified;