From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Tue, 18 Feb 2020 20:07:08 -0600
Subject: [PATCH] Add canSaveToDisk to Entity


diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 076d6c1e1cc049dd312ecb30518e7b25fc2d7371..5f04591193d58ba7897194142da5efcbec3763dd 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -536,6 +536,7 @@ public class ChunkRegionLoader {
 
                 while (iterator1.hasNext()) {
                     Entity entity = (Entity) iterator1.next();
+                    if (!entity.canSaveToDisk()) continue; // Purpur
                     final EntityTypes<?> entityType = entity.getEntityType();
                     final int saveLimit = worldserver.paperConfig.entityPerChunkSaveLimits.getOrDefault(entityType, -1);
                     if (saveLimit > -1) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 05902a6e9b1dd326776cac3bd70c438f9e83da26..a1776d7fad2aad6bd323c6c97472fdca0b4618db 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -321,6 +321,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
         this.headHeight = this.getHeadHeight(EntityPose.STANDING, this.size);
     }
 
+    // Purpur start
+    public boolean canSaveToDisk() {
+        return true;
+    }
+    // Purpur end
+
     public boolean isSpectator() {
         return false;
     }
