Class SimpleWorldPurger
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.SimpleWorldPurger
-
- All Implemented Interfaces:
WorldPurger
public class SimpleWorldPurger extends java.lang.Object implements WorldPurger
Utility class that removes animals from worlds that don't belong there.
-
-
Constructor Summary
Constructors Constructor Description SimpleWorldPurger(MultiverseCore plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpurgeWorld(MultiverseWorld world)Convenience method forWorldPurger.purgeWorld(MultiverseWorld, java.util.List, boolean, boolean)that takes the settings from the world-config.voidpurgeWorld(MultiverseWorld mvworld, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters)Clear all animals/monsters that do not belong to a world according to the config.voidpurgeWorld(MultiverseWorld mvworld, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters, org.bukkit.command.CommandSender sender)Clear all animals/monsters that do not belong to a world according to the config.voidpurgeWorlds(java.util.List<MultiverseWorld> worlds)Synchronizes the given worlds with their settings.booleanshouldWeKillThisCreature(MultiverseWorld world, org.bukkit.entity.Entity e)Determines whether the specified creature should be killed and automatically reads the params from a world object.booleanshouldWeKillThisCreature(org.bukkit.entity.Entity e, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters)Determines whether the specified creature should be killed.
-
-
-
Constructor Detail
-
SimpleWorldPurger
public SimpleWorldPurger(MultiverseCore plugin)
-
-
Method Detail
-
purgeWorlds
public void purgeWorlds(java.util.List<MultiverseWorld> worlds)
Synchronizes the given worlds with their settings.- Specified by:
purgeWorldsin interfaceWorldPurger- Parameters:
worlds- A list ofMultiverseWorld
-
purgeWorld
public void purgeWorld(MultiverseWorld world)
Convenience method forWorldPurger.purgeWorld(MultiverseWorld, java.util.List, boolean, boolean)that takes the settings from the world-config.- Specified by:
purgeWorldin interfaceWorldPurger- Parameters:
world- TheMultiverseWorld.
-
shouldWeKillThisCreature
public boolean shouldWeKillThisCreature(MultiverseWorld world, org.bukkit.entity.Entity e)
Determines whether the specified creature should be killed and automatically reads the params from a world object.- Specified by:
shouldWeKillThisCreaturein interfaceWorldPurger- Parameters:
world- The world.e- The creature.- Returns:
trueif the creature should be killed, otherwisefalse.
-
purgeWorld
public void purgeWorld(MultiverseWorld mvworld, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters, org.bukkit.command.CommandSender sender)
Clear all animals/monsters that do not belong to a world according to the config.- Specified by:
purgeWorldin interfaceWorldPurger- Parameters:
mvworld- TheMultiverseWorld.thingsToKill- AListof animals/monsters to be killed.negateAnimals- Whether the monsters in the list should be negated.negateMonsters- Whether the animals in the list should be negated.sender- TheCommandSenderthat initiated the action. He will/should be notified.
-
shouldWeKillThisCreature
public boolean shouldWeKillThisCreature(org.bukkit.entity.Entity e, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters)Determines whether the specified creature should be killed.- Specified by:
shouldWeKillThisCreaturein interfaceWorldPurger- Parameters:
e- The creature.thingsToKill- AListof animals/monsters to be killed.negateAnimals- Whether the monsters in the list should be negated.negateMonsters- Whether the animals in the list should be negated.- Returns:
trueif the creature should be killed, otherwisefalse.
-
purgeWorld
public void purgeWorld(MultiverseWorld mvworld, java.util.List<java.lang.String> thingsToKill, boolean negateAnimals, boolean negateMonsters)
Clear all animals/monsters that do not belong to a world according to the config.- Specified by:
purgeWorldin interfaceWorldPurger- Parameters:
mvworld- TheMultiverseWorld.thingsToKill- AListof animals/monsters to be killed.negateAnimals- Whether the monsters in the list should be negated.negateMonsters- Whether the animals in the list should be negated.
-
-