Files
Purpur/patches/server/0254-Stop-bees-from-dying-after-stinging.patch
BillyGalbreath 90adb4e4af Update to 1.18.2
2022-03-01 17:27:08 -06:00

39 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
Date: Mon, 3 Jan 2022 01:19:46 -0600
Subject: [PATCH] Stop bees from dying after stinging
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 02fc6bb52419b75f04092b33e15e0ab1ea7a7b1a..2a1785a6758a030bc554accfba35d82974fc1fa7 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -454,6 +454,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.hurt(DamageSource.DROWN, 1.0F);
}
+ if (flag && !this.level.purpurConfig.beeDiesAfterSting) setHasStung(false); else // Purpur
if (flag) {
++this.timeSinceSting;
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, (int) 1, (int) 1200)) == 0) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 978be4f1f14a8fe647ea31ff2002a16010210a33..18611782bc89ea034565709530637838e5327eb7 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1076,6 +1076,7 @@ public class PurpurWorldConfig {
public boolean beeCanWorkAtNight = false;
public boolean beeCanWorkInRain = false;
public boolean beeAlwaysDropExp = false;
+ public boolean beeDiesAfterSting = true;
private void beeSettings() {
beeRidable = getBoolean("mobs.bee.ridable", beeRidable);
beeRidableInWater = getBoolean("mobs.bee.ridable-in-water", beeRidableInWater);
@@ -1092,6 +1093,7 @@ public class PurpurWorldConfig {
beeCanWorkAtNight = getBoolean("mobs.bee.can-work-at-night", beeCanWorkAtNight);
beeCanWorkInRain = getBoolean("mobs.bee.can-work-in-rain", beeCanWorkInRain);
beeAlwaysDropExp = getBoolean("mobs.bee.always-drop-exp", beeAlwaysDropExp);
+ beeDiesAfterSting = getBoolean("mobs.bee.dies-after-sting", beeDiesAfterSting);
}
public boolean blazeRidable = false;