mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
another 6 bite the dust
This commit is contained in:
36
patches/removed/1.17/0067-Add-canSaveToDisk-to-Entity.patch
Normal file
36
patches/removed/1.17/0067-Add-canSaveToDisk-to-Entity.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
|
||||
1.17: major stuff was changed around this area
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 5a235642c702e6a0c1971d060b5e5a41ad277b65..0bb2b362f257801d3ec8d232f2970d88b32f2748 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -388,6 +388,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 4eaf497d048324a85ce49fc1c6e9559991c20df7..4eb89daf27621a212d12d410aa819e2453708922 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
|
||||
@@ -546,6 +546,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) {
|
||||
Reference in New Issue
Block a user