diff options
author | blablubbabc <lukas@wirsindwir.de> | 2018-06-14 19:28:41 +0200 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-30 12:29:11 +1000 |
commit | cf6548b4fd81f5be6a243eaf00da815c76611495 (patch) | |
tree | e8b3fe9b5f56ad2b2bf0b54e530fd61eaa9e4231 /src/main/java/org | |
parent | 949d53709bae68956175c93f540f46e97b427422 (diff) | |
download | bukkit-cf6548b4fd81f5be6a243eaf00da815c76611495.tar bukkit-cf6548b4fd81f5be6a243eaf00da815c76611495.tar.gz bukkit-cf6548b4fd81f5be6a243eaf00da815c76611495.tar.lz bukkit-cf6548b4fd81f5be6a243eaf00da815c76611495.tar.xz bukkit-cf6548b4fd81f5be6a243eaf00da815c76611495.zip |
SPIGOT-227: Add entity persistent flag
Non-persistent entities won't get saved when the chunk saves the entities.
Entities that are passengers of a non-persistent entity won't get saved.
Players won't save their vehicle, if the player is directly or
indirectly riding a non-persistent entity.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/entity/Entity.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java index 9d96976d..62bf70f5 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -190,6 +190,36 @@ public interface Entity extends Metadatable, CommandSender, Nameable { public Server getServer(); /** + * Returns true if the entity gets persisted. + * <p> + * By default all entities are persistent. An entity will also not get + * persisted, if it is riding an entity that is not persistent. + * <p> + * The persistent flag has no effect on players. If a player is directly or + * indirectly riding a non-persistent entity, the vehicle at the root and + * all its passengers won't get persisted. + * <p> + * <b>This should not be confused with + * {@link LivingEntity#setRemoveWhenFarAway(boolean)} which controls + * despawning of living entities. </b> + * + * @return true if this entity is persistent + * @deprecated draft API + */ + @Deprecated + public boolean isPersistent(); + + /** + * Sets whether or not the entity gets persisted. + * + * @param persistent the persistence status + * @see #isPersistent() + * @deprecated draft API + */ + @Deprecated + public void setPersistent(boolean persistent); + + /** * Gets the primary passenger of a vehicle. For vehicles that could have * multiple passengers, this will only return the primary passenger. * |