diff --git a/PATCHED.md b/PATCHED.md index 9023064e..bb889c23 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -59,6 +59,7 @@ | Basic | [MC-7569](https://bugs.mojang.com/browse/MC-7569) | RCON output has newlines removed | | Gameplay | [MC-8187](https://bugs.mojang.com/browse/MC-8187) | Two-by-two arrangements of jungle or spruce saplings cannot grow when there are adjacent blocks located north or west of the sapling formation | | Basic | [MC-30391](https://bugs.mojang.com/browse/MC-30391) | Chickens, blazes and the wither emit particles when landing from a height, despite falling slowly | +| Basic | [MC-44654](https://bugs.mojang.com/browse/MC-44654) | Some entities don't update position to the client when teleported | | Basic | [MC-69216](https://bugs.mojang.com/browse/MC-69216) | Switching to spectator mode while fishing keeps rod cast | | Basic | [MC-81773](https://bugs.mojang.com/browse/MC-81773) | Bows and tridents drawn in survival/creative/adventure mode can be released in spectator mode | | Basic | [MC-82263](https://bugs.mojang.com/browse/MC-82263) | Ender dragon produces regular hurt sound on final hit | diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc44654/EntityMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc44654/EntityMixin.java new file mode 100644 index 00000000..0c160186 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc44654/EntityMixin.java @@ -0,0 +1,32 @@ +package dev.isxander.debugify.mixins.basic.mc44654; + +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@BugFix(id = "MC-44654", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Some entities don't update position to the client when teleported") +@Mixin(Entity.class) +public abstract class EntityMixin { + @Shadow + public abstract EntityType getType(); + + @Shadow + public boolean hasImpulse; + + /** + * Since the update interval is at the integer limit, the position will never get updated. + * To fix, we mark velocity as dirty via hasImpulse to force an update. + */ + @Inject(method = "setPosRaw", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;isRemoved()Z", shift = At.Shift.AFTER)) + private void fixUpdateInterval(double x, double y, double z, CallbackInfo ci) { + if (this.getType().updateInterval() == Integer.MAX_VALUE) { + this.hasImpulse = true; + } + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..ca2dfaec 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -62,6 +62,7 @@ "basic.mc298066.LivingEntityMixin", "basic.mc299115.ProjectileMixin", "basic.mc30391.LivingEntityMixin", + "basic.mc44654.EntityMixin", "basic.mc69216.ServerPlayerMixin", "basic.mc7569.RconConsoleSourceMixin", "basic.mc82263.EnderDragonMixin",