Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
feat: fix minecraft class not being present in newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dxxxxy committed May 24, 2024
1 parent 88a9e1c commit 115e835
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# EssentialCosmeticsUnlocker
**Client-side only** patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.4).
**Client-side only** patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.6).

![](https://img.shields.io/badge/COMPATIBILITY-∞-0?style=for-the-badge)
![](https://img.shields.io/github/downloads/DxxxxY/EssentialCosmeticsUnlocker/total?style=for-the-badge)
Expand All @@ -11,23 +11,23 @@ Grab the .jar you need from the [Releases](https://github.com/DxxxxY/EssentialCo
- Efficient, single class and light-weight thanks to mixins.
- Unlock ALL cosmetics and emotes (including developer).
- Universally compatible with any version (view [Compatibility](#compatibility) table).
- Saves equipped cosmetics to config file located in `.minecraft/ecu`.
- Saves equipped cosmetics to config file located in `AppData/Roaming/ecu`.
- Loads equipped cosmetics from config file when you toggle the `Hide/Show My Cosmetics` button.
- Dumps cosmetic data in `.minecraft/ecu` (texture, geometry) when opening the game. Useful for those looking to replicate the cosmetics in their own projects.
- Dumps cosmetic data in `AppData/Roaming/ecu` (texture, geometry) when opening the game. Useful for those looking to replicate the cosmetics in their own projects.

## Compatibility
Feel free to contribute to this table with a PR and a convincing screenshot. Only the major versions are tested as it takes time to do it manually.

| MC Major Version | Forge | Fabric* | Last Checked (dd/mm/yyyy) |
|------------------|--------------|--------------------|---------------------------|
| 1.8 | `✔️ works`^ | `⬛ not applicable` | 23/06/2024 |
| 1.8 | `✔️ works`^ | `⬛ not applicable` | 24/05/2024 |
| 1.12 | `✔️ works`^️ | `⬛ not applicable` | |
| | | | |
| 1.16 | `✔️ works` | `✔️ works` | |
| 1.17 | `✔️ works`| `✔️ works` | |
| 1.18 | `✔️ works`| `✔️ works` | |
| 1.19 | `✔️ works`| `✔️ works` | |
| 1.20 | `✔️ works` | `✔️ works` | |
| 1.20 | `✔️ works` | `✔️ works` | 24/05/2024 |

Last Essential version checked: **v1.3.2.4**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import gg.essential.network.connectionmanager.cosmetics.EquippedCosmeticsManager;
import gg.essential.network.cosmetics.Cosmetic;
import gg.essential.util.UUIDUtil;
import net.minecraft.client.Minecraft;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -52,7 +51,7 @@ public void CosmeticManager(ConnectionManager connectionManager, File baseDir, C
System.out.println("[EssentialCosmeticsUnlocker] Loading config");

//create if doesnt exist
File configFile = new File(new File(Minecraft.getMinecraft().mcDataDir, "ecu"), "ecu.txt");
File configFile = new File(new File(System.getenv("APPDATA"), "ecu"), "ecu.txt");
configFile.getParentFile().mkdirs();

Scanner sc = new Scanner(configFile);
Expand Down Expand Up @@ -96,7 +95,7 @@ public void updateEquippedCosmetic(CosmeticSlot slot, String cosmeticId, Callbac
//save config
try {
System.out.println("[EssentialCosmeticsUnlocker] Saving config");
PrintWriter pw = new PrintWriter(new File(new File(Minecraft.getMinecraft().mcDataDir, "ecu"), "ecu.txt"));
PrintWriter pw = new PrintWriter(new File(new File(System.getenv("APPDATA"), "ecu"), "ecu.txt"));

for (Map.Entry<CosmeticSlot, String> entry : map.entrySet()) {
pw.println(entry.getKey().getId() + "=" + entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import gg.essential.cosmetics.model.Cosmetic;
import gg.essential.network.connectionmanager.ConnectionManager;
import gg.essential.network.connectionmanager.handler.cosmetics.ServerCosmeticsPopulatePacketHandler;
import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -26,7 +25,7 @@ public void onHandle(ConnectionManager connectionManager, ServerCosmeticsPopulat
try {
Gson gson = new Gson();
List<Cosmetic> cosmetics = new ArrayList<>();
File dumpFile = new File(new File(Minecraft.getMinecraft().mcDataDir, "ecu"), "dump.txt");
File dumpFile = new File(new File(System.getenv("APPDATA"), "ecu"), "dump.txt");
dumpFile.getParentFile().mkdirs();

//start with already existing or new list
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "ecu",
"version": "1.4.0",
"name": "EssentialCosmeticsUnlocker",
"description": "Client-side only patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.4).",
"description": "Client-side only patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.6).",
"authors": ["dxxxxy"],
"license": "GPL-3.0",
"environment": "*",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/modid.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[{
"modid": "ecu",
"name": "EssentialCosmeticsUnlocker",
"description": "Client-side only patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.4).",
"description": "Client-side only patch that allows you to unlock ALL cosmetics (+ emotes) in the Essential mod. Works on every version of Essential MC (1.8.9 - 1.20.6).",
"version": "1.4.0",
"authorList": ["dxxxxy"],
}]

0 comments on commit 115e835

Please sign in to comment.