类org.bukkit.Color源码实例Demo

下面列出了怎么用org.bukkit.Color的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: XSeries   文件: XParticle.java
/**
 * Spawns a julia set.
 * https://en.wikipedia.org/wiki/Julia_set
 *
 * @param size        the size of the image.
 * @param zoom        the zoom ratio to the set.
 * @param colorScheme the color scheme for the julia set.
 * @param moveX       the amount to move in the x axis.
 * @param moveY       the amount to move in the y axis.
 * @see #mandelbrot(double, double, double, double, double, int, ParticleDisplay)
 * @since 4.0.0
 */
public static void julia(double size, double zoom, int colorScheme, double moveX, double moveY, ParticleDisplay display) {
    display.particle = Particle.REDSTONE;

    double cx = -0.7;
    double cy = 0.27015;

    for (double x = -size; x < size; x += 0.1) {
        for (double y = -size; y < size; y += 0.1) {
            double zx = 1.5 * (size - size / 2) / (0.5 * zoom * size) + moveX;
            double zy = (y - size / 2) / (0.5 * zoom * size) + moveY;

            int i = colorScheme;
            while (zx * zx + zy * zy < 4 && i > 0) {
                double xtemp = zx * zx - zy * zy + cx;//Math.pow((zx * zx + zy * zy), (n / 2)) * (Math.cos(n * Math.atan2(zy, zx))) + cx;
                zy = 2 * zx * zy + cy; //Math.pow((zx * zx + zy * zy), (n / 2)) * Math.sin(n * Math.atan2(zy, zx)) + cy;
                zx = xtemp;
                i--;
            }
            java.awt.Color color = new java.awt.Color((i << 21) + (i << 10) + i * 8);

            display.data = new float[]{color.getRed(), color.getGreen(), color.getBlue(), 0.8f};
            display.spawn(x, y, 0);
        }
    }
}
 
源代码2 项目: ChestCommands   文件: ItemUtils.java
public static Color parseColor(String input) throws FormatException {
	String[] split = StringUtils.stripChars(input, " ").split(",");

	if (split.length != 3) {
		throw new FormatException("it must be in the format \"red, green, blue\".");
	}

	int red, green, blue;

	try {
		red = Integer.parseInt(split[0]);
		green = Integer.parseInt(split[1]);
		blue = Integer.parseInt(split[2]);
	} catch (NumberFormatException ex) {
		throw new FormatException("it contains invalid numbers.");
	}

	if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255) {
		throw new FormatException("it should only contain numbers between 0 and 255.");
	}

	return Color.fromRGB(red, green, blue);
}
 
源代码3 项目: PGM   文件: FireworkMatchModule.java
public void spawnFireworkDisplay(
    Location center, Color color, int count, double radius, int power) {
  FireworkEffect effect =
      FireworkEffect.builder()
          .with(Type.BURST)
          .withFlicker()
          .withColor(color)
          .withFade(Color.BLACK)
          .build();

  for (int i = 0; i < count; i++) {
    double angle = 2 * Math.PI / count * i;
    double dx = radius * Math.cos(angle);
    double dz = radius * Math.sin(angle);
    Location baseLocation = center.clone().add(dx, 0, dz);

    Block block = baseLocation.getBlock();
    if (block == null || !block.getType().isOccluding()) {
      spawnFirework(getOpenSpaceAbove(baseLocation), effect, power);
    }
  }
}
 
源代码4 项目: AnnihilationPro   文件: Loadout.java
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;
}
 
源代码5 项目: TradePlus   文件: UMaterial.java
public ItemStack getItemStack() {
  final String v = getVersionName();
  final Material m = v != null ? Material.valueOf(v) : null;
  ItemStack is = m != null ? EIGHT || NINE || TEN || ELEVEN || TWELVE ? new ItemStack(m, 1, data) : new ItemStack(m) : null;
  if(is != null && attributes != null) {
    for(String s : attributes.split(";")) {
      if(s.startsWith("color=")) {
        final String[] a = s.split(":");
        final LeatherArmorMeta me = (LeatherArmorMeta) is.getItemMeta();
        me.setColor(Color.fromRGB(Integer.parseInt(a[0]), Integer.parseInt(a[1]), Integer.parseInt(a[2])));
        is.setItemMeta(me);
      } else if(s.startsWith("enchant=")) {
        final String[] e = s.split("=")[1].split(":");
        final EnchantmentStorageMeta sm = (EnchantmentStorageMeta) is.getItemMeta();
        sm.addStoredEnchant(Sounds.version < 114 ? Enchantment.getByName(e[0]) : ItemUtils1_14.getEnchantment(e[0]), Integer.parseInt(e[1]), true);
        is.setItemMeta(sm);
      } else if(s.startsWith("upotion=")) {
        final String[] p = s.split("=")[1].split(":");
        is = new UPotion(PotionBase.valueOf(p[0]), p[1], Boolean.parseBoolean(p[2]), Boolean.parseBoolean(p[3])).getItemStack();
      }
    }
  }
  return is;
}
 
