Update to Minecraft 1.15

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-12-11 09:00:00 +11:00
parent 1400103b2f
commit 0e142c7f03
293 changed files with 2875 additions and 2648 deletions

View File

@@ -25,7 +25,7 @@ public class ItemFactoryTest extends AbstractTestingBase {
continue;
}
final Class<?> clazz = Class.forName(entryName.substring(0, entryName.length() - ".class".length()).replace('/', '.'));
final Class<?> clazz = Class.forName(entryName.substring(0, entryName.length() - ".class".length()).replace('/', '.'), false, ClassLoader.getSystemClassLoader());
assertThat(entryName, clazz, is(not(nullValue())));
for (final Field field : clazz.getDeclaredFields()) {
if (IAttribute.class.isAssignableFrom(field.getType()) && Modifier.isStatic(field.getModifiers())) {

View File

@@ -144,44 +144,6 @@ public class ItemMetaTest extends AbstractTestingBase {
assertThat(bukkit, is((ItemStack) craft));
}
@Test
public void testNoDamageEquality() {
CraftItemStack noTag = CraftItemStack.asCraftCopy(new ItemStack(Material.SHEARS));
CraftItemStack noDamage = CraftItemStack.asCraftCopy(new ItemStack(Material.SHEARS));
noDamage.handle.setDamage(0);
CraftItemStack enchanted = CraftItemStack.asCraftCopy(new ItemStack(Material.SHEARS));
enchanted.addEnchantment(Enchantment.DIG_SPEED, 1);
CraftItemStack enchantedNoDamage = CraftItemStack.asCraftCopy(new ItemStack(Material.SHEARS));
enchantedNoDamage.addEnchantment(Enchantment.DIG_SPEED, 1);
enchantedNoDamage.handle.setDamage(0);
// check tags:
assertThat("noTag should have no NBT tag", CraftItemStack.hasItemMeta(noTag.handle), is(false));
assertThat("noTag should have no meta", noTag.hasItemMeta(), is(false));
assertThat("noDamage should have no NBT tag", CraftItemStack.hasItemMeta(noDamage.handle), is(false));
assertThat("noDamage should have no meta", noDamage.hasItemMeta(), is(false));
assertThat("enchanted should have NBT tag", CraftItemStack.hasItemMeta(enchanted.handle), is(true));
assertThat("enchanted should have meta", enchanted.hasItemMeta(), is(true));
assertThat("enchantedNoDamage should have NBT tag", CraftItemStack.hasItemMeta(enchantedNoDamage.handle), is(true));
assertThat("enchantedNoDamage should have meta", enchantedNoDamage.hasItemMeta(), is(true));
// check comparisons:
assertThat("noTag and noDamage stacks should be similar", noTag.isSimilar(noDamage), is(true));
assertThat("noTag and noDamage stacks should be equal", noTag.equals(noDamage), is(true));
assertThat("enchanted and enchantedNoDamage stacks should be similar", enchanted.isSimilar(enchantedNoDamage), is(true));
assertThat("enchanted and enchantedNoDamage stacks should be equal", enchanted.equals(enchantedNoDamage), is(true));
assertThat("noTag and enchanted stacks should not be similar", noTag.isSimilar(enchanted), is(false));
assertThat("noTag and enchanted stacks should not be equal", noTag.equals(enchanted), is(false));
}
@Test
public void testBlockStateMeta() {
List<Block> queue = new ArrayList<>();