aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/events/EntityEquipmentChangeEvent.kt
blob: eecc132caf5154a8755fdbd0eda7303bc339463f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package at.hannibal2.skyhanni.events

import net.minecraft.entity.Entity
import net.minecraft.item.ItemStack

data class EntityEquipmentChangeEvent(
    val entity: Entity,
    val equipmentSlot: Int,
    val newItemStack: ItemStack?
) : LorenzEvent() {
    val isHead get() = equipmentSlot == EQUIPMENT_SLOT_HEAD
    val isChest get() = equipmentSlot == EQUIPMENT_SLOT_CHEST
    val isLeggings get() = equipmentSlot == EQUIPMENT_SLOT_LEGGINGS
    val isFeet get() = equipmentSlot == EQUIPMENT_SLOT_FEET
    val isHand get() = equipmentSlot == EQUIPMENT_SLOT_HAND

    companion object {
        const val EQUIPMENT_SLOT_HEAD = 4
        const val EQUIPMENT_SLOT_CHEST = 3
        const val EQUIPMENT_SLOT_LEGGINGS = 2
        const val EQUIPMENT_SLOT_FEET = 1
        const val EQUIPMENT_SLOT_HAND = 0
    }
}