Skip to content

Commit

Permalink
Fix MC-84789
Browse files Browse the repository at this point in the history
  • Loading branch information
Rektroth committed Apr 25, 2024
1 parent 125b4d2 commit bfbe583
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand All @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Patch for MC-84789
*
* Authored for CraftBukkit/Spigot by Jake Potrebic <[email protected]> on July 11, 2022.
* Ported to Fabric by Rektroth <[email protected]> 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();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Patch for MC-84789
*
* Authored for CraftBukkit/Spigot by Jake Potrebic <[email protected]> on July 11, 2022.
* Ported to Fabric by Rektroth <[email protected]> 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();
}
}
4 changes: 3 additions & 1 deletion src/main/resources/whiteout.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bfbe583

Please sign in to comment.