Class WorldTargeter

java.lang.Object
me.deecaad.core.mechanics.targeters.Targeter
me.deecaad.core.mechanics.targeters.WorldTargeter
All Implemented Interfaces:
InlineSerializer<Targeter>, Serializer<Targeter>, net.kyori.adventure.key.Keyed, org.bukkit.Keyed
Direct Known Subclasses:
WorldPlayersTargeter

public class WorldTargeter extends Targeter
  • Constructor Details

    • WorldTargeter

      public WorldTargeter()
      Default constructor for serializer.
    • WorldTargeter

      public WorldTargeter(String worldName)
  • Method Details

    • getWorldName

      public String getWorldName()
    • getWorldCache

      public org.bukkit.World getWorldCache()
    • setWorldCache

      public void setWorldCache(org.bukkit.World worldCache)
    • isEntity

      public boolean isEntity()
      Description copied from class: Targeter
      Returns true if this targeter specifically targets an entity. Entity targeters also target locations by default, but that location will always be the entity's location.

      There is 1 caveat, when Targeter.getOffset() is non-null, the targeted location will be different from the targeted entity.

      Specified by:
      isEntity in class Targeter
      Returns:
      true if this targeter targets entities, not specific locations.
    • getTargets0

      public Iterator<CastData> getTargets0(CastData cast)
      Specified by:
      getTargets0 in class Targeter
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
    • getWikiLink

      @Nullable public @Nullable String getWikiLink()
      Description copied from interface: Serializer
      Returns a link to the page on the wiki that describes this serializer. This method is called from SerializeData, and is used to help the user find potential solutions to their problem.
      Specified by:
      getWikiLink in interface Serializer<Targeter>
      Overrides:
      getWikiLink in class Targeter
      Returns:
      The nullable link to the wiki.
    • serialize

      @NotNull public @NotNull Targeter serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Description copied from interface: Serializer
      Instantiates a new Object to be added into the finalized configuration. The object should be built off of SerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw a SerializerException. This method may not return null.
      Parameters:
      data - The non-null data containing config
      Returns:
      The non-null serialized data.
      Throws:
      me.deecaad.core.file.SerializerException - If there is an error in config.
    • isDefaultValues

      public boolean isDefaultValues()
      Returns true if this targeter uses the default values. This is checked in the PlayerEffectMechanicList to determine if a mechanic is eligible to have its targeters cached for improved performance.
      Returns:
      true if this has default values.