9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-22 16:39:22 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0026-Make-saving-fireworks-configurable.patch
2025-06-15 08:13:47 +08:00

38 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
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 <aikar@aikar.co>
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
}