diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java new file mode 100644 index 00000000..0bb84f44 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java @@ -0,0 +1,29 @@ +package io.github.moulberry.notenoughupdates.mixins; + +import io.github.moulberry.notenoughupdates.CustomItemEffects; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.StreamerMode; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Team; +import org.lwjgl.util.vector.Vector3f; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(NetHandlerPlayClient.class) +public class MixinNetHandlerPlayClient { + + private static final String TARGET = "Lnet/minecraft/entity/player/EntityPlayer;" + + "setPositionAndRotation(DDDFF)V"; + @Redirect(method="handlePlayerPosLook", at=@At(value="INVOKE", target=TARGET)) + public void handlePlayerPosLook_setPositionAndRotation(EntityPlayer player, double x, double y, double z, float yaw, float pitch) { + if(CustomItemEffects.INSTANCE.aoteTeleportationCurr != null) { + CustomItemEffects.INSTANCE.aoteTeleportationMillis += + Math.max(0, Math.min(300, NotEnoughUpdates.INSTANCE.manager.config.smoothAoteMillis.value)); + } + player.setPositionAndRotation(x, y, z, yaw, pitch); + } + +} |
