Files
Purpur/patches/server/0242-Stop-bees-from-dying-after-stinging.patch
Encode42 dad13788ad Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@2040c1e Player Flying Fall Damage API (#5357)
PaperMC/Paper@fa42c68 Expose pre-collision moving velocity to VehicleBlockCollisionEvent (#8457)
PaperMC/Paper@90750a6 Rework filtering spawn egg and tile entity nbt config (#6613)
2022-12-29 00:19:27 -05: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 251fc8c09d3856464b8f5c64f7840a65553ae16c..7d8ab3c5d5277b81157d56b408293cc3ae511c78 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -455,6 +455,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 6d474c112cd622910f168695e6e0a959b9f9f405..31b4c0624f45e44c98d29d51c486ee332faf1ab9 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1077,6 +1077,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);
@@ -1093,6 +1094,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;