Class PylonEntity
-
public abstract class PylonEntity<E extends Entity>Represents a Pylon entity in the world.
All custom Pylon entities extend this class. Every instance of this class is wrapping a real entity in the world, and is stored in EntityStorage. All new block types must be registered using register, and all new Pylon entities must be added to EntityStorage with EntityStorage.add.
You are responsible for creating your Pylon entities; there are no place constructors as with Pylon blocks. This is because it doesn't make sense for Pylon to manage spawning entities. However, your entity must still have a load constructor that takes a single parameter of type E.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPylonEntity.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static PylonEntity.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description PylonEntity(E entity)PylonEntity(NamespacedKey key, E entity)
-
Method Summary
Modifier and Type Method Description final EgetEntity()final NamespacedKeygetKey()final PylonEntitySchemagetSchema()final UUIDgetUuid()WailaDisplaygetWaila(Player player)WAILA is the text that shows up when looking at a block to tell you what the block is. voidwriteDebugInfo(PersistentDataContainer pdc)Called when debug info is requested for the entity by someone using the DebugWaxedWeatheredCutCopperStairs. voidwrite(PersistentDataContainer pdc)Called when the entity is saved. final ConfiggetSettings()Returns settings associated with the block. final static voidregister(NamespacedKey key, Class<?> entityClass, Class<out PylonEntity<?>> pylonEntityClass)-
-
Constructor Detail
-
PylonEntity
PylonEntity(E entity)
-
PylonEntity
PylonEntity(NamespacedKey key, E entity)
-
-
Method Detail
-
getKey
final NamespacedKey getKey()
-
getSchema
final PylonEntitySchema getSchema()
-
getWaila
WailaDisplay getWaila(Player player)
WAILA is the text that shows up when looking at a block to tell you what the block is. It can also be used for entities.
This will only be called for the player if the player has WAILA enabled.
- Returns:
the WAILA configuration, or null if WAILA should not be shown for this block.
-
writeDebugInfo
void writeDebugInfo(PersistentDataContainer pdc)
Called when debug info is requested for the entity by someone using the DebugWaxedWeatheredCutCopperStairs. If there is any transient data that can be useful for debugging, you're encouraged to save it here.
Defaults to a normal write call.
-
write
void write(PersistentDataContainer pdc)
Called when the entity is saved.
Put any logic to save the data in the entity here.
Do not assume that when this is called, the entity is being unloaded. This may be called for other reasons, such as when a player right clicks with DebugWaxedWeatheredCutCopperStairs
-
getSettings
final Config getSettings()
Returns settings associated with the block.
Shorthand for
Settings.get(getKey())
-
register
final static void register(NamespacedKey key, Class<?> entityClass, Class<out PylonEntity<?>> pylonEntityClass)
-
-
-
-