Compare commits
42 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a838e99139 |
||
|
|
3df0d0d35c |
||
|
|
edbcab72bc |
||
|
|
758b956bf9 |
||
|
|
c2b8ab2b40 |
||
|
|
e8f972b648 |
||
|
|
685e76dd1c |
||
|
|
7c333cc20c |
||
|
|
fa2b879e81 |
||
|
|
3be876b20d |
||
|
|
7ebaf4d5ef |
||
|
|
1c736735c5 |
||
|
|
2618cefdc4 |
||
|
|
c08426c6da |
||
|
|
5c4183a96a |
||
|
|
2c2f307d2b |
||
|
|
c8d6011205 |
||
|
|
423916b98a |
||
|
|
36da879c8b |
||
|
|
46b57d109a |
||
|
|
8e6f2b1774 |
||
|
|
5689fc8b9a |
||
|
|
bc0bba9bde |
||
|
|
b0958576b2 |
||
|
|
485da5863c |
||
|
|
403d41d6d9 |
||
|
|
acc4df76ea |
||
|
|
a07c3207cf |
||
|
|
709352762e |
||
|
|
5f39288896 |
||
|
|
c3c1d4b4c6 |
||
|
|
09c08bf97f |
||
|
|
aa53a8bc3a |
||
|
|
e94c747a6c |
||
|
|
85ad018a15 |
||
|
|
82375417fd |
||
|
|
216309e111 |
||
|
|
35e31c2b52 |
||
|
|
d0853bcaa1 |
||
|
|
cce5305b1d |
||
|
|
5260679bf9 |
||
|
|
530bd2f2bd |
4 changed files with 4 additions and 33 deletions
|
|
@ -14,7 +14,7 @@ var modapi_preinit = `globalThis.ModAPI ||= {};
|
|||
`;
|
||||
var freezeCallstack = `if(ModAPI.hooks.freezeCallstack){return false};`;
|
||||
const EFIConfig = {
|
||||
ModAPIVersion: "v2.7.5", //also change in package.json
|
||||
ModAPIVersion: "v2.7.4", //also change in package.json
|
||||
doEaglerforge: true,
|
||||
verbose: false,
|
||||
doServerExtras: false,
|
||||
|
|
@ -375,11 +375,9 @@ var main;(function(){`
|
|||
|
||||
_status("Injecting scripts...");
|
||||
await wait(50);
|
||||
// 1.12 check is using nleit_MainClass, because peyton felt like renaming stuff. annoying, but useful too ig
|
||||
patchedFile = patchedFile.replace(
|
||||
` id="game_frame">`,
|
||||
` id="game_frame">
|
||||
\<script id="1_12_corelib_flag"\>ModAPI.is_1_12 = ${patchedFile.includes("nleit_MainClass_main")}\<\/script\>
|
||||
\<script id="modapi_patchesreg_events"\>${assets.PatchesRegistry.getEventInjectorCode()};\<\/script\>
|
||||
\<script id="modapi_postinit"\>${assets.modapi_postinit.replace("__modapi_version_code__", EFIConfig.ModAPIVersion)}\<\/script\>
|
||||
\<script id="modapi_modloader"\>${assets.modapi_modloader}\<\/script\>
|
||||
|
|
@ -390,8 +388,6 @@ var main;(function(){`
|
|||
);
|
||||
backgroundLog("[HTML] Injecting script files");
|
||||
patchedFile = patchedFile.replace(`<title>EaglercraftX`, `<title>EFI ${EFIConfig.ModAPIVersion} on`);
|
||||
patchedFile = patchedFile.replace(`<title>Eaglercraft`, `<title>EFI ${EFIConfig.ModAPIVersion} on`);
|
||||
|
||||
backgroundLog("[HTML] Injecting title");
|
||||
patchedFile = patchedFile.replaceAll(/main\(\);\s*?}/gm, (match) => {
|
||||
return match.replace("main();", "main();ModAPI.hooks._postInit();");
|
||||
|
|
|
|||
|
|
@ -129,16 +129,6 @@ const modapi_postinit = "(" + (() => {
|
|||
}) : args))
|
||||
}
|
||||
}
|
||||
function easyAlias(obj, realProperty, alias) {
|
||||
Object.defineProperty(obj, alias, {
|
||||
get: function () {
|
||||
return obj[realProperty];
|
||||
},
|
||||
set: function (x) {
|
||||
obj[realProperty] = x;
|
||||
}
|
||||
});
|
||||
}
|
||||
ModAPI.meta.title = function (title) {
|
||||
if (!document.currentScript || document.currentScript.getAttribute("data-isMod") !== "true") {
|
||||
return console.log("[ModAPIMeta] Cannot set meta for non-mod script.");
|
||||
|
|
@ -213,9 +203,6 @@ const modapi_postinit = "(" + (() => {
|
|||
}
|
||||
ModAPI.util ||= {};
|
||||
ModAPI.util.getMethodFromPackage = function (classId, methodName) {
|
||||
if (ModAPI.is_1_12) {
|
||||
classId = classId.replace(".eaglercraft.v1_8", ".eaglercraft"); //why peyton why must you do this. you couldve changed it to v1_12 too, that would've worked
|
||||
}
|
||||
var name = "";
|
||||
var classStuff = classId.split(".");
|
||||
classStuff.forEach((component, i) => {
|
||||
|
|
@ -229,9 +216,6 @@ const modapi_postinit = "(" + (() => {
|
|||
return name;
|
||||
}
|
||||
ModAPI.util.getCompiledNameFromPackage = ModAPI.util.getCompiledName = function (classId) {
|
||||
if (ModAPI.is_1_12) {
|
||||
classId = classId.replace(".eaglercraft.v1_8", ".eaglercraft"); //why peyton why must you do this. you couldve changed it to v1_12 too, that would've worked
|
||||
}
|
||||
var name = "";
|
||||
var classStuff = classId.split(".");
|
||||
classStuff.forEach((component, i) => {
|
||||
|
|
@ -924,16 +908,8 @@ const modapi_postinit = "(" + (() => {
|
|||
globalThis.Minecraft = ModAPI.mcinstance = ModAPI.javaClient = args[0];
|
||||
ModAPI.settings = new Proxy(ModAPI.mcinstance.$gameSettings, TeaVM_to_Recursive_BaseData_ProxyConf);
|
||||
|
||||
|
||||
if (ModAPI.is_1_12) {
|
||||
easyAlias(ModAPI.javaClient, "$player", "$thePlayer");
|
||||
easyAlias(ModAPI.javaClient, "$world", "$theWorld");
|
||||
}
|
||||
|
||||
startModLoader();
|
||||
|
||||
ModAPI.hooks.methods[initMethodName] = originalInit; //unhook
|
||||
|
||||
return x;
|
||||
};
|
||||
|
||||
|
|
@ -1150,7 +1126,6 @@ const modapi_postinit = "(" + (() => {
|
|||
ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain", "_main")] = function (...args) {
|
||||
if ((!inited) && (!getEaglerConfigFlag("noInitialModGui"))) {
|
||||
inited = true;
|
||||
ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.lax1dude.eaglercraft.v1_8.internal.teavm.ClientMain", "_main")] = originalMainMethod; //unhook
|
||||
return modapi_displayModGui(globalThis.main);
|
||||
} else {
|
||||
return originalMainMethod.apply(this, args);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(function grapplehook() {
|
||||
PluginAPI.require("player"); //Require the player
|
||||
globalThis.GrappleHookPlugin = {
|
||||
var GrappleHookPlugin = {
|
||||
oldXYZ: [0, 0, 0], //The previous hook position.
|
||||
prev: "NONE", //The previous state
|
||||
scaleH: 0.25, //Used for X and Z velocity
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
if (
|
||||
player.fishEntity !== undefined && //If the fish hook exists
|
||||
GrappleHookPlugin.prev === "AIR" && //And the hook was previously in the air
|
||||
(player.fishEntity.inGround || player.fishEntity.onGround) //And the hook is in the ground
|
||||
player.fishEntity.inGround //And the hook is in the ground
|
||||
) {
|
||||
GrappleHookPlugin.oldXYZ = [ //Set old grapple hook position
|
||||
player.fishEntity.posX,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eaglerforgeinjector",
|
||||
"version": "2.7.5",
|
||||
"version": "2.7.4",
|
||||
"description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.",
|
||||
"main": "node.js",
|
||||
"directories": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue