use of net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket in project meteor-client by MeteorDevelopment.
the class AntiBed method sendStopPackets.
private void sendStopPackets(BlockPos blockPos) {
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, blockPos, Direction.UP));
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
}
use of net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket in project Client by MatHax.
the class TNTAura method mine.
public void mine(BlockPos blockPos, FindItemResult item) {
if (breakMode.get() == Mode.Normal) {
InvUtils.swap(item.slot(), false);
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP));
mc.player.swingHand(Hand.MAIN_HAND);
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, Direction.UP));
}
if (breakMode.get() == Mode.Instant) {
InvUtils.swap(item.slot(), false);
if (!startBreak) {
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP));
startBreak = true;
}
if (rotate.get())
Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction)));
else
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction));
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
}
}
use of net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket in project Client by MatHax.
the class SelfProtect method sendMinePackets.
private void sendMinePackets(BlockPos blockPos) {
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP));
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, Direction.UP));
}
use of net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket in project Client by MatHax.
the class SelfProtect method mine.
private void mine(BlockPos blockPos) {
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP));
mc.player.swingHand(Hand.MAIN_HAND);
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, Direction.UP));
}
use of net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket in project Client by MatHax.
the class AutoExtinguish method extinguishFire.
private void extinguishFire(BlockPos blockPos) {
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, net.minecraft.util.math.Direction.UP));
mc.player.swingHand(Hand.MAIN_HAND);
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, net.minecraft.util.math.Direction.UP));
}
Aggregations