9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-21 15:59:23 +00:00
Files
DivineMC/patches/server/0020-Don-t-save-Fireworks.patch
2024-11-02 16:43:01 +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 8a4e7e1c0c4919d2ee34121c14f9665b9ad95273..70c8fe6c225a1e90a144f9b00e6ce2d97d5d82a7 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -370,6 +370,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);
+ }
}