All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.command.tree.node.ItemNode Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.command.tree.node;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import cn.nukkit.item.Item;

/**
 * 解析对应参数为{@link Item}值
 * 

* 所有命令枚举{@link cn.nukkit.command.data.CommandEnum#ENUM_ITEM ENUM_ITEM}如果没有手动指定{@link IParamNode},则会默认使用这个解析 */ @PowerNukkitXOnly @Since("1.19.60-r1") public class ItemNode extends ParamNode { @Override public void fill(String arg) { Item item = Item.fromString(arg); if (item.getId() == 0) { error(); return; } this.value = item; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy