mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 06:01:38 -09:00
Add 'eagler' domain to AsyncSink
This commit is contained in:
parent
0af8737e1d
commit
71f69fe2a0
@ -188,39 +188,44 @@ ModAPI.meta.credits("By ZXMushroom63");
|
||||
const objectStore = transaction.objectStore("filesystem");
|
||||
var object = (await promisifyIDBRequest(objectStore.get(["resourcepacks/manifest.json"])))?.data;
|
||||
var resourcePackList = object ? JSON.parse(dec.decode(object)) : { resourcePacks: [] };
|
||||
if (!resourcePackList.resourcePacks.find(x => x.name === "AsyncSinkLib")) {
|
||||
resourcePackList.resourcePacks.push({
|
||||
domains: ["minecraft"],
|
||||
folder: "AsyncSinkLib",
|
||||
name: "AsyncSinkLib",
|
||||
timestamp: Date.now()
|
||||
});
|
||||
const writeableTransaction = db.transaction(["filesystem"], "readwrite");
|
||||
const writeableObjectStore = writeableTransaction.objectStore("filesystem");
|
||||
await promisifyIDBRequest(writeableObjectStore.put({
|
||||
path: "resourcepacks/manifest.json",
|
||||
data: enc.encode(JSON.stringify(resourcePackList)).buffer
|
||||
}));
|
||||
await promisifyIDBRequest(writeableObjectStore.put({
|
||||
path: "resourcepacks/AsyncSinkLib/pack.mcmeta",
|
||||
data: enc.encode(JSON.stringify({
|
||||
"pack": {
|
||||
"pack_format": 1,
|
||||
"description": "AsyncSink Library Resources"
|
||||
}
|
||||
})).buffer
|
||||
}));
|
||||
|
||||
var icon = {
|
||||
path: "resourcepacks/AsyncSinkLib/pack.png",
|
||||
data: await (await fetch(asyncSinkIcon)).arrayBuffer()
|
||||
};
|
||||
|
||||
const imageTransaction = db.transaction(["filesystem"], "readwrite");
|
||||
const imageObjectStore = imageTransaction.objectStore("filesystem");
|
||||
|
||||
await promisifyIDBRequest(imageObjectStore.put(icon));
|
||||
var pack = {
|
||||
domains: ["minecraft", "eagler"],
|
||||
folder: "AsyncSinkLib",
|
||||
name: "AsyncSinkLib",
|
||||
timestamp: Date.now()
|
||||
};
|
||||
if (resourcePackList.resourcePacks.find(x => x.name === "AsyncSinkLib")) {
|
||||
var idx = resourcePackList.resourcePacks.indexOf(resourcePackList.resourcePacks.find(x => x.name === "AsyncSinkLib"));
|
||||
resourcePackList.resourcePacks = pack;
|
||||
} else {
|
||||
resourcePackList.resourcePacks.push(pack);
|
||||
}
|
||||
|
||||
const writeableTransaction = db.transaction(["filesystem"], "readwrite");
|
||||
const writeableObjectStore = writeableTransaction.objectStore("filesystem");
|
||||
await promisifyIDBRequest(writeableObjectStore.put({
|
||||
path: "resourcepacks/manifest.json",
|
||||
data: enc.encode(JSON.stringify(resourcePackList)).buffer
|
||||
}));
|
||||
await promisifyIDBRequest(writeableObjectStore.put({
|
||||
path: "resourcepacks/AsyncSinkLib/pack.mcmeta",
|
||||
data: enc.encode(JSON.stringify({
|
||||
"pack": {
|
||||
"pack_format": 1,
|
||||
"description": "AsyncSink Library Resources"
|
||||
}
|
||||
})).buffer
|
||||
}));
|
||||
|
||||
var icon = {
|
||||
path: "resourcepacks/AsyncSinkLib/pack.png",
|
||||
data: await (await fetch(asyncSinkIcon)).arrayBuffer()
|
||||
};
|
||||
|
||||
const imageTransaction = db.transaction(["filesystem"], "readwrite");
|
||||
const imageObjectStore = imageTransaction.objectStore("filesystem");
|
||||
|
||||
await promisifyIDBRequest(imageObjectStore.put(icon));
|
||||
}
|
||||
|
||||
// Client side reminders to enable the AsyncSink Resource Pack
|
||||
|
Loading…
x
Reference in New Issue
Block a user