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-08-19 12:16:12 +1000
committerMoulberry <james.jenour@student.scotch.wa.edu.au>2020-08-19 12:16:12 +1000
commitea1391e0c6f0db863bbb61511eb6e9acb57a5968 (patch)
tree16e0b8a76055838b6cc1963f56c1327cd8850c66 /src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
parent0c23f52d2be811d74a3b6ef598dd9de7ccb763ab (diff)
downloadnotenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.tar.gz
notenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.tar.bz2
notenoughupdates-ea1391e0c6f0db863bbb61511eb6e9acb57a5968.zip
1.1.5
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.java26
1 files changed, 26 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..2337aa8b
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
@@ -0,0 +1,26 @@
+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) {
+ CustomItemEffects.INSTANCE.teleported = true;
+ player.setPositionAndRotation(x, y, z, yaw, pitch);
+ }
+
+}