Search in sources :

Example 1 with EquipmentSlotLens

use of org.spongepowered.common.inventory.lens.impl.slot.EquipmentSlotLens in project SpongeCommon by SpongePowered.

the class EquipmentInventoryLens method init.

private void init(Map<EquipmentType, SlotLens> lenses) {
    for (EquipmentSlot slot : EquipmentSlot.values()) {
        final EquipmentType type = (EquipmentType) (Object) slot;
        final SlotLens lensAtSlot = lenses.get(slot);
        if (lensAtSlot != null) {
            final EquipmentSlotLens equipmentSlotLens = new EquipmentSlotLens(this, lensAtSlot, type);
            this.addSpanningChild(equipmentSlotLens, KeyValuePair.of(Keys.EQUIPMENT_TYPE, type));
            this.lenses.put(type, equipmentSlotLens);
        }
    }
}
Also used : EquipmentSlotLens(org.spongepowered.common.inventory.lens.impl.slot.EquipmentSlotLens) EquipmentSlot(net.minecraft.world.entity.EquipmentSlot) EquipmentType(org.spongepowered.api.item.inventory.equipment.EquipmentType) EquipmentSlotLens(org.spongepowered.common.inventory.lens.impl.slot.EquipmentSlotLens) SlotLens(org.spongepowered.common.inventory.lens.slots.SlotLens)

Aggregations

EquipmentSlot (net.minecraft.world.entity.EquipmentSlot)1 EquipmentType (org.spongepowered.api.item.inventory.equipment.EquipmentType)1 EquipmentSlotLens (org.spongepowered.common.inventory.lens.impl.slot.EquipmentSlotLens)1 SlotLens (org.spongepowered.common.inventory.lens.slots.SlotLens)1