Update material values

This commit is contained in:
h31ix committed 2013-03-15 15:57:12 -04:00
1 parent e481af55cc
commit 5f1ac209d4
3 files changed
+74 -6

No files matched your search

@@ -43,10 +43,14 @@ public enum BlockHardness {
LAPIS_ORE(Material.LAPIS_ORE, 3.00D),
LAPIS_BLOCK(Material.LAPIS_BLOCK, 3.00D),
DISPENSER(Material.DISPENSER, 3.50D),
DROPPER(Material.DROPPER, 3.50D),
SANDSTONE(Material.SANDSTONE, 0.80D),
NOTE_BLOCK(Material.NOTE_BLOCK, 0.80D),
BED(Material.BED, 0.20D),
RAILS(Material.RAILS, 0.70D),
DETECTOR_RAIL(Material.DETECTOR_RAIL, 0.70D),
POWERED_RAIL(Material.POWERED_RAIL, 0.70D),
ACTIVATOR_RAIL(Material.ACTIVATOR_RAIL, 0.70D),
WEB(Material.WEB, 4.00D),
LONG_GRASS(Material.LONG_GRASS, 0.00D),
DEAD_BUSH(Material.DEAD_BUSH, 0.00D),
@@ -68,6 +72,7 @@ public enum BlockHardness {
FIRE(Material.FIRE, 0.00D),
MOB_SPAWNER(Material.MOB_SPAWNER, 5.00D),
CHEST(Material.CHEST, 2.50D),
TRAPPED_CHEST(Material.TRAPPED_CHEST, 2.50D),
REDSTONE_WIRE(Material.REDSTONE_WIRE, 0.00D),
DIAMOND_ORE(Material.DIAMOND_ORE, 3.00D),
DIAMOND_BLOCK(Material.DIAMOND_BLOCK, 5.00D),
@@ -77,15 +82,24 @@ public enum BlockHardness {
BURNING_FURNACE(Material.BURNING_FURNACE, 3.50D),
WOODEN_DOOR(Material.WOODEN_DOOR, 3.00D),
LADDER(Material.LADDER, 0.40D),
RAILS(Material.RAILS, 0.70D),
LEVER(Material.LEVER, 0.50D),
STONE_PLATE(Material.STONE_PLATE, 0.50D),
IRON_DOOR_BLOCK(Material.IRON_DOOR_BLOCK, 5.00D),
HOPPER(Material.HOPPER, 2.00D),
STONE_PLATE(Material.STONE_PLATE, 0.50D),
WOOD_PLATE(Material.WOOD_PLATE, 0.50D),
GOLD_PLATE(Material.GOLD_PLATE, 0.50D),
IRON_PLATE(Material.IRON_PLATE, 0.50D),
QUARTZ_BLOCK(Material.QUARTZ_BLOCK, 0.80D),
QUARTZ_ORE(Material.QUARTZ_ORE, 3.00D),
QUARTZ_STAIRS(Material.QUARTZ_STAIRS, 0.80D),
REDSTONE_BLOCK(Material.REDSTONE_BLOCK, 5.00D),
REDSTONE_ORE(Material.REDSTONE_ORE, 3.00D),
GLOWING_REDSTONE_ORE(Material.GLOWING_REDSTONE_ORE, 3.00D),
REDSTONE_TORCH_OFF(Material.REDSTONE_TORCH_OFF, 0.00D),
REDSTONE_TORCH_ON(Material.REDSTONE_TORCH_ON, 0.00D),
REDSTONE_COMPARATOR_OFF(Material.REDSTONE_COMPARATOR_OFF, 0.00D),
REDSTONE_COMPARATOR_ON(Material.REDSTONE_COMPARATOR_ON, 0.00D),
DAYLIGHT_DETECTOR(Material.DAYLIGHT_DETECTOR, 0.20D),
STONE_BUTTON(Material.STONE_BUTTON, 0.50D),
SNOW(Material.SNOW, 0.10D),
ICE(Material.ICE, 0.50D),
@@ -134,7 +148,6 @@ public enum BlockHardness {
HUGE_MUSHROOM_1(Material.HUGE_MUSHROOM_1, 0.20D),
HUGE_MUSHROOM_2(Material.HUGE_MUSHROOM_2, 0.20D),
BED_BLOCK(Material.BED_BLOCK, 0.20D),
POWERED_RAIL(Material.POWERED_RAIL, 0.70D),
WOOD_STAIRS(Material.WOOD_STAIRS, 2.00D),
COBBLESTONE_STAIRS(Material.COBBLESTONE_STAIRS, 2.00D),
BRICK_STAIRS(Material.BRICK_STAIRS, 2.00D),
@@ -0,0 +1,45 @@
/*
* AntiCheat for Bukkit.
* Copyright (C) 2012-2013 AntiCheat Team | http://gravitydevelopment.net
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.h31ix.anticheat.util;
import org.bukkit.Material;
import org.junit.Assert;
import org.junit.Test;
public class BlockHardnessTest {
@Test
public void verifyExistence() {
for(Material m : Material.values()) {
if(!BlockHardness.hasBlockHardness(m) && m.isBlock() && m != Material.AIR && m != Material.BEDROCK) {
Assert.fail("Material " + m + " is not accounted for by BlockHardness");
}
}
}
@Test
public void verifyName() {
for(Material m : Material.values()) {
BlockHardness hardness = BlockHardness.getHardness(m);
if(hardness != null && !hardness.name().equals(m.name())) {
Assert.fail("BlockHardness " + hardness + " and its material " + m + " have mismatched names");
}
}
}
}