Search in sources :

Example 1 with MissingArgumentException

use of logisticspipes.commands.exception.MissingArgumentException in project LogisticsPipes by RS485.

the class NameLookupCommand method executeCommand.

@Override
public void executeCommand(ICommandSender sender, String[] args) {
    if (args.length < 2) {
        throw new MissingArgumentException();
    }
    String idString = args[0];
    String metaString = args[1];
    int id = Integer.valueOf(idString);
    int meta = Integer.valueOf(metaString);
    ItemIdentifier item = ItemIdentifier.get(Item.getItemById(id), meta, null);
    sender.addChatMessage(new ChatComponentText("Name: " + item.getFriendlyNameCC()));
}
Also used : ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) MissingArgumentException(logisticspipes.commands.exception.MissingArgumentException) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

MissingArgumentException (logisticspipes.commands.exception.MissingArgumentException)1 ItemIdentifier (logisticspipes.utils.item.ItemIdentifier)1 ChatComponentText (net.minecraft.util.ChatComponentText)1