mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: b8020379c Extract Adventure Version into a variable, add reminder to update the linked JD on the homepage (#5422) Airplane Changes: f5fb02447 Temporarily revert patch 3c728a7a9 Oops, these 2 too 37a93e561 Your daily dose of 1-3% optimization patches bbd689a77 Remove useless check
36 lines
1.8 KiB
Diff
36 lines
1.8 KiB
Diff
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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 56d7662ccc2181df298f37a043f7af4036fe6125..08f286a085cf36ce9a0ea420389f4ea33fb1cc1a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -447,6 +447,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
this.headHeight = this.getHeadHeight(EntityPose.STANDING, this.size);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean canSaveToDisk() {
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
public boolean isSpectator() {
|
|
return false;
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
|
index bf96f9e538fc29ca914536e8a7ce727ebe43a8b2..5997f3e47f3d509c271f38eb2785f126066f5c6e 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
|
@@ -582,6 +582,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) {
|