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: 808bd9198 Add fast alternative constructor for Vector3f (#5339) e849c51da fix #5336 0b25bacfc fix patch 'Remove streams from SensorNearest' (fixes #5330) 4d287e31c Use Adventure for `/version` command feedback, add copy to clipboard click event (#5333) Tuinity Changes: 5b6d8beec: Update Upstream (Paper) 81d5fc1dd: Fix NPE in pickup logic for arrow 19ac6608f: Move region chunk unload & poi unload hook up 38ad5a1bd: Do not run close logic for inventories on chunk load fb75a6f83: Do not allow the server to unload chunks at request of plugins f87cb795f: Make entity tracker use highest range of passengers 71b089f18: Do not run raytrace logic for AIR 09e1a1036: Fix NPE in light exception handler 0ae7c2c23: Dump even more info for ticking entities 2e4a930c4: Store changed positions inside field on light engine 7734ef0a9: Detail player ticking in watchdog dumps
36 lines
1.7 KiB
Diff
36 lines
1.7 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/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;
|
|
}
|