3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

Made ItemType.usesDamageValue a bit more sane.

Dieser Commit ist enthalten in:
TomyLobo 2011-11-03 18:34:20 +01:00
Ursprung ff39121fc8
Commit d9b8285a35

Datei anzeigen

@ -558,6 +558,80 @@ public enum ItemType {
return shouldNotStack.contains(id);
}
private static final Set<Integer> usesDamageValue = new HashSet<Integer>();
static {
usesDamageValue.add(BlockID.SAPLING);
//usesDamageValue.add(BlockID.WATER);
//usesDamageValue.add(BlockID.STATIONARY_WATER);
//usesDamageValue.add(BlockID.LAVA);
//usesDamageValue.add(BlockID.STATIONARY_LAVA);
usesDamageValue.add(BlockID.LOG);
usesDamageValue.add(BlockID.LEAVES);
//usesDamageValue.add(BlockID.DISPENSER);
//usesDamageValue.add(BlockID.BED);
//usesDamageValue.add(BlockID.POWERED_RAIL);
//usesDamageValue.add(BlockID.DETECTOR_RAIL);
//usesDamageValue.add(BlockID.PISTON_STICKY_BASE);
//usesDamageValue.add(BlockID.LONG_GRASS);
//usesDamageValue.add(BlockID.PISTON_BASE);
//usesDamageValue.add(BlockID.PISTON_EXTENSION);
usesDamageValue.add(BlockID.CLOTH);
usesDamageValue.add(BlockID.DOUBLE_STEP);
usesDamageValue.add(BlockID.STEP);
//usesDamageValue.add(BlockID.TORCH);
//usesDamageValue.add(BlockID.FIRE);
//usesDamageValue.add(BlockID.WOODEN_STAIRS);
//usesDamageValue.add(BlockID.CHEST);
//usesDamageValue.add(BlockID.REDSTONE_WIRE);
//usesDamageValue.add(BlockID.CROPS);
//usesDamageValue.add(BlockID.SOIL);
//usesDamageValue.add(BlockID.FURNACE);
//usesDamageValue.add(BlockID.BURNING_FURNACE);
//usesDamageValue.add(BlockID.SIGN_POST);
//usesDamageValue.add(BlockID.WOODEN_DOOR);
//usesDamageValue.add(BlockID.LADDER);
//usesDamageValue.add(BlockID.MINECART_TRACKS);
//usesDamageValue.add(BlockID.COBBLESTONE_STAIRS);
//usesDamageValue.add(BlockID.WALL_SIGN);
//usesDamageValue.add(BlockID.LEVER);
//usesDamageValue.add(BlockID.STONE_PRESSURE_PLATE);
//usesDamageValue.add(BlockID.IRON_DOOR);
//usesDamageValue.add(BlockID.WOODEN_PRESSURE_PLATE);
//usesDamageValue.add(BlockID.REDSTONE_TORCH_OFF);
//usesDamageValue.add(BlockID.REDSTONE_TORCH_ON);
//usesDamageValue.add(BlockID.STONE_BUTTON);
//usesDamageValue.add(BlockID.SNOW);
//usesDamageValue.add(BlockID.CACTUS);
//usesDamageValue.add(BlockID.REED);
//usesDamageValue.add(BlockID.JUKEBOX);
//usesDamageValue.add(BlockID.PUMPKIN);
//usesDamageValue.add(BlockID.JACKOLANTERN);
//usesDamageValue.add(BlockID.CAKE_BLOCK);
//usesDamageValue.add(BlockID.REDSTONE_REPEATER_OFF);
//usesDamageValue.add(BlockID.REDSTONE_REPEATER_ON);
//usesDamageValue.add(BlockID.TRAP_DOOR);
//usesDamageValue.add(BlockID.SILVERFISH_BLOCK);
usesDamageValue.add(BlockID.STONE_BRICK);
//usesDamageValue.add(BlockID.RED_MUSHROOM_CAP);
//usesDamageValue.add(BlockID.BROWN_MUSHROOM_CAP);
//usesDamageValue.add(BlockID.PUMPKIN_STEM);
//usesDamageValue.add(BlockID.MELON_STEM);
//usesDamageValue.add(BlockID.VINE);
//usesDamageValue.add(BlockID.FENCE_GATE);
//usesDamageValue.add(BlockID.BRICK_STAIRS);
//usesDamageValue.add(BlockID.STONE_BRICK_STAIRS);
//usesDamageValue.add(BlockID.NETHER_BRICK_STAIRS);
//usesDamageValue.add(BlockID.NETHER_WART);
//usesDamageValue.add(BlockID.ENCHANTMENT_TABLE);
//usesDamageValue.add(BlockID.BREWING_STAND);
//usesDamageValue.add(BlockID.CAULDRON);
//usesDamageValue.add(BlockID.END_PORTAL_FRAME);
usesDamageValue.add(ItemID.COAL);
usesDamageValue.add(ItemID.INK_SACK);
usesDamageValue.add(ItemID.POTION);
usesDamageValue.add(ItemID.GLASS_BOTTLE);
}
/**
* Returns true if an item uses its damage value for something
* other than damage.
@ -566,11 +640,6 @@ public enum ItemType {
* @return
*/
public static boolean usesDamageValue(int id) {
return id == ItemID.COAL
|| id == ItemID.INK_SACK
|| id == ItemID.POTION
|| id == ItemID.GLASS_BOTTLE
// for material only, orientation data is not stored in inventory anyway
|| BlockType.usesData(id);
return usesDamageValue.contains(id);
}
}