Fixed FriendsGUI not removing ghost items when redrawing page

This commit is contained in:
libraryaddict 2015-02-12 04:08:43 +13:00
parent 9bdf248643
commit 858a6fb674

View File

@ -110,9 +110,20 @@ public class FriendsGUI implements Listener
int slot = i + 18; int slot = i + 18;
if (friendSlot >= friends.size()) if (friendSlot >= friends.size())
{
ItemStack item = _inventory.getItem(slot);
if (item == null || item.getType() == Material.AIR)
{ {
break; break;
} }
else
{
_inventory.setItem(slot, new ItemStack(Material.AIR));
continue;
}
}
FriendStatus friend = friends.get(friendSlot); FriendStatus friend = friends.get(friendSlot);
@ -244,9 +255,20 @@ public class FriendsGUI implements Listener
int slot = i + 18; int slot = i + 18;
if (friendSlot >= friends.size()) if (friendSlot >= friends.size())
{
ItemStack item = _inventory.getItem(slot);
if (item == null || item.getType() == Material.AIR)
{ {
break; break;
} }
else
{
_inventory.setItem(slot, new ItemStack(Material.AIR));
continue;
}
}
FriendStatus friend = friends.get(friendSlot); FriendStatus friend = friends.get(friendSlot);
@ -445,9 +467,20 @@ public class FriendsGUI implements Listener
final int slot = i + 18; final int slot = i + 18;
if (friendSlot >= friends.size()) if (friendSlot >= friends.size())
{
ItemStack item = _inventory.getItem(slot);
if (item == null || item.getType() == Material.AIR)
{ {
break; break;
} }
else
{
_inventory.setItem(slot, new ItemStack(Material.AIR));
continue;
}
}
FriendStatus friend = friends.get(friendSlot); FriendStatus friend = friends.get(friendSlot);