java - Spigot Material WOOL doesn't exist anymore
问题描述
I'm working on a big spigot plugin with a menu made with an inventory, and in this inventory, I add wools like choices for the player.
I use the following line to create my ItemStack:
ItemStack i = new ItemStack(Material.WOOL);
But I have the following error since spigot was updated in 1.13:
WOOL cannot be resolved or is not a field
Does someone know why, and how to update through the correct way?
解决方案
在 Spigot 1.13 中,材质略有不同,每种颜色的羊毛都有自己的名称。
更多信息:Spigot 文档
例如,如果您需要白色羊毛(它是 的默认颜色Material.WOOL
),您将需要Material.WHITE_WOOL
,并且您的代码将是:
ItemStack i = new ItemStack(Material.WHITE_WOOL);
推荐阅读
- java - Spring Web 应用程序架构中的上下文级别
- vbscript - VBScript 挂在 CopyFile 操作上
- random - 在 Bigquery legacy 中生成随机数
- php - 带有 AJAX 的 Symfony 4 验证器
- swift - XCUITest:与具有许多单元格的表格进行交互
- postgresql - SQLAlchemy - 通过 Flask 运行时出现 Postgres 连接问题
- javascript - 仅在带有动画的 Firefox 上进行文本模糊
- python - 如何在 python 中运行 ipython 脚本?
- node.js - ZSCAN 结果输出应该是有序的方法
- git - 如何自动推送 TortoiseGit