mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
57 lines
3.3 KiB
Diff
57 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
Date: Sat, 5 Dec 2020 02:34:22 -0800
|
|
Subject: [PATCH] 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.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
|
index 0f53ab48bb28188400c7b420cd79ea202c8f5746..921d4e60052f6ceb9a6ecc2956350bd70c94dca7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
|
@@ -152,7 +152,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
|
this.maybeAlertOthers();
|
|
}
|
|
|
|
- if (this.isAngry()) {
|
|
+ if (this.isAngry() && this.level.purpurConfig.zombifiedPiglinCountAsPlayerKillWhenAngry) { // Purpur
|
|
this.lastHurtByPlayerTime = this.tickCount;
|
|
}
|
|
|
|
@@ -207,7 +207,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
|
this.ticksUntilNextAlert = ZombifiedPiglin.ALERT_INTERVAL.sample(this.random);
|
|
}
|
|
|
|
- if (entityliving instanceof Player) {
|
|
+ if (entityliving instanceof Player && this.level.purpurConfig.zombifiedPiglinCountAsPlayerKillWhenAngry) { // Purpur
|
|
this.setLastHurtByPlayer((Player) entityliving);
|
|
}
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 3e7226737f786399c06b80d72f2b0b7ec5bbd8e6..75a55280a0f57ef3586f3c32d5b37de504ee1fcc 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1566,6 +1566,7 @@ public class PurpurWorldConfig {
|
|
public boolean zombifiedPiglinJockeyOnlyBaby = true;
|
|
public double zombifiedPiglinJockeyChance = 0.05D;
|
|
public boolean zombifiedPiglinJockeyTryExistingChickens = true;
|
|
+ public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = true;
|
|
private void zombifiedPiglinSettings() {
|
|
if (PurpurConfig.version < 10) {
|
|
double oldValue = getDouble("mobs.zombified_piglin.attributes.max-health", zombifiedPiglinMaxHealth);
|
|
@@ -1577,6 +1578,7 @@ 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);
|
|
}
|
|
|
|
public boolean babiesAreRidable = true;
|