use of net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket in project BleachHack by BleachDrinker420.
the class ElytraFly method onSendPacket.
@BleachSubscribe
public void onSendPacket(EventPacket.Send event) {
if (getSetting(0).asMode().getMode() == 4 && shouldPacketFly()) {
if (event.getPacket() instanceof PlayerMoveC2SPacket.LookAndOnGround) {
event.setCancelled(true);
return;
}
if (event.getPacket() instanceof PlayerMoveC2SPacket.Full) {
event.setCancelled(true);
PlayerMoveC2SPacket p = (PlayerMoveC2SPacket) event.getPacket();
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.getX(0), p.getY(0), p.getZ(0), p.isOnGround()));
}
}
}
use of net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket in project Client by MatHax.
the class Blink method onSendPacket.
@EventHandler
private void onSendPacket(PacketEvent.Send event) {
if (!(event.packet instanceof PlayerMoveC2SPacket))
return;
event.cancel();
synchronized (packets) {
PlayerMoveC2SPacket p = (PlayerMoveC2SPacket) event.packet;
PlayerMoveC2SPacket prev = packets.size() == 0 ? null : packets.get(packets.size() - 1);
if (prev != null && p.isOnGround() == prev.isOnGround() && p.getYaw(-1) == prev.getYaw(-1) && p.getPitch(-1) == prev.getPitch(-1) && p.getX(-1) == prev.getX(-1) && p.getY(-1) == prev.getY(-1) && p.getZ(-1) == prev.getZ(-1))
return;
packets.add(p);
}
}
Aggregations