simple api function

This commit is contained in:
radmanplays 2024-02-11 09:24:25 +03:30
parent c9570ae373
commit dbdeb61db8
4 changed files with 39 additions and 9 deletions

View File

@ -20,10 +20,11 @@
> DELETE 1 @ 1 : 4
> CHANGE 1 : 52 @ 1 : 4
> CHANGE 1 : 53 @ 1 : 4
~
~ import net.eaglerforge.EaglerForge;
~ import net.eaglerforge.api.ModAPI;
~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
~
~ import org.apache.commons.lang3.Validate;
@ -156,12 +157,13 @@
~ private final List<FutureTask<?>> scheduledTasks = new LinkedList();
> INSERT 14 : 18 @ 14
> INSERT 14 : 19 @ 14
+ public int joinWorldTickCounter = 0;
+ private int dontPauseTimer = 0;
+ public int bungeeOutdatedMsgTimer = 0;
+ private boolean isLANOpen = false;
+ public ModAPI modapi;
> INSERT 1 : 3 @ 1
@ -192,7 +194,7 @@
> INSERT 1 : 2 @ 1
+ EaglerForge.init();
+
> CHANGE 14 : 16 @ 14 : 16
@ -221,9 +223,11 @@
~ } finally {
~ this.shutdownMinecraftApplet();
> CHANGE 4 : 6 @ 4 : 6
> CHANGE 4 : 8 @ 4 : 6
~ private void startGame() throws IOException {
~ EaglerForge.init();
~ this.modapi = new ModAPI(theMinecraft);
~ this.gameSettings = new GameSettings(this);
> DELETE 1 @ 1 : 2
@ -305,7 +309,7 @@
~ private void createDisplay() {
~ Display.create();
~ Display.setTitle("Eaglercraft 1.8.8");
~ Display.setTitle("Eaglercraft* 1.8.8");
> DELETE 2 @ 2 : 39

View File

@ -3,6 +3,8 @@ package net.eaglerforge;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import static net.eaglerforge.api.ModAPI.initAPI;
public class EaglerForge {
public static final Logger log = LogManager.getLogger();
public static void init() {

View File

@ -0,0 +1,25 @@
package net.eaglerforge.api;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.minecraft.client.Minecraft;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import static net.lax1dude.eaglercraft.v1_8.EaglercraftVersion.projectForkVersion;
public class ModAPI {
private static Minecraft mc;
public static final Logger log = LogManager.getLogger();
public static String version = projectForkVersion;
@JSBody(params = { "version" }, script ="var ModAPI = {};\r\n" + //
"ModAPI.version = version;\r\n" + //
"ModAPI.log = log;\r\n" + //
"ModAPI.mcinstance = mc;\r\n" + //
"window.ModAPI = ModAPI;")
public static native void initAPI(String version);
public ModAPI(Minecraft mcIn) {
this.mc = mcIn;
initAPI(version);
}
}

View File

@ -48,13 +48,12 @@ public class EaglercraftVersion {
// Miscellaneous variables:
public static final String mainMenuStringA = "Minecraft* 1.8.8";
public static final String mainMenuStringB = projectOriginName + " " +
projectOriginRevision + "-" + projectOriginVersion + " ultimate";
public static final String mainMenuStringB = projectForkName + " " + projectForkVersion;
public static final String mainMenuStringC = "";
public static final String mainMenuStringD = "Resources Copyright Mojang AB";
public static final String mainMenuStringE = projectForkName + " " + projectForkVersion;
public static final String mainMenuStringF = "Based on eaglercraft " + projectOriginVersion;
public static final String mainMenuStringE = null;
public static final String mainMenuStringF = null;
public static final String mainMenuStringG = "Collector's Edition";
public static final String mainMenuStringH = "PBR Shaders";