@OnEntityEntered
public void onEntityEntered(Context ctx, Entity e) {
if (e.getDtClass().getDtName().equals("CDOTAWearableItem")) {
Integer accountId = getEntityProperty(e, "m_iAccountID", null);
Integer itemDefinitionIndex = getEntityProperty(e, "m_iItemDefinitionIndex", null);
Integer ownerHandle = getEntityProperty(e, "m_hOwnerEntity", null);
Entity owner = ctx.getProcessor(Entities.class).getByHandle(ownerHandle);
if (accountId > 0)
{
Integer playerId = getEntityProperty(owner, "m_iPlayerID", null);
Long accountId64 = 76561197960265728L + accountId;
Integer playerSlot = steamid_to_playerslot.get(accountId64);
cosmeticsMap.put(itemDefinitionIndex, playerSlot);
}
}
}