mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 20:12:54 +00:00
Add support for /worth all and /worth hand
This commit is contained in:
parent
d044ba2fb9
commit
a14104c529
21 changed files with 208 additions and 123 deletions
|
@ -141,10 +141,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
retval.setDurability(metaData);
|
||||
return retval;
|
||||
}
|
||||
|
||||
public List<ItemStack> getMatching (User user, String[] args) throws Exception {
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getMatching(User user, String[] args) throws Exception
|
||||
{
|
||||
List<ItemStack> is = new ArrayList<ItemStack>();
|
||||
|
||||
|
||||
if (args[0].equalsIgnoreCase("hand"))
|
||||
{
|
||||
is.add(user.getItemInHand());
|
||||
|
@ -158,7 +160,7 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
continue;
|
||||
}
|
||||
is.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("blocks"))
|
||||
{
|
||||
|
@ -171,13 +173,18 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
is.add(stack);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (args.length > 0)
|
||||
{
|
||||
is.add(get(args[0]));
|
||||
}
|
||||
else {
|
||||
is.add(user.getItemInHand());
|
||||
}
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String names(ItemStack item)
|
||||
{
|
||||
ItemData itemData = new ItemData(item.getTypeId(), item.getDurability());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue