mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Toggle for Zombified Piglin death always counting as player kill when angry
In Vanilla (as of 1.16.4), when Zombified Piglins die while angry, it will count as a player kill regardless of whether a player has ever hit them, meaning they will drop XP. This is abused in Zombified Piglin farms where the player kills the entities through cramming, but they still drop XP due to the Piglin being angry, even though the player never hit them. This patch adds a toggle to disable this behavior.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
@@ -112,7 +_,7 @@
|
||||
this.maybeAlertOthers();
|
||||
}
|
||||
|
||||
- if (this.isAngry()) {
|
||||
+ if (this.isAngry() && this.level().purpurConfig.zombifiedPiglinCountAsPlayerKillWhenAngry) { // Purpur - Toggle for Zombified Piglin death always counting as player kill when angry
|
||||
this.lastHurtByPlayerTime = this.tickCount;
|
||||
}
|
||||
|
||||
@@ -163,7 +_,7 @@
|
||||
this.ticksUntilNextAlert = ALERT_INTERVAL.sample(this.random);
|
||||
}
|
||||
|
||||
- if (livingEntity instanceof Player) {
|
||||
+ if (livingEntity instanceof Player && this.level().purpurConfig.zombifiedPiglinCountAsPlayerKillWhenAngry) { // Purpur - Toggle for Zombified Piglin death always counting as player kill when angry
|
||||
this.setLastHurtByPlayer((Player)livingEntity);
|
||||
}
|
||||
|
||||
@@ -2180,6 +2180,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombifiedPiglinJockeyOnlyBaby = true;
|
||||
public double zombifiedPiglinJockeyChance = 0.05D;
|
||||
public boolean zombifiedPiglinJockeyTryExistingChickens = true;
|
||||
public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = true;
|
||||
private void zombifiedPiglinSettings() {
|
||||
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
|
||||
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
|
||||
@@ -2195,5 +2196,6 @@ public class PurpurWorldConfig {
|
||||
zombifiedPiglinJockeyOnlyBaby = getBoolean("mobs.zombified_piglin.jockey.only-babies", zombifiedPiglinJockeyOnlyBaby);
|
||||
zombifiedPiglinJockeyChance = getDouble("mobs.zombified_piglin.jockey.chance", zombifiedPiglinJockeyChance);
|
||||
zombifiedPiglinJockeyTryExistingChickens = getBoolean("mobs.zombified_piglin.jockey.try-existing-chickens", zombifiedPiglinJockeyTryExistingChickens);
|
||||
zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user