-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d608163
commit d40106b
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/net/wurstclient/hacks/AntiForceLookHack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2014-2023 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.hacks; | ||
|
||
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; | ||
import net.wurstclient.Category; | ||
import net.wurstclient.SearchTags; | ||
import net.wurstclient.events.PacketOutputListener; | ||
import net.wurstclient.hack.Hack; | ||
import net.wurstclient.mixin.PlayerPositionLookS2CPacketAccessor; | ||
|
||
@SearchTags({"anti force look", "no rotate"}) | ||
public final class AntiForceLookHack extends Hack implements PacketOutputListener | ||
{ | ||
public AntiForceLookHack() | ||
{ | ||
super("AntiForceLook"); | ||
setCategory(Category.MOVEMENT); | ||
} | ||
|
||
@Override | ||
public void onEnable() | ||
{ | ||
EVENTS.add(PacketOutputListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onDisable() | ||
{ | ||
EVENTS.remove(PacketOutputListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onSentPacket(PacketOutputEvent event) | ||
{ | ||
if(event.getPacket() instanceof PlayerPositionLookS2CPacket) | ||
{ | ||
PlayerPositionLookS2CPacketAccessor packet = (PlayerPositionLookS2CPacketAccessor)event.getPacket(); | ||
packet.setYaw(MC.player.getYaw()); | ||
packet.setPitch(MC.player.getPitch()); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/net/wurstclient/mixin/PlayerPositionLookS2CPacketAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2014-2023 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; | ||
|
||
@Mixin(PlayerPositionLookS2CPacket.class) | ||
public interface PlayerPositionLookS2CPacketAccessor | ||
{ | ||
@Mutable | ||
@Accessor("yaw") | ||
void setYaw(float yaw); | ||
|
||
@Mutable | ||
@Accessor("pitch") | ||
void setPitch(float pitch); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters