Java Code Examples for org.bukkit.DyeColor#BLUE

The following examples show how to use org.bukkit.DyeColor#BLUE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MonumentWool.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public ChatColor renderSidebarStatusColor(@Nullable Competitor competitor, Party viewer) {
  if (getDyeColor() == DyeColor.BLUE) {
    return ChatColor.DARK_BLUE; // DARK_BLUE looks ok on sidebar, but not in chat
  } else {
    return BukkitUtils.dyeColorToChatColor(this.getDyeColor());
  }
}
 
Example 2
Source File: MonumentWool.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public ChatColor renderSidebarStatusColor(@Nullable Competitor competitor, Party viewer) {
    if(getDyeColor() == DyeColor.BLUE) {
        return ChatColor.DARK_BLUE; // DARK_BLUE looks ok on sidebar, but not in chat
    } else {
        return BukkitUtils.toChatColor(this.getDyeColor());
    }
}
 
Example 3
Source File: MiscUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static DyeColor convertChatColorToDyeColor(ChatColor chatColor) {
    switch (chatColor) {
        case WHITE:
            return DyeColor.WHITE;
        case AQUA:
            return DyeColor.LIGHT_BLUE;
        case GOLD:
            return DyeColor.ORANGE;
        case LIGHT_PURPLE:
            return DyeColor.MAGENTA;
        case YELLOW:
            return DyeColor.YELLOW;
        case GREEN:
            return DyeColor.LIME;
        case RED:
            return DyeColor.PINK;
        case GRAY:
            return DyeColor.SILVER;
        case DARK_GRAY:
            return DyeColor.GRAY;
        case DARK_AQUA:
            return DyeColor.CYAN;
        case DARK_PURPLE:
            return DyeColor.PURPLE;
        case DARK_BLUE:
            return DyeColor.BLUE;
        case BLUE:
            return DyeColor.BLUE;
        case DARK_GREEN:
            return DyeColor.GREEN;
        case DARK_RED:
            return DyeColor.RED;
        case BLACK:
            return DyeColor.BLACK;
    }

    return DyeColor.WHITE;
}
 
Example 4
Source File: EnchantingContainer.java    From Carbon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public ItemStack b(EntityHuman entityhuman, int i) {
	ItemStack itemstack = null;
	Slot slot = (Slot) this.c.get(i);
	if ((slot != null) && (slot.hasItem())) {
		ItemStack itemstack1 = slot.getItem();
		itemstack = itemstack1.cloneItemStack();
		if (i == 0) {
			if (!a(itemstack1, 2, 38, true)) {
				return null;
			}
		} else if (i == 1) {
			if (!this.a(itemstack1, 2, 38, true)) {
				return null;
			}
		} else if (itemstack1.getItem() == Items.INK_SACK && DyeColor.getByData((byte) itemstack1.getData()) == DyeColor.BLUE) {
			if (!this.a(itemstack1, 1, 2, true)) {
				return null;
			}
		} else {
			if ((((Slot) this.c.get(0)).hasItem()) || (!((Slot) this.c.get(0)).isAllowed(itemstack1))) {
				return null;
			}
			if ((itemstack1.hasTag()) && (itemstack1.count == 1)) {
				((Slot) this.c.get(0)).set(itemstack1.cloneItemStack());
				itemstack1.count = 0;
			} else if (itemstack1.count >= 1) {
				((Slot) this.c.get(0)).set(new ItemStack(itemstack1.getItem(), 1, itemstack.getData()));
				itemstack1.count -= 1;
			}
		}
		if (itemstack1.count == 0) {
			slot.set((ItemStack) null);
		} else {
			slot.f();
		}
		if (itemstack1.count == itemstack.count) {
			return null;
		}
		slot.a(entityhuman, itemstack1);
	}
	return itemstack;
}
 
Example 5
Source File: SlotLapis.java    From Carbon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public boolean isAllowed(ItemStack itemStack) {
	return itemStack.getItem() == Items.INK_SACK && DyeColor.getByDyeData((byte) itemStack.getData()) == DyeColor.BLUE;
}