Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/debugify.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down