源代码6 项目: MineTinker   文件: Ender.java
private void spawnParticles(Player player, Location oldLoc) {
	if (this.hasParticles) {
		AreaEffectCloud cloud = (AreaEffectCloud) player.getWorld().spawnEntity(player.getLocation(), EntityType.AREA_EFFECT_CLOUD);
		cloud.setVelocity(new Vector(0, 1, 0));
		cloud.setRadius(0.5f);
		cloud.setDuration(5);
		cloud.setColor(Color.GREEN);
		cloud.getLocation().setYaw(90);

		AreaEffectCloud cloud2 = (AreaEffectCloud) player.getWorld().spawnEntity(oldLoc, EntityType.AREA_EFFECT_CLOUD);
		cloud2.setVelocity(new Vector(0, 1, 0));
		cloud2.setRadius(0.5f);
		cloud2.setDuration(5);
		cloud2.setColor(Color.GREEN);
		cloud2.getLocation().setPitch(90);
	}
}
 
源代码7 项目: EffectLib   文件: ParticleDisplay.java
protected void displayLegacyColored(Particle particle, Location center, float speed, Color color, double range, List<Player> targetPlayers) {
    int amount = 0;
    // Colored particles can't have a speed of 0.
    if (speed == 0) {
        speed = 1;
    }
    float offsetX = (float) color.getRed() / 255;
    float offsetY = (float) color.getGreen() / 255;
    float offsetZ = (float) color.getBlue() / 255;

    // The redstone particle reverts to red if R is 0!
    if (offsetX < Float.MIN_NORMAL) {
        offsetX = Float.MIN_NORMAL;
    }

    display(particle, center, offsetX, offsetY, offsetZ, speed, amount, null, range, targetPlayers);
}
 
源代码8 项目: Slimefun4   文件: ColoredFireworkStar.java
public ColoredFireworkStar(Color color, String name, String... lore) {
    super(Material.FIREWORK_STAR, im -> {
        if (name != null) {
            im.setDisplayName(ChatColors.color(name));
        }

        ((FireworkEffectMeta) im).setEffect(FireworkEffect.builder().with(Type.BURST).withColor(color).build());

        if (lore.length > 0) {
            List<String> lines = new ArrayList<>();

            for (String line : lore) {
                lines.add(ChatColors.color(line));
            }

            im.setLore(lines);
        }
    });
}
 
源代码9 项目: Kettle   文件: CraftMetaMap.java
CraftMetaMap(NBTTagCompound tag) {
    super(tag);

    if (tag.hasKey(MAP_SCALING.NBT)) {
        this.scaling = tag.getBoolean(MAP_SCALING.NBT) ? SCALING_TRUE : SCALING_FALSE;
    }

    if (tag.hasKey(DISPLAY.NBT)) {
        NBTTagCompound display = tag.getCompoundTag(DISPLAY.NBT);

        if (display.hasKey(MAP_LOC_NAME.NBT)) {
            locName = display.getString(MAP_LOC_NAME.NBT);
        }

        if (display.hasKey(MAP_COLOR.NBT)) {
            color = Color.fromRGB(display.getInteger(MAP_COLOR.NBT));
        }
    }
}
 
源代码10 项目: Civs   文件: StructureUtil.java
public static void removeBoundingBox(UUID uuid) {
    Player player = Bukkit.getPlayer(uuid);
    if (player == null || !player.isOnline()) {
        return;
    }
    StructureUtil.BoundingBox boundingBox = boundingBoxes.get(uuid);
    if (boundingBox == null) {
        return;
    }
    Map<Location, Color> locations = boundingBoxes.get(uuid).getLocations();
    if (locations == null) {
        return;
    }
    if (!ConfigManager.getInstance().isUseParticleBoundingBoxes()) {
        for (Location location : locations.keySet()) {
            if (!Util.isLocationWithinSightOfPlayer(location)) {
                continue;
            }
            player.sendBlockChange(location, Material.AIR.createBlockData());
        }
    }
    boundingBoxes.remove(uuid);
}
 
