mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@484d6bf [ci skip] Move some disruptive patches back PaperMC/Paper@52619e7 [ci skip] Add more patch identifying comments PaperMC/Paper@e660379 [ci skip] Move some disruptive patches back PaperMC/Paper@c57d1aa Move diffs around to compile without later ones applied PaperMC/Paper@581b101 Add world to Entity AddTo/RemoveFrom Events (#10183) PaperMC/Paper@24dc2bf Add BlockStateMeta#clearBlockState (#10160) PaperMC/Paper@76da4bc Expose LootTable of DecoratedPot (#10023) PaperMC/Paper@11645e3 [ci skip] (Mostly) finish adding identifying patch comments PaperMC/Paper@51bef80 [ci skip] Remove removed patches PaperMC/Paper@ad2cf68 [ci skip] Move chunk system patch back a bit PaperMC/Paper@d405ff1 [ci skip] Fixup last commit PaperMC/Paper@a4a08b7 [ci skip] Move chunk system patch a bit back PaperMC/Paper@b700460 Convert average tick value in the GUI to the correct granularity PaperMC/Paper@1831240 [ci skip] Move chunk system patch back
86 lines
4.0 KiB
Diff
86 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 605c15bb3ca7f4c13a7c869ccd61961d5e01937e..2dcfcc740aab2fe069aff01bff37c1c310203998 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -560,6 +560,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
return false;
|
|
}
|
|
|
|
+ public boolean canSaveToDisk() {
|
|
+ return true;
|
|
+ }
|
|
+
|
|
public final boolean hardCollides() {
|
|
return this.hardCollides;
|
|
}
|
|
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 4a2331c22a022881d66bcfd4134b0ffe421a0633..d57ef27df0a3597416564f8723b4b986413ad314 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
|
|
@@ -116,6 +116,11 @@ public class WitherSkull extends AbstractHurtingProjectile {
|
|
return target != this.getRider() && super.canHitEntity(target);
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean canSaveToDisk() {
|
|
+ return false;
|
|
+ }
|
|
+
|
|
@Override
|
|
public boolean isPickable() {
|
|
return false;
|
|
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 23dc37ff1f92951817864963bf93220d5aae91bb..af563ffb67c43b50555951fe1b5e4320d429a7f1 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 - Entity load/save limit per chunk
|
|
entities.forEach((entity) -> { // diff here: use entities parameter
|
|
+ if (!entity.canSaveToDisk()) return; // Purpur
|
|
// Paper start - Entity load/save limit per chunk
|
|
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 83dd3f982d5869e26748e6e0d0b38a3c7a08fe02..92d562fa11f69bb6b841299aef257ea0c674ca1c 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java
|
|
@@ -35,6 +35,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 8fa9b376682d9e8b1971a9f72b918c6dc6872d04..d0d951f867390fa12cae2ba2a49212354b10d7b0 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();
|
|
|