more progress

This commit is contained in:
BillyGalbreath
2021-06-18 19:09:50 -05:00
parent 16d318fed6
commit 9a48162500
106 changed files with 2769 additions and 417 deletions

View File

@@ -0,0 +1,32 @@
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 e617f1acd2d73c35d293580b27bbd9a49b569e21..73d1efb6eb6a96368db57f316867cfc027159056 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4058,5 +4058,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
public boolean processClick(InteractionHand hand) {
return false;
}
+
+ public boolean canSaveToDisk() {
+ return true;
+ }
// Purpur end
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
index 6204c6c9cf2cb620e41105889807f85438bd006c..29f1ae2df9bd792e7d77479432ae48b0d070586b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
@@ -90,6 +90,7 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
} else {
ListTag listTag = new ListTag();
dataList.getEntities().forEach((entity) -> {
+ if (!entity.canSaveToDisk()) return; // Purpur
CompoundTag compoundTag = new CompoundTag();
if (entity.save(compoundTag)) {
listTag.add(compoundTag);