diff --git a/patches/server/0074-Fix-MC-2025.patch b/patches/server/0067-Fix-MC-2025.patch similarity index 100% rename from patches/server/0074-Fix-MC-2025.patch rename to patches/server/0067-Fix-MC-2025.patch diff --git a/patches/server/0075-Fix-MC-65198.patch b/patches/server/0068-Fix-MC-65198.patch similarity index 100% rename from patches/server/0075-Fix-MC-65198.patch rename to patches/server/0068-Fix-MC-65198.patch diff --git a/patches/server/0069-Fix-MC-172047.patch b/patches/server/0069-Fix-MC-172047.patch new file mode 100644 index 00000000..4cb97cdd --- /dev/null +++ b/patches/server/0069-Fix-MC-172047.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: HaHaWTH +Date: Fri, 15 Mar 2024 02:12:38 +0800 +Subject: [PATCH] Fix-MC-172047 + + +diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java +index a90055fe8819a32180754b6060a0f88e81d1a3b6..77def11f7862ec0ad9701fd74f504dd4c46e9a87 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java +@@ -58,6 +58,7 @@ import net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal; + import net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal; + import net.minecraft.world.entity.animal.horse.AbstractHorse; + import net.minecraft.world.entity.animal.horse.Llama; ++import net.minecraft.world.entity.decoration.ArmorStand; + import net.minecraft.world.entity.monster.AbstractSkeleton; + import net.minecraft.world.entity.monster.Creeper; + import net.minecraft.world.entity.monster.Ghast; +@@ -672,17 +673,29 @@ public class Wolf extends TamableAnimal implements NeutralMob { + + @Override + public boolean wantsToAttack(LivingEntity target, LivingEntity owner) { +- if (!(target instanceof Creeper) && !(target instanceof Ghast)) { +- if (target instanceof Wolf) { +- Wolf entitywolf = (Wolf) target; +- +- return !entitywolf.isTame() || entitywolf.getOwner() != owner; +- } else { +- return target instanceof Player && owner instanceof Player && !((Player) owner).canHarmPlayer((Player) target) ? false : (target instanceof AbstractHorse && ((AbstractHorse) target).isTamed() ? false : !(target instanceof TamableAnimal) || !((TamableAnimal) target).isTame()); +- } +- } else { ++ // Leaf start - Improve readability ++ if (target instanceof Creeper || target instanceof Ghast || target instanceof ArmorStand) { // Leaf - Fix MC-172047 + return false; + } ++ ++ if (target instanceof Wolf entityWolf) { ++ return !entityWolf.isTame() || entityWolf.getOwner() != owner; ++ } ++ ++ if (target instanceof Player targetPlayer && owner instanceof Player ownerPlayer) { ++ return ownerPlayer.canHarmPlayer(targetPlayer); ++ } ++ ++ if (target instanceof AbstractHorse targetHorse) { ++ return !targetHorse.isTamed(); ++ } ++ ++ if (target instanceof TamableAnimal tamableAnimalTarget) { ++ return !tamableAnimalTarget.isTame(); ++ } ++ ++ return true; ++ // Leaf end + } + + @Override diff --git a/patches/server/0067-Including-5s-in-getTPS.patch b/patches/server/0070-Including-5s-in-getTPS.patch similarity index 100% rename from patches/server/0067-Including-5s-in-getTPS.patch rename to patches/server/0070-Including-5s-in-getTPS.patch diff --git a/patches/server/0068-Remove-useless-creating-stats-json-bases-on-player-n.patch b/patches/server/0071-Remove-useless-creating-stats-json-bases-on-player-n.patch similarity index 100% rename from patches/server/0068-Remove-useless-creating-stats-json-bases-on-player-n.patch rename to patches/server/0071-Remove-useless-creating-stats-json-bases-on-player-n.patch diff --git a/patches/server/0069-Fix-NPE-during-creating-GUI-graph.patch b/patches/server/0072-Fix-NPE-during-creating-GUI-graph.patch similarity index 100% rename from patches/server/0069-Fix-NPE-during-creating-GUI-graph.patch rename to patches/server/0072-Fix-NPE-during-creating-GUI-graph.patch diff --git a/patches/server/0070-Don-t-throw-exception-on-missing-ResourceKey-value.patch b/patches/server/0073-Don-t-throw-exception-on-missing-ResourceKey-value.patch similarity index 100% rename from patches/server/0070-Don-t-throw-exception-on-missing-ResourceKey-value.patch rename to patches/server/0073-Don-t-throw-exception-on-missing-ResourceKey-value.patch diff --git a/patches/server/0071-Improve-Purpur-AFK-system.patch b/patches/server/0074-Improve-Purpur-AFK-system.patch similarity index 100% rename from patches/server/0071-Improve-Purpur-AFK-system.patch rename to patches/server/0074-Improve-Purpur-AFK-system.patch diff --git a/patches/server/0072-Ability-to-use-Virtual-Thread-for-async-scheduler.patch b/patches/server/0075-Ability-to-use-Virtual-Thread-for-async-scheduler.patch similarity index 100% rename from patches/server/0072-Ability-to-use-Virtual-Thread-for-async-scheduler.patch rename to patches/server/0075-Ability-to-use-Virtual-Thread-for-async-scheduler.patch diff --git a/patches/server/0073-Use-a-shadow-fork-that-supports-Java-21.patch b/patches/server/0076-Use-a-shadow-fork-that-supports-Java-21.patch similarity index 100% rename from patches/server/0073-Use-a-shadow-fork-that-supports-Java-21.patch rename to patches/server/0076-Use-a-shadow-fork-that-supports-Java-21.patch diff --git a/patches/server/0076-Chat-Image-protocol.patch b/patches/server/0077-Chat-Image-protocol.patch similarity index 100% rename from patches/server/0076-Chat-Image-protocol.patch rename to patches/server/0077-Chat-Image-protocol.patch diff --git a/patches/server/0077-Fix-MC-172047.patch b/patches/server/0077-Fix-MC-172047.patch deleted file mode 100644 index 0050f16a..00000000 --- a/patches/server/0077-Fix-MC-172047.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: HaHaWTH -Date: Fri, 15 Mar 2024 02:12:38 +0800 -Subject: [PATCH] Fix-MC-172047 - - -diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index a90055fe8819a32180754b6060a0f88e81d1a3b6..35d4645ebad044c5c216bc7d0126a055d623ee9f 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java -+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -58,6 +58,7 @@ import net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal; - import net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal; - import net.minecraft.world.entity.animal.horse.AbstractHorse; - import net.minecraft.world.entity.animal.horse.Llama; -+import net.minecraft.world.entity.decoration.ArmorStand; - import net.minecraft.world.entity.monster.AbstractSkeleton; - import net.minecraft.world.entity.monster.Creeper; - import net.minecraft.world.entity.monster.Ghast; -@@ -672,13 +673,33 @@ public class Wolf extends TamableAnimal implements NeutralMob { - - @Override - public boolean wantsToAttack(LivingEntity target, LivingEntity owner) { -- if (!(target instanceof Creeper) && !(target instanceof Ghast)) { -+ if (!(target instanceof Creeper) && !(target instanceof Ghast) && !(target instanceof ArmorStand)) { // Leaf - Fix MC-172047 - if (target instanceof Wolf) { - Wolf entitywolf = (Wolf) target; -- - return !entitywolf.isTame() || entitywolf.getOwner() != owner; - } else { -- return target instanceof Player && owner instanceof Player && !((Player) owner).canHarmPlayer((Player) target) ? false : (target instanceof AbstractHorse && ((AbstractHorse) target).isTamed() ? false : !(target instanceof TamableAnimal) || !((TamableAnimal) target).isTame()); -+ // Leaf start -+ if (target instanceof Player) { -+ Player targetPlayer = (Player) target; -+ if (owner instanceof Player) { -+ Player ownerPlayer = (Player) owner; -+ if (!ownerPlayer.canHarmPlayer(targetPlayer)) { -+ return false; -+ } -+ } -+ } -+ if (target instanceof AbstractHorse) { -+ AbstractHorse targetHorse = (AbstractHorse) target; -+ if (targetHorse.isTamed()) { -+ return false; -+ } -+ } -+ if (target instanceof TamableAnimal) { -+ TamableAnimal tamableAnimalTarget = (TamableAnimal) target; -+ return !tamableAnimalTarget.isTame(); -+ } -+ return true; -+ // Leaf end - } - } else { - return false;