mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Use UUID for cure reputation on 1.21.5
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 70e68d56f2d781930d877f40818d9aeb377dc8af..56c44a8ad87e7c17083ba09a5381aec50b844154 100644
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -284,9 +284,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
villager.refreshBrain(level);
|
||||
if (this.conversionStarter != null) {
|
||||
Player playerByUuid = level.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);
|
||||
- level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
|
||||
+ // level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager); // Leaf - move up
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 63ce733ce78eb9bc630c497988949e18cbb56fe2..f163b3368853770ebac64b92ccde4e91e4511daa 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -1093,6 +1093,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;
|
||||
Reference in New Issue
Block a user