Add canSaveToDisk to Entity

This commit is contained in:
William Blake Galbreath
2025-01-05 16:43:10 -08:00
committed by granny
parent 27d7eadf95
commit f068d01f6b
7 changed files with 57 additions and 95 deletions

View File

@@ -17,6 +17,19 @@
public boolean noPhysics;
private boolean wasOnFire;
public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
@@ -526,6 +_,12 @@
}
// Paper end - optimise entity tracker
+ // Purpur start - Add canSaveToDisk to Entity
+ public boolean canSaveToDisk() {
+ return true;
+ }
+ // Purpur end - Add canSaveToDisk to Entity
+
public Entity(EntityType<?> entityType, Level level) {
this.type = entityType;
this.level = level;
@@ -2922,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashable) {
if (leashable.getLeashHolder() == player) {

View File

@@ -0,0 +1,16 @@
--- a/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
@@ -103,6 +_,13 @@
}
}
+ // Purpur start - Add canSaveToDisk to Entity
+ @Override
+ public boolean canSaveToDisk() {
+ return false;
+ }
+ // Purpur end - Add canSaveToDisk to Entity
+
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
builder.define(DATA_DANGEROUS, false);