-
Notifications
You must be signed in to change notification settings - Fork 9
/
Util.cs
34 lines (29 loc) · 1.07 KB
/
Util.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
using Lumina.Excel.Sheets;
namespace SimpleHeels;
public static unsafe class Utils {
public static GameObject* GetGameObjectById(uint objectId) {
for (var i = 0; i < Constants.ObjectLimit; i++) {
var o = GameObjectManager.Instance()->Objects.IndexSorted[i].Value;
if (o == null || o->EntityId != objectId) continue;
return o;
}
return null;
}
public static Lazy<HashSet<uint>> StaticMinions = new(() => {
try {
return PluginService.Data.GetExcelSheet<Companion>()?.Where(c => c.Behavior.RowId == 3).Select(c => c.RowId)?.ToHashSet() ?? [];
} catch {
return [];
}
});
public static bool IsPlayerWorld(this World world) {
if (world.Name.Data.IsEmpty) return false;
if (world.DataCenter.RowId == 0) return false;
if (world.IsPublic) return true;
return char.IsUpper((char)world.Name.Data.Span[0]);
}
}