源代码11 项目: civcraft   文件: ArenaControlBlock.java
public void explode() {
	World world = Bukkit.getWorld(coord.getWorldname());
	ItemManager.setTypeId(coord.getLocation().getBlock(), CivData.AIR);
	world.playSound(coord.getLocation(), Sound.ANVIL_BREAK, 1.0f, -1.0f);
	world.playSound(coord.getLocation(), Sound.EXPLODE, 1.0f, 1.0f);
	
	FireworkEffect effect = FireworkEffect.builder().with(Type.BURST).withColor(Color.YELLOW).withColor(Color.RED).withTrail().withFlicker().build();
	FireworkEffectPlayer fePlayer = new FireworkEffectPlayer();
	for (int i = 0; i < 3; i++) {
		try {
			fePlayer.playFirework(world, coord.getLocation(), effect);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
 
源代码12 项目: Civs   文件: StructureUtil.java
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);
}
 
源代码13 项目: ProjectAres   文件: ProximityAlarm.java
private void showFlare() {
    float angle = (float) (this.random.nextFloat() * Math.PI * 2);
    Location location = this.definition.detectRegion.getBounds().center()
                            .plus(
                                new Vector(
                                    Math.sin(angle) * this.definition.flareRadius,
                                    0,
                                    Math.cos(angle) * this.definition.flareRadius
                                )
                            ).toLocation(this.match.getWorld());

    Set<Color> colors = new HashSet<>();

    for(MatchPlayer player : this.playersInside) {
        colors.add(player.getParty().getFullColor());
    }

    Firework firework = FireworkUtil.spawnFirework(location,
                                                   FireworkEffect.builder()
                                                       .with(FireworkEffect.Type.BALL)
                                                       .withColor(colors)
                                                       .build(),
                                                   0);
    NMSHacks.skipFireworksLaunch(firework);
}
 
源代码14 项目: XSeries   文件: XParticle.java
/**
 * Renders every pixel of the image and saves the location and
 * the particle colors to a map.
 *
 * @param image         the image to render.
 * @param resizedWidth  the new image width.
 * @param resizedHeight the new image height.
 * @param compact       particles compact value. Should be lower than 0.5 and higher than 0.1 The recommended value is 0.2
 * @return a rendered map of an image.
 * @since 1.0.0
 */
public static CompletableFuture<Map<Location, Color>> renderImage(BufferedImage image, int resizedWidth, int resizedHeight, double compact) {
    return CompletableFuture.supplyAsync(() -> {
        if (image == null) return null;

        double centerX = image.getWidth() / 2D;
        double centerY = image.getHeight() / 2D;

        Map<Location, Color> rendered = new HashMap<>();
        for (int y = 0; y < image.getHeight(); y++) {
            for (int x = 0; x < image.getWidth(); x++) {
                int pixel = image.getRGB(x, y);

                // Transparency
                if ((pixel >> 24) == 0x00) continue;
                // 0 - 255
                //if ((pixel & 0xff000000) >>> 24 == 0) continue;
                // 0.0 - 1.0
                //if (pixel == java.awt.Color.TRANSLUCENT) continue;

                java.awt.Color color = new java.awt.Color(pixel);
                int r = color.getRed();
                int g = color.getGreen();
                int b = color.getBlue();

                Color bukkitColor = Color.fromRGB(r, g, b);
                rendered.put(new Location(null, (x - centerX) * compact, (y - centerY) * compact, 0), bukkitColor);
            }
        }
        return rendered;
    });
}
 
源代码15 项目: XSeries   文件: XParticle.java
/**
 * Display a rendered image repeatedly.
 *
 * @param render   the rendered image map.
 * @param location the dynamic location to display the image at.
 * @param quality  the quality of the image is exactly the number of particles display for each pixel. Recommended value is 1
 * @param speed    the speed is exactly the same value as the speed of particles. Recommended amount is 0
 * @param size     the size of the particle. Recommended amount is 0.8
 * @since 1.0.0
 */
public static void displayRenderedImage(Map<Location, Color> render, Location location, int quality, int speed, float size) {
    for (Map.Entry<Location, Color> pixel : render.entrySet()) {
        Particle.DustOptions data = new Particle.DustOptions(pixel.getValue(), size);
        Location pixelLoc = pixel.getKey();

        Location loc = new Location(location.getWorld(), location.getX() - pixelLoc.getX(),
                location.getY() - pixelLoc.getY(), location.getZ() - pixelLoc.getZ());
        loc.getWorld().spawnParticle(Particle.REDSTONE, loc, quality, 0, 0, 0, speed, data);
    }
}
 
源代码16 项目: PGM   文件: FireworkMatchModule.java
public void spawnFireworkDisplay(
    World world, Region region, Color color, int count, double radiusMultiplier, int power) {
  final Bounds bound = region.getBounds();
  final double radius = bound.getMax().subtract(bound.getMin()).multiply(0.5).length();
  final Location center = bound.getMin().getMidpoint(bound.getMax()).toLocation(world);
  this.spawnFireworkDisplay(center, color, count, radiusMultiplier * radius, power);
}
 
源代码17 项目: ExoticGarden   文件: ExoticGarden.java
private void registerTree(String name, String texture, String color, Color pcolor, String juice, boolean pie, Material... soil) {
	String id = name.toUpperCase(Locale.ROOT).replace(' ', '_');
	Tree tree = new Tree(id, texture, soil);
	trees.add(tree);

	SlimefunItemStack sapling = new SlimefunItemStack(id + "_SAPLING", Material.OAK_SAPLING, color + name + " Sapling");

	items.put(id + "_SAPLING", sapling);

	new SlimefunItem(mainCategory, sapling, ExoticGardenRecipeTypes.BREAKING_GRASS,
	new ItemStack[] {null, null, null, null, new ItemStack(Material.GRASS), null, null, null, null})
	.register(this);

	new ExoticGardenFruit(mainCategory, new SlimefunItemStack(id, texture, color + name), ExoticGardenRecipeTypes.HARVEST_TREE, true,
	new ItemStack[] {null, null, null, null, getItem(id + "_SAPLING"), null, null, null, null})
	.register(this);

	if (pcolor != null) {
		new Juice(drinksCategory, new SlimefunItemStack(juice.toUpperCase().replace(" ", "_"), new CustomPotion(color + juice, pcolor, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger")), RecipeType.JUICER,
		new ItemStack[] {getItem(id), null, null, null, null, null, null, null, null})
		.register(this);
	}

	if (pie) {
		new CustomFood(foodCategory, new SlimefunItemStack(id + "_PIE", "3418c6b0a29fc1fe791c89774d828ff63d2a9fa6c83373ef3aa47bf3eb79", color + name + " Pie", "", "&7&oRestores &b&o" + "6.5" + " &7&oHunger"),
		new ItemStack[] {getItem(id), new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), new ItemStack(Material.MILK_BUCKET), SlimefunItems.WHEAT_FLOUR, null, null, null, null},
		13)
		.register(this);
	}

	if (!new File(schematicsFolder, id + "_TREE.schematic").exists()) {
		saveSchematic(id + "_TREE");
	}
}
 
源代码18 项目: EffectLib   文件: ParticleDisplay_13.java
@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);
}
 
