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);
}
}
}
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();
}
}
}
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();
}
}
Aggregations