mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-22 16:29:26 +00:00
52 lines
2.4 KiB
Diff
52 lines
2.4 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/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
index b2f08889139dc447f7071f1c81456035bf8de31e..3e8cc641cd4dafd4e220a24033a5f58d450c043f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
@@ -357,4 +357,12 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
|
public boolean isAttackable() {
|
|
return false;
|
|
}
|
|
+
|
|
+ // Gale start - EMC - make saving fireworks configurable
|
|
+ @Override
|
|
+ public boolean shouldBeSaved() {
|
|
+ return this.level().galeConfig().smallOptimizations.saveFireworks;
|
|
+ }
|
|
+ // Gale end - EMC - make saving fireworks configurable
|
|
+
|
|
}
|
|
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
index 7e7e01f6514f6bbb9c89dc3c878fb6da25eb6b1f..00a327bd0e4e0f2def0bb29d5ecff4f0ec4ba1eb 100644
|
|
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
|
@@ -33,6 +33,8 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
|
public SmallOptimizations smallOptimizations;
|
|
public class SmallOptimizations extends ConfigurationPart {
|
|
|
|
+ public boolean saveFireworks = true; // Gale - EMC - make saving fireworks configurable
|
|
+
|
|
// Gale start - Airplane - reduce projectile chunk loading
|
|
public MaxProjectileChunkLoads maxProjectileChunkLoads;
|
|
public class MaxProjectileChunkLoads extends ConfigurationPart {
|