源代码19 项目: Crazy-Crates   文件: ItemBuilder.java
private static DyeColor getDyeColor(String color) {
    if (color != null) {
        try {
            return DyeColor.valueOf(color.toUpperCase());
        } catch (Exception e) {
            try {
                String[] rgb = color.split(",");
                return DyeColor.getByColor(Color.fromRGB(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])));
            } catch (Exception ignore) {
            }
        }
    }
    return null;
}
 
源代码20 项目: CardinalPGM   文件: Fireworks.java
public static void spawnFireworks(Vector vec, double radius, int count, Color color, int power) {
    Location loc = vec.toLocation(GameHandler.getGameHandler().getMatchWorld());
    FireworkEffect effect = getFireworkEffect(color);
    for(int i = 0; i < count; i++) {
        double angle = (2 * Math.PI / count) * i;
        double x = radius * Math.cos(angle);
        double z = radius * Math.sin(angle);
        spawnFirework(firstEmptyBlock(loc.clone().add(x, 0, z)), effect, power);
    }
}
 
源代码21 项目: BetonQuest   文件: Utils.java
/**
 * Parses the string as RGB or as DyeColor and returns it as Color.
 *
 * @param string string to parse as a Color
 * @return the Color (never null)
 * @throws InstructionParseException when something goes wrong
 */
