ArrayList, I choose you! (Fixes CraftBook erroring when the killall command is used and custom drops are enabled in that plugin)

This commit is contained in:
md_5 2013-01-04 13:49:45 +11:00
parent 2232d859fd
commit ef8bd3422a

View file

@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Locale; import java.util.Locale;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -10,6 +11,7 @@ import org.bukkit.World;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemStack;
public class Commandkillall extends EssentialsCommand public class Commandkillall extends EssentialsCommand
@ -120,7 +122,7 @@ public class Commandkillall extends EssentialsCommand
{ {
if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob) if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob)
{ {
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event); ess.getServer().getPluginManager().callEvent(event);
entity.remove(); entity.remove();
numKills++; numKills++;
@ -130,7 +132,7 @@ public class Commandkillall extends EssentialsCommand
{ {
if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime) if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime)
{ {
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event); ess.getServer().getPluginManager().callEvent(event);
entity.remove(); entity.remove();
numKills++; numKills++;