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

Commit

Permalink
FIMOZZZZZ
Browse files Browse the repository at this point in the history
  • Loading branch information
ulybaka1337 committed Sep 28, 2024
1 parent 392015a commit b1eb912
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ModuleManager implements IManager {
public static MouseElytraFix mouseElytraFix = new MouseElytraFix();
public static TotemAnimation totemAnimation = new TotemAnimation();
public static PortalGodMode portalGodMode = new PortalGodMode();
public static OptifineCapes optifineCapes = new OptifineCapes();
public static Capes capes = new Capes();
public static Notifications notifications = new Notifications();
public static NoEntityTrace noEntityTrace = new NoEntityTrace();
public static MessageAppend messageAppend = new MessageAppend();
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/thunder/hack/features/modules/client/Capes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package thunder.hack.features.modules.client;

import thunder.hack.features.modules.Module;
import thunder.hack.setting.Setting;

public class Capes extends Module {
public Capes() {
super("Capes", Category.CLIENT);
}

public Setting<Boolean> optifineCapes = new Setting<>("Optifine", true);
public Setting<Boolean> minecraftcapesCapes = new Setting<>("Minecraftcapes.net", false);
public Setting<capePriority> priority = new Setting<>("Priority", capePriority.Optifine);

public enum capePriority { Optifine, Minecraftcapes}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void getTexture(GameProfile profile) {
customCapeTexture = Identifier.of("thunderhack", "textures/capes/starcape.png");
}

if (ModuleManager.optifineCapes.isEnabled())
if (ModuleManager.capes.isEnabled())
OptifineCapes.loadPlayerCape(profile, id -> {
customCapeTexture = id;
});
Expand Down
28 changes: 24 additions & 4 deletions src/main/java/thunder/hack/utility/OptifineCapes.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.NativeImageBackedTexture;
import net.minecraft.util.Identifier;
import thunder.hack.core.manager.client.ModuleManager;
import thunder.hack.features.modules.client.Capes;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -23,9 +25,28 @@ public interface ReturnCapeTexture {
public static void loadPlayerCape(GameProfile player, ReturnCapeTexture response) {
try {
String uuid = player.getId().toString();
NativeImageBackedTexture nIBT = getCapeFromURL(String.format("http://s.optifine.net/capes/%s.png", player.getName()));
Identifier capeTexture = MinecraftClient.getInstance().getTextureManager().registerDynamicTexture("th-cape-" + uuid, nIBT);
response.response(capeTexture);
NativeImageBackedTexture optifineCape = getCapeFromURL(String.format("http://s.optifine.net/capes/%s.png", player.getName()));
NativeImageBackedTexture minecraftcapesCape = getCapeFromURL(String.format("https://api.minecraftcapes.net/profile/%s/cape/map", player.getId().toString().replace("-","")));
switch (ModuleManager.capes.priority.getValue()) {
case Capes.capePriority.Optifine:
if (optifineCape != null && ModuleManager.capes.optifineCapes.getValue()) {
Identifier capeTexture = MinecraftClient.getInstance().getTextureManager().registerDynamicTexture("th-cape-" + uuid, optifineCape);
response.response(capeTexture);
} else if (ModuleManager.capes.minecraftcapesCapes.getValue()) {
Identifier capeTexture = MinecraftClient.getInstance().getTextureManager().registerDynamicTexture("th-cape-" + uuid, minecraftcapesCape);
response.response(capeTexture);
}
break;
case Capes.capePriority.Minecraftcapes:
if (minecraftcapesCape != null && ModuleManager.capes.minecraftcapesCapes.getValue()) {
Identifier capeTexture = MinecraftClient.getInstance().getTextureManager().registerDynamicTexture("th-cape-" + uuid, minecraftcapesCape);
response.response(capeTexture);
} else if (ModuleManager.capes.optifineCapes.getValue()) {
Identifier capeTexture = MinecraftClient.getInstance().getTextureManager().registerDynamicTexture("th-cape-" + uuid, optifineCape);
response.response(capeTexture);
}
break;
}
} catch (Exception ignored) {
}
}
Expand Down Expand Up @@ -57,7 +78,6 @@ public static NativeImage parseCape(NativeImage image) {
int imageHeight = 32;
int imageSrcWidth = image.getWidth();
int srcHeight = image.getHeight();

for (int imageSrcHeight = image.getHeight(); imageWidth < imageSrcWidth || imageHeight < imageSrcHeight; imageHeight *= 2) {
imageWidth *= 2;
}
Expand Down

0 comments on commit b1eb912

Please sign in to comment.