Prevent inf loop when adding air to kits.

Should fix #4555
This commit is contained in:
KHobbits 2013-08-12 00:26:09 +01:00
parent c43574eab9
commit e9c0bd3bab
3 changed files with 10 additions and 2 deletions

View file

@ -186,6 +186,11 @@ public class Kit
final String[] parts = kitItem.split(" +"); final String[] parts = kitItem.split(" +");
final ItemStack parseStack = ess.getItemDb().get(parts[0], parts.length > 1 ? Integer.parseInt(parts[1]) : 1); final ItemStack parseStack = ess.getItemDb().get(parts[0], parts.length > 1 ? Integer.parseInt(parts[1]) : 1);
if (parseStack.getTypeId() == 0) {
continue;
}
final MetaItemStack metaStack = new MetaItemStack(parseStack); final MetaItemStack metaStack = new MetaItemStack(parseStack);
if (parts.length > 2) if (parts.length > 2)

View file

@ -150,6 +150,10 @@ public abstract class UserData extends PlayerExtension implements IConf
{ {
try try
{ {
if (getHomes().isEmpty())
{
return null;
}
Location loc; Location loc;
for (String home : getHomes()) for (String home : getHomes())
{ {
@ -476,7 +480,6 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("teleportenabled", set); config.setProperty("teleportenabled", set);
config.save(); config.save();
} }
private List<String> ignoredPlayers; private List<String> ignoredPlayers;
public List<String> _getIgnoredPlayers() public List<String> _getIgnoredPlayers()

View file

@ -94,7 +94,7 @@ public final class InventoryWorkaround
for (int i = 0; i < combined.length; i++) for (int i = 0; i < combined.length; i++)
{ {
final ItemStack item = combined[i]; final ItemStack item = combined[i];
if (item == null) if (item == null || item.getTypeId() == 0)
{ {
continue; continue;
} }