9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-21 16:09:19 +00:00
Files
Leaf/patches/server/0088-Don-t-save-falling-block-entity.patch
Kobe ⑧ fa9c4a78a7 Added region based comment (#165)
* Region based comment helper functions

* (Region based comment) Dont save entity

* (Region based comment) Pufferfish DAB

* (Region based comment) Cache EntityType

* (Region based comment) Cache EntityType

* (Region based comment) Pufferfish EntityTTL

* (Region based comment) Faster sequence

* (Region based comment) FastRNG

* (Region based comment) 0042

* (Region based comment) 0721

* (Region based comment) 0009

* (Region based comment) V1rtUal tHReaD

* (Region based comment) ZSSM

* [ci skip] (Region based comment) 0079

* [ci skip] (Region based comment) 0089 0090

* [ci skip] (Region based comment) 0049 0118 0138

* [ci skip] (Region based comment) 0006 0017 0018 0080 0081

* [ci skip] (Region based comment) 0019 0038 0059 0108 0117 0127

* ALL PATCHES ARE DONE

* [ci skip] NZDD
2024-11-14 06:40:57 -05:00

42 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nostalfinals <yuu8583@proton.me>
Date: Mon, 29 Apr 2024 23:31:25 +0800
Subject: [PATCH] Don't save falling block entity
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index b83be9bbb9f348da83c0fd1ecc7f65c8a58b45b9..5b3844f92caf2962be58e911f98a26e6992f8184 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -422,4 +422,11 @@ public class FallingBlockEntity extends Entity {
this.forceTickAfterTeleportToDuplicate = entity != null && flag && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper
return entity;
}
+
+ // Leaf start - PMC - Don't save falling block entity
+ @Override
+ public boolean shouldBeSaved() {
+ return !org.dreeam.leaf.config.modules.opt.DontSaveEntity.dontSaveFallingBlock && super.shouldBeSaved();
+ }
+ // Leaf end - PMC - Don't save falling block entity
}
diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
index 43c9fcc5a27d523d00656e058c46c34f36da8b63..28dc5e191a26a4783d9e8c18b2653b9ed3238a88 100644
--- a/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
@@ -10,6 +10,7 @@ public class DontSaveEntity extends ConfigModules {
}
public static boolean dontSavePrimedTNT = false;
+ public static boolean dontSaveFallingBlock = false;
@Override
public void onLoaded() {
@@ -22,5 +23,6 @@ public class DontSaveEntity extends ConfigModules {
"""
区块卸载时不保存掉落的方块和激活的 TNT,
可以避免在玩家掉线时机器被炸毁."""));
+ dontSaveFallingBlock = config.getBoolean(getBasePath() + ".dont-save-falling-block", dontSaveFallingBlock);
}
}