Class ItemsRegistry
java.lang.Object
net.chen.legacyLand.item.ItemsRegistry
物品注册中心,模仿 Fabric Registry 风格
用法:
public static final CustomItem MERCURY_THERMOMETER =
ItemsRegistry.register("mercury_thermometer", new ThermometerItem());
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomItemfromStack(org.bukkit.inventory.ItemStack stack) 从 ItemStack 反查 CustomItem 实例static CustomItem通过 ID 获取 CustomItem 实例static Map<String, CustomItem> getAll()static StringgetItemId(org.bukkit.inventory.ItemStack stack) 从 ItemStack 的 PDC 中读取 item_idstatic org.bukkit.inventory.ItemStack通过 ID 生成 ItemStackstatic <T extends CustomItem>
T注册自定义物品
-
Method Details
-
register
注册自定义物品 -
get
通过 ID 获取 CustomItem 实例 -
make
通过 ID 生成 ItemStack -
getItemId
从 ItemStack 的 PDC 中读取 item_id -
fromStack
从 ItemStack 反查 CustomItem 实例 -
getAll
-