mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 73fc9666 Fix per-world settings not reloading (#4756) 94c99a8d Fix NPE thrown when converting MerchantRecipe from Bukkit to NMS (#4755) 072faf2a Fix minor issue with JavaDoc breaking doc deploys
44 lines
2.5 KiB
Diff
44 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Mon, 10 Aug 2020 13:54:05 -0500
|
|
Subject: [PATCH] Add option to reset reputation when villager is cured
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
index 7cf6d4a4c..5dd9e3bb2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
@@ -39,7 +39,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
|
@Nullable
|
|
private EntityHuman bv;
|
|
private byte bx;
|
|
- private final Reputation by;
|
|
+ private Reputation by; // Purpur - remove final
|
|
private long bz;
|
|
private long bA;
|
|
private int bB;
|
|
@@ -942,6 +942,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
|
@Override
|
|
public void a(ReputationEvent reputationevent, Entity entity) {
|
|
if (reputationevent == ReputationEvent.a) {
|
|
+ if (world.purpurConfig.zombieVillagerResetReputationsWhenCured) this.by = new Reputation(); // Purpur
|
|
this.by.a(entity.getUniqueID(), ReputationType.MAJOR_POSITIVE, 20);
|
|
this.by.a(entity.getUniqueID(), ReputationType.MINOR_POSITIVE, 25);
|
|
} else if (reputationevent == ReputationEvent.e) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 8496be870..806ef0bb4 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -547,9 +547,11 @@ public class PurpurWorldConfig {
|
|
public boolean zombieVillagerJockeyOnlyBaby = true;
|
|
public double zombieVillagerJockeyChance = 0.05D;
|
|
public boolean zombieVillagerJockeyTryExistingChickens = true;
|
|
+ public boolean zombieVillagerResetReputationsWhenCured = false;
|
|
private void zombieVillagerSettings() {
|
|
zombieVillagerJockeyOnlyBaby = getBoolean("mobs.zombie_villager.jockey.only-babies", zombieVillagerJockeyOnlyBaby);
|
|
zombieVillagerJockeyChance = getDouble("mobs.zombie_villager.jockey.chance", zombieVillagerJockeyChance);
|
|
zombieVillagerJockeyTryExistingChickens = getBoolean("mobs.zombie_villager.jockey.try-existing-chickens", zombieVillagerJockeyTryExistingChickens);
|
|
+ zombieVillagerResetReputationsWhenCured = getBoolean("mobs.zombie_villager.reset-reputation-when-cured", zombieVillagerResetReputationsWhenCured);
|
|
}
|
|
}
|