From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Mon, 26 Dec 2022 07:30:30 +0100 Subject: [PATCH] Make saving fireworks configurable License: MIT (https://opensource.org/licenses/MIT) Gale - https://galemc.org This patch is based on the following patch: "Don't save Fireworks" By: Aikar As part of: EmpireCraft (https://github.com/starlis/empirecraft) Licensed under: MIT (https://opensource.org/licenses/MIT) * EmpireCraft description * Fireworks can bug out and not detonate, and an automated launcher can very easily fill a chunk. Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case. diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java index d8dc196ef92e97f831cf97cd1536a46f81f9d5d1..8d29c5c7f651176639363f5227a386679f5b67f3 100644 --- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java @@ -350,4 +350,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { double d1 = entity.position().z - this.position().z; return DoubleDoubleImmutablePair.of(d, d1); } + + // Gale start - EMC - make saving fireworks configurable + @Override + public boolean shouldBeSaved() { + return this.level().galeConfig().smallOptimizations.saveFireworks; + } + // Gale end - EMC - make saving fireworks configurable }