Java Code Examples for org.bukkit.Material#BLAZE_POWDER

The following examples show how to use org.bukkit.Material#BLAZE_POWDER . 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: BrewingStandContainer.java    From Transport-Pipes with MIT License 6 votes vote down vote up
@Override
public int spaceForItem(TPDirection insertDirection, ItemStack insertion) {
    if (isInvLocked(cachedBrewingStand)) {
        return 0;
    }
    if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
        if (cachedInv.getItem(0) != null && cachedInv.getItem(1) != null && cachedInv.getItem(2) != null) {
            return 0;
        } else {
            return 1;
        }
    } else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
        return spaceForItem(cachedInv.getFuel(), insertion);
    } else if (isBrewingIngredient(insertion.getType())) {
        return spaceForItem(cachedInv.getIngredient(), insertion);
    } else {
        return 0;
    }
}
 
Example 2
Source File: ExoticGarden.java    From ExoticGarden with GNU General Public License v3.0 6 votes vote down vote up
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 SlimefunItem(magicalCategory, new SlimefunItemStack(enumStyle + "_PLANT", Material.OAK_SAPLING, "&r" + name + " Plant"), RecipeType.ENHANCED_CRAFTING_TABLE,
	recipe)
	.register(this);

	MagicalEssence magicalEssence = new MagicalEssence(magicalCategory, essence);

	magicalEssence.setRecipeOutput(item.clone());
	magicalEssence.register(this);
}
 
Example 3
Source File: GrindStone.java    From Slimefun4 with GNU General Public License v3.0 6 votes vote down vote up
public GrindStone(Category category, SlimefunItemStack item) {
       super(category, item, 
			new ItemStack[] {null, null, null, null, new ItemStack(Material.OAK_FENCE), null, null, new CustomItem(Material.DISPENSER, "Dispenser (Facing up)"), null},
			new ItemStack[] {
					new ItemStack(Material.BLAZE_ROD), new ItemStack(Material.BLAZE_POWDER, 4), 
					new ItemStack(Material.BONE), new ItemStack(Material.BONE_MEAL, 4), 
					new ItemStack(Material.GRAVEL), new ItemStack(Material.FLINT), 
					new ItemStack(Material.ENDER_EYE), new CustomItem(SlimefunItems.ENDER_LUMP_1, 2), 
					new ItemStack(Material.COBBLESTONE), new ItemStack(Material.GRAVEL), 
					new ItemStack(Material.ANDESITE), new ItemStack(Material.GRAVEL),
					new ItemStack(Material.DIORITE), new ItemStack(Material.GRAVEL),
					new ItemStack(Material.GRANITE), new ItemStack(Material.GRAVEL),
					new ItemStack(Material.DIRT), SlimefunItems.STONE_CHUNK, 
					new ItemStack(Material.SANDSTONE), new ItemStack(Material.SAND, 4), 
					new ItemStack(Material.RED_SANDSTONE), new ItemStack(Material.RED_SAND, 4),
					new ItemStack(Material.PRISMARINE_BRICKS), new ItemStack(Material.PRISMARINE, 2),
					new ItemStack(Material.PRISMARINE), new ItemStack(Material.PRISMARINE_SHARD, 4)
			},
			BlockFace.SELF
	);
}
 
Example 4
Source File: BrewingStandContainer.java    From Transport-Pipes with MIT License 5 votes vote down vote up
@Override
public ItemStack insertItem(TPDirection insertDirection, ItemStack insertion) {
    if (!isInLoadedChunk()) {
        return insertion;
    }
    if (isInvLocked(cachedBrewingStand)) {
        return insertion;
    }
    if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
        if (cachedInv.getItem(0) == null) {
            cachedInv.setItem(0, insertion);
            return null;
        } else if (cachedInv.getItem(1) == null) {
            cachedInv.setItem(1, insertion);
            return null;
        } else if (cachedInv.getItem(2) == null) {
            cachedInv.setItem(2, insertion);
            return null;
        }
    } else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
        ItemStack oldFuel = cachedInv.getFuel();
        cachedInv.setFuel(accumulateItems(oldFuel, insertion));
        if (insertion == null || insertion.getAmount() == 0) {
            insertion = null;
        }
    } else if (isBrewingIngredient(insertion.getType())) {
        ItemStack oldIngredient = cachedInv.getIngredient();
        cachedInv.setIngredient(accumulateItems(oldIngredient, insertion));
        if (insertion == null || insertion.getAmount() == 0) {
            insertion = null;
        }
    }
    return insertion;
}
 
