Made the static initializer for BlockType.blockDrops refer to the BlockID constants instead of having the literal IDs.

This commit is contained in:
TomyLobo 2011-09-16 03:32:58 +02:00
parent 19eedecdaf
commit f0308efdd0

View File

@ -23,6 +23,7 @@ import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.sk89q.util.StringUtil; import com.sk89q.util.StringUtil;
/** /**
@ -151,102 +152,102 @@ public enum BlockType {
* Static constructor. * Static constructor.
*/ */
static { static {
blockDrops.put(1, 4); blockDrops.put(BlockID.STONE, BlockID.COBBLESTONE);
blockDrops.put(2, 3); blockDrops.put(BlockID.GRASS, BlockID.DIRT);
blockDrops.put(3, 3); blockDrops.put(BlockID.DIRT, BlockID.DIRT);
blockDrops.put(4, 4); blockDrops.put(BlockID.COBBLESTONE, BlockID.COBBLESTONE);
blockDrops.put(5, 5); blockDrops.put(BlockID.WOOD, BlockID.WOOD);
blockDrops.put(6, 6); blockDrops.put(BlockID.SAPLING, BlockID.SAPLING);
blockDrops.put(7, -1); blockDrops.put(BlockID.BEDROCK, -1);
blockDrops.put(12, 12); blockDrops.put(BlockID.SAND, BlockID.SAND);
blockDrops.put(13, 13); blockDrops.put(BlockID.GRAVEL, BlockID.GRAVEL);
blockDrops.put(14, 14); blockDrops.put(BlockID.GOLD_ORE, BlockID.GOLD_ORE);
blockDrops.put(15, 15); blockDrops.put(BlockID.IRON_ORE, BlockID.IRON_ORE);
blockDrops.put(16, 16); blockDrops.put(BlockID.COAL_ORE, BlockID.COAL_ORE);
blockDrops.put(17, 17); blockDrops.put(BlockID.LOG, BlockID.LOG);
blockDrops.put(18, 18); blockDrops.put(BlockID.LEAVES, BlockID.LEAVES);
blockDrops.put(19, 19); blockDrops.put(BlockID.SPONGE, BlockID.SPONGE);
blockDrops.put(20, 20); // Have to drop glass for //undo blockDrops.put(BlockID.GLASS, BlockID.GLASS); // Have to drop glass for //undo
blockDrops.put(21, 21); // Block damage drops not implemented blockDrops.put(BlockID.LAPIS_LAZULI_ORE, BlockID.LAPIS_LAZULI_ORE); // Block damage drops not implemented
blockDrops.put(22, 22); blockDrops.put(BlockID.LAPIS_LAZULI_BLOCK, BlockID.LAPIS_LAZULI_BLOCK);
blockDrops.put(23, 23); blockDrops.put(BlockID.DISPENSER, BlockID.DISPENSER);
blockDrops.put(24, 24); blockDrops.put(BlockID.SANDSTONE, BlockID.SANDSTONE);
blockDrops.put(25, 25); blockDrops.put(BlockID.NOTE_BLOCK, BlockID.NOTE_BLOCK);
blockDrops.put(26, 355); blockDrops.put(BlockID.BED, ItemType.BED_ITEM.getID());
blockDrops.put(27, 27); blockDrops.put(BlockID.POWERED_RAIL, BlockID.POWERED_RAIL);
blockDrops.put(28, 28); blockDrops.put(BlockID.DETECTOR_RAIL, BlockID.DETECTOR_RAIL);
blockDrops.put(30, 30); blockDrops.put(BlockID.WEB, BlockID.WEB);
blockDrops.put(34, -1); blockDrops.put(BlockID.PISTON_EXTENSION, -1);
blockDrops.put(35, 35); blockDrops.put(BlockID.CLOTH, BlockID.CLOTH);
blockDrops.put(36, -1); blockDrops.put(BlockID.PISTON_MOVING_PIECE, -1);
blockDrops.put(37, 37); blockDrops.put(BlockID.YELLOW_FLOWER, BlockID.YELLOW_FLOWER);
blockDrops.put(38, 38); blockDrops.put(BlockID.RED_FLOWER, BlockID.RED_FLOWER);
blockDrops.put(39, 39); blockDrops.put(BlockID.BROWN_MUSHROOM, BlockID.BROWN_MUSHROOM);
blockDrops.put(40, 40); blockDrops.put(BlockID.RED_MUSHROOM, BlockID.RED_MUSHROOM);
blockDrops.put(41, 41); blockDrops.put(BlockID.GOLD_BLOCK, BlockID.GOLD_BLOCK);
blockDrops.put(42, 42); blockDrops.put(BlockID.IRON_BLOCK, BlockID.IRON_BLOCK);
blockDrops.put(43, 43); blockDrops.put(BlockID.DOUBLE_STEP, BlockID.DOUBLE_STEP);
blockDrops.put(44, 44); blockDrops.put(BlockID.STEP, BlockID.STEP);
blockDrops.put(45, 45); blockDrops.put(BlockID.BRICK, BlockID.BRICK);
blockDrops.put(47, 47); blockDrops.put(BlockID.BOOKCASE, BlockID.BOOKCASE);
blockDrops.put(48, 48); blockDrops.put(BlockID.MOSSY_COBBLESTONE, BlockID.MOSSY_COBBLESTONE);
blockDrops.put(49, 49); blockDrops.put(BlockID.OBSIDIAN, BlockID.OBSIDIAN);
blockDrops.put(50, 50); blockDrops.put(BlockID.TORCH, BlockID.TORCH);
blockDrops.put(53, 53); blockDrops.put(BlockID.WOODEN_STAIRS, BlockID.WOODEN_STAIRS);
blockDrops.put(54, 54); blockDrops.put(BlockID.CHEST, BlockID.CHEST);
blockDrops.put(55, 331); blockDrops.put(BlockID.REDSTONE_WIRE, ItemType.REDSTONE_DUST.getID());
blockDrops.put(56, 264); blockDrops.put(BlockID.DIAMOND_ORE, ItemType.DIAMOND.getID());
blockDrops.put(57, 57); blockDrops.put(BlockID.DIAMOND_BLOCK, BlockID.DIAMOND_BLOCK);
blockDrops.put(58, 58); blockDrops.put(BlockID.WORKBENCH, BlockID.WORKBENCH);
blockDrops.put(59, 295); blockDrops.put(BlockID.CROPS, ItemType.SEEDS.getID());
blockDrops.put(60, 60); blockDrops.put(BlockID.SOIL, BlockID.SOIL);
blockDrops.put(61, 61); blockDrops.put(BlockID.FURNACE, BlockID.FURNACE);
blockDrops.put(62, 61); blockDrops.put(BlockID.BURNING_FURNACE, BlockID.FURNACE);
blockDrops.put(63, 323); blockDrops.put(BlockID.SIGN_POST, ItemType.SIGN.getID());
blockDrops.put(64, 324); blockDrops.put(BlockID.WOODEN_DOOR, ItemType.WOODEN_DOOR_ITEM.getID());
blockDrops.put(65, 65); blockDrops.put(BlockID.LADDER, BlockID.LADDER);
blockDrops.put(66, 66); blockDrops.put(BlockID.MINECART_TRACKS, BlockID.MINECART_TRACKS);
blockDrops.put(67, 67); blockDrops.put(BlockID.COBBLESTONE_STAIRS, BlockID.COBBLESTONE_STAIRS);
blockDrops.put(68, 323); blockDrops.put(BlockID.WALL_SIGN, ItemType.SIGN.getID());
blockDrops.put(69, 69); blockDrops.put(BlockID.LEVER, BlockID.LEVER);
blockDrops.put(70, 70); blockDrops.put(BlockID.STONE_PRESSURE_PLATE, BlockID.STONE_PRESSURE_PLATE);
blockDrops.put(71, 330); blockDrops.put(BlockID.IRON_DOOR, ItemType.IRON_DOOR_ITEM.getID());
blockDrops.put(72, 72); blockDrops.put(BlockID.WOODEN_PRESSURE_PLATE, BlockID.WOODEN_PRESSURE_PLATE);
blockDrops.put(73, 331); blockDrops.put(BlockID.REDSTONE_ORE, ItemType.REDSTONE_DUST.getID());
blockDrops.put(74, 331); blockDrops.put(BlockID.GLOWING_REDSTONE_ORE, ItemType.REDSTONE_DUST.getID());
blockDrops.put(75, 76); blockDrops.put(BlockID.REDSTONE_TORCH_OFF, BlockID.REDSTONE_TORCH_ON);
blockDrops.put(76, 76); blockDrops.put(BlockID.REDSTONE_TORCH_ON, BlockID.REDSTONE_TORCH_ON);
blockDrops.put(77, 77); blockDrops.put(BlockID.STONE_BUTTON, BlockID.STONE_BUTTON);
blockDrops.put(78, 332); blockDrops.put(BlockID.SNOW, ItemType.SNOWBALL.getID());
blockDrops.put(80, 80); blockDrops.put(BlockID.ICE, BlockID.ICE);
blockDrops.put(81, 81); blockDrops.put(BlockID.SNOW_BLOCK, BlockID.SNOW_BLOCK);
blockDrops.put(82, 82); blockDrops.put(BlockID.CLAY, BlockID.CLAY);
blockDrops.put(83, 338); blockDrops.put(BlockID.REED, ItemType.SUGAR_CANE_ITEM.getID());
blockDrops.put(84, 84); blockDrops.put(BlockID.JUKEBOX, BlockID.JUKEBOX);
blockDrops.put(85, 85); blockDrops.put(BlockID.FENCE, BlockID.FENCE);
blockDrops.put(86, 86); blockDrops.put(BlockID.PUMPKIN, BlockID.PUMPKIN);
blockDrops.put(87, 87); blockDrops.put(BlockID.NETHERRACK, BlockID.NETHERRACK);
blockDrops.put(88, 88); blockDrops.put(BlockID.SLOW_SAND, BlockID.SLOW_SAND);
blockDrops.put(89, 348); blockDrops.put(BlockID.LIGHTSTONE, ItemType.LIGHTSTONE_DUST.getID());
blockDrops.put(91, 91); blockDrops.put(BlockID.JACKOLANTERN, BlockID.JACKOLANTERN);
blockDrops.put(92, 354); blockDrops.put(BlockID.CAKE_BLOCK, ItemType.CAKE_ITEM.getID());
blockDrops.put(93, 356); blockDrops.put(BlockID.REDSTONE_REPEATER_OFF, ItemType.REDSTONE_REPEATER.getID());
blockDrops.put(94, 356); blockDrops.put(BlockID.REDSTONE_REPEATER_ON, ItemType.REDSTONE_REPEATER.getID());
blockDrops.put(95, 95); blockDrops.put(BlockID.LOCKED_CHEST, BlockID.LOCKED_CHEST);
blockDrops.put(96, 96); blockDrops.put(BlockID.TRAP_DOOR, BlockID.TRAP_DOOR);
blockDrops.put(97, -1); blockDrops.put(BlockID.SILVERFISH_BLOCK, -1);
blockDrops.put(98, 98); blockDrops.put(BlockID.STONE_BRICK, BlockID.STONE_BRICK);
blockDrops.put(99, 99); blockDrops.put(BlockID.BROWN_MUSHROOM_CAP, BlockID.BROWN_MUSHROOM_CAP); // the wiki has the 2 mushroom caps the other way round
blockDrops.put(100, 100); blockDrops.put(BlockID.RED_MUSHROOM_CAP, BlockID.RED_MUSHROOM_CAP);
blockDrops.put(101, 101); blockDrops.put(BlockID.IRON_BARS, BlockID.IRON_BARS);
blockDrops.put(102, 102); blockDrops.put(BlockID.GLASS_PANE, BlockID.GLASS_PANE);
blockDrops.put(103, 103); blockDrops.put(BlockID.MELON_BLOCK, BlockID.MELON_BLOCK);
blockDrops.put(104, 104); blockDrops.put(BlockID.PUMPKIN_STEM, BlockID.PUMPKIN_STEM);
blockDrops.put(105, 105); blockDrops.put(BlockID.MELON_STEM, BlockID.MELON_STEM);
blockDrops.put(106, -1); blockDrops.put(BlockID.VINE, -1);
blockDrops.put(107, 107); blockDrops.put(BlockID.FENCE_GATE, BlockID.FENCE_GATE);
blockDrops.put(108, 45); blockDrops.put(BlockID.BRICK_STAIRS, BlockID.BRICK);
blockDrops.put(109, 98); blockDrops.put(BlockID.STONE_BRICK_STAIRS, BlockID.STONE_BRICK);
} }
/** /**