Unit tests for Material.isItem

Dieser Commit ist enthalten in:
md_5 2018-01-16 09:57:47 +11:00
Ursprung bd308430b5
Commit bdcc7c7b02

Datei anzeigen

@ -162,4 +162,22 @@ public class PerMaterialTest extends AbstractTestingBase {
assertFalse(EnchantmentTarget.BREAKABLE.includes(material)); assertFalse(EnchantmentTarget.BREAKABLE.includes(material));
} }
} }
@Test
public void testBlock() {
if (material == Material.AIR) {
assertTrue(material.isBlock());
} else {
assertThat(material.isBlock(), is(equalTo(CraftMagicNumbers.getBlock(material) != Blocks.AIR)));
}
}
@Test
public void testAir() {
if (material == Material.AIR) {
assertTrue(material.isItem());
} else {
assertThat(material.isItem(), is(equalTo(CraftMagicNumbers.getItem(material) != null)));
}
}
} }