summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2013-02-17 15:17:47 +0100
committersnowleo <schneeleo@gmail.com>2013-02-17 15:17:47 +0100
commitf016ca922080ece7943d80112ee78af5adc275a7 (patch)
tree77403b86430af83737c8195c243962f969cbb788
parent93b328d8f4220e11f1ef4416d38ca15646e90d2f (diff)
downloadEssentials-f016ca922080ece7943d80112ee78af5adc275a7.tar
Essentials-f016ca922080ece7943d80112ee78af5adc275a7.tar.gz
Essentials-f016ca922080ece7943d80112ee78af5adc275a7.tar.lz
Essentials-f016ca922080ece7943d80112ee78af5adc275a7.tar.xz
Essentials-f016ca922080ece7943d80112ee78af5adc275a7.zip
Revert the last 2 commits and actually fix the right one.
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhat.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index 3d51c5aa4..1a03a0145 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -169,7 +169,7 @@ public class Trade
{
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
- user.getInventory().removeItem(getItemStack().clone());
+ user.getInventory().removeItem(getItemStack());
user.updateInventory();
}
if (command != null)
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
index 703d8e5f7..cb1046685 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
@@ -39,12 +39,12 @@ public class Commandhat extends EssentialsCommand
{
if (user.getItemInHand().getType() != Material.AIR)
{
- final ItemStack hand = user.getItemInHand();
+ final ItemStack hand = user.getItemInHand().clone();
if (hand.getType().getMaxDurability() == 0)
{
final PlayerInventory inv = user.getInventory();
final ItemStack head = inv.getHelmet();
- inv.removeItem(hand.clone());
+ inv.removeItem(hand);
inv.setHelmet(hand);
inv.setItemInHand(head);
user.sendMessage(_("hatPlaced"));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index b238361b2..a7b1ae32d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -157,7 +157,7 @@ public class Commandsell extends EssentialsCommand
// This should never happen.
throw new IllegalStateException("Trying to remove more items than are available.");
}
- user.getInventory().removeItem(ris.clone());
+ user.getInventory().removeItem(ris);
user.updateInventory();
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);