Package ch.njol.skript.entity
Class SimpleEntityData
java.lang.Object
ch.njol.skript.entity.EntityData<org.bukkit.entity.Entity>
ch.njol.skript.entity.SimpleEntityData
- All Implemented Interfaces:
SyntaxElement,YggdrasilSerializable,YggdrasilSerializable.YggdrasilExtendedSerializable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable -
Field Summary
Fields inherited from class ch.njol.skript.entity.EntityData
LANGUAGE_NODE, m_adult, m_age_pattern, m_baby, matchedPattern, serializer -
Constructor Summary
ConstructorsConstructorDescriptionSimpleEntityData(Class<? extends org.bukkit.entity.Entity> c)SimpleEntityData(org.bukkit.entity.Entity e) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(Fields fields)Deserialises this object.protected booleandeserialize(String s)Deprecated.protected booleanequals_i(EntityData<?> obj)Returns the super type of this entity data, e.g.Class<? extends org.bukkit.entity.Entity>getType()protected intprotected booleanprotected booleaninit(Literal<?>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult)booleanisSupertypeOf(EntityData<?> e)booleanmatch(org.bukkit.entity.Entity e)Serialises this object.voidset(org.bukkit.entity.Entity entity)Methods inherited from class ch.njol.skript.entity.EntityData
equals, fromClass, fromEntity, getAgeAdjective, getAll, getAll, getAll, getInfo, getInfo, getName, hashCode, init, isBaby, isInstance, isPlural, parse, parseWithoutIndefiniteArticle, register, register, spawn, spawn, toString, toString, toString, toString, toString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
-
Constructor Details
-
SimpleEntityData
public SimpleEntityData() -
SimpleEntityData
-
SimpleEntityData
public SimpleEntityData(org.bukkit.entity.Entity e)
-
-
Method Details
-
init
protected boolean init(Literal<?>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult)- Specified by:
initin classEntityData<org.bukkit.entity.Entity>
-
init
protected boolean init(@Nullable Class<? extends org.bukkit.entity.Entity> c, @Nullable org.bukkit.entity.Entity e)- Specified by:
initin classEntityData<org.bukkit.entity.Entity>- Parameters:
c- An entity's class, e.g. Playere- An actual entity, or null to get an entity data for an entity class- Returns:
- Whether initialisation was successful
-
set
public void set(org.bukkit.entity.Entity entity)- Specified by:
setin classEntityData<org.bukkit.entity.Entity>
-
match
public boolean match(org.bukkit.entity.Entity e)- Specified by:
matchin classEntityData<org.bukkit.entity.Entity>
-
getType
- Specified by:
getTypein classEntityData<org.bukkit.entity.Entity>
-
hashCode_i
protected int hashCode_i()- Specified by:
hashCode_iin classEntityData<org.bukkit.entity.Entity>
-
equals_i
- Specified by:
equals_iin classEntityData<org.bukkit.entity.Entity>
-
serialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableSerialises this object. Only fields contained in the returned Fields object will be written to stream.You can use return new
Fields(this); to emulate the default behaviour.- Specified by:
serializein interfaceYggdrasilSerializable.YggdrasilExtendedSerializable- Overrides:
serializein classEntityData<org.bukkit.entity.Entity>- Returns:
- A Fields object containing all fields that should be written to stream
- Throws:
NotSerializableException- If this object or one of its fields is not serialisable
-
deserialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableDeserialises this object. No fields have been set when this method is called, use fields.setFields(this, yggdrasil) to set all compatible non-transient and non-static fields (and call incompatible/missing field handlers if applicable – this implies that errors will be thrown if the fields object is invalid).You can use fields.
setFields(this); to emulate the default behaviour.- Specified by:
deserializein interfaceYggdrasilSerializable.YggdrasilExtendedSerializable- Overrides:
deserializein classEntityData<org.bukkit.entity.Entity>- Parameters:
fields- A Fields object containing all fields read from stream- Throws:
StreamCorruptedException- If the Fields object is invalid, i.e. was not written byYggdrasilSerializable.YggdrasilExtendedSerializable.serialize()or Yggrdasil's default serialisation.NotSerializableException
-
deserialize
Deprecated.- Overrides:
deserializein classEntityData<org.bukkit.entity.Entity>
-
isSupertypeOf
- Specified by:
isSupertypeOfin classEntityData<org.bukkit.entity.Entity>
-
getSuperType
Description copied from class:EntityDataReturns the super type of this entity data, e.g. 'wolf' for 'angry wolf'.- Specified by:
getSuperTypein classEntityData<org.bukkit.entity.Entity>- Returns:
- The supertype of this entity data. Must not be null.
-