use of com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot in project InteractionVisualizer by LOOHP.
the class V1_11 method createEntityEquipmentPacket.
@Override
public PacketContainer[] createEntityEquipmentPacket(int entityId, List<ValuePairs<EquipmentSlot, ItemStack>> equipments) {
PacketContainer[] packets = new PacketContainer[equipments.size()];
for (int i = 0; i < equipments.size(); i++) {
ValuePairs<EquipmentSlot, ItemStack> pair = equipments.get(i);
PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
ItemSlot libSlot;
switch(pair.getFirst()) {
case CHEST:
libSlot = ItemSlot.CHEST;
break;
case FEET:
libSlot = ItemSlot.FEET;
break;
case HEAD:
libSlot = ItemSlot.HEAD;
break;
case LEGS:
libSlot = ItemSlot.LEGS;
break;
case OFF_HAND:
libSlot = ItemSlot.OFFHAND;
break;
case HAND:
default:
libSlot = ItemSlot.MAINHAND;
break;
}
packet.getItemSlots().write(0, libSlot);
packet.getItemModifier().write(0, pair.getSecond());
packets[i] = packet;
}
return packets;
}
use of com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot in project InteractionVisualizer by LOOHP.
the class V1_12 method createEntityEquipmentPacket.
@Override
public PacketContainer[] createEntityEquipmentPacket(int entityId, List<ValuePairs<EquipmentSlot, ItemStack>> equipments) {
PacketContainer[] packets = new PacketContainer[equipments.size()];
for (int i = 0; i < equipments.size(); i++) {
ValuePairs<EquipmentSlot, ItemStack> pair = equipments.get(i);
PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
ItemSlot libSlot;
switch(pair.getFirst()) {
case CHEST:
libSlot = ItemSlot.CHEST;
break;
case FEET:
libSlot = ItemSlot.FEET;
break;
case HEAD:
libSlot = ItemSlot.HEAD;
break;
case LEGS:
libSlot = ItemSlot.LEGS;
break;
case OFF_HAND:
libSlot = ItemSlot.OFFHAND;
break;
case HAND:
default:
libSlot = ItemSlot.MAINHAND;
break;
}
packet.getItemSlots().write(0, libSlot);
packet.getItemModifier().write(0, pair.getSecond());
packets[i] = packet;
}
return packets;
}
use of com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot in project InteractionVisualizer by LOOHP.
the class V1_13 method createEntityEquipmentPacket.
@Override
public PacketContainer[] createEntityEquipmentPacket(int entityId, List<ValuePairs<EquipmentSlot, ItemStack>> equipments) {
PacketContainer[] packets = new PacketContainer[equipments.size()];
for (int i = 0; i < equipments.size(); i++) {
ValuePairs<EquipmentSlot, ItemStack> pair = equipments.get(i);
PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
ItemSlot libSlot;
switch(pair.getFirst()) {
case CHEST:
libSlot = ItemSlot.CHEST;
break;
case FEET:
libSlot = ItemSlot.FEET;
break;
case HEAD:
libSlot = ItemSlot.HEAD;
break;
case LEGS:
libSlot = ItemSlot.LEGS;
break;
case OFF_HAND:
libSlot = ItemSlot.OFFHAND;
break;
case HAND:
default:
libSlot = ItemSlot.MAINHAND;
break;
}
packet.getItemSlots().write(0, libSlot);
packet.getItemModifier().write(0, pair.getSecond());
packets[i] = packet;
}
return packets;
}
use of com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot in project InteractionVisualizer by LOOHP.
the class V1_13_1 method createEntityEquipmentPacket.
@Override
public PacketContainer[] createEntityEquipmentPacket(int entityId, List<ValuePairs<EquipmentSlot, ItemStack>> equipments) {
PacketContainer[] packets = new PacketContainer[equipments.size()];
for (int i = 0; i < equipments.size(); i++) {
ValuePairs<EquipmentSlot, ItemStack> pair = equipments.get(i);
PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
ItemSlot libSlot;
switch(pair.getFirst()) {
case CHEST:
libSlot = ItemSlot.CHEST;
break;
case FEET:
libSlot = ItemSlot.FEET;
break;
case HEAD:
libSlot = ItemSlot.HEAD;
break;
case LEGS:
libSlot = ItemSlot.LEGS;
break;
case OFF_HAND:
libSlot = ItemSlot.OFFHAND;
break;
case HAND:
default:
libSlot = ItemSlot.MAINHAND;
break;
}
packet.getItemSlots().write(0, libSlot);
packet.getItemModifier().write(0, pair.getSecond());
packets[i] = packet;
}
return packets;
}
use of com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot in project InteractionVisualizer by LOOHP.
the class V1_15 method createEntityEquipmentPacket.
@Override
public PacketContainer[] createEntityEquipmentPacket(int entityId, List<ValuePairs<EquipmentSlot, ItemStack>> equipments) {
PacketContainer[] packets = new PacketContainer[equipments.size()];
for (int i = 0; i < equipments.size(); i++) {
ValuePairs<EquipmentSlot, ItemStack> pair = equipments.get(i);
PacketContainer packet = InteractionVisualizer.protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
ItemSlot libSlot;
switch(pair.getFirst()) {
case CHEST:
libSlot = ItemSlot.CHEST;
break;
case FEET:
libSlot = ItemSlot.FEET;
break;
case HEAD:
libSlot = ItemSlot.HEAD;
break;
case LEGS:
libSlot = ItemSlot.LEGS;
break;
case OFF_HAND:
libSlot = ItemSlot.OFFHAND;
break;
case HAND:
default:
libSlot = ItemSlot.MAINHAND;
break;
}
packet.getItemSlots().write(0, libSlot);
packet.getItemModifier().write(0, pair.getSecond());
packets[i] = packet;
}
return packets;
}
Aggregations