龙头 | PersistantDataContainer() 说无法解析

Spigot | PersistantDataContainer() says Cannot Resolve

可能是一个愚蠢的问题,但是如果我在我的方法中使用 getPersistentDataContainer() ,就会有一条消息调用 cannot resolve。我该如何解决这个问题?

    private ItemStack createItem(String name, ArrayList<String> lore, Material mat, String itemfunc, int amount) {

    ItemStack iStack = new ItemStack(mat, amount);
    ItemMeta iMeta = iStack.getItemMeta();
    iMeta.getPersistentDataContainer().set(this.ITEMFUNC, PersistentDataType.STRING, itemfunc);
    iMeta.setDisplayName(name);
    iMeta.setLore(lore);
    iStack.setItemMeta(iMeta);


    return iStack;
}

已修复:

<dependency>
        <groupId>com.github.MilkBowl</groupId>
        <artifactId>VaultAPI</artifactId>
        <version>1.7</version>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

仅当您使用 VaultAPI 时,您必须排除 org.bukkit。这样我们就可以从原来的依赖中使用它