9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-22 16:29:23 +00:00
Files
DivineMC/patches/server/0007-Don-t-save-Fireworks.patch
NONPLAYT dea175509b Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@222387f Updated Upstream (Paper)
PurpurMC/Purpur@692ff89 [ci skip] specify purpur in version command
PurpurMC/Purpur@7b850ef [ci skip] Fix version inconsistency in README (#1517)
PurpurMC/Purpur@22fc5f9 Updated Upstream (Paper)
2024-05-26 12:13:55 +03:00

39 lines
1.9 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 6671796d292fbc922a94271136f5a7a4bbdedaca..768daecf46aa77089ed7e0c4b0f5cfbf479d8d4e 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -345,6 +345,13 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
return false;
}
+ // DivineMC start - Don't save Fireworks
+ @Override
+ public boolean shouldBeSaved() {
+ return this.level().divinemcConfig.saveFireworks;
+ }
+ // DivineMC end
+
public static ItemStack getDefaultItem() {
return new ItemStack(Items.FIREWORK_ROCKET);
}
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);
+ }
}