mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-21 07:49:18 +00:00
45 lines
2.0 KiB
Diff
45 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sun, 23 Feb 2025 01:04:29 +0300
|
|
Subject: [PATCH] Option to disable saving of snowball and firework
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
index 774ca9e0b56fd175ae246051de762d0c4256ca58..3a380d038ef1231624a646c38b60a4344694e321 100644
|
|
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
@@ -364,4 +364,14 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
|
double d1 = entity.position().z - this.position().z;
|
|
return DoubleDoubleImmutablePair.of(d, d1);
|
|
}
|
|
+
|
|
+ // DivineMC start - Option to disable saving firework
|
|
+ @Override
|
|
+ public boolean shouldBeSaved() {
|
|
+ if (this.level().divineConfig.disableFireworkSaving) {
|
|
+ return false;
|
|
+ }
|
|
+ return super.shouldBeSaved();
|
|
+ }
|
|
+ // DivineMC end - Option to disable saving firework
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/Snowball.java b/net/minecraft/world/entity/projectile/Snowball.java
|
|
index cad1f8cb68ef9615587e651a3120f68a3c32add0..18298f3ba544e07110ea8d5b15ae753f7e3de65a 100644
|
|
--- a/net/minecraft/world/entity/projectile/Snowball.java
|
|
+++ b/net/minecraft/world/entity/projectile/Snowball.java
|
|
@@ -100,4 +100,14 @@ public class Snowball extends ThrowableItemProjectile {
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
}
|
|
}
|
|
+
|
|
+ // DivineMC start - Option to disable snowball saving
|
|
+ @Override
|
|
+ public boolean shouldBeSaved() {
|
|
+ if (this.level().divineConfig.disableSnowballSaving) {
|
|
+ return false;
|
|
+ }
|
|
+ return super.shouldBeSaved();
|
|
+ }
|
|
+ // DivineMC end - Option to disable snowball saving
|
|
}
|