9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-22 08:19:19 +00:00
Files
DivineMC/patches/server/0008-Don-t-save-Fireworks.patch
2024-03-01 00:12:11 +03:00

37 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 22:47:12 +0300
Subject: [PATCH] Don't save Fireworks
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
index 5b3b59057b962438c6f4fc8a1507342865b3bc11..f09388fa1fb3a84da4678ea46761a55872a03cc8 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -355,4 +355,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
public boolean isAttackable() {
return false;
}
+
+ // DivineMC start - Don't save Fireworks
+ @Override
+ public boolean shouldBeSaved() {
+ return this.level().divinemcConfig.saveFireworks;
+ }
+ // DivineMC end
}
diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java
index 3e64e0d2d925f9fca1eb38cc07c20cae785ef39f..243b3d4379f4f6f273222a3611d8a463053d3e70 100644
--- a/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java
+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineWorldConfig.java
@@ -77,4 +77,9 @@ public class DivineWorldConfig {
final Map<String, Object> value = DivineConfig.getMap("world-settings." + worldName + "." + path, null);
return value.isEmpty() ? fallback : value;
}
+
+ public boolean saveFireworks = false;
+ private void saveFireworks() {
+ saveFireworks = getBoolean("gameplay-mechanics.should-save-fireworks", saveFireworks);
+ }
}