mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-26 15:29:26 -09:00
commit
1c736735c5
File diff suppressed because one or more lines are too long
@ -3,7 +3,18 @@
|
|||||||
ModAPI.meta.version("v0");
|
ModAPI.meta.version("v0");
|
||||||
ModAPI.meta.description("testing custom entities");
|
ModAPI.meta.description("testing custom entities");
|
||||||
ModAPI.meta.credits("By ZXMushroom63");
|
ModAPI.meta.credits("By ZXMushroom63");
|
||||||
|
function waitForRenderManager() {
|
||||||
|
return new Promise((res, rej)=>{
|
||||||
|
function check() {
|
||||||
|
if (ModAPI.mc.renderManager) {
|
||||||
|
res();
|
||||||
|
} else {
|
||||||
|
setTimeout(check, 1/20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
check();
|
||||||
|
});
|
||||||
|
}
|
||||||
function registerEntity() {
|
function registerEntity() {
|
||||||
// Utils
|
// Utils
|
||||||
const ResourceLocation = ModAPI.reflect.getClassByName("ResourceLocation").constructors.find(x => x.length === 1);
|
const ResourceLocation = ModAPI.reflect.getClassByName("ResourceLocation").constructors.find(x => x.length === 1);
|
||||||
@ -120,6 +131,8 @@
|
|||||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAQBJREFUeF7l0BFzAmAAgOGvKxgMgiAYDIJgEARBEASDQTAIgiAYBEEQBN0NBkEQBEEQBIMgCAZBEAwGgyAIgiAIgiConxE88PJ790RCCNdYCOGeRe/4j4SYDvCgAzzqAHEdIKEDJHWAJx3gWQdI6QBpHeBFB8joAFkdIKcD5HWAgg5Q1AFedYA3HaCkA7zrAGUdoKIDVHWAmg7woQPUdYCGDtDUAVo6QFsH6OgAnzrAlw7Q1QF6OkBfBxjoAEMdYKQDjHWAiQ7wrQNMdYCZDjDXAX50gIUOsNQBVjrArw7wpwP86wBrHWCjA2x1gJ0OsNcBDjrAUQc46QBnHeBiA9wALSueIjTE4PwAAAAASUVORK5CYII="
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAQBJREFUeF7l0BFzAmAAgOGvKxgMgiAYDIJgEARBEASDQTAIgiAYBEEQBN0NBkEQBEEQBIMgCAZBEAwGgyAIgiAIgiConxE88PJ790RCCNdYCOGeRe/4j4SYDvCgAzzqAHEdIKEDJHWAJx3gWQdI6QBpHeBFB8joAFkdIKcD5HWAgg5Q1AFedYA3HaCkA7zrAGUdoKIDVHWAmg7woQPUdYCGDtDUAVo6QFsH6OgAnzrAlw7Q1QF6OkBfBxjoAEMdYKQDjHWAiQ7wrQNMdYCZDjDXAX50gIUOsNQBVjrArw7wpwP86wBrHWCjA2x1gJ0OsNcBDjrAUQc46QBnHeBiA9wALSueIjTE4PwAAAAASUVORK5CYII="
|
||||||
)).arrayBuffer());
|
)).arrayBuffer());
|
||||||
AsyncSink.hideFile("resourcepacks/AsyncSinkLib/assets/minecraft/textures/entity/cube.png.mcmeta");
|
AsyncSink.hideFile("resourcepacks/AsyncSinkLib/assets/minecraft/textures/entity/cube.png.mcmeta");
|
||||||
|
|
||||||
|
await waitForRenderManager()
|
||||||
ModAPI.mc.renderManager.entityRenderMap.put(ModAPI.util.asClass(data.EntityCube), new data.RenderCube(ModAPI.mc.renderManager.getRef()));
|
ModAPI.mc.renderManager.entityRenderMap.put(ModAPI.util.asClass(data.EntityCube), new data.RenderCube(ModAPI.mc.renderManager.getRef()));
|
||||||
ModAPI.promisify(ModAPI.mc.renderEngine.bindTexture)(data.cubeTexture).then(() => {
|
ModAPI.promisify(ModAPI.mc.renderEngine.bindTexture)(data.cubeTexture).then(() => {
|
||||||
console.log("Loaded cube texture into cache.");
|
console.log("Loaded cube texture into cache.");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
globalThis.ModAPIVersion = "v2.7";
|
globalThis.ModAPIVersion = "v2.7.1";
|
||||||
globalThis.doEaglerforge = true;
|
globalThis.doEaglerforge = true;
|
||||||
document.querySelector("title").innerText = `EaglerForge Injector ${ModAPIVersion}`;
|
document.querySelector("title").innerText = `EaglerForge Injector ${ModAPIVersion}`;
|
||||||
document.querySelector("h1").innerText = `EaglerForge Injector ${ModAPIVersion}`;
|
document.querySelector("h1").innerText = `EaglerForge Injector ${ModAPIVersion}`;
|
||||||
|
@ -771,7 +771,7 @@ globalThis.modapi_postinit = "(" + (() => {
|
|||||||
if (!object) {
|
if (!object) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (prop in object) {
|
if ((prop in object) && Object.keys(object).includes(prop)) {
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
var possibleKeys = Object.keys(object).filter(x => { return x.startsWith(prop) });
|
var possibleKeys = Object.keys(object).filter(x => { return x.startsWith(prop) });
|
||||||
@ -780,7 +780,7 @@ globalThis.modapi_postinit = "(" + (() => {
|
|||||||
})
|
})
|
||||||
return possibleKeys.sort((a, b) => {
|
return possibleKeys.sort((a, b) => {
|
||||||
return a.length - b.length;
|
return a.length - b.length;
|
||||||
})[0] || null;
|
})[0] || prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModAPI.util.modifyFunction = function (fn, patcherFn) {
|
ModAPI.util.modifyFunction = function (fn, patcherFn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user