Example 5
Source File: ShopMenu.java    From AnnihilationPro with MIT License 4 votes vote down vote up
public static void addGunPowder()
{
	ItemStack s = new ItemStack(Material.BLAZE_POWDER);
	brewing.setItem(24, new ShopMenuItem(s,s,15));
}
 
Example 6
Source File: GUIManager.java    From Statz with GNU General Public License v3.0 4 votes vote down vote up
private Material getIconMaterialForSpecificStatistic(Query query, PlayerStat stat) {

        if (stat == PlayerStat.BLOCKS_BROKEN || stat == PlayerStat.BLOCKS_PLACED) {

            Material material = Material.getMaterial(query.getValue("block").toString());

            if (material != null && material.isItem()) {
                return material;
            }
        }

        if (stat == PlayerStat.VILLAGER_TRADES) {
            return Material.getMaterial(query.getValue("trade").toString());
        }

        if (stat == PlayerStat.KILLS_MOBS) {
            return Material.getMaterial(query.getValue("weapon").toString());
        }

        if (stat == PlayerStat.ITEMS_PICKED_UP || stat == PlayerStat.ITEMS_DROPPED || stat == PlayerStat.ITEMS_CRAFTED || stat == PlayerStat.TOOLS_BROKEN) {
            return Material.getMaterial(query.getValue("item").toString());
        }

        if (stat == PlayerStat.ITEMS_CAUGHT) {
            return Material.getMaterial(query.getValue("caught").toString());
        }

        if (stat == PlayerStat.FOOD_EATEN) {
            return Material.getMaterial(query.getValue("foodEaten").toString());
        }

        if (stat == PlayerStat.DISTANCE_TRAVELLED) {
            String movementType = query.getValue("moveType").toString();

            switch (movementType) {
                case "SWIM":
                    return Material.TROPICAL_FISH;
                case "FLY":
                    return Material.BLAZE_POWDER;
                case "BOAT":
                    return Material.OAK_BOAT;
                case "MINECART":
                case "HORSE IN MINECART":
                    return Material.MINECART;
                case "PIG IN MINECART":
                case "PIG":
                    return Material.COOKED_PORKCHOP;
                case "HORSE":
                    return Material.DIAMOND_HORSE_ARMOR;
                case "FLY WITH ELYTRA":
                    return Material.ELYTRA;
                case "WALK":
                    return Material.GOLDEN_BOOTS;
            }
        }


        return plugin.getStatisticDescriptionConfig().getIconMaterial(stat);
    }
 
Example 7
Source File: CargoUtils.java    From Slimefun4 with GNU General Public License v3.0 4 votes vote down vote up
static ItemStack insertIntoVanillaInventory(ItemStack stack, Inventory inv) {
    ItemStack[] contents = inv.getContents();
    int minSlot = 0;
    int maxSlot = contents.length;

    // Check if it is a normal furnace
    if (inv instanceof FurnaceInventory) {
        // Check if it is fuel or not
        if (stack.getType().isFuel()) {
            maxSlot = 2;

            // Any non-smeltable items should not land in the upper slot
            if (!isSmeltable(stack, true)) {
                minSlot = 1;
            }
        }
        else {
            maxSlot = 1;
        }
    }
    else if (inv instanceof BrewerInventory) {
        if (stack.getType() == Material.POTION || stack.getType() == Material.LINGERING_POTION || stack.getType() == Material.SPLASH_POTION) {
            // Potions slot
            maxSlot = 3;
        }
        else if (stack.getType() == Material.BLAZE_POWDER) {
            // Blaze Powder slot
            minSlot = 4;
            maxSlot = 5;
        }
        else {
            // Input slot
            minSlot = 3;
            maxSlot = 4;
        }
    }

    ItemStackWrapper wrapper = new ItemStackWrapper(stack);

    for (int slot = minSlot; slot < maxSlot; slot++) {
        // Changes to this ItemStack are synchronized with the Item in the Inventory
        ItemStack itemInSlot = contents[slot];

        if (itemInSlot == null) {
            inv.setItem(slot, stack);
            return null;
        }
        else {
            int maxStackSize = itemInSlot.getType().getMaxStackSize();

            if (SlimefunUtils.isItemSimilar(itemInSlot, wrapper, true, false) && itemInSlot.getAmount() < maxStackSize) {
                int amount = itemInSlot.getAmount() + stack.getAmount();

                if (amount > maxStackSize) {
                    stack.setAmount(amount - maxStackSize);
                }
                else {
                    stack = null;
                }

                itemInSlot.setAmount(Math.min(amount, maxStackSize));
                // Setting item in inventory will clone the ItemStack
                inv.setItem(slot, itemInSlot);

                return stack;
            }
        }
    }

    return stack;
}