Пример #1
0
        public override void EntityInteraction(Entity player, Entity target, ItemUseOnEntityAction action, int hand, int slot)
        {
            switch (action)
            {
            case ItemUseOnEntityAction.Interact:
            {
                var packet = new InteractEntityPacket();
                packet.EntityId = (int)target.EntityId;
                packet.Type     = 0;
                packet.Hand     = hand;
                packet.Sneaking = player.IsSneaking;

                Client.SendPacket(packet);
            }
            break;

            case ItemUseOnEntityAction.Attack:
            {
                var packet = new InteractEntityPacket();
                packet.EntityId = (int)target.EntityId;
                packet.Type     = 1;
                packet.Hand     = hand;
                packet.Sneaking = player.IsSneaking;

                Client.SendPacket(packet);
            }
            break;

            case ItemUseOnEntityAction.ItemInteract:
                break;
            }
        }
Пример #2
0
 public override void EntityInteraction(Entity player, Entity target, ItemUseOnEntityAction action, int hand, int slot)
 {
 }
Пример #3
0
 public abstract void EntityInteraction(Entity player, Entity target,
                                        ItemUseOnEntityAction action);
Пример #4
0
 public abstract void EntityInteraction(Entity player, Entity target,
                                        ItemUseOnEntityAction action, int hand, int slot);
Пример #5
0
 public override void EntityInteraction(Entity player, Entity target, ItemUseOnEntityAction action)
 {
 }