Class Targeter
java.lang.Object
me.deecaad.core.mechanics.targeters.Targeter
- All Implemented Interfaces:
InlineSerializer<Targeter>,Serializer<Targeter>,net.kyori.adventure.key.Keyed,org.bukkit.Keyed
- Direct Known Subclasses:
RelativeTargeter,ServerPlayersTargeter,SourceTargeter,TargetTargeter,WorldTargeter
A targeter returns a list of targets. A target can be a
Location, an
Entity, or a Player.-
Nested Class Summary
Nested classes/interfaces inherited from interface me.deecaad.core.file.InlineSerializer
InlineSerializer.FormatException -
Field Summary
Fields inherited from interface me.deecaad.core.file.InlineSerializer
NAME_FINDER, UNIQUE_IDENTIFIER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TargeterapplyParentArgs(me.deecaad.core.file.SerializeData data, Targeter targeter) @Nullable VectorProvidergetTargets(CastData cast) Public method to get every possible target for the mechanic using this targeter.getTargets0(CastData cast) Returns a link to the page on the wiki that describes this serializer.abstract booleanisEntity()Returnstrueif this targeter specifically targets an entity.booleanisEye()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.InlineSerializer
getInlineKeyword, getKey, getKeyword, shouldSerializeMethods inherited from interface org.bukkit.Keyed
keyMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, letPassThrough, serialize, tryPathTo, useLater
-
Constructor Details
-
Targeter
public Targeter()Default constructor for serializers.
-
-
Method Details
-
getWikiLink
Description copied from interface:SerializerReturns a link to the page on the wiki that describes this serializer. This method is called fromSerializeData, and is used to help the user find potential solutions to their problem.- Specified by:
getWikiLinkin interfaceSerializer<Targeter>- Returns:
- The nullable link to the wiki.
-
isEye
public boolean isEye() -
getOffset
-
isEntity
public abstract boolean isEntity()Returnstrueif 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
getOffset()is non-null, the targeted location will be different from the targeted entity.- Returns:
- true if this targeter targets entities, not specific locations.
-
getTargets
Public method to get every possible target for the mechanic using this targeter. The returned targets will have the offset (getOffset()) already applied.- Parameters:
cast- The non-null origin of the cast.- Returns:
- The list of targets.
-
getTargets0
-
applyParentArgs
protected Targeter applyParentArgs(me.deecaad.core.file.SerializeData data, Targeter targeter) throws me.deecaad.core.file.SerializerException - Throws:
me.deecaad.core.file.SerializerException
-