This repository was archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModules.cs
More file actions
49 lines (45 loc) · 1.7 KB
/
Modules.cs
File metadata and controls
49 lines (45 loc) · 1.7 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json;
namespace CubeIconReverter
{
public class Modules
{
//yes i know i couldve made this better but it was hurting my brain too much so i took the simple way
public readonly string cachepath = $"{Environment.GetEnvironmentVariable("localappdata")}\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\localcache\\minecraftpe\\packcache\\resource";
public static List<modulesClass> modules = new List<modulesClass>();
public static List<string> Get()
{
try
{
WebClient wc = new WebClient();
var json = JsonConvert.DeserializeObject<modulesClass[]>(wc.DownloadString("https://raw.githubusercontent.com/quartzexpressDEV/anticcpack/main/_modules/health_bar/health_bar.json"));
wc.Dispose();
Modules.modules.AddRange(json);
IEnumerable<string> ie = json.Select(modul => modul.name);
List<string> a = new List<string>();
a.AddRange(ie);
return a;
}
catch(Exception e)
{
Handlers.ReportException(e);
return new List<string> { "Error" };
}
}
public static string getFileNameByIndex(int index)
{
IEnumerable<string> ie = Modules.modules.Select(modul => modul.fileName);
List<string> a = new List<string>();
a.AddRange(ie);
return a[index];
}
}
public class modulesClass
{
public string name { get; set; }
public string fileName { get; set; }
}
}