--- a/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java
@@ -90,7 +90,18 @@
 
         } else {
             ListTag listTag = new ListTag();
+            final java.util.Map<net.minecraft.world.entity.EntityType<?>, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper
             dataList.getEntities().forEach((entity) -> {
+                // Paper start
+                final EntityType<?> entityType = entity.getType();
+                final int saveLimit = this.level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1);
+                if (saveLimit > -1) {
+                    if (savedEntityCounts.getOrDefault(entityType, 0) >= saveLimit) {
+                        return;
+                    }
+                    savedEntityCounts.merge(entityType, 1, Integer::sum);
+                }
+                // Paper end
                 CompoundTag compoundTag = new CompoundTag();
                 if (entity.save(compoundTag)) {
                     listTag.add(compoundTag);
@@ -117,7 +128,7 @@
 
     private CompoundTag upgradeChunkTag(CompoundTag chunkNbt) {
         int i = getVersion(chunkNbt);
-        return NbtUtils.update(this.fixerUpper, DataFixTypes.ENTITY_CHUNK, chunkNbt, i);
+        return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system
     }
 
     public static int getVersion(CompoundTag chunkNbt) {
