aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
diff options
context:
space:
mode:
authorMoulberry <james.jenour@student.scotch.wa.edu.au>2020-11-08 17:44:27 +1100
committerMoulberry <james.jenour@student.scotch.wa.edu.au>2020-11-08 17:44:27 +1100
commit07403ec86c53f67b94d988b4c01a0afc2fdb2810 (patch)
treefba4b3c37b02c42267e03a07453d3941c98fd66d /src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
parentfc4143dd3c892b11ae5f427fcecc22044ff98460 (diff)
parentec0660e41145d3d9ed479b3e697afddf8ddc8c4c (diff)
downloadnotenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.tar.gz
notenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.tar.bz2
notenoughupdates-07403ec86c53f67b94d988b4c01a0afc2fdb2810.zip
Merge branch 'beta'
uh yeah its pretty necessary guys
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.java29
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);
+ }
+
+}