Removing drops at initializing

Closes gh-269
This commit is contained in:
Tim Düsterhus 2011-08-21 23:00:03 +02:00
parent 5f0bc9f2b8
commit 2c25017b40

View File

@ -11,6 +11,9 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
@ -91,7 +94,7 @@ public class Warzone {
// perfect match, return right away
return warzone;
} else if (warzone.getName().toLowerCase().startsWith(name.toLowerCase())) {
// prehaps there's a perfect match in the remaining zones, let's take this one aside
// prehaps there's a perfect match in the remaining zones, let's take this one aside
bestGuess = warzone;
}
}
@ -259,6 +262,16 @@ public class Warzone {
}
this.flagThieves.clear();
// nom drops
for(Entity entity : (this.getWorld().getEntities())) {
if (!(entity instanceof Item) && !(entity instanceof CraftItem)) continue;
// validate position
if (!this.getVolume().contains(entity.getLocation())) continue;
// omnomnomnom
entity.remove();
}
}
public void endRound() {