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:9259558b58Fix remapping issue with RangedAttackMob and RangedEntity (#7167)3d9385e665Add material tags for copper blocks (#7141)75f4cb074aMove setShouldBurnInDay to AbstractSkeleton (#7120)9adc0b243bFix breakNaturally for fluid-logged blocks (#7134)76f327471dMove VehicleCollisionEvent HandlerList up (#7112)d4c819056dForward CraftEntity in teleport command (#7025)9012ae8880Improve scoreboard entries (#6871)264b11d9f3Entity powdered snow API (#6833)a6a6a3db24[ci skip] Revert change to apatch script2cf6a57bcaFix entity type tags suggestions in selectors (#6468)8a21c1742bAdd API for item entity health (#6514)26fbb02aaeAdventure changes for Java 17 and Component support for resourcepack prompt10bfb63f6cConfigurable max block light for monster spawning (#7129)6e5ceb34ebFix ChunkMap distanceManager field reobf82eaf4ee15Fix duplicated BlockPistonRetractEvent call (#7111)cf621c5eb3Load effect amplifiers greater than 127 correctly (#7175)1ce4281666Fix ABI breakage for plainSerializer (#7178)bf826b3fac[ci skip] Update Gradle wrapper to 7.3.3464b1715bbAdd uncaught exception handler using logger to usages of ThreadFactoryBuilder (#7179)
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 359c70f3618ebd8138daaaadae88db98ee733a30..3417d7aaf858ae4759fd6b2b22f67e951769c33c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -4339,5 +4339,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
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 19f48278c5c8f9640683d61b9555074e140fa2ab..9a0a5da86e0502382cb538d6abea8e425e40dddc 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
|
|
@@ -204,6 +204,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 fec7d5c6a7b7a20ac9aecec1d3187f5c61fc430c..d4fd425c934e1e033d9aefda66958c864c11ea7d 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
|
|
@@ -92,6 +92,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
|
|
dataList.getEntities().forEach((entity) -> {
|
|
+ if (!entity.canSaveToDisk()) return; // Purpur
|
|
// Paper start
|
|
final EntityType<?> entityType = entity.getType();
|
|
final int saveLimit = this.level.paperConfig.entityPerChunkSaveLimits.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 d55f7611599b2a339293688861100cb8dae9f6c6..5e99789e5156e8ffbf125e77114c547e1f8e7925 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 2eca8317e991ec46cc88a4c7d6d8b50152ba4ea7..b6a594cd6b08c687cf51c2f5494297ef96ec4b92 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();
|
|
|