Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void purgeWorld​(MultiverseWorld world)
      Convenience method for WorldPurger.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleWorldPurger

        public SimpleWorldPurger​(MultiverseCore plugin)
    • Method Detail

      • 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 interface WorldPurger
        Parameters:
        world - The world.
        e - The creature.
        Returns:
        true if the creature should be killed, otherwise false.
      • 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 interface WorldPurger
        Parameters:
        mvworld - The MultiverseWorld.
        thingsToKill - A List 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 - The CommandSender 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 interface WorldPurger
        Parameters:
        e - The creature.
        thingsToKill - A List 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, otherwise false.
      • 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 interface WorldPurger
        Parameters:
        mvworld - The MultiverseWorld.
        thingsToKill - A List 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.