public static Color getColor(String string) throws InstructionParseException {
    if (string == null || string.isEmpty()) {
        throw new InstructionParseException("Color is not specified");
    }
    try {
        return Color.fromRGB(Integer.parseInt(string));
    } catch (NumberFormatException e1) {
        LogUtils.logThrowableIgnore(e1);
        // string is not a decimal number
        try {
            return Color.fromRGB(Integer.parseInt(string.replace("#", ""), 16));
        } catch (NumberFormatException e2) {
            LogUtils.logThrowableIgnore(e2);
            // string is not a hexadecimal number, try dye color
            try {
                return DyeColor.valueOf(string.trim().toUpperCase().replace(' ', '_')).getColor();
            } catch (IllegalArgumentException e3) {
                // this was not a dye color name
                throw new InstructionParseException("Dye color does not exist: " + string, e3);
            }
        }
    } catch (IllegalArgumentException e) {
        // string was a number, but incorrect
        throw new InstructionParseException("Incorrect RGB code: " + string, e);
    }
}
 
源代码22 项目: Slimefun4   文件: FireworkUtils.java
public static void launchFirework(Location l, Color color) {
    Firework fw = (Firework) l.getWorld().spawnEntity(l, EntityType.FIREWORK);
    FireworkMeta meta = fw.getFireworkMeta();

    meta.setDisplayName(ChatColor.GREEN + "Slimefun Research");
    FireworkEffect effect = getRandomEffect(ThreadLocalRandom.current(), color);
    meta.addEffect(effect);
    meta.setPower(ThreadLocalRandom.current().nextInt(2) + 1);
    fw.setFireworkMeta(meta);
}
 
源代码23 项目: CS-CoreLib   文件: FireworkShow.java
public static Firework createFirework(Location l, Color color) {
	Firework fw = (Firework)l.getWorld().spawnEntity(l, EntityType.FIREWORK);
	FireworkMeta meta = fw.getFireworkMeta();
    FireworkEffect effect = FireworkEffect.builder().flicker(CSCoreLib.randomizer().nextBoolean()).withColor(color).with(CSCoreLib.randomizer().nextInt(3) + 1 == 1 ? Type.BALL: Type.BALL_LARGE).trail(CSCoreLib.randomizer().nextBoolean()).build();
    meta.addEffect(effect);
    meta.setPower(CSCoreLib.randomizer().nextInt(2) + 1);
    fw.setFireworkMeta(meta);
    return fw;
}
 
源代码24 项目: Kettle   文件: CraftMetaLeatherArmor.java
CraftMetaLeatherArmor(NBTTagCompound tag) {
    super(tag);
    if (tag.hasKey(DISPLAY.NBT)) {
        NBTTagCompound display = tag.getCompoundTag(DISPLAY.NBT);
        if (display.hasKey(COLOR.NBT)) {
            color = Color.fromRGB(display.getInteger(COLOR.NBT));
        }
    }
}
 
源代码25 项目: CS-CoreLib   文件: CustomPotion.java
public CustomPotion(String name, Color color, PotionEffect effect, String... lore) {
	super(Material.POTION, name, lore);
	PotionMeta meta = (PotionMeta) getItemMeta();
	meta.setColor(color);
	meta.addCustomEffect(effect, true);
	setItemMeta(meta);
}
 
