9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch
2025-06-13 22:25:37 +08:00

50 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
Date: Tue, 9 Nov 2077 00:00:00 +0800
Subject: [PATCH] Use UUID for cure reputation
Related MC issue: https://bugs.mojang.com/browse/MC/issues/MC-247647
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
index d4b6c93f9f0e109be300164c4fd9167aba2d951c..138e62965a4e532972e51c16b429e050bb147788 100644
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -310,9 +310,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
villager.refreshBrain(serverLevel);
if (this.conversionStarter != null) {
Player playerByUuid = serverLevel.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate
+ villager.onReputationEventFromUUID(ReputationEventType.ZOMBIE_VILLAGER_CURED, this.conversionStarter); // Leaf - Use UUID for cure reputation
if (playerByUuid instanceof ServerPlayer) {
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, villager);
- serverLevel.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
+ //serverLevel.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager); // Leaf - Use UUID for cure reputation - move up
}
}
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
index acf8059017f4e45c307a113abed36c59b231d9a6..3d6ffc2f9bba9cd81adf34e12840a08fa1fa9245 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
@@ -1103,6 +1103,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
}
+ // Leaf start - Use UUID for cure reputation
+ public void onReputationEventFromUUID(ReputationEventType type, java.util.UUID target) {
+ if (type == ReputationEventType.ZOMBIE_VILLAGER_CURED) {
+ this.gossips.add(target, GossipType.MAJOR_POSITIVE, 20);
+ this.gossips.add(target, GossipType.MINOR_POSITIVE, 25);
+ } else if (type == ReputationEventType.TRADE) {
+ this.gossips.add(target, GossipType.TRADING, 2);
+ } else if (type == ReputationEventType.VILLAGER_HURT) {
+ this.gossips.add(target, GossipType.MINOR_NEGATIVE, 25);
+ } else if (type == ReputationEventType.VILLAGER_KILLED) {
+ this.gossips.add(target, GossipType.MAJOR_NEGATIVE, 25);
+ }
+ }
+ // Leaf end - Use UUID for cure reputation
+
@Override
public int getVillagerXp() {
return this.villagerXp;