mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
add back pufferfish patches
This commit is contained in:
85
patches/server/0056-Add-canSaveToDisk-to-Entity.patch
Normal file
85
patches/server/0056-Add-canSaveToDisk-to-Entity.patch
Normal file
@@ -0,0 +1,85 @@
|
||||
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 403ff6ad6bfca4813397b922e5e97c85e613b27f..2831d061ae0f5a7a5d70aef0715078c0607b5701 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -480,6 +480,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
public final boolean hardCollides() {
|
||||
return this.hardCollides;
|
||||
}
|
||||
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 38800a318f675ab11eeba17cb1966e9a294c69e1..a20017a6086421061ee13df9cf37e08eeb515a5b 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
|
||||
@@ -229,6 +229,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
skull.setPosRaw(headX, headY, headZ);
|
||||
level().addFreshEntity(skull);
|
||||
}
|
||||
+
|
||||
+ @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 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 af057c1d7fd74f3dd806c5ce7f8b0ad06cab7b8e..ce614ae6b1fa0b31c1ee8dacb69134bb20c949f4 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 1fd6412e332ea8ee82b19c108e113624e51d764b..ea8b928b6d82689e71bbcc39ab497491072dfba6 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