diff --git a/README.md b/README.md index 7e6dc7a..8887fa4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Whiteout is an attempt to implement the bug fixes offered by the [Paper](https:/ |-------------------------------------------------------|-------|-----------------------|----------------------------------------------------------------------| | [MC-4](https://bugs.mojang.com/browse/MC-4) | Yes | Low | Item drops sometimes appear at the wrong location | | [MC-27056](https://bugs.mojang.com/browse/MC-27056) | Yes | Low | You can blow the extension off a piston | +| [MC-84789](https://bugs.mojang.com/browse/MC-84789) | No | Low | Tamed wolves beg for bones while wild wolves don't | | [MC-158900](https://bugs.mojang.com/browse/MC-158900) | No | *None* | "bad packet id 26" upon connecting after tempban expire | | [MC-257487](https://bugs.mojang.com/browse/MC-257487) | No | Low | The ender dragon's name is not reset when it is respawned in the end | @@ -29,7 +30,6 @@ Any patches that are considered "lazy" or are for a bug ticket which does not ha |-------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MC-11193](https://bugs.mojang.com/browse/MC-11193) | The order in which powerable blocks (e.g. redstone dust blocks) along a wire are powered or de-powered is not clearly defined and causes a non-deterministic behavior for redstone contraptions | | [MC-81098](https://bugs.mojang.com/browse/MC-81098) | Redstone dust updates cause lag | -| [MC-84789](https://bugs.mojang.com/browse/MC-84789) | Tamed wolves beg for bones while wild wolves don't | | [MC-108513](https://bugs.mojang.com/browse/MC-108513) | end crystal did not spawn/despawn correct after enderdragon respawned | | [MC-123450](https://bugs.mojang.com/browse/MC-123450) | Item frames play sounds when the item within them is read from NBT | | [MC-123848](https://bugs.mojang.com/browse/MC-123848) | Item frames (and items within) when removed from a ceiling, drop atop, not under, the block | diff --git a/gradle.properties b/gradle.properties index ec70e47..0b56118 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.5+build.1 loader_version=0.15.10 # Mod Properties -mod_version=0.3.0 +mod_version=0.4.0 maven_group=io.github.rektroth archives_base_name=whiteout diff --git a/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalAccessor.java b/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalAccessor.java new file mode 100644 index 0000000..e573e98 --- /dev/null +++ b/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalAccessor.java @@ -0,0 +1,19 @@ +/* + * Patch for MC-84789 + * + * Authored for CraftBukkit/Spigot by Jake Potrebic on July 11, 2022. + * Ported to Fabric by Rektroth on April 24, 2024. + */ + +package io.github.rektroth.whiteout.mixin.entity.ai.goal; + +import net.minecraft.entity.ai.goal.WolfBegGoal; +import net.minecraft.entity.passive.WolfEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(WolfBegGoal.class) +public interface WolfBegGoalAccessor { + @Accessor("wolf") + WolfEntity getWolf(); +} diff --git a/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalMixin.java b/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalMixin.java new file mode 100644 index 0000000..f29562a --- /dev/null +++ b/src/main/java/io/github/rektroth/whiteout/mixin/entity/ai/goal/WolfBegGoalMixin.java @@ -0,0 +1,24 @@ +/* + * Patch for MC-84789 + * + * Authored for CraftBukkit/Spigot by Jake Potrebic on July 11, 2022. + * Ported to Fabric by Rektroth on April 24, 2024. + */ + +package io.github.rektroth.whiteout.mixin.entity.ai.goal; + +import net.minecraft.entity.ai.goal.WolfBegGoal; +import net.minecraft.entity.passive.WolfEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(WolfBegGoal.class) +public class WolfBegGoalMixin { + @Redirect( + at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;isTamed()Z"), + method = "isAttractive(Lnet/minecraft/entity/player/PlayerEntity;)Z") + public boolean fixedBadTameCheck(WolfEntity instance) { + return !((WolfBegGoalAccessor)this).getWolf().isTamed(); + } +} diff --git a/src/main/resources/whiteout.mixins.json b/src/main/resources/whiteout.mixins.json index 85b1df5..2f01b82 100644 --- a/src/main/resources/whiteout.mixins.json +++ b/src/main/resources/whiteout.mixins.json @@ -3,9 +3,11 @@ "package": "io.github.rektroth.whiteout.mixin", "compatibilityLevel": "JAVA_21", "mixins": [ + "entity.EntityMixin", + "entity.ai.goal.WolfBegGoalAccessor", + "entity.ai.goal.WolfBegGoalMixin", "entity.boss.dragon.EnderDragonFightAccessor", "entity.boss.dragon.EnderDragonFightMixin", - "entity.EntityMixin", "server.PlayerManagerAccessor", "server.PlayerManagerMixin", "world.explosion.ExplosionAccessor",