Package org.spout.vanilla.protocol.msg.entity

Examples of org.spout.vanilla.protocol.msg.entity.EntityEquipmentMessage


    event.getMessages().add(new PlayerAbilityMessage(event.getGodMode(), event.isFlying(), event.canFly(), event.isCreativeMode(), event.getFlyingSpeed(), event.getWalkingSpeed()));
  }

  @EventHandler
  public void onEntityEquipment(EntityEquipmentEvent event) {
    event.getMessages().add(new EntityEquipmentMessage(event.getEntity().getId(), event.getSlot(), event.getItem()));
  }
View Full Code Here


  @Override
  public EntityEquipmentMessage decode(ByteBuf buffer) throws IOException {
    int entityId = buffer.readInt();
    int slot = buffer.readUnsignedShort();
    ItemStack item = VanillaByteBufUtils.readItemStack(buffer);
    return new EntityEquipmentMessage(entityId, slot, item);
  }
View Full Code Here

      chestplate = armor.getChestPlate();
      helmet = armor.getHelmet();
      held = inventory.getQuickbar().getSelectedSlot().get();
    }
    if (held != null) {
      messages.add(new EntityEquipmentMessage(entity.getId(), EntityEquipmentMessage.HELD_SLOT, held));
    }
    messages.add(new EntityEquipmentMessage(entity.getId(), EntityEquipmentMessage.BOOTS_SLOT, boots));
    messages.add(new EntityEquipmentMessage(entity.getId(), EntityEquipmentMessage.LEGGINGS_SLOT, leggings));
    messages.add(new EntityEquipmentMessage(entity.getId(), EntityEquipmentMessage.CHESTPLATE_SLOT, chestplate));
    messages.add(new EntityEquipmentMessage(entity.getId(), EntityEquipmentMessage.HELMET_SLOT, helmet));

    return messages;
  }
View Full Code Here

    EntityInventory inventory = entity.get(EntityInventory.class);
    if (inventory != null) {
      final ItemStack held, boots, legs, chest, helm;
      held = inventory.getHeldItem();
      if (held != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.HELD_SLOT, held));
      }
      boots = inventory.getArmor().getBoots();
      if (boots != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.BOOTS_SLOT, boots));
      }
      legs = inventory.getArmor().getLeggings();
      if (legs != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.LEGGINGS_SLOT, legs));
      }
      chest = inventory.getArmor().getChestPlate();
      if (chest != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.CHESTPLATE_SLOT, chest));
      }
      helm = inventory.getArmor().getHelmet();
      if (helm != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.HELMET_SLOT, helm));
      }
    }
    return messages;
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.entity.EntityEquipmentMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.