mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-28 12:07:38 +01:00
Revert "Merge pull request #286 from GunfighterJ/2.9"
This reverts commit57de3f3ed2
, reversing changes made to76d1ea5cab
.
This commit is contained in:
parent
57de3f3ed2
commit
a64cb31211
@ -43,7 +43,7 @@ public class Commandsell extends EssentialsCommand
|
||||
}
|
||||
try
|
||||
{
|
||||
totalWorth += sellItem(user, stack, args, true);
|
||||
totalWorth += sellItem(user, stack, args, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -164,23 +164,11 @@ public class Commandsell extends EssentialsCommand
|
||||
}
|
||||
|
||||
//TODO: Prices for Enchantments
|
||||
ItemStack[] pinv = user.getInventory().getContents();
|
||||
int itemIndex = -1;
|
||||
for (int i = 0; i < pinv.length; i++)
|
||||
{
|
||||
if (pinv[i] != null)
|
||||
{
|
||||
if (pinv[i].getType() == is.getType() && pinv[i].getDurability() == is.getDurability())
|
||||
{
|
||||
itemIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pinv[itemIndex].setAmount(pinv[itemIndex].getAmount() - amount);
|
||||
user.getInventory().setContents(pinv);
|
||||
final ItemStack ris = is.clone();
|
||||
ris.setAmount(amount);
|
||||
user.getInventory().removeItem(ris);
|
||||
user.updateInventory();
|
||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(pinv[itemIndex], ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
|
||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
|
||||
user.giveMoney(worth * amount);
|
||||
user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess)));
|
||||
logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess)));
|
||||
|
Loading…
Reference in New Issue
Block a user