本文整理匯總了Java中org.bukkit.inventory.meta.LeatherArmorMeta.getColor方法的典型用法代碼示例。如果您正苦於以下問題:Java LeatherArmorMeta.getColor方法的具體用法?Java LeatherArmorMeta.getColor怎麽用?Java LeatherArmorMeta.getColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.inventory.meta.LeatherArmorMeta
的用法示例。
在下文中一共展示了LeatherArmorMeta.getColor方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CardboardMetaLeatherArmor
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public CardboardMetaLeatherArmor(ItemStack leather) {
this.id = leather.getTypeId();
LeatherArmorMeta meta = (LeatherArmorMeta) leather.getItemMeta();
this.color = new CardboardColor(meta.getColor());
}
示例2: show
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
/**
*
* @param board
* @param obj
*/
private void show(Scoreboard board, Objective obj) {
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(Lang.TITLE.toString() + " Debug");
player.setScoreboard(board);
if (!main.getWorkers().containsKey(player.getUniqueId())) {
return;
}
ItemStack[] armor = player.getInventory().getArmorContents();
ItemStack is = null;
// find first piece of armor to debug
for (int i = 0; i < armor.length; i++) {
if (armor[i] != null) {
is = armor[i];
break;
}
}
Color color = null;
if (is != null && is.hasItemMeta()) {
ItemMeta im = is.getItemMeta();
if (im instanceof LeatherArmorMeta) {
LeatherArmorMeta lam = (LeatherArmorMeta) im;
color = lam.getColor();
}
}
if (color != null) {
Score red = obj.getScore("Red: ");
red.setScore(color.getRed());
Score green = obj.getScore("Green: ");
green.setScore(color.getGreen());
Score blue = obj.getScore("Blue: ");
blue.setScore(color.getBlue());
}
}
示例3: getColor
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
/**
* Gets the 32-bit color of an {@link ItemStack} if it has any.
*
* @param item The {@link ItemStack}.
*
* @return The {@link Color} or null if item does not have 32-bit color.
*/
@Nullable
public static Color getColor(ItemStack item) {
PreCon.notNull(item);
ItemMeta meta = item.getItemMeta();
if (meta instanceof LeatherArmorMeta) {
LeatherArmorMeta laMeta = (LeatherArmorMeta)meta;
return laMeta.getColor();
}
return null;
}
示例4: initialize
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
@Override
public SerialItemData initialize(ItemStack stack) {
ItemMeta meta = stack.getItemMeta();
if(meta instanceof LeatherArmorMeta) {
valid = true;
LeatherArmorMeta leatherMeta = (LeatherArmorMeta)meta;
color = leatherMeta.getColor();
}
return this;
}
示例5: CardboardMetaLeatherArmor
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
public CardboardMetaLeatherArmor(ItemStack leather) {
this.id = leather.getTypeId();
LeatherArmorMeta meta = (LeatherArmorMeta) leather.getItemMeta();
this.color = new CardboardColor(meta.getColor());
}