Search in sources :

Example 16 with HandSwingC2SPacket

use of net.minecraft.network.packet.c2s.play.HandSwingC2SPacket in project BleachHack by BleachDrinker420.

the class MixinClientPlayerEntity method swingHand.

@Overwrite
public void swingHand(Hand hand) {
    EventSwingHand event = new EventSwingHand(hand);
    BleachHack.eventBus.post(event);
    if (!event.isCancelled()) {
        super.swingHand(event.getHand());
    }
    networkHandler.sendPacket(new HandSwingC2SPacket(hand));
}
Also used : HandSwingC2SPacket(net.minecraft.network.packet.c2s.play.HandSwingC2SPacket) EventSwingHand(org.bleachhack.event.events.EventSwingHand) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Aggregations

HandSwingC2SPacket (net.minecraft.network.packet.c2s.play.HandSwingC2SPacket)16 PlayerActionC2SPacket (net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket)6 ActionResult (net.minecraft.util.ActionResult)4 BlockHitResult (net.minecraft.util.hit.BlockHitResult)4 BlockPos (net.minecraft.util.math.BlockPos)4 Vec3d (net.minecraft.util.math.Vec3d)4 Hand (net.minecraft.util.Hand)3 Direction (net.minecraft.util.math.Direction)3 Scaffold (dev.hypnotic.module.player.Scaffold)2 List (java.util.List)2 Entity (net.minecraft.entity.Entity)2 PlayerMoveC2SPacket (net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket)2 Lists (com.google.common.collect.Lists)1 FriendManager (dev.hypnotic.config.friends.FriendManager)1 EventTarget (dev.hypnotic.event.EventTarget)1 EventMotionUpdate (dev.hypnotic.event.events.EventMotionUpdate)1 EventRender3D (dev.hypnotic.event.events.EventRender3D)1 EventSendPacket (dev.hypnotic.event.events.EventSendPacket)1 PlayerMoveC2SPacketAccessor (dev.hypnotic.mixin.PlayerMoveC2SPacketAccessor)1 Category (dev.hypnotic.module.Category)1