mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Make matchMaterial accept the minecraft: namespace
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -43,6 +43,26 @@ public class MaterialTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchMaterialByKey() {
|
||||
for (Material material : Material.values()) {
|
||||
if (material.isLegacy()) {
|
||||
continue;
|
||||
}
|
||||
assertThat(Material.matchMaterial(material.getKey().toString()), is(material));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchMaterialByWrongNamespace() {
|
||||
for (Material material : Material.values()) {
|
||||
if (material.isLegacy()) {
|
||||
continue;
|
||||
}
|
||||
assertNull(Material.matchMaterial("bogus:" + material.getKey().getKey()));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchMaterialByLowerCaseAndSpaces() {
|
||||
for (Material material : Material.values()) {
|
||||
|
Reference in New Issue
Block a user