Search in sources :

Example 1 with ExoticGardenFruit

use of io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit in project DynaTech by ProfElements.

the class SeedPlucker method findNextRecipe.

@Override
public MachineRecipe findNextRecipe(BlockMenu inv) {
    if (DynaTech.isExoticGardenInstalled() && exoticGardenIntegration.getValue()) {
        for (int inputSlot : getInputSlots()) {
            SlimefunItem item = SlimefunItem.getByItem(inv.getItemInSlot(inputSlot));
            if (item instanceof ExoticGardenFruit) {
                SlimefunItem out = SlimefunItem.getById(item.getId().concat("_BUSH"));
                if (out != null) {
                    inv.consumeItem(inputSlot);
                    return new MachineRecipe(10, new ItemStack[] { item.getItem() }, new ItemStack[] { out.getItem() });
                }
                out = SlimefunItem.getById(item.getId().concat("_SAPLING"));
                if (out != null) {
                    inv.consumeItem(inputSlot);
                    return new MachineRecipe(10, new ItemStack[] { item.getItem() }, new ItemStack[] { out.getItem() });
                }
                out = SlimefunItem.getById(item.getId().concat("_PLANT"));
                if (out != null) {
                    inv.consumeItem(inputSlot);
                    return new MachineRecipe(10, new ItemStack[] { item.getItem() }, new ItemStack[] { out.getItem() });
                }
            }
        }
    }
    return super.findNextRecipe(inv);
}
Also used : MachineRecipe(me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe) SlimefunItem(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem) ExoticGardenFruit(io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit)

Example 2 with ExoticGardenFruit

use of io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit 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 3 with ExoticGardenFruit

use of io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit 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 4 with ExoticGardenFruit

use of io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit 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

ExoticGardenFruit (io.github.thebusybiscuit.exoticgarden.items.ExoticGardenFruit)4 BonemealableItem (io.github.thebusybiscuit.exoticgarden.items.BonemealableItem)3 SlimefunItemStack (io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack)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 SlimefunItem (io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem)1 File (java.io.File)1 MachineRecipe (me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe)1