mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-20 05:21:21 +02:00
Renamed /find to /itemdb
This commit is contained in:
@@ -2,12 +2,13 @@ package com.earth2me.essentials.commands;
|
|||||||
|
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
public class Commandfind extends EssentialsCommand
|
public class Commanditemdb extends EssentialsCommand
|
||||||
{
|
{
|
||||||
public Commandfind()
|
public Commanditemdb()
|
||||||
{
|
{
|
||||||
super("find");
|
super("find");
|
||||||
}
|
}
|
||||||
@@ -15,11 +16,22 @@ public class Commandfind extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
ItemStack itemStack = null;
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
|
{
|
||||||
|
if (sender instanceof Player)
|
||||||
|
{
|
||||||
|
itemStack = ((Player)sender).getItemInHand();
|
||||||
|
}
|
||||||
|
if (itemStack == null)
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
ItemStack itemStack = ess.getItemDb().get(args[0]);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemStack = ess.getItemDb().get(args[0]);
|
||||||
|
}
|
||||||
sender.sendMessage(itemStack.getType().toString() + "- " + itemStack.getTypeId() + ":" + Integer.toString(itemStack.getData().getData()));
|
sender.sendMessage(itemStack.getType().toString() + "- " + itemStack.getTypeId() + ":" + Integer.toString(itemStack.getData().getData()));
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -102,10 +102,10 @@ commands:
|
|||||||
description: Satisfy the hunger.
|
description: Satisfy the hunger.
|
||||||
usage: /<command> [player]
|
usage: /<command> [player]
|
||||||
aliases: [efeed]
|
aliases: [efeed]
|
||||||
find:
|
itemdb:
|
||||||
description: Searches for an item.
|
description: Searches for an item.
|
||||||
usage: /<command> <item>
|
usage: /<command> <item>
|
||||||
aliases: [efind]
|
aliases: [eitemdb]
|
||||||
fireball:
|
fireball:
|
||||||
description: Throw a fireball.
|
description: Throw a fireball.
|
||||||
usage: /<command> [small]
|
usage: /<command> [small]
|
||||||
|
Reference in New Issue
Block a user