public static float getWeaponSpeedMod(EntityLivingBase entity) { WeaponType weapon = InventoryUtil.getMainWeapon(entity); if (WeaponType.NONE.equals(weapon)) { MonsterModel monster = ((IMonster) entity).getModel(); if (entity instanceof IMonster) {} } return weapon.getSpeed(); }
public static boolean isWieldingLightWeapon(EntityLivingBase entity) { WeaponType weapon = InventoryUtil.getMainWeapon(entity); if (WeaponType.NONE.equals(weapon) && entity instanceof IMonster) { // TODO handle secondary attacks return false; } return weapon.getHandedness().equals(Handedness.LIGHT); }
public static CritRoll getAttackDamage(EntityLivingBase entity) { WeaponType weapon = InventoryUtil.getMainWeapon(entity); if (WeaponType.NONE.equals(weapon)) { MonsterModel monster = ((IMonster) entity).getModel(); if (entity instanceof IMonster && !monster.damage.isEmpty()) { // TODO determine which weapon is being used return monster.damage.get(0); } } return weapon.getDamage((int) BuffableType.SIZE.get(entity)); }