Java Code Examples for org.bukkit.Material#IRON_BARS

The following examples show how to use org.bukkit.Material#IRON_BARS . 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: NMSHandler.java    From SkyWarsReloaded with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ItemStack getMaterial(String item) {
	if (item.equalsIgnoreCase("SKULL_ITEM")) {
		return new ItemStack(Material.SKELETON_SKULL, 1);
	} else if (item.equalsIgnoreCase("ENDER_PORTAL_FRAME")) {
		return new ItemStack(Material.END_PORTAL_FRAME, 1);
	} else if (item.equalsIgnoreCase("WORKBENCH")) {
		return new ItemStack(Material.CRAFTING_TABLE, 1);
	} else if (item.equalsIgnoreCase("IRON_FENCE")) {
		return new ItemStack(Material.IRON_BARS, 1);
	} else if (item.equalsIgnoreCase("REDSTONE_COMPARATOR")) {
		return new ItemStack(Material.COMPARATOR);
	} else if (item.equalsIgnoreCase("SIGN_POST")) {
		return new ItemStack(Material.SIGN);
	} else if (item.equalsIgnoreCase("STONE_PLATE")) {
		return new ItemStack(Material.STONE_PRESSURE_PLATE);
	} else if (item.equalsIgnoreCase("IRON_PLATE")) {
		return new ItemStack(Material.HEAVY_WEIGHTED_PRESSURE_PLATE);
	} else if (item.equalsIgnoreCase("GOLD_PLATE")) {
		return new ItemStack(Material.LIGHT_WEIGHTED_PRESSURE_PLATE);
	} else if (item.equalsIgnoreCase("MOB_SPAWNER")) {
		return new ItemStack(Material.SPAWNER);
	} else if (item.equalsIgnoreCase("SNOW_BALL")) {
		return new ItemStack(Material.SNOWBALL);
	} else {
		return new ItemStack(Material.AIR, 1);
	}
}
 
Example 2
Source File: SkyBlockMenu.java    From uSkyBlock with GNU General Public License v3.0 4 votes vote down vote up
private void onClickMainMenu(InventoryClickEvent event, ItemStack currentItem, Player p, int slotIndex) {
    event.setCancelled(true);
    if (slotIndex < 0 || slotIndex > 35) {
        return;
    }
    PlayerInfo playerInfo = plugin.getPlayerInfo(p);
    IslandInfo islandInfo = plugin.getIslandInfo(playerInfo);
    if (currentItem.getType() == Material.JUNGLE_SAPLING) {
        p.closeInventory();
        p.performCommand("island biome");
    } else if (currentItem.getType() == Material.PLAYER_HEAD) {
        p.closeInventory();
        p.performCommand("island party");
    } else if (currentItem.getType() == Material.RED_BED) {
        p.closeInventory();
        p.performCommand("island sethome");
        p.performCommand("island");
    } else if (currentItem.getType() == Material.GRASS) {
        p.closeInventory();
        p.performCommand("island spawn");
    } else if (currentItem.getType() == Material.HOPPER) {
        p.closeInventory();
        p.performCommand("island setwarp");
        p.performCommand("island");
    } else if (currentItem.getType() == Material.WRITABLE_BOOK) {
        p.closeInventory();
        p.performCommand("island log");
    } else if (currentItem.getType() == Material.OAK_DOOR) {
        p.closeInventory();
        p.performCommand("island home");
    } else if (currentItem.getType() == Material.EXPERIENCE_BOTTLE) {
        p.closeInventory();
        p.performCommand("island level");
    } else if (currentItem.getType() == Material.DIAMOND_ORE) {
        p.closeInventory();
        p.performCommand("c");
    } else if (currentItem.getType() == Material.END_STONE || currentItem.getType() == Material.END_PORTAL_FRAME) {
        p.closeInventory();
        p.performCommand("island togglewarp");
        p.performCommand("island");
    } else if (currentItem.getType() == Material.IRON_BARS && islandInfo.isLocked()) {
        p.closeInventory();
        p.performCommand("island unlock");
        p.performCommand("island");
    } else if (currentItem.getType() == Material.IRON_BARS && !islandInfo.isLocked()) {
        p.closeInventory();
        p.performCommand("island lock");
        p.performCommand("island");
    } else if (slotIndex == 17) {
        if (islandInfo.isLeader(p) && plugin.getConfig().getBoolean("island-schemes-enabled", true)) {
            p.closeInventory();
            p.openInventory(createRestartGUI(p));
        } else {
            if (plugin.getConfirmHandler().millisLeft(p, "/is leave") > 0) {
                p.closeInventory();
                p.performCommand("island leave");
            } else {
                p.performCommand("island leave");
                updateLeaveMenuItemTimer(p, event.getInventory(), currentItem);
            }
        }
    } else {
        if (!isExtraMenuAction(p, currentItem)) {
            p.closeInventory();
            p.performCommand("island");
        }
    }
}
 
Example 3
Source File: MenuItemFactory.java    From uSkyBlock with GNU General Public License v3.0 4 votes vote down vote up
public ItemStack createIntegerIcon(int value, boolean readonly) {
    return Math.abs(value) <= MAX_INT_VALUE
            ? (readonly ? new ItemStack(Material.DETECTOR_RAIL, value) : new ItemStack(Material.RAIL, value))
            : (readonly ? new ItemStack(Material.IRON_BARS, 1, (short)1) : new ItemStack(Material.ACTIVATOR_RAIL, 1));
}
 
Example 4
Source File: OreCrusher.java    From Slimefun4 with GNU General Public License v3.0 4 votes vote down vote up
public OreCrusher(Category category, SlimefunItemStack item) {
    super(category, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.IRON_BARS), new CustomItem(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.IRON_BARS) }, new ItemStack[] { new ItemStack(Material.COBBLESTONE, 8), new ItemStack(Material.SAND, 1), SlimefunItems.GOLD_4K, SlimefunItems.GOLD_DUST, new ItemStack(Material.GRAVEL), new ItemStack(Material.SAND), new ItemStack(Material.MAGMA_BLOCK, 4), SlimefunItems.SULFATE }, BlockFace.SELF);

    addItemSetting(doubleOres);
}