Fix item drop on trade signs, if player inventory is full.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1257 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-21 16:37:37 +00:00
parent e08bba4db3
commit 5fbee1f39e

View File

@ -94,7 +94,10 @@ public class EssentialsEcoPlayerListener extends PlayerListener
}
else if (i1 != null)
{
user.getInventory().addItem(i1);
Map<Integer, ItemStack> leftOver = user.getInventory().addItem(i1);
for (ItemStack itemStack : leftOver.values()) {
user.getWorld().dropItem(user.getLocation(), itemStack);
}
user.updateInventory();
}
r1 = 0;
@ -122,8 +125,12 @@ public class EssentialsEcoPlayerListener extends PlayerListener
if (m2)
user.giveMoney(q2);
else
user.getInventory().addItem(qi2);
else {
Map<Integer, ItemStack> leftOver = user.getInventory().addItem(qi2);
for (ItemStack itemStack : leftOver.values()) {
user.getWorld().dropItem(user.getLocation(), itemStack);
}
}
user.updateInventory();