org.bukkit.Color Java Examples

The following examples show how to use org.bukkit.Color. 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 7 votes vote down vote up
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);
}
 
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: Ender.java    From MineTinker with GNU General Public License v3.0 6 votes vote down vote up
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);
	}
}
 
Example #4
Source File: UMaterial.java    From TradePlus with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #5
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 #6
Source File: FireworkMatchModule.java    From PGM with GNU Affero General Public License v3.0 6 votes vote down vote up
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);
    }
  }
}
 
Example #7
Source File: ProximityAlarm.java    From ProjectAres with GNU Affero General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #8
Source File: ArenaControlBlock.java    From civcraft with GNU General Public License v2.0 6 votes vote down vote up
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();
		}
	}
}
 
Example #9
Source File: CraftMetaMap.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
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));
        }
    }
}
 
Example #10
Source File: ItemUtils.java    From ChestCommands with GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #11
Source File: ColoredFireworkStar.java    From Slimefun4 with GNU General Public License v3.0 6 votes vote down vote up
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);
        }
    });
}
 
Example #12
Source File: XParticle.java    From XSeries with MIT License 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #13
Source File: ParticleDisplay.java    From EffectLib with MIT License 6 votes vote down vote up
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);
}
 
Example #14
Source File: ItemBuilder.java    From EnchantmentsEnhance with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the armor color of a leather armor piece. Works only on leather
 * armor pieces.
 *
 * @param color The color to set it to.
 */
public ItemBuilder setLeatherArmorColor(Color color) {
    try {
        LeatherArmorMeta im = (LeatherArmorMeta) is.getItemMeta();
        im.setColor(color);
        is.setItemMeta(im);
    } catch (ClassCastException expected) {
    }
    return this;
}
 
Example #15
Source File: CustomPotion.java    From CS-CoreLib with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: ColorVariable.java    From NBTEditor with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example #17
Source File: FireworkUtils.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
public static Firework createFirework(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 = FireworkEffect.builder().flicker(ThreadLocalRandom.current().nextBoolean()).withColor(color).with(ThreadLocalRandom.current().nextInt(3) + 1 == 1 ? Type.BALL : Type.BALL_LARGE).trail(ThreadLocalRandom.current().nextBoolean()).build();
    meta.addEffect(effect);
    meta.setPower(ThreadLocalRandom.current().nextInt(2) + 1);
    fw.setFireworkMeta(meta);

    return fw;
}
 
Example #18
Source File: XParticle.java    From XSeries with MIT License 5 votes vote down vote up
/**
 * 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;
    });
}
 
Example #19
Source File: Items.java    From StaffPlus with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #20
Source File: Effect.java    From EffectLib with MIT License 5 votes vote down vote up
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);
}
 
Example #21
Source File: XParticle.java    From XSeries with MIT License 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #22
Source File: ItemBuilder.java    From Crazy-Crates with MIT License 5 votes vote down vote up
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;
}
 
Example #23
Source File: Fireworks.java    From CardinalPGM with MIT License 5 votes vote down vote up
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);
    }
}
 
Example #24
Source File: Items.java    From TabooLib with MIT License 5 votes vote down vote up
public static Color asColor(String color) {
    try {
        String[] v = color.split("-");
        return Color.fromRGB(NumberConversions.toInt(v[0]), NumberConversions.toInt(v[1]), NumberConversions.toInt(v[2]));
    } catch (Throwable e) {
        return Color.fromRGB(0, 0, 0);
    }
}
 
Example #25
Source File: Utils.java    From BetonQuest with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #26
Source File: FireworkShow.java    From CS-CoreLib with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #27
Source File: FireworkUtils.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #28
Source File: CraftMetaLeatherArmor.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
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));
        }
    }
}
 
Example #29
Source File: CraftMetaFirework.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #30
Source File: ExoticGarden.java    From ExoticGarden with GNU General Public License v3.0 5 votes vote down vote up
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);
}