源代码26 项目: ExoticGarden   文件: ExoticGarden.java
public void registerBerry(String name, ChatColor color, Color potionColor, PlantType type, String texture) {
	String upperCase = name.toUpperCase(Locale.ROOT);
	Berry berry = new Berry(upperCase, type, texture);
	berries.add(berry);

	SlimefunItemStack sfi = new SlimefunItemStack(upperCase + "_BUSH", Material.OAK_SAPLING, color + name + " Bush");

	items.put(upperCase + "_BUSH", sfi);

	new SlimefunItem(mainCategory, sfi, ExoticGardenRecipeTypes.BREAKING_GRASS,
	new ItemStack[] {null, null, null, null, new ItemStack(Material.GRASS), null, null, null, null})
	.register(this);

	new ExoticGardenFruit(mainCategory, new SlimefunItemStack(upperCase, texture, color + name), ExoticGardenRecipeTypes.HARVEST_BUSH, true,
	new ItemStack[] {null, null, null, null, getItem(upperCase + "_BUSH"), null, null, null, null})
	.register(this);

	new Juice(drinksCategory, new SlimefunItemStack(upperCase + "_JUICE", new CustomPotion(color + name + " Juice", potionColor, new PotionEffect(PotionEffectType.SATURATION, 6, 0), "", "&7&oRestores &b&o" + "3.0" + " &7&oHunger")), RecipeType.JUICER,
	new ItemStack[] {getItem(upperCase), null, null, null, null, null, null, null, null})
	.register(this);

	new Juice(drinksCategory, new SlimefunItemStack(upperCase + "_SMOOTHIE", new CustomPotion(color + name + " Smoothie", potionColor, new PotionEffect(PotionEffectType.SATURATION, 10, 0), "", "&7&oRestores &b&o" + "5.0" + " &7&oHunger")), RecipeType.ENHANCED_CRAFTING_TABLE,
	new ItemStack[] {getItem(upperCase + "_JUICE"), getItem("ICE_CUBE"), null, null, null, null, null, null, null})
	.register(this);

	new CustomFood(foodCategory, new SlimefunItemStack(upperCase + "_JELLY_SANDWICH", "8c8a939093ab1cde6677faf7481f311e5f17f63d58825f0e0c174631fb0439", color + name + " Jelly Sandwich", "", "&7&oRestores &b&o" + "8.0" + " &7&oHunger"),
	new ItemStack[] {null, new ItemStack(Material.BREAD), null, null, getItem(upperCase + "_JUICE"), null, null, new ItemStack(Material.BREAD), null},
	16)
	.register(this);

	new CustomFood(foodCategory, new SlimefunItemStack(upperCase + "_PIE", "3418c6b0a29fc1fe791c89774d828ff63d2a9fa6c83373ef3aa47bf3eb79", color + name + " Pie", "", "&7&oRestores &b&o" + "6.5" + " &7&oHunger"),
	new ItemStack[] {getItem(upperCase), new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), new ItemStack(Material.MILK_BUCKET), SlimefunItems.WHEAT_FLOUR, null, null, null, null},
	13)
	.register(this);
}
 
源代码27 项目: Kettle   文件: CraftMetaFirework.java
static void addColors(NBTTagCompound compound, ItemMetaKey key, List<Color> colors) {
    if (colors.isEmpty()) {
        return;
    }

    final int[] colorArray = new int[colors.size()];
    int i = 0;
    for (Color color : colors) {
        colorArray[i++] = color.asRGB();
    }

    compound.setIntArray(key.NBT, colorArray);
}
 
源代码28 项目: NBTEditor   文件: ColorVariable.java
@Override
public String get() {
	NBTTagCompound data = data();
	Color color = Color.fromRGB(data.getInt(_key));
	String r = Integer.toHexString(color.getRed());
	String g = Integer.toHexString(color.getGreen());
	String b = Integer.toHexString(color.getBlue());
	return "#" + (r.length() == 1 ? "0" + r : r) + (g.length() == 1 ? "0" + g : g) + (b.length() == 1 ? "0" + b : b);
}
 
源代码29 项目: StaffPlus   文件: Items.java
public static ItemStack createColoredArmor(Armor armor, Color color, String name)
{
	ItemStack leatherArmor = new ItemStack(armor.getMaterial());
	LeatherArmorMeta meta = (LeatherArmorMeta) leatherArmor.getItemMeta();
	meta.setColor(color);
	if(name != null)
	    meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name));
	leatherArmor.setItemMeta(meta);
	return leatherArmor;
}
 
源代码30 项目: EffectLib   文件: Effect.java
protected void display(Particle particle, Location location, Color color, float speed, int amount) {
    if (targetPlayers == null && targetPlayer != null) {
        targetPlayers = new ArrayList<Player>();
        targetPlayers.add(targetPlayer);
    }
    effectManager.display(particle, location, particleOffsetX, particleOffsetY, particleOffsetZ, speed, amount,
            particleSize, color, material, materialData, visibleRange, targetPlayers);
}
 
 类所在包
 同包方法