Fix 1.18 merge

Handle comment out test cases
This commit is contained in:
DerFrZocker 2021-12-04 22:29:39 +01:00
parent 0988647e06
commit bbe3f79102
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
5 changed files with 7 additions and 106 deletions

View file

@ -2221,6 +2221,10 @@ public interface Material extends Keyed, Comparable<Material> {
return Bukkit.getUnsafe().fromLegacy(match);
}
if (name == null) {
return null;
}
if (name.startsWith(LEGACY_PREFIX)) {
return Bukkit.getUnsafe().getLegacyMaterial(name);
} else {

View file

@ -19,7 +19,7 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
public static final Biome OCEAN = getBiome("ocean");
public static final Biome PLAINS = getBiome("plains");
public static final Biome DESERT = getBiome("desert");
public static final Biome WINDSWEPT_HILLS = getBiome("windswept_Hills");
public static final Biome WINDSWEPT_HILLS = getBiome("windswept_hills");
public static final Biome FOREST = getBiome("forest");
public static final Biome TAIGA = getBiome("taiga");
public static final Biome SWAMP = getBiome("swamp");

View file

@ -1034,6 +1034,7 @@ public interface ItemType extends Material {
ItemType MUSIC_DISC_WARD = asItemType(Material.MUSIC_DISC_WARD);
ItemType MUSIC_DISC_11 = asItemType(Material.MUSIC_DISC_11);
ItemType MUSIC_DISC_WAIT = asItemType(Material.MUSIC_DISC_WAIT);
ItemType MUSIC_DISC_OTHERSIDE = asItemType(Material.MUSIC_DISC_OTHERSIDE);
ItemType MUSIC_DISC_PIGSTEP = asItemType(Material.MUSIC_DISC_PIGSTEP);
ItemType TRIDENT = asItemType(Material.TRIDENT);
ItemType PHANTOM_MEMBRANE = asItemType(Material.PHANTOM_MEMBRANE);

View file

@ -1,47 +0,0 @@
package org.bukkit;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.support.AbstractTestingBase;
import org.junit.Ignore;
import org.junit.Test;
@Ignore
public class ArtTest extends AbstractTestingBase {
@Test(expected = IllegalArgumentException.class)
public void getByNullName() {
Art.getByName(null);
}
@Test
public void getById() {
for (Art art : Art.values()) {
assertThat(Art.getById(art.getId()), is(art));
}
}
@Test
public void getByName() {
for (Art art : Art.values()) {
assertThat(Art.getByName(art.toString()), is(art));
}
}
@Test
@Ignore // Values are now pulled directly from the
public void dimensionSanityCheck() {
for (Art art : Art.values()) {
assertThat(art.getBlockHeight(), is(greaterThan(0)));
assertThat(art.getBlockWidth(), is(greaterThan(0)));
}
}
@Test
public void getByNameWithMixedCase() {
Art subject = Art.values()[0];
String name = subject.toString().replace('E', 'e');
assertThat(Art.getByName(name), is(subject));
}
}

View file

@ -1,75 +1,18 @@
package org.bukkit;
/*
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import org.bukkit.material.MaterialData;
import org.junit.Test;
*/
public class MaterialTest {
/*
@Test
public void getByName() {
for (Material material : Material.values()) {
assertThat(Material.getMaterial(material.toString()), is(material));
}
}
@Test
public void getByNameNull() {
assertThat(Material.getMaterial(null), is(nullValue()));
}
@Test
public void getData() {
for (Material material : Material.values()) {
if (!material.isLegacy()) {
continue;
}
Class<? extends MaterialData> clazz = material.getData();
assertThat(material.getNewData((byte) 0), is(instanceOf(clazz)));
}
}
@Test(expected = IllegalArgumentException.class)
public void matchMaterialByNull() {
Material.matchMaterial(null);
}
@Test
public void matchMaterialByName() {
for (Material material : Material.values()) {
assertThat(Material.matchMaterial(material.toString()), is(material));
}
}
@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()) {
String name = material.toString().replaceAll("_", " ").toLowerCase(java.util.Locale.ENGLISH);
assertThat(Material.matchMaterial(name), is(material));
}
}
*/
}