diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java index a22b273..6988e9e 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java @@ -30,7 +30,11 @@ + this.statWriter = statWriter; -> CHANGE 116 : 123 @ 116 : 117 +> INSERT 19 : 20 @ 19 + ++ mc.modapi.onUpdate(); + +> CHANGE 97 : 104 @ 97 : 98 ~ if (((sendQueue.getNetworkManager() instanceof ClientIntegratedServerNetworkManager) ~ || (sendQueue.getNetworkManager() instanceof LANClientNetworkManager)) diff --git a/sources/main/java/net/eaglerforge/api/GlobalsListener.java b/sources/main/java/net/eaglerforge/api/GlobalsListener.java index 6b9e42a..03c699c 100644 --- a/sources/main/java/net/eaglerforge/api/GlobalsListener.java +++ b/sources/main/java/net/eaglerforge/api/GlobalsListener.java @@ -17,12 +17,12 @@ class GlobalsListener { void onUpdate(); } - @JSBody(params = { "handler" }, script = "window.PluginAPI.globals.onGlobalsUpdate = handler;") + @JSBody(params = { "handler" }, script = "window.ModAPI.globals.onGlobalsUpdate = handler;") static native void provideCallback(GlobalsHandler handler); - @JSBody(params = { "handler" }, script = "window.PluginAPI.globals.onRequire = handler;") + @JSBody(params = { "handler" }, script = "window.ModAPI.globals.onRequire = handler;") static native void provideRequireCallback(GlobalsHandler handler); - @JSBody(params = { "handler" }, script = "window.PluginAPI.update = handler;") + @JSBody(params = { "handler" }, script = "window.ModAPI.update = handler;") static native void provideUpdateCallback(UpdateHandler handler); } \ No newline at end of file diff --git a/sources/main/java/net/eaglerforge/api/ModAPI.java b/sources/main/java/net/eaglerforge/api/ModAPI.java index a46ebbd..12a2edb 100644 --- a/sources/main/java/net/eaglerforge/api/ModAPI.java +++ b/sources/main/java/net/eaglerforge/api/ModAPI.java @@ -59,6 +59,10 @@ public class ModAPI { this.mc = mcIn; requiredList = new ArrayList(); initAPI(version); + newEvent("update"); + globalsFunctor(this); + globalsRequireFunctor(this); + globalsUpdateFunctor(this); getModAPI().setCallbackVoidWithDataArg("displayToChat", (BaseData params) -> { mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(params.getString("msg"))); }); @@ -112,5 +116,6 @@ public class ModAPI { } public void onUpdate() { + ModAPI.callEvent("update", new ModData()); } }