mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-20 23:49:31 +00:00
* 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
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: nostalfinals <yuu8583@proton.me>
|
|
Date: Mon, 29 Apr 2024 23:30:21 +0800
|
|
Subject: [PATCH] Don't save primed tnt entity
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
index 2a4425d04917b32c7ae5af3e7422c0bafc2aa1c2..2493e94b170dc5c0a3c36dded8e1ac3918fa266a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
@@ -255,4 +255,11 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
|
return super.interact(player, hand);
|
|
}
|
|
// Purpur end - Shears can defuse TNT
|
|
+
|
|
+ // Leaf start - PMC - Don't save primed tnt entity
|
|
+ @Override
|
|
+ public boolean shouldBeSaved() {
|
|
+ return !org.dreeam.leaf.config.modules.opt.DontSaveEntity.dontSavePrimedTNT && super.shouldBeSaved();
|
|
+ }
|
|
+ // Leaf - PMC - Don't save primed tnt 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
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..43c9fcc5a27d523d00656e058c46c34f36da8b63
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/DontSaveEntity.java
|
|
@@ -0,0 +1,26 @@
|
|
+package org.dreeam.leaf.config.modules.opt;
|
|
+
|
|
+import org.dreeam.leaf.config.ConfigModules;
|
|
+import org.dreeam.leaf.config.EnumConfigCategory;
|
|
+
|
|
+public class DontSaveEntity extends ConfigModules {
|
|
+
|
|
+ public String getBasePath() {
|
|
+ return EnumConfigCategory.PERF.getBaseKeyName() + ".dont-save-entity";
|
|
+ }
|
|
+
|
|
+ public static boolean dontSavePrimedTNT = false;
|
|
+
|
|
+ @Override
|
|
+ public void onLoaded() {
|
|
+ dontSavePrimedTNT = config.getBoolean(getBasePath() + ".dont-save-primed-tnt", dontSavePrimedTNT,
|
|
+ config.pickStringRegionBased(
|
|
+ """
|
|
+ Disable save primed tnt on chunk unloads.
|
|
+ Useful for redstone/technical servers, can prevent machines from being exploded by TNT,
|
|
+ when player disconnected caused by Internet issue.""",
|
|
+ """
|
|
+ 区块卸载时不保存掉落的方块和激活的 TNT,
|
|
+ 可以避免在玩家掉线时机器被炸毁."""));
|
|
+ }
|
|
+}
|