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 void
purgeWorld(MultiverseWorld world)
Convenience method forWorldPurger.purgeWorld(MultiverseWorld, java.util.List, boolean, boolean)
that takes the settings from the world-config.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.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.void
purgeWorlds(java.util.List<MultiverseWorld> worlds)
Synchronizes the given worlds with their settings.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.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.
-
-
-
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:
purgeWorlds
in 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:
purgeWorld
in 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:
shouldWeKillThisCreature
in interfaceWorldPurger
- Parameters:
world
- The world.e
- The creature.- Returns:
true
if 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:
purgeWorld
in interfaceWorldPurger
- Parameters:
mvworld
- TheMultiverseWorld
.thingsToKill
- AList
of 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
- TheCommandSender
that 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:
shouldWeKillThisCreature
in interfaceWorldPurger
- Parameters:
e
- The creature.thingsToKill
- AList
of 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:
true
if 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:
purgeWorld
in interfaceWorldPurger
- Parameters:
mvworld
- TheMultiverseWorld
.thingsToKill
- AList
of 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.
-
-