mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 07:34:48 +01:00
parent
c0d9b8db7c
commit
37d4b08ff4
1 changed files with 17 additions and 0 deletions
|
@ -29,6 +29,7 @@ import org.bukkit.craftbukkit.inventory.ItemStackTest.BukkitWrapper;
|
|||
import org.bukkit.craftbukkit.inventory.ItemStackTest.CraftWrapper;
|
||||
import org.bukkit.craftbukkit.inventory.ItemStackTest.StackProvider;
|
||||
import org.bukkit.craftbukkit.inventory.ItemStackTest.StackWrapper;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Axolotl;
|
||||
import org.bukkit.entity.TropicalFish;
|
||||
|
@ -48,6 +49,7 @@ import org.bukkit.inventory.meta.KnowledgeBookMeta;
|
|||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
import org.bukkit.inventory.meta.MapMeta;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.inventory.meta.SpawnEggMeta;
|
||||
import org.bukkit.inventory.meta.TropicalFishBucketMeta;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
@ -184,6 +186,21 @@ public class ItemMetaTest extends AbstractTestingBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSpawnEggsHasMeta() {
|
||||
for (Item item : BuiltInRegistries.ITEM) {
|
||||
if (item instanceof net.minecraft.world.item.ItemMonsterEgg) {
|
||||
Material material = CraftMagicNumbers.getMaterial(item);
|
||||
CraftMetaItem baseMeta = (CraftMetaItem) Bukkit.getItemFactory().getItemMeta(material);
|
||||
ItemMeta baseMetaItem = CraftItemStack.getItemMeta(item.getDefaultInstance());
|
||||
|
||||
assertTrue(material + " is not handled in CraftItemFactory", baseMeta instanceof CraftMetaSpawnEgg);
|
||||
assertTrue(material + " is not applicable to CraftMetaSpawnEgg", baseMeta.applicableTo(material));
|
||||
assertTrue(material + " is not handled in CraftItemStack", baseMetaItem instanceof SpawnEggMeta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEachExtraData() {
|
||||
final List<StackProvider> providers = Arrays.asList(
|
||||
|
|
Loading…
Reference in a new issue