From c3a8de0371ffaad3752a503ba1f7583544a0662c Mon Sep 17 00:00:00 2001 From: blablubbabc Date: Thu, 14 Jun 2018 19:59:21 +0200 Subject: 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. --- src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 64cfc951..5f8a9e42 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -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(); } -- cgit v1.2.3