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.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot
2018-06-14 19:59:21 +02:00
parent 888b0dc31b
commit 94950beea7
3 changed files with 109 additions and 67 deletions

View File

@@ -356,6 +356,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return server;
}
@Override
public boolean isPersistent() {
return entity.persist;
}
@Override
public void setPersistent(boolean persistent) {
entity.persist = persistent;
}
public Vector getMomentum() {
return getVelocity();
}