Search in sources :

Example 1 with BonemealableItem

use of io.github.thebusybiscuit.exoticgarden.items.BonemealableItem in project ExoticGarden by TheBusyBiscuit.

the class ExoticGarden method registerTree.

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 BonemealableItem(mainItemGroup, sapling, ExoticGardenRecipeTypes.BREAKING_GRASS, new ItemStack[] { null, null, null, null, new ItemStack(Material.GRASS), null, null, null, null }).register(this);
    new ExoticGardenFruit(mainItemGroup, 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(drinksItemGroup, 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(foodItemGroup, 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");
    }
}
Also used : PotionEffect(org.bukkit.potion.PotionEffect) Juice(io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice) BonemealableItem(io.github.thebusybiscuit.exoticgarden.items.BonemealableItem) ExoticGardenFruit(io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit) CustomFood(io.github.thebusybiscuit.exoticgarden.items.CustomFood) ItemStack(org.bukkit.inventory.ItemStack) CustomItemStack(io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack) File(java.io.File) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)

Example 2 with BonemealableItem

use of io.github.thebusybiscuit.exoticgarden.items.BonemealableItem in project ExoticGarden by TheBusyBiscuit.

the class ExoticGarden method registerMagicalPlant.

private void registerMagicalPlant(String name, ItemStack item, String texture, ItemStack[] recipe) {
    String upperCase = name.toUpperCase(Locale.ROOT);
    String enumStyle = upperCase.replace(' ', '_');
    SlimefunItemStack essence = new SlimefunItemStack(enumStyle + "_ESSENCE", Material.BLAZE_POWDER, "&rMagical Essence", "", "&7" + name);
    Berry berry = new Berry(essence, upperCase + "_ESSENCE", PlantType.ORE_PLANT, texture);
    berries.add(berry);
    new BonemealableItem(magicalItemGroup, new SlimefunItemStack(enumStyle + "_PLANT", Material.OAK_SAPLING, "&r" + name + " Plant"), RecipeType.ENHANCED_CRAFTING_TABLE, recipe).register(this);
    MagicalEssence magicalEssence = new MagicalEssence(magicalItemGroup, essence);
    magicalEssence.setRecipeOutput(item.clone());
    magicalEssence.register(this);
}
Also used : BonemealableItem(io.github.thebusybiscuit.exoticgarden.items.BonemealableItem) MagicalEssence(io.github.thebusybiscuit.exoticgarden.items.MagicalEssence) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)

Example 3 with BonemealableItem

use of io.github.thebusybiscuit.exoticgarden.items.BonemealableItem in project ExoticGarden by TheBusyBiscuit.

the class PlantsListener method onBonemealPlant.

@EventHandler(ignoreCancelled = true)
public void onBonemealPlant(BlockFertilizeEvent e) {
    Block b = e.getBlock();
    if (b.getType() == Material.OAK_SAPLING) {
        SlimefunItem item = BlockStorage.check(b);
        if (item instanceof BonemealableItem && ((BonemealableItem) item).isBonemealDisabled()) {
            e.setCancelled(true);
            b.getWorld().spawnParticle(Particle.VILLAGER_ANGRY, b.getLocation().clone().add(0.5, 0, 0.5), 4);
            b.getWorld().playSound(b.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1);
        }
    }
}
Also used : Block(org.bukkit.block.Block) SlimefunItem(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem) BonemealableItem(io.github.thebusybiscuit.exoticgarden.items.BonemealableItem) EventHandler(org.bukkit.event.EventHandler)

Example 4 with BonemealableItem

use of io.github.thebusybiscuit.exoticgarden.items.BonemealableItem in project ExoticGarden by TheBusyBiscuit.

the class ExoticGarden method registerBerry.

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 BonemealableItem(mainItemGroup, sfi, ExoticGardenRecipeTypes.BREAKING_GRASS, new ItemStack[] { null, null, null, null, new ItemStack(Material.GRASS), null, null, null, null }).register(this);
    new ExoticGardenFruit(mainItemGroup, 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(drinksItemGroup, 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(drinksItemGroup, 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(foodItemGroup, 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(foodItemGroup, 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);
}
Also used : PotionEffect(org.bukkit.potion.PotionEffect) Juice(io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice) BonemealableItem(io.github.thebusybiscuit.exoticgarden.items.BonemealableItem) ExoticGardenFruit(io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit) CustomFood(io.github.thebusybiscuit.exoticgarden.items.CustomFood) ItemStack(org.bukkit.inventory.ItemStack) CustomItemStack(io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)

Example 5 with BonemealableItem

use of io.github.thebusybiscuit.exoticgarden.items.BonemealableItem in project ExoticGarden by TheBusyBiscuit.

the class ExoticGarden method registerPlant.

public void registerPlant(String name, ChatColor color, PlantType type, String texture) {
    String upperCase = name.toUpperCase(Locale.ROOT);
    String enumStyle = upperCase.replace(' ', '_');
    Berry berry = new Berry(enumStyle, type, texture);
    berries.add(berry);
    SlimefunItemStack bush = new SlimefunItemStack(enumStyle + "_BUSH", Material.OAK_SAPLING, color + name + " Plant");
    items.put(upperCase + "_BUSH", bush);
    new BonemealableItem(mainItemGroup, bush, ExoticGardenRecipeTypes.BREAKING_GRASS, new ItemStack[] { null, null, null, null, new ItemStack(Material.GRASS), null, null, null, null }).register(this);
    new ExoticGardenFruit(mainItemGroup, new SlimefunItemStack(enumStyle, texture, color + name), ExoticGardenRecipeTypes.HARVEST_BUSH, true, new ItemStack[] { null, null, null, null, getItem(enumStyle + "_BUSH"), null, null, null, null }).register(this);
}
Also used : BonemealableItem(io.github.thebusybiscuit.exoticgarden.items.BonemealableItem) ExoticGardenFruit(io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit) ItemStack(org.bukkit.inventory.ItemStack) CustomItemStack(io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack) SlimefunItemStack(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)

Aggregations

BonemealableItem (io.github.thebusybiscuit.exoticgarden.items.BonemealableItem)5 SlimefunItemStack (io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)4 ExoticGardenFruit (io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit)3 CustomItemStack (io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack)3 ItemStack (org.bukkit.inventory.ItemStack)3 CustomFood (io.github.thebusybiscuit.exoticgarden.items.CustomFood)2 Juice (io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice)2 PotionEffect (org.bukkit.potion.PotionEffect)2 MagicalEssence (io.github.thebusybiscuit.exoticgarden.items.MagicalEssence)1 SlimefunItem (io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem)1 File (java.io.File)1 Block (org.bukkit.block.Block)1 EventHandler (org.bukkit.event.EventHandler)1