Skip to content

Commit

Permalink
Fix MC-167279
Browse files Browse the repository at this point in the history
  • Loading branch information
Rektroth committed Apr 25, 2024
1 parent 5121bcc commit 6978917
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Whiteout is an attempt to implement the gameplay and mechanic consistency patche
| [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-167279](https://bugs.mojang.com/browse/MC-167279) | No | Normal | Bees get stuck in the void |
| [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 |

Expand Down Expand Up @@ -40,7 +41,6 @@ Any patches that are considered "lazy" or are for a bug ticket which does not ha
| [MC-153086](https://bugs.mojang.com/browse/MC-153086) | Beacons always play deactivating sound when broken, even when not powered |
| [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 |
| [MC-171420](https://bugs.mojang.com/browse/MC-171420) | OP players get kicked for not being on the whitelist (enforce = on) |
| [MC-174630](https://bugs.mojang.com/browse/MC-174630) | Secondary beacon effect remains when switching primary effect |
| [MC-179072](https://bugs.mojang.com/browse/MC-179072) | Creepers do not defuse when switching from Survival to Creative/Spectator |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Patch for MC-167279
*
* Authored for CraftBukkit/Spigot by William Blake Galbreath <[email protected]> on January 26, 2020.
* Ported to Fabric by Rektroth <[email protected]> on April 25, 2024.
*/

package io.github.rektroth.whiteout.mixin.entity.passive;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.ai.control.FlightMoveControl;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.BeeEntity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(BeeEntity.class)
public abstract class BeeEntityMixin extends AnimalEntity {
protected BeeEntityMixin(EntityType<? extends AnimalEntity> entityType, World world) {
super(entityType, world);
}

@Inject(
at = @At("TAIL"),
method = "<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V"
)
public void fixedMoveControl(EntityType<? extends BeeEntity> entityType, World world, CallbackInfo ci) {
class BeeFlyingMoveControl extends FlightMoveControl {
public BeeFlyingMoveControl(final MobEntity entity, final int maxPitchChange, final boolean noGravity) {
super(entity, maxPitchChange, noGravity);
}

@Override
public void tick() {
if (!BeeEntityMixin.this.getWorld().isInBuildLimit(this.entity.getBlockPos())) {
this.entity.setNoGravity(false);
}

super.tick();
}
}

this.moveControl = new BeeFlyingMoveControl(this, 20, true);
}
}
1 change: 1 addition & 0 deletions src/main/resources/whiteout.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"entity.ai.goal.WolfBegGoalMixin",
"entity.boss.dragon.EnderDragonFightAccessor",
"entity.boss.dragon.EnderDragonFightMixin",
"entity.passive.BeeEntityMixin",
"server.PlayerManagerAccessor",
"server.PlayerManagerMixin",
"server.dedicated.command.DeOpCommandMixin",
Expand Down

0 comments on commit 6978917

Please sign in to comment.