use of dev.hypnotic.mixin.PlayerInputC2SPacketAccessor in project Hypnotic-Client by Hypnotic-Development.
the class Disabler method onSendPacket.
@EventTarget
public void onSendPacket(EventSendPacket event) {
if (mode.is("Verus")) {
if (event.getPacket() instanceof PlayerInteractEntityC2SPacket) {
event.setCancelled(true);
}
if (event.getPacket() instanceof PlayerActionC2SPacket) {
mc.player.networkHandler.sendPacket(new PlayerInputC2SPacket(0, 0, false, false));
}
if (event.getPacket() instanceof PlayerInputC2SPacket) {
final PlayerInputC2SPacket packet = (PlayerInputC2SPacket) event.getPacket();
// mc.player.networkHandler.sendPacket(new PlayerInputC2SPacket(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, mc.player.age % 2 == 0, mc.player.age % 2 != 0));
((PlayerInputC2SPacketAccessor) packet).setForward(Float.POSITIVE_INFINITY);
((PlayerInputC2SPacketAccessor) packet).setSideways(Float.POSITIVE_INFINITY);
((PlayerInputC2SPacketAccessor) packet).setJumping(mc.player.age % 2 == 0);
((PlayerInputC2SPacketAccessor) packet).setSneaking(mc.player.age % 2 != 0);
}
}
}
Aggregations