Skip to content

Commit

Permalink
Actually missed this in gradle.yml. Fixed some typos in README.md. Mo…
Browse files Browse the repository at this point in the history
…re LuaScript changes.
  • Loading branch information
tanishisherewithhh committed Sep 4, 2024
1 parent 46c5091 commit 5c42f65
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ jobs:
GITHUB_RUN_NUMBER: ${{ github.run_number }}
GITHUB_REPOSITORY: ${{ github.repository }}
PUSH_USER: ${{ github.actor }}

RUN_ID: ${{ github.run_id }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}

- name: Build success Notification
if: ${{ success() }}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</details>
<details>
<summary>Click to show the previous GUI</summary>
<p>Previous clickgui as of commit #199 (0758e8c)</p>
<p>Previous click-gui as of commit #199 (0758e8c)</p>
<img src="https://github.com/HeliosMinecraft/HeliosClient/blob/main/.github/images/heliosclientgui.png?raw=true" alt="Prev Click GUI">
</details>
<details>
Expand All @@ -31,15 +31,15 @@
1. Clone this repository
2. Run:
- Windows (CMD): `gradlew build`
- Linux/MacOS/Windows (Powershell): `./gradlew build`
- Linux/macOS/Windows (Powershell): `./gradlew build`

## Installation

- Install [Fabric](https://fabricmc.net/use/installer/) for Minecraft 1.20.4
- Put this mod into the `.minecraft/mods` folder
- The default keybind for the clickgui is `RSHIFT`.
- The default keybind for the click-gui is `RSHIFT`.

***Note: In future we may require [Satin API](https://modrinth.com/mod/satin-api) for shaders (or it will be packedged together)***
***Note: In future we may require [Satin API](https://modrinth.com/mod/satin-api) for shaders (or it will be packaged together)***


## Submitting a Bug
Expand Down Expand Up @@ -71,7 +71,7 @@ Thanks to all the people who helped to make this project what it is now, especia

## Thanks to

- [MoonlightMeadowns](https://github.com/kawaiizenbo/MoonlightMeadows) made by [KawaiiZenbo](https://github.com/kawaiizenbo) for serving as base project.
- [MoonlightMeadows](https://github.com/kawaiizenbo/MoonlightMeadows) made by [Kawaiizenbo](https://github.com/kawaiizenbo) for serving as base project.
- [Trouser-Streak](https://github.com/etianl/Trouser-Streak) for finding the Palette Exploit.
- Many other clients for serving as a base for inspiration. (Like Meteor-Client, BleachHack, TH Recode, Old 3arth4ck, LiquidBounce)
- [0x3C50](https://github.com/0x3C50/Renderer) for the Renderer library (especially the FontRenderer).
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/dev/heliosclient/scripting/LuaFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class LuaFile extends File {
private final LuaExecutor executor;
public boolean isLoaded = false;
private boolean isLoaded = false;
public int bindKey = -1;
BufferedReader reader = null;
/**
Expand All @@ -33,6 +33,10 @@ public boolean isLoaded() {
return isLoaded;
}

public void setLoaded(boolean loaded) {
isLoaded = loaded;
}

/**
* Retrieves a reader for the Lua script file.
*
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/dev/heliosclient/scripting/LuaLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public void load(LuaFile luaFile) {
ChatUtils.sendHeliosMsg(ColorUtils.darkRed + "onRun() function not found for " + ColorUtils.blue + luaFile.getAbsolutePath() + ColorUtils.darkRed + " while loading");
HeliosClient.LOGGER.error("onRun() function not found for file: {} while loading", luaFile.getName());
}
luaFile.isLoaded = true;
luaFile.setLoaded(true);
ChatUtils.sendHeliosMsg(ColorUtils.green + "Loaded LuaFile" + ColorUtils.gray + " [" + ColorUtils.aqua + luaFile.getName() + ColorUtils.gray + "]");
if (HeliosClient.shouldSendNotification() && ModuleManager.get(NotificationModule.class).scriptNotifications.value) {
NotificationManager.addNotification(new InfoNotification(luaFile.getName(), "was loaded!", 1000, SoundUtils.TING_SOUNDEVENT));
}

} catch (FileNotFoundException e) {
luaFile.isLoaded = false;
luaFile.setLoaded(false);
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public void close(LuaFile file) {
//Call the Garbage collector to collect any leftover garbage by the script. Might cause lag or crash if unused properly
System.gc();

file.isLoaded = false;
file.setLoaded(false);
ChatUtils.sendHeliosMsg(ColorUtils.green + "Closed LuaFile" + ColorUtils.gray + " [" + ColorUtils.aqua + file.getScriptName() + ColorUtils.gray + "]");
if (HeliosClient.shouldSendNotification() && ModuleManager.get(NotificationModule.class).scriptNotifications.value) {
NotificationManager.addNotification(new InfoNotification(file.getScriptName(), "was unloaded!", 1000, SoundUtils.TING_SOUNDEVENT));
Expand All @@ -98,7 +98,7 @@ public void close(LuaFile file) {
// Clear all event listeners for the Lua file
LuaEventManager.INSTANCE.clearListeners(file);
} catch (IOException e) {
file.isLoaded = false;
file.setLoaded(false);
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@ public LuaFile getScript(LuaFile file) {
.map(file1 -> {
LuaFile luaFile = new LuaFile(file1.getPath(), executor);
luaFile.setBindKey(file.bindKey);
luaFile.isLoaded = false;
luaFile.setLoaded(false);
return luaFile;
})
.orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ public class LuaScriptManager {
* Retrieves all Lua scripts.
*/
public static void getScripts() {
luaFiles.addAll(luaLoader.getScripts());
luaFiles.forEach(file-> luaLoader.close(file));
ChatUtils.sendHeliosMsg(ColorUtils.green + "Closed all scripts");

luaFiles.addAll(luaLoader.getScripts());
ChatUtils.sendHeliosMsg(ColorUtils.green + "Reloaded all scripts successfully");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,9 @@ public static void moveItem(int fromSlot, int toSlot, SlotActionType fromAction,
HeliosClient.MC.interactionManager.clickSlot(player.currentScreenHandler.syncId, toSlot, 0, toAction, player);
}
}

public static void moveItemPickup(int fromSlot, int toSlot) {
moveItem(fromSlot,toSlot,SlotActionType.PICKUP,SlotActionType.PICKUP);
}

}

0 comments on commit 5c42f65

Please sign in to comment.