mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-24 18:18:29 +01:00
Merge diff from krnlyng:
Adjust item spawn, to allow for match native names.
This commit is contained in:
parent
db50d455df
commit
47c8217511
@ -163,6 +163,11 @@ public class ItemDb implements IConf
|
||||
metaData = durabilities.get(itemname);
|
||||
}
|
||||
}
|
||||
else if(Material.getMaterial(itemname) != null)
|
||||
{
|
||||
itemid = Material.getMaterial(itemname).getId();
|
||||
metaData = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(Util.format("unknownItemName", id));
|
||||
|
@ -50,7 +50,7 @@ public class Commandgive extends EssentialsCommand
|
||||
}
|
||||
|
||||
User giveTo = getPlayer(server, args, 0);
|
||||
String itemName = stack.getType().name().toLowerCase().replace('_', ' ');
|
||||
String itemName = stack.getType().toString().toLowerCase().replace('_', ' ');
|
||||
charge(sender);
|
||||
sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + ".");
|
||||
giveTo.getInventory().addItem(stack);
|
||||
|
@ -46,7 +46,7 @@ public class Commanditem extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
String itemName = stack.getType().name().toLowerCase().replace('_', ' ');
|
||||
String itemName = stack.getType().toString().toLowerCase().replace('_', ' ');
|
||||
charge(user);
|
||||
user.sendMessage(Util.format("itemSpawn", stack.getAmount(), itemName));
|
||||
user.getInventory().addItem(stack);
|
||||
|
Loading…
Reference in New Issue
Block a user