mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@3c8a7fe Re-add missing chunk event calls (#11104) PaperMC/Paper@a8db527 Even more cleanup of mcutil patch PaperMC/Paper@d08e8d1 Add total time to done message (#11109)
This commit is contained in:
86
patches/server/0053-Add-canSaveToDisk-to-Entity.patch
Normal file
86
patches/server/0053-Add-canSaveToDisk-to-Entity.patch
Normal file
@@ -0,0 +1,86 @@
|
||||
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 6410eb03fa1a3fbdc8da5dde92d7bd956004a3ff..88fd465aa3e448e36fe519f8f882d2d3225d679f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -551,6 +551,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
}
|
||||
// Paper end - optimise entity tracker
|
||||
+ // Purpur start
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
public Entity(EntityType<?> type, Level world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
index 63f48841c849ff49d9d43efc5de8952c5a9bba3a..e472df057d087fe46bd40b798c050ed6e38a283c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
@@ -121,6 +121,11 @@ public class WitherSkull extends AbstractHurtingProjectile {
|
||||
// do not hit rider
|
||||
return target != this.getRider() && super.canHitEntity(target);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return false;
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
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 d4a505ef4af9ded02aeb1a817bcbe5b1a912a5b3..97a310f042db1a838a744d2909d261aaf253ea17 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
|
||||
@@ -105,6 +105,7 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
|
||||
}
|
||||
// Paper end - Entity load/save limit per chunk
|
||||
CompoundTag compoundTagx = new CompoundTag();
|
||||
+ if (!entity.canSaveToDisk()) return; // Purpur
|
||||
if (entity.save(compoundTagx)) {
|
||||
listTag.add(compoundTagx);
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
||||
index 89c476c740b4efb4f44c1dcd384b908626d96780..f25abee6dbf99c8d08f8e09db02b41df86115faa 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
||||
@@ -36,6 +36,13 @@ public class DolphinSpit extends LlamaSpit {
|
||||
dolphin.getZ() + (double) (dolphin.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(dolphin.yBodyRot * 0.017453292F));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public void tick() {
|
||||
super_tick();
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java
|
||||
index c0b7e0eeffdf31b88662232b07944bf3e6fa2148..75e31aee6e706f042398444f272888f9ad0fa3f4 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java
|
||||
@@ -38,6 +38,13 @@ public class PhantomFlames extends LlamaSpit {
|
||||
phantom.getZ() + (double) (phantom.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(phantom.yBodyRot * 0.017453292F));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public void tick() {
|
||||
super_tick();
|
||||
|
||||
Reference in New Issue
Block a user