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 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); + } }