Skip to content

Commit

Permalink
Fix MC-157464
Browse files Browse the repository at this point in the history
  • Loading branch information
Rektroth committed Apr 25, 2024
1 parent 99d6e31 commit 8dcff7a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ Whiteout is an attempt to implement the bug fixes offered by the [Paper](https:/

### Present

| Bug | Lazy? | Mojang Prioritization | Name |
|-------------------------------------------------------|-------|-----------------------|----------------------------------------------------------------------|
| [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-253721](https://bugs.mojang.com/browse/MC-253721) | No | Important | Wrong logs when running /op @a |
| [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 |
| Bug | Lazy? | Mojang Prioritization | Name |
|-------------------------------------------------------|-------|-----------------------|--------------------------------------------------------------------------------|
| [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-157464](https://bugs.mojang.com/browse/MC-157464) | No | Normal | Villagers move around in bed or even leave the bed when food is thrown at them |
| [MC-158900](https://bugs.mojang.com/browse/MC-158900) | No | *None* | "bad packet id 26" upon connecting after tempban expire |
| [MC-253721](https://bugs.mojang.com/browse/MC-253721) | No | Important | Wrong logs when running /op @a |
| [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 |

Patches that are marked as "lazy" generally meet at least one of the following criteria:

Expand All @@ -37,7 +38,6 @@ Any patches that are considered "lazy" or are for a bug ticket which does not ha
| [MC-145260](https://bugs.mojang.com/browse/MC-145260) | Whitelist on state inconsistency |
| [MC-145656](https://bugs.mojang.com/browse/MC-145656) | Attribute "follow_range" is not working to hostile mobs before they find the target |
| [MC-153086](https://bugs.mojang.com/browse/MC-153086) | Beacons always play deactivating sound when broken, even when not powered |
| [MC-157464](https://bugs.mojang.com/browse/MC-157464) | Villagers move around in bed or even leave the bed when food is thrown at them |
| [MC-159283](https://bugs.mojang.com/browse/MC-159283) | The End terrain does not generate in multiple rings centered around the world center |
| [MC-163962](https://bugs.mojang.com/browse/MC-163962) | Villager demand values decrease indefinitely |
| [MC-167279](https://bugs.mojang.com/browse/MC-167279) | Bees get stuck in the void |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Patch for MC-157464
*
* Authored for CraftBukkit/Spigot by Jake Potrebic <[email protected]> on July 11, 2022.
* Ported to Fabric by Rektroth <[email protected]> on April 25, 2024.
*/

package io.github.rektroth.whiteout.mixin.entity.ai.brain.task;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.brain.task.Task;
import net.minecraft.entity.ai.brain.task.VillagerTaskListProvider;
import net.minecraft.entity.ai.brain.task.WalkToNearestVisibleWantedItemTask;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(VillagerTaskListProvider.class)
public class VillagerTaskListProviderMixin {
@Redirect(
at = @At(
target = "Lnet/minecraft/entity/ai/brain/task/WalkToNearestVisibleWantedItemTask;create(FZI)Lnet/minecraft/entity/ai/brain/task/Task;",
value = "INVOKE"),
method = "createCoreTasks")
private static Task<LivingEntity> goToWantedItemFix(float speed, boolean requiresWalkTarget, int radius) {
return WalkToNearestVisibleWantedItemTask.create(
villager -> !villager.isSleeping(),
speed,
requiresWalkTarget,
radius
);
}
}
1 change: 1 addition & 0 deletions src/main/resources/whiteout.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compatibilityLevel": "JAVA_21",
"mixins": [
"entity.EntityMixin",
"entity.ai.brain.task.VillagerTaskListProviderMixin",
"entity.ai.goal.WolfBegGoalAccessor",
"entity.ai.goal.WolfBegGoalMixin",
"entity.boss.dragon.EnderDragonFightAccessor",
Expand Down

0 comments on commit 8dcff7a

Please sign in to comment.