Java Code Examples for org.bukkit.Color#RED

The following examples show how to use org.bukkit.Color#RED . 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: StructureUtil.java    From Civs with GNU General Public License v3.0 6 votes vote down vote up
private static void setGlass(World world, double x, double y, double z, Map<Location, Color> boundingBox, Material mat, Player player) {
    if (y < 1 || y >= world.getMaxHeight()) {
        return;
    }

    Location location = new Location(world, x, y, z);
    Block block = location.getBlock();
    if (block.getType() != Material.AIR ||
            block.getRelative(BlockFace.DOWN).getType() == Material.GRASS_PATH ||
            block.getRelative(BlockFace.DOWN).getType() == Material.FARMLAND) {
        return;
    }
    Color color = Color.RED;
    if (mat == Material.BLUE_STAINED_GLASS) {
        color = Color.BLUE;
    } else if (mat == Material.LIME_STAINED_GLASS) {
        color = Color.GREEN;
    }
    BlockData blockData = mat.createBlockData();
    boundingBox.put(new Location(world, x, y, z), color);
    player.sendBlockChange(location, blockData);
}
 
Example 2
Source File: Loadout.java    From AnnihilationPro with MIT License 6 votes vote down vote up
private static ItemStack[] coloredArmor(AnniTeam team)
{
	Color c;
	if(team.getColor() == ChatColor.RED)
		c = Color.RED;
	else if(team.getColor() == ChatColor.BLUE)
		c = Color.BLUE;
	else if(team.getColor() == ChatColor.GREEN)
		c = Color.GREEN;
	else
		c = Color.YELLOW;
	ItemStack[] stacks = KitUtils.getLeatherArmor();
	for(ItemStack stack : stacks)
	{
		LeatherArmorMeta meta = (LeatherArmorMeta) stack.getItemMeta();
		meta.setColor(c);
		stack.setItemMeta(meta);
	}
	return stacks;
}
 
Example 3
Source File: TestCoolerListener.java    From Slimefun4 with GNU General Public License v3.0 6 votes vote down vote up
@BeforeAll
public static void load() {
    server = MockBukkit.mock();
    SlimefunPlugin plugin = MockBukkit.load(SlimefunPlugin.class);

    Category category = new Category(new NamespacedKey(plugin, "cooler_test"), new CustomItem(Material.SNOWBALL, "Mr. Freeze"));
    SlimefunItemStack item = new SlimefunItemStack("TEST_COOLER", Material.SNOWBALL, "&6Test Cooler", "", "&7ID: <ID>");
    cooler = new Cooler(18, category, item, RecipeType.NULL, new ItemStack[9]);
    cooler.register(plugin);

    SlimefunItemStack juiceItem = new SlimefunItemStack("TEST_JUICE", Color.RED, new PotionEffect(PotionEffectType.HEALTH_BOOST, 6, 0), "&4Test Juice");
    juice = new Juice(category, juiceItem, RecipeType.NULL, new ItemStack[9]);
    juice.register(plugin);

    listener = new CoolerListener(plugin, cooler);
}
 
Example 4
Source File: Tools.java    From ce with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static Color fireworkColor(int i) {
    switch (i) {
    default:
    case 1:
        return Color.SILVER;
    case 2:
        return Color.AQUA;
    case 3:
        return Color.BLACK;
    case 4:
        return Color.BLUE;
    case 5:
        return Color.FUCHSIA;
    case 6:
        return Color.GRAY;
    case 7:
        return Color.GREEN;
    case 8:
        return Color.LIME;
    case 9:
        return Color.MAROON;
    case 10:
        return Color.NAVY;
    case 11:
        return Color.OLIVE;
    case 12:
        return Color.ORANGE;
    case 13:
        return Color.PURPLE;
    case 14:
        return Color.RED;
    case 15:
        return Color.YELLOW;
    case 16:
        return Color.TEAL;

    }
}
 
Example 5
Source File: BigBangEffect.java    From EffectLib with MIT License 5 votes vote down vote up
public BigBangEffect(EffectManager effectManager) {
    super(effectManager);
    color = Color.RED;
    type = EffectType.REPEATING;
    period = 2;
    iterations = 400;
    asynchronous = false;
}
 
Example 6
Source File: ParticleDisplay_13.java    From EffectLib with MIT License 5 votes vote down vote up
@Override
public void display(Particle particle, Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount, float size, Color color, Material material, byte materialData, double range, List<Player> targetPlayers) {
    // Legacy colorizeable particles
    if (color != null && (particle == Particle.SPELL_MOB || particle == Particle.SPELL_MOB_AMBIENT)) {
        displayLegacyColored(particle, center, speed, color, range, targetPlayers);
        return;
    }

    if (particle == Particle.ITEM_CRACK) {
        displayItem(particle, center, offsetX, offsetY, offsetZ, speed, amount, material, materialData, range, targetPlayers);
        return;
    }

    Object data = null;
    if (particle == Particle.BLOCK_CRACK || particle == Particle.BLOCK_DUST || particle == Particle.FALLING_DUST) {
        if (material == null || material == Material.AIR) {
            return;
        }
        data = material.createBlockData();
        if (data == null) {
            return;
        }
    }

    if (particle == Particle.REDSTONE) {
        // color is required for 1.13
        if (color == null) {
            color = Color.RED;
        }
        data = new Particle.DustOptions(color, size);
    }

    display(particle, center, offsetX, offsetY, offsetZ, speed, amount, data, range, targetPlayers);
}
 
Example 7
Source File: ItemBuilder.java    From Crazy-Crates with MIT License 4 votes vote down vote up
private static Color getColor(String color) {
    if (color != null) {
        switch (color.toUpperCase()) {
            case "AQUA":
                return Color.AQUA;
            case "BLACK":
                return Color.BLACK;
            case "BLUE":
                return Color.BLUE;
            case "FUCHSIA":
                return Color.FUCHSIA;
            case "GRAY":
                return Color.GRAY;
            case "GREEN":
                return Color.GREEN;
            case "LIME":
                return Color.LIME;
            case "MAROON":
                return Color.MAROON;
            case "NAVY":
                return Color.NAVY;
            case "OLIVE":
                return Color.OLIVE;
            case "ORANGE":
                return Color.ORANGE;
            case "PURPLE":
                return Color.PURPLE;
            case "RED":
                return Color.RED;
            case "SILVER":
                return Color.SILVER;
            case "TEAL":
                return Color.TEAL;
            case "WHITE":
                return Color.WHITE;
            case "YELLOW":
                return Color.YELLOW;
        }
        try {
            String[] rgb = color.split(",");
            return Color.fromRGB(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2]));
        } catch (Exception ignore) {
        }
    }
    return null;
}
 
Example 8
Source File: FireworkShow.java    From CS-CoreLib with GNU General Public License v3.0 4 votes vote down vote up
public static Color[] getColors() {
	return new Color[] {Color.AQUA, Color.BLACK, Color.BLUE, Color.FUCHSIA, Color.GRAY, Color.GREEN, Color.LIME, Color.MAROON, Color.NAVY, Color.OLIVE, Color.ORANGE, Color.PURPLE, Color.RED, Color.SILVER, Color.TEAL, Color.WHITE, Color.YELLOW};
}