mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-06 16:37:55 +01:00
Revert the last 2 commits and actually fix the right one.
This commit is contained in:
parent
ce9e630072
commit
af10a2050a
@ -169,7 +169,7 @@ public class Trade
|
|||||||
{
|
{
|
||||||
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
|
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
|
||||||
}
|
}
|
||||||
user.getInventory().removeItem(getItemStack().clone());
|
user.getInventory().removeItem(getItemStack());
|
||||||
user.updateInventory();
|
user.updateInventory();
|
||||||
}
|
}
|
||||||
if (command != null)
|
if (command != null)
|
||||||
|
@ -39,12 +39,12 @@ public class Commandhat extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
if (user.getItemInHand().getType() != Material.AIR)
|
if (user.getItemInHand().getType() != Material.AIR)
|
||||||
{
|
{
|
||||||
final ItemStack hand = user.getItemInHand();
|
final ItemStack hand = user.getItemInHand().clone();
|
||||||
if (hand.getType().getMaxDurability() == 0)
|
if (hand.getType().getMaxDurability() == 0)
|
||||||
{
|
{
|
||||||
final PlayerInventory inv = user.getInventory();
|
final PlayerInventory inv = user.getInventory();
|
||||||
final ItemStack head = inv.getHelmet();
|
final ItemStack head = inv.getHelmet();
|
||||||
inv.removeItem(hand.clone());
|
inv.removeItem(hand);
|
||||||
inv.setHelmet(hand);
|
inv.setHelmet(hand);
|
||||||
inv.setItemInHand(head);
|
inv.setItemInHand(head);
|
||||||
user.sendMessage(_("hatPlaced"));
|
user.sendMessage(_("hatPlaced"));
|
||||||
|
@ -157,7 +157,7 @@ public class Commandsell extends EssentialsCommand
|
|||||||
// This should never happen.
|
// This should never happen.
|
||||||
throw new IllegalStateException("Trying to remove more items than are available.");
|
throw new IllegalStateException("Trying to remove more items than are available.");
|
||||||
}
|
}
|
||||||
user.getInventory().removeItem(ris.clone());
|
user.getInventory().removeItem(ris);
|
||||||
user.updateInventory();
|
user.updateInventory();
|
||||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, 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.giveMoney(worth * amount);
|
||||||
|
Loading…
Reference in New Issue
Block a user