Skip to content

Commit

Permalink
don't save primed tnt entity
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Aug 9, 2024
1 parent 737c98a commit 1316cfe
Show file tree
Hide file tree
Showing 42 changed files with 43 additions and 2 deletions.
22 changes: 20 additions & 2 deletions patches/server/0002-Vine-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ index 0000000000000000000000000000000000000000..6feb7269907d2c88a9eb5b52204e55c1
\ No newline at end of file
diff --git a/src/main/kotlin/one/tranic/vine/config/VineConfig.kt b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
new file mode 100644
index 0000000000000000000000000000000000000000..53d7f099183f1b9760807e917f9ee44030891b79
index 0000000000000000000000000000000000000000..08c0b1b53bc675e293fb1cd8d150528a20a6f9ef
--- /dev/null
+++ b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
@@ -0,0 +1,311 @@
@@ -0,0 +1,329 @@
+package one.tranic.vine.config
+
+import gg.pufferfish.pufferfish.simd.SIMDDetection
Expand Down Expand Up @@ -278,6 +278,14 @@ index 0000000000000000000000000000000000000000..53d7f099183f1b9760807e917f9ee440
+ "Whether to print detailed information to the console when this issue is triggered"
+ )
+
+ addDefault(
+ "feature.dont-save-entity.primed-tnt", false, listOf(
+ "Disable save primed tnt on chunk unloads.",
+ "Useful for redstone server, can prevent machine be exploded by TNT,",
+ "when player disconnected caused by Internet issue."
+ )
+ )
+ addDefault("feature.dont-save-entity.falling-block", false)
+ addDefault("feature.zero-tick-plants", false)
+ addDefault("feature.disable-spark", true)
+ addDefault(
Expand Down Expand Up @@ -340,6 +348,8 @@ index 0000000000000000000000000000000000000000..53d7f099183f1b9760807e917f9ee440
+ Feature.zeroTickPlants = getBoolean("feature.zero-tick-plants")
+ Feature.disableSpark = getBoolean("feature.disable-spark")
+ Feature.flattenTriangularDistribution = getBoolean("feature.flatten-triangular-distribution")
+ Feature.DSE.primedTNT = getBoolean("feature.dont-save-entity.primed-tnt")
+ Feature.DSE.fallingBlock = getBoolean("feature.dont-save-entity.falling-block")
+
+ getBoolean("feature.secure-seed") {
+ if (isSecureSeed == null) {
Expand Down Expand Up @@ -443,6 +453,14 @@ index 0000000000000000000000000000000000000000..53d7f099183f1b9760807e917f9ee440
+
+ @JvmField
+ var disableSpark = true
+
+ object DSE {
+ @JvmField
+ var primedTNT = false
+
+ @JvmField
+ var fallingBlock = false
+ }
+ }
+
+ object Optimize {
Expand Down
23 changes: 23 additions & 0 deletions patches/server/0006-Leaf-Don-t-save-primed-tnt-entity.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 404Setup <153366651+404Setup@users.noreply.github.com>
Date: Fri, 9 Aug 2024 09:34:17 +0800
Subject: [PATCH] Leaf: Don't save primed tnt entity

You can find the original code on https://github.com/Winds-Studio/Leaf

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 de8fd467abdc826d21179084a5669bd97c03850d..6290f60a5d0d57d95752e24e7a185b9c62db8757 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -219,4 +219,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 !one.tranic.vine.config.VineConfig.Feature.DSE.primedTNT && super.shouldBeSaved();
+ }
+ // Leaf - PMC - Don't save primed tnt entity
}
File renamed without changes.
File renamed without changes.

0 comments on commit 1316cfe

Please sign in to comment.