diff --git a/patches/minecraft/net/minecraft/client/Minecraft.edit.java b/patches/minecraft/net/minecraft/client/Minecraft.edit.java index a760eba..a133e7b 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.edit.java +++ b/patches/minecraft/net/minecraft/client/Minecraft.edit.java @@ -748,19 +748,7 @@ > DELETE 36 @ 36 : 41 -> INSERT 11 : 20 @ 11 - -+ public static ModData makeModData() { -+ ModData mcglobal = new ModData(); -+ mcglobal.setCallbackString("currentScreen", () -> { -+ return getMinecraft().currentScreen.toString(); -+ }); -+ -+ return mcglobal; -+ } -+ - -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 12 : 13 @ 12 : 13 ~ return this.addScheduledTaskFuture(new Runnable() { diff --git a/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java b/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java index 758f080..2a51b24 100644 --- a/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java @@ -7,8 +7,10 @@ > DELETE 2 @ 2 : 6 -> CHANGE 4 : 11 @ 4 : 6 +> CHANGE 4 : 13 @ 4 : 6 +~ +~ import net.eaglerforge.api.ModData; ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ ~ import net.lax1dude.eaglercraft.v1_8.HString; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java index 14c803d..a019eba 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java @@ -161,16 +161,14 @@ + } + -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 11 @ 8 : 10 -~ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 24, 98, 20, - -> CHANGE 1 : 9 @ 1 : 5 - -~ this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 24, 98, 20, +~ this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, ~ I18n.format("menu.editProfile", new Object[0]))); ~ -~ this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, i + 72 + 24)); + +> CHANGE 1 : 5 @ 1 : 2 + ~ if (isFork) { ~ this.openGLWarning1 = EaglercraftVersion.mainMenuStringE; ~ this.openGLWarning2 = EaglercraftVersion.mainMenuStringF; @@ -186,11 +184,11 @@ > CHANGE 10 : 25 @ 10 : 12 -~ this.buttonList.add(new GuiButton(69420, this.width / 2 - 100, parInt1 + parInt2 * 2, +~ this.buttonList.add(new GuiButton(69420, this.width / 2 + 2, parInt1 + parInt2 * 2, 98, 20, ~ I18n.format("eaglerforge.menu.mods"))); ~ if (EaglercraftVersion.mainMenuEnableGithubButton) { -~ this.buttonList.add( -~ new GuiButton(14, this.width / 2 - 100, parInt1 + parInt2 * 3, I18n.format("menu.forkOnGitlab"))); +~ this.buttonList.add(new GuiButton(14, this.width / 2 - 100, parInt1 + parInt2 * 2, 98, 20, +~ I18n.format("menu.forkOnGitlab"))); ~ } else { ~ if (EagRuntime.getConfiguration().isEnableDownloadOfflineButton() ~ && (EagRuntime.getConfiguration().getDownloadOfflineButtonLink() != null diff --git a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java index 12a511e..83063c4 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java @@ -18,13 +18,14 @@ + import java.util.Locale; -> INSERT 1 : 14 @ 1 +> INSERT 1 : 15 @ 1 + import java.util.TimeZone; + + import com.google.common.base.Strings; + import com.google.common.collect.Lists; + ++ import net.eaglerforge.api.ModAPI; + import net.lax1dude.eaglercraft.v1_8.Display; + import net.lax1dude.eaglercraft.v1_8.EagRuntime; + import net.lax1dude.eaglercraft.v1_8.HString; @@ -299,7 +300,11 @@ + } + -> CHANGE 10 : 11 @ 10 : 11 +> INSERT 5 : 6 @ 5 + ++ "ModAPI: " + ModAPI.version, this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), + +> CHANGE 5 : 6 @ 5 : 6 ~ HString.format("Chunk-relative: %d %d %d", new Object[] { Integer.valueOf(blockpos.getX() & 15), diff --git a/patches/minecraft/net/minecraft/client/gui/ScaledResolution.edit.java b/patches/minecraft/net/minecraft/client/gui/ScaledResolution.edit.java new file mode 100644 index 0000000..6d3e7f9 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/ScaledResolution.edit.java @@ -0,0 +1,48 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> INSERT 2 : 3 @ 2 + ++ import net.eaglerforge.api.ModData; + +> CHANGE 3 : 9 @ 3 : 9 + +~ public class ScaledResolution extends ModData { +~ private static double scaledWidthD; +~ private static double scaledHeightD; +~ private static int scaledWidth; +~ private static int scaledHeight; +~ private static int scaleFactor; + +> INSERT 26 : 50 @ 26 + ++ public static ModData makeModData() { ++ ModData ScaledResolutionglobal = new ModData(); ++ ScaledResolutionglobal.setCallbackInt("getScaledWidth", () -> { ++ return scaledWidth; ++ }); ++ ScaledResolutionglobal.setCallbackInt("getScaledHeight", () -> { ++ return scaledHeight; ++ }); ++ ScaledResolutionglobal.setCallbackDouble("getScaledWidth_double", () -> { ++ return scaledWidthD; ++ }); ++ ScaledResolutionglobal.setCallbackDouble("getScaledHeight_double", () -> { ++ return scaledHeightD; ++ }); ++ ScaledResolutionglobal.setCallbackInt("getScaledWidth_double", () -> { ++ return scaledWidth; ++ }); ++ ScaledResolutionglobal.setCallbackInt("getScaleFactor", () -> { ++ return scaleFactor; ++ }); ++ ++ return ScaledResolutionglobal; ++ } ++ + +> EOF diff --git a/sources/main/java/net/eaglerforge/api/ModAPI.java b/sources/main/java/net/eaglerforge/api/ModAPI.java index 5228b7d..96f65d1 100644 --- a/sources/main/java/net/eaglerforge/api/ModAPI.java +++ b/sources/main/java/net/eaglerforge/api/ModAPI.java @@ -6,6 +6,7 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.minecraft.client.ClientBrandRetriever; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.ChatComponentText; import me.otterdev.UwUAPI; import org.teavm.jso.JSBody; @@ -25,6 +26,7 @@ import net.minecraft.client.gui.Gui; public class ModAPI { private static Minecraft mc; + private static ScaledResolution sr; private static Gui gui; public ArrayList requiredList; @@ -212,13 +214,19 @@ public class ModAPI { setGlobal("platform", PlatformAPI.makeModData()); setGlobal("logger", LoggerAPI.makeModData()); setGlobal("emptygui", EmptyGui.makeModData()); - setGlobal("mc", mc.makeModData()); + setGlobal("ScaledResolution", ScaledResolution.makeModData()); + getModAPI().setCallbackString("currentScreen", () -> { + return mc.currentScreen.toString(); + }); getModAPI().setCallbackInt("getdisplayHeight", () -> { return mc.displayHeight; }); getModAPI().setCallbackInt("getdisplayWidth", () -> { return mc.displayWidth; }); + getModAPI().setCallbackInt("getFONT_HEIGHT", () -> { + return mc.fontRendererObj.FONT_HEIGHT; + }); getModAPI().setCallbackVoidWithDataArg("drawStringWithShadow", (BaseData params) -> { mc.fontRendererObj.drawStringWithShadow(params.getString("msg"), params.getFloat("x"), params.getFloat("y"), params.getInt("color")); }); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 493cab7..4b16164 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -14,7 +14,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "EaglerForge"; - public static final String projectForkVersion = "v1.2.1"; + public static final String projectForkVersion = "v1.2.2"; public static final String projectForkVendor = "radmanplays"; public static final String projectForkURL = "https://github.com/eaglerforge/EaglerForge"; diff --git a/sources/setup/workspace_template/javascript/favicon.png b/sources/setup/workspace_template/javascript/favicon.png index 9c9fc89..0289395 100644 Binary files a/sources/setup/workspace_template/javascript/favicon.png and b/sources/setup/workspace_template/javascript/favicon.png differ diff --git a/sources/setup/workspace_template/javascript/index.html b/sources/setup/workspace_template/javascript/index.html index 9c4c456..1e22c55 100644 --- a/sources/setup/workspace_template/javascript/index.html +++ b/sources/setup/workspace_template/javascript/index.html @@ -5,7 +5,7 @@ - EaglerForge prerelease + EaglerForge