Skip to content

Commit

Permalink
нейм протект для друзей (сделал dest4590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slieko committed May 27, 2024
1 parent 577b2c1 commit 4e1cfa2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
25 changes: 0 additions & 25 deletions src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,31 +103,6 @@ public void render(@NotNull DrawContext context, int mouseX, int mouseY, float d
context.drawTexture(FORK_AUTHOR, mc.getWindow().getScaledWidth() - 120, mc.getWindow().getScaledHeight() - 60, 40, 40, 0, 0, 40, 40, 40, 40);
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);

int offsetY = 10;
for (String change : ThunderUtility.changeLog) {
String prefix = getPrefix(change);
FontRenderers.sf_medium.drawString(context.getMatrices(), prefix, 10, offsetY, Render2DEngine.applyOpacity(-1, 0.4f));
offsetY += 10;
}

}

private static @NotNull String getPrefix(@NotNull String change) {
String prefix = "";
if (change.contains("[+]")) {
change = change.replace("[+] ", "");
prefix = Formatting.GREEN + "[+] " + Formatting.RESET;
} else if (change.contains("[-]")) {
change = change.replace("[-] ", "");
prefix = Formatting.RED + "[-] " + Formatting.RESET;
} else if (change.contains("[/]")) {
change = change.replace("[/] ", "");
prefix = Formatting.LIGHT_PURPLE + "[/] " + Formatting.RESET;
} else if (change.contains("[*]")) {
change = change.replace("[*] ", "");
prefix = Formatting.GOLD + "[*] " + Formatting.RESET;
}
return prefix + change;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@Mixin(SkinTextures.class)
public class MixinSkinTextures {
private static final Identifier SUN_SKIN = new Identifier("textures/sunskin.png");
private static final Identifier SUN_SKIN = new Identifier("thunderhack", "textures/misc/sunskin.png");

@Inject(method = "texture", at = @At("HEAD"), cancellable = true)
public void getSkinTextureHook(CallbackInfoReturnable<Identifier> cir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static String protect(String string) {
if (string.contains(me)) {
return string.replace(me, NameProtect.getCustomName());
}

// by dest4590
List<String> friends = thunder.hack.core.impl.FriendManager.getFriends();
for (String friend : friends) {
if (string.contains(friend)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/modules/misc/NameProtect.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static String getCustomName() {
return ModuleManager.nameProtect.isEnabled() ? newName.getValue().replaceAll("&", "\u00a7") : mc.getGameProfile().getName();
}
public static String getCustomFriendsName() {
return ModuleManager.nameProtect.isEnabled() && NameProtect.friendProtect.getValue() ? friendName.getValue().replaceAll("&", "\u00a7") : mc.getGameProfile().getName();
return ModuleManager.nameProtect.isEnabled() && NameProtect.friendProtect.getValue() ? friendName.getValue().replaceAll("&", "\u00a7") : mc.getName();
}

}

0 comments on commit 4e1cfa2

Please sign in to comment.