/FileExtraction/Java_unseen/serversigns_ServerSigns/src/main/java/de/czymm/serversigns/utils/MaterialConvertor.java
/*
 * This file is part of ServerSigns.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package de.czymm.serversigns.utils;

import org.bukkit.Material;

import java.util.HashMap;

public class MaterialConvertor {
    private static final HashMap<Integer, String> idMap = new HashMap<>();

    static {
        idMap.put(0, "AIR");
        idMap.put(1, "STONE");
        idMap.put(2, "GRASS");
        idMap.put(3, "DIRT");
        idMap.put(4, "COBBLESTONE");
        idMap.put(5, "WOOD");
        idMap.put(6, "SAPLING");
        idMap.put(7, "BEDROCK");
        idMap.put(8, "WATER");
        idMap.put(9, "STATIONARY_WATER");
        idMap.put(10, "LAVA");
        idMap.put(11, "STATIONARY_LAVA");
        idMap.put(12, "SAND");
        idMap.put(13, "GRAVEL");
        idMap.put(14, "GOLD_ORE");
        idMap.put(15, "IRON_ORE");
        idMap.put(16, "COAL_ORE");
        idMap.put(17, "LOG");
        idMap.put(18, "LEAVES");
        idMap.put(19, "SPONGE");
        idMap.put(20, "GLASS");
        idMap.put(21, "LAPIS_ORE");
        idMap.put(22, "LAPIS_BLOCK");
        idMap.put(23, "DISPENSER");
        idMap.put(24, "SANDSTONE");
        idMap.put(25, "NOTE_BLOCK");
        idMap.put(26, "BED_BLOCK");
        idMap.put(27, "POWERED_RAIL");
        idMap.put(28, "DETECTOR_RAIL");
        idMap.put(29, "PISTON_STICKY_BASE");
        idMap.put(30, "WEB");
        idMap.put(31, "LONG_GRASS");
        idMap.put(32, "DEAD_BUSH");
        idMap.put(33, "PISTON_BASE");
        idMap.put(34, "PISTON_EXTENSION");
        idMap.put(35, "WOOL");
        idMap.put(36, "PISTON_MOVING_PIECE");
        idMap.put(37, "YELLOW_FLOWER");
        idMap.put(38, "RED_ROSE");
        idMap.put(39, "BROWN_MUSHROOM");
        idMap.put(40, "RED_MUSHROOM");
        idMap.put(41, "GOLD_BLOCK");
        idMap.put(42, "IRON_BLOCK");
        idMap.put(43, "DOUBLE_STEP");
        idMap.put(44, "STEP");
        idMap.put(45, "BRICK");
        idMap.put(46, "TNT");
        idMap.put(47, "BOOKSHELF");
        idMap.put(48, "MOSSY_COBBLESTONE");
        idMap.put(49, "OBSIDIAN");
        idMap.put(50, "TORCH");
        idMap.put(51, "FIRE");
        idMap.put(52, "MOB_SPAWNER");
        idMap.put(53, "WOOD_STAIRS");
        idMap.put(54, "CHEST");
        idMap.put(55, "REDSTONE_WIRE");
        idMap.put(56, "DIAMOND_ORE");
        idMap.put(57, "DIAMOND_BLOCK");
        idMap.put(58, "WORKBENCH");
        idMap.put(59, "CROPS");
        idMap.put(60, "SOIL");
        idMap.put(61, "FURNACE");
        idMap.put(62, "BURNING_FURNACE");
        idMap.put(63, "SIGN_POST");
        idMap.put(64, "WOODEN_DOOR");
        idMap.put(65, "LADDER");
        idMap.put(66, "RAILS");
        idMap.put(67, "COBBLESTONE_STAIRS");
        idMap.put(68, "WALL_SIGN");
        idMap.put(69, "LEVER");
        idMap.put(70, "STONE_PLATE");
        idMap.put(71, "IRON_DOOR_BLOCK");
        idMap.put(72, "WOOD_PLATE");
        idMap.put(73, "REDSTONE_ORE");
        idMap.put(74, "GLOWING_REDSTONE_ORE");
        idMap.put(75, "REDSTONE_TORCH_OFF");
        idMap.put(76, "REDSTONE_TORCH_ON");
        idMap.put(77, "STONE_BUTTON");
        idMap.put(78, "SNOW");
        idMap.put(79, "ICE");
        idMap.put(80, "SNOW_BLOCK");
        idMap.put(81, "CACTUS");
        idMap.put(82, "CLAY");
        idMap.put(83, "SUGAR_CANE_BLOCK");
        idMap.put(84, "JUKEBOX");
        idMap.put(85, "FENCE");
        idMap.put(86, "PUMPKIN");
        idMap.put(87, "NETHERRACK");
        idMap.put(88, "SOUL_SAND");
        idMap.put(89, "GLOWSTONE");
        idMap.put(90, "PORTAL");
        idMap.put(91, "JACK_O_LANTERN");
        idMap.put(92, "CAKE_BLOCK");
        idMap.put(93, "DIODE_BLOCK_OFF");
        idMap.put(94, "DIODE_BLOCK_ON");
        idMap.put(95, "STAINED_GLASS");
        idMap.put(96, "TRAP_DOOR");
        idMap.put(97, "MONSTER_EGGS");
        idMap.put(98, "SMOOTH_BRICK");
        idMap.put(99, "HUGE_MUSHROOM_1");
        idMap.put(100, "HUGE_MUSHROOM_2");
        idMap.put(101, "IRON_FENCE");
        idMap.put(102, "THIN_GLASS");
        idMap.put(103, "MELON_BLOCK");
        idMap.put(104, "PUMPKIN_STEM");
        idMap.put(105, "MELON_STEM");
        idMap.put(106, "VINE");
        idMap.put(107, "FENCE_GATE");
        idMap.put(108, "BRICK_STAIRS");
        idMap.put(109, "SMOOTH_STAIRS");
        idMap.put(110, "MYCEL");
        idMap.put(111, "WATER_LILY");
        idMap.put(112, "NETHER_BRICK");
        idMap.put(113, "NETHER_FENCE");
        idMap.put(114, "NETHER_BRICK_STAIRS");
        idMap.put(115, "NETHER_WARTS");
        idMap.put(116, "ENCHANTMENT_TABLE");
        idMap.put(117, "BREWING_STAND");
        idMap.put(118, "CAULDRON");
        idMap.put(119, "ENDER_PORTAL");
        idMap.put(120, "ENDER_PORTAL_FRAME");
        idMap.put(121, "ENDER_STONE");
        idMap.put(122, "DRAGON_EGG");
        idMap.put(123, "REDSTONE_LAMP_OFF");
        idMap.put(124, "REDSTONE_LAMP_ON");
        idMap.put(125, "WOOD_DOUBLE_STEP");
        idMap.put(126, "WOOD_STEP");
        idMap.put(127, "COCOA");
        idMap.put(128, "SANDSTONE_STAIRS");
        idMap.put(129, "EMERALD_ORE");
        idMap.put(130, "ENDER_CHEST");
        idMap.put(131, "TRIPWIRE_HOOK");
        idMap.put(132, "TRIPWIRE");
        idMap.put(133, "EMERALD_BLOCK");
        idMap.put(134, "SPRUCE_WOOD_STAIRS");
        idMap.put(135, "BIRCH_WOOD_STAIRS");
        idMap.put(136, "JUNGLE_WOOD_STAIRS");
        idMap.put(137, "COMMAND");
        idMap.put(138, "BEACON");
        idMap.put(139, "COBBLE_WALL");
        idMap.put(140, "FLOWER_POT");
        idMap.put(141, "CARROT");
        idMap.put(142, "POTATO");
        idMap.put(143, "WOOD_BUTTON");
        idMap.put(144, "SKULL");
        idMap.put(145, "ANVIL");
        idMap.put(146, "TRAPPED_CHEST");
        idMap.put(147, "GOLD_PLATE");
        idMap.put(148, "IRON_PLATE");
        idMap.put(149, "REDSTONE_COMPARATOR_OFF");
        idMap.put(150, "REDSTONE_COMPARATOR_ON");
        idMap.put(151, "DAYLIGHT_DETECTOR");
        idMap.put(152, "REDSTONE_BLOCK");
        idMap.put(153, "QUARTZ_ORE");
        idMap.put(154, "HOPPER");
        idMap.put(155, "QUARTZ_BLOCK");
        idMap.put(156, "QUARTZ_STAIRS");
        idMap.put(157, "ACTIVATOR_RAIL");
        idMap.put(158, "DROPPER");
        idMap.put(159, "STAINED_CLAY");
        idMap.put(160, "STAINED_GLASS_PANE");
        idMap.put(161, "LEAVES_2");
        idMap.put(162, "LOG_2");
        idMap.put(163, "ACACIA_STAIRS");
        idMap.put(164, "DARK_OAK_STAIRS");
        idMap.put(165, "SLIME_BLOCK");
        idMap.put(166, "BARRIER");
        idMap.put(167, "IRON_TRAPDOOR");
        idMap.put(168, "PRISMARINE");
        idMap.put(169, "SEA_LANTERN");
        idMap.put(170, "HAY_BLOCK");
        idMap.put(171, "CARPET");
        idMap.put(172, "HARD_CLAY");
        idMap.put(173, "COAL_BLOCK");
        idMap.put(174, "PACKED_ICE");
        idMap.put(175, "DOUBLE_PLANT");
        idMap.put(176, "STANDING_BANNER");
        idMap.put(177, "WALL_BANNER");
        idMap.put(178, "DAYLIGHT_DETECTOR_INVERTED");
        idMap.put(179, "RED_SANDSTONE");
        idMap.put(180, "RED_SANDSTONE_STAIRS");
        idMap.put(181, "DOUBLE_STONE_SLAB2");
        idMap.put(182, "STONE_SLAB2");
        idMap.put(183, "SPRUCE_FENCE_GATE");
        idMap.put(184, "BIRCH_FENCE_GATE");
        idMap.put(185, "JUNGLE_FENCE_GATE");
        idMap.put(186, "DARK_OAK_FENCE_GATE");
        idMap.put(187, "ACACIA_FENCE_GATE");
        idMap.put(188, "SPRUCE_FENCE");
        idMap.put(189, "BIRCH_FENCE");
        idMap.put(190, "JUNGLE_FENCE");
        idMap.put(191, "DARK_OAK_FENCE");
        idMap.put(192, "ACACIA_FENCE");
        idMap.put(193, "SPRUCE_DOOR");
        idMap.put(194, "BIRCH_DOOR");
        idMap.put(195, "JUNGLE_DOOR");
        idMap.put(196, "ACACIA_DOOR");
        idMap.put(197, "DARK_OAK_DOOR");
        idMap.put(256, "IRON_SPADE");
        idMap.put(257, "IRON_PICKAXE");
        idMap.put(258, "IRON_AXE");
        idMap.put(259, "FLINT_AND_STEEL");
        idMap.put(260, "APPLE");
        idMap.put(261, "BOW");
        idMap.put(262, "ARROW");
        idMap.put(263, "COAL");
        idMap.put(264, "DIAMOND");
        idMap.put(265, "IRON_INGOT");
        idMap.put(266, "GOLD_INGOT");
        idMap.put(267, "IRON_SWORD");
        idMap.put(268, "WOOD_SWORD");
        idMap.put(269, "WOOD_SPADE");
        idMap.put(270, "WOOD_PICKAXE");
        idMap.put(271, "WOOD_AXE");
        idMap.put(272, "STONE_SWORD");
        idMap.put(273, "STONE_SPADE");
        idMap.put(274, "STONE_PICKAXE");
        idMap.put(275, "STONE_AXE");
        idMap.put(276, "DIAMOND_SWORD");
        idMap.put(277, "DIAMOND_SPADE");
        idMap.put(278, "DIAMOND_PICKAXE");
        idMap.put(279, "DIAMOND_AXE");
        idMap.put(280, "STICK");
        idMap.put(281, "BOWL");
        idMap.put(282, "MUSHROOM_SOUP");
        idMap.put(283, "GOLD_SWORD");
        idMap.put(284, "GOLD_SPADE");
        idMap.put(285, "GOLD_PICKAXE");
        idMap.put(286, "GOLD_AXE");
        idMap.put(287, "STRING");
        idMap.put(288, "FEATHER");
        idMap.put(289, "SULPHUR");
        idMap.put(290, "WOOD_HOE");
        idMap.put(291, "STONE_HOE");
        idMap.put(292, "IRON_HOE");
        idMap.put(293, "DIAMOND_HOE");
        idMap.put(294, "GOLD_HOE");
        idMap.put(295, "SEEDS");
        idMap.put(296, "WHEAT");
        idMap.put(297, "BREAD");
        idMap.put(298, "LEATHER_HELMET");
        idMap.put(299, "LEATHER_CHESTPLATE");
        idMap.put(300, "LEATHER_LEGGINGS");
        idMap.put(301, "LEATHER_BOOTS");
        idMap.put(302, "CHAINMAIL_HELMET");
        idMap.put(303, "CHAINMAIL_CHESTPLATE");
        idMap.put(304, "CHAINMAIL_LEGGINGS");
        idMap.put(305, "CHAINMAIL_BOOTS");
        idMap.put(306, "IRON_HELMET");
        idMap.put(307, "IRON_CHESTPLATE");
        idMap.put(308, "IRON_LEGGINGS");
        idMap.put(309, "IRON_BOOTS");
        idMap.put(310, "DIAMOND_HELMET");
        idMap.put(311, "DIAMOND_CHESTPLATE");
        idMap.put(312, "DIAMOND_LEGGINGS");
        idMap.put(313, "DIAMOND_BOOTS");
        idMap.put(314, "GOLD_HELMET");
        idMap.put(315, "GOLD_CHESTPLATE");
        idMap.put(316, "GOLD_LEGGINGS");
        idMap.put(317, "GOLD_BOOTS");
        idMap.put(318, "FLINT");
        idMap.put(319, "PORK");
        idMap.put(320, "GRILLED_PORK");
        idMap.put(321, "PAINTING");
        idMap.put(322, "GOLDEN_APPLE");
        idMap.put(323, "SIGN");
        idMap.put(324, "WOOD_DOOR");
        idMap.put(325, "BUCKET");
        idMap.put(326, "WATER_BUCKET");
        idMap.put(327, "LAVA_BUCKET");
        idMap.put(328, "MINECART");
        idMap.put(329, "SADDLE");
        idMap.put(330, "IRON_DOOR");
        idMap.put(331, "REDSTONE");
        idMap.put(332, "SNOW_BALL");
        idMap.put(333, "BOAT");
        idMap.put(334, "LEATHER");
        idMap.put(335, "MILK_BUCKET");
        idMap.put(336, "CLAY_BRICK");
        idMap.put(337, "CLAY_BALL");
        idMap.put(338, "SUGAR_CANE");
        idMap.put(339, "PAPER");
        idMap.put(340, "BOOK");
        idMap.put(341, "SLIME_BALL");
        idMap.put(342, "STORAGE_MINECART");
        idMap.put(343, "POWERED_MINECART");
        idMap.put(344, "EGG");
        idMap.put(345, "COMPASS");
        idMap.put(346, "FISHING_ROD");
        idMap.put(347, "WATCH");
        idMap.put(348, "GLOWSTONE_DUST");
        idMap.put(349, "RAW_FISH");
        idMap.put(350, "COOKED_FISH");
        idMap.put(351, "INK_SACK");
        idMap.put(352, "BONE");
        idMap.put(353, "SUGAR");
        idMap.put(354, "CAKE");
        idMap.put(355, "BED");
        idMap.put(356, "DIODE");
        idMap.put(357, "COOKIE");
        idMap.put(358, "MAP");
        idMap.put(359, "SHEARS");
        idMap.put(360, "MELON");
        idMap.put(361, "PUMPKIN_SEEDS");
        idMap.put(362, "MELON_SEEDS");
        idMap.put(363, "RAW_BEEF");
        idMap.put(364, "COOKED_BEEF");
        idMap.put(365, "RAW_CHICKEN");
        idMap.put(366, "COOKED_CHICKEN");
        idMap.put(367, "ROTTEN_FLESH");
        idMap.put(368, "ENDER_PEARL");
        idMap.put(369, "BLAZE_ROD");
        idMap.put(370, "GHAST_TEAR");
        idMap.put(371, "GOLD_NUGGET");
        idMap.put(372, "NETHER_STALK");
        idMap.put(373, "POTION");
        idMap.put(374, "GLASS_BOTTLE");
        idMap.put(375, "SPIDER_EYE");
        idMap.put(376, "FERMENTED_SPIDER_EYE");
        idMap.put(377, "BLAZE_POWDER");
        idMap.put(378, "MAGMA_CREAM");
        idMap.put(379, "BREWING_STAND_ITEM");
        idMap.put(380, "CAULDRON_ITEM");
        idMap.put(381, "EYE_OF_ENDER");
        idMap.put(382, "SPECKLED_MELON");
        idMap.put(383, "MONSTER_EGG");
        idMap.put(384, "EXP_BOTTLE");
        idMap.put(385, "FIREBALL");
        idMap.put(386, "BOOK_AND_QUILL");
        idMap.put(387, "WRITTEN_BOOK");
        idMap.put(388, "EMERALD");
        idMap.put(389, "ITEM_FRAME");
        idMap.put(390, "FLOWER_POT_ITEM");
        idMap.put(391, "CARROT_ITEM");
        idMap.put(392, "POTATO_ITEM");
        idMap.put(393, "BAKED_POTATO");
        idMap.put(394, "POISONOUS_POTATO");
        idMap.put(395, "EMPTY_MAP");
        idMap.put(396, "GOLDEN_CARROT");
        idMap.put(397, "SKULL_ITEM");
        idMap.put(398, "CARROT_STICK");
        idMap.put(399, "NETHER_STAR");
        idMap.put(400, "PUMPKIN_PIE");
        idMap.put(401, "FIREWORK");
        idMap.put(402, "FIREWORK_CHARGE");
        idMap.put(403, "ENCHANTED_BOOK");
        idMap.put(404, "REDSTONE_COMPARATOR");
        idMap.put(405, "NETHER_BRICK_ITEM");
        idMap.put(406, "QUARTZ");
        idMap.put(407, "EXPLOSIVE_MINECART");
        idMap.put(408, "HOPPER_MINECART");
        idMap.put(409, "PRISMARINE_SHARD");
        idMap.put(410, "PRISMARINE_CRYSTALS");
        idMap.put(411, "RABBIT");
        idMap.put(412, "COOKED_RABBIT");
        idMap.put(413, "RABBIT_STEW");
        idMap.put(414, "RABBIT_FOOT");
        idMap.put(415, "RABBIT_HIDE");
        idMap.put(416, "ARMOR_STAND");
        idMap.put(417, "IRON_BARDING");
        idMap.put(418, "GOLD_BARDING");
        idMap.put(419, "DIAMOND_BARDING");
        idMap.put(420, "LEASH");
        idMap.put(421, "NAME_TAG");
        idMap.put(422, "COMMAND_MINECART");
        idMap.put(423, "MUTTON");
        idMap.put(424, "COOKED_MUTTON");
        idMap.put(425, "BANNER");
        idMap.put(427, "SPRUCE_DOOR_ITEM");
        idMap.put(428, "BIRCH_DOOR_ITEM");
        idMap.put(429, "JUNGLE_DOOR_ITEM");
        idMap.put(430, "ACACIA_DOOR_ITEM");
        idMap.put(431, "DARK_OAK_DOOR_ITEM");
        idMap.put(2256, "GOLD_RECORD");
        idMap.put(2257, "GREEN_RECORD");
        idMap.put(2258, "RECORD_3");
        idMap.put(2259, "RECORD_4");
        idMap.put(2260, "RECORD_5");
        idMap.put(2261, "RECORD_6");
        idMap.put(2262, "RECORD_7");
        idMap.put(2263, "RECORD_8");
        idMap.put(2264, "RECORD_9");
        idMap.put(2265, "RECORD_10");
        idMap.put(2266, "RECORD_11");
        idMap.put(2267, "RECORD_12");
    }

    public static Material getMaterialById(int id) {
        try {
            return Material.valueOf(idMap.get(id));
        } catch (Exception ex) {
            return null;
        }
    }
}
