mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 10:44:39 +01:00
Unit tests for Material.isItem
By: md_5 <git@md-5.net>
This commit is contained in:
parent
b7e9ff9023
commit
4cb801b840
1 changed files with 18 additions and 0 deletions
|
@ -162,4 +162,22 @@ public class PerMaterialTest extends AbstractTestingBase {
|
|||
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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue