Search in sources :

Example 1 with PlayerPositionLookS2CPacket

use of net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket in project BleachHack by BleachDrinker420.

the class PacketFly method onReadPacket.

@BleachSubscribe
public void onReadPacket(EventPacket.Read event) {
    if (event.getPacket() instanceof PlayerPositionLookS2CPacket) {
        PlayerPositionLookS2CPacket p = (PlayerPositionLookS2CPacket) event.getPacket();
        p.yaw = mc.player.getYaw();
        p.pitch = mc.player.getPitch();
        if (getSetting(4).asToggle().getState()) {
            event.setCancelled(true);
        }
    }
}
Also used : PlayerPositionLookS2CPacket(net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Example 2 with PlayerPositionLookS2CPacket

use of net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket in project meteor-rejects by AntiCope.

the class PacketFly method onPacketReceive.

@EventHandler
public void onPacketReceive(PacketEvent.Receive event) {
    if (event.packet instanceof PlayerPositionLookS2CPacket && !(mc.player == null || mc.world == null)) {
        PlayerPositionLookS2CPacket packet = (PlayerPositionLookS2CPacket) event.packet;
        if (setYaw.get()) {
            ((PlayerPositionLookS2CPacketAccessor) event.packet).setPitch(mc.player.getPitch());
            ((PlayerPositionLookS2CPacketAccessor) event.packet).setYaw(mc.player.getYaw());
        }
        if (setID.get()) {
            teleportID = packet.getTeleportId();
        }
    }
}
Also used : PlayerPositionLookS2CPacketAccessor(meteordevelopment.meteorclient.mixin.PlayerPositionLookS2CPacketAccessor) PlayerPositionLookS2CPacket(net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket) EventHandler(meteordevelopment.orbit.EventHandler)

Example 3 with PlayerPositionLookS2CPacket

use of net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket in project BleachHack by BleachDrinker420.

the class ElytraFly method onReadPacket.

@BleachSubscribe
public void onReadPacket(EventPacket.Read event) {
    if (getSetting(0).asMode().getMode() == 4 && shouldPacketFly() && event.getPacket() instanceof PlayerPositionLookS2CPacket) {
        PlayerPositionLookS2CPacket p = (PlayerPositionLookS2CPacket) event.getPacket();
        p.yaw = mc.player.getYaw();
        p.pitch = mc.player.getPitch();
    }
}
Also used : PlayerPositionLookS2CPacket(net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket) BleachSubscribe(org.bleachhack.eventbus.BleachSubscribe)

Aggregations

PlayerPositionLookS2CPacket (net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket)3 BleachSubscribe (org.bleachhack.eventbus.BleachSubscribe)2 PlayerPositionLookS2CPacketAccessor (meteordevelopment.meteorclient.mixin.PlayerPositionLookS2CPacketAccessor)1 EventHandler (meteordevelopment.orbit.EventHandler)1