diff --git a/leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch index d66b6c8a..abb59c03 100644 --- a/leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch +++ b/leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch @@ -4,70 +4,32 @@ Date: Tue, 9 Nov 2077 00:00:00 +0800 Subject: [PATCH] Use UUID for cure reputation -diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index eb849c57992658005e0f514c6f7923f8ca43bebf..8043bc04fea74af4dac7fd3333353a08434b0b08 100644 ---- a/net/minecraft/server/level/ServerLevel.java -+++ b/net/minecraft/server/level/ServerLevel.java -@@ -2529,6 +2529,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe - host.onReputationEventFrom(type, target); - } - -+ // Leaf start - Use UUID for cure reputation -+ public void onReputationEvent(ReputationEventType type, UUID target, ReputationEventHandler host) { -+ host.onReputationEventFrom(type, target); -+ } -+ // Leaf end - Use UUID for cure reputation -+ - public void saveDebugReport(Path path) throws IOException { - ChunkMap chunkMap = this.getChunkSource().chunkMap; - -diff --git a/net/minecraft/world/entity/ReputationEventHandler.java b/net/minecraft/world/entity/ReputationEventHandler.java -index 2d704ba14ce676a3e721e8ce8dd3fe76acea7db1..9b47635584cd1326c13c23201a7d2c1a8541b18f 100644 ---- a/net/minecraft/world/entity/ReputationEventHandler.java -+++ b/net/minecraft/world/entity/ReputationEventHandler.java -@@ -4,4 +4,5 @@ import net.minecraft.world.entity.ai.village.ReputationEventType; - - public interface ReputationEventHandler { - void onReputationEventFrom(ReputationEventType type, Entity target); -+ void onReputationEventFrom(ReputationEventType type, java.util.UUID target); // Leaf - Use UUID for cure reputation - } diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java -index d4b6c93f9f0e109be300164c4fd9167aba2d951c..21b1ceb34973be6364c889f85c405717517ef462 100644 +index d4b6c93f9f0e109be300164c4fd9167aba2d951c..301228895f0347ec514cefc8a11d8ca7bc2f2225 100644 --- a/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/net/minecraft/world/entity/monster/ZombieVillager.java -@@ -312,7 +312,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -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, this.conversionStarter, villager); // Leaf - Use UUID for cure reputation ++ // serverLevel.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 acf8059017f4e45c307a113abed36c59b231d9a6..b46a94c78bb487a102f0156ee9329f768794d28b 100644 +index acf8059017f4e45c307a113abed36c59b231d9a6..3d6ffc2f9bba9cd81adf34e12840a08fa1fa9245 100644 --- a/net/minecraft/world/entity/npc/Villager.java +++ b/net/minecraft/world/entity/npc/Villager.java -@@ -1091,6 +1091,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler - - @Override - public void onReputationEventFrom(ReputationEventType type, Entity target) { -+ // Leaf start - Use UUID for reputation - Redirect to UUID method -+ if (true) { -+ this.onReputationEventFrom(type, target.getUUID()); -+ return; -+ } -+ // Leaf end - Use UUID for reputation - Redirect to UUID method - if (type == ReputationEventType.ZOMBIE_VILLAGER_CURED) { - this.gossips.add(target.getUUID(), GossipType.MAJOR_POSITIVE, 20); - this.gossips.add(target.getUUID(), GossipType.MINOR_POSITIVE, 25); -@@ -1103,6 +1109,22 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1103,6 +1103,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } } + // Leaf start - Use UUID for cure reputation -+ @Override -+ public void onReputationEventFrom(ReputationEventType type, java.util.UUID target) { ++ 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);