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: PaperMC/Paper@efd47e3 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9188) PaperMC/Paper@1edfefd Add option to flush region files on save (#9149) PaperMC/Paper@9daa019 Added wither vanilla invulnerability API (#9124)
81 lines
4.0 KiB
Diff
81 lines
4.0 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 8bf194c2db3f775405c7117c6882ecd398922c2a..a617879ca6c819c40c21df3519f106620220a70e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -4793,5 +4793,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
public boolean processClick(InteractionHand hand) {
|
|
return false;
|
|
}
|
|
+
|
|
+ public boolean canSaveToDisk() {
|
|
+ return true;
|
|
+ }
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
index a6a9628f0e467f2b38dd346d90862f19712b3016..864ebffb6c903acb9de5594029838b927eea4318 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
@@ -220,6 +220,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
|
// do not hit rider
|
|
return target != rider && super.canHitEntity(target);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean canSaveToDisk() {
|
|
+ return false;
|
|
+ }
|
|
};
|
|
skull.setPosRaw(headX, headY, headZ);
|
|
level.addFreshEntity(skull);
|
|
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 060e064625969610539dbf969ce773b877a7c579..32cd9df202704cdfb8fa06aaf0e738d483054feb 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
|
|
@@ -112,6 +112,7 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
|
|
ListTag listTag = new ListTag();
|
|
final java.util.Map<net.minecraft.world.entity.EntityType<?>, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper
|
|
entities.forEach((entity) -> { // diff here: use entities parameter
|
|
+ if (!entity.canSaveToDisk()) return; // Purpur
|
|
// Paper start
|
|
final EntityType<?> entityType = entity.getType();
|
|
final int saveLimit = level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
|
index 602df34e3ec0d05f58737a54a1e8585e8730095c..f0279d6cdc93f524f321c3c40967fdeeb8d2c46b 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
|
@@ -35,6 +35,11 @@ public class DolphinSpit extends LlamaSpit {
|
|
dolphin.getZ() + (double) (dolphin.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(dolphin.yBodyRot * 0.017453292F));
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean canSaveToDisk() {
|
|
+ return false;
|
|
+ }
|
|
+
|
|
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 9ee7fc642d05fd61d91d09c754c6f0680bc39e56..1542f038621b97a298a0fb31ab3be912e2bcd0d6 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java
|
|
@@ -38,6 +38,11 @@ public class PhantomFlames extends LlamaSpit {
|
|
phantom.getZ() + (double) (phantom.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(phantom.yBodyRot * 0.017453292F));
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean canSaveToDisk() {
|
|
+ return false;
|
|
+ }
|
|
+
|
|
public void tick() {
|
|
super_tick();
|
|
|