Skip to content

Commit

Permalink
1.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipPanda committed Jun 7, 2024
1 parent d4e1a49 commit 05b1085
Show file tree
Hide file tree
Showing 50 changed files with 595 additions and 601 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class TempleClient {
public static final String MODID = "templeclient";
public static final String NAME = "Temple Client";
public static final String VERSION = "1.9.4";
public static final String VERSION = "1.9.5";
public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
public static String name = NAME + " " + VERSION;
public static AnnotatedEventManager eventBus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public class ConfigManager {
private final File mainDirectory;
private final File configDirectory;
private final File friendsDirectory;
private final File altsDirectory;
private final File altsFile;
private final File defaultConfigFile;
private final File baseFinderLogDirectory;

Expand All @@ -37,7 +35,6 @@ public ConfigManager() {
this.mainDirectory = new File(System.getProperty("user.dir") + File.separator + "Temple Client");
this.configDirectory = new File(this.mainDirectory, "1.12.2" + File.separator + "Config");
this.friendsDirectory = new File(this.mainDirectory, "1.12.2" + File.separator + "Friends");
this.altsDirectory = new File(this.mainDirectory, "1.12.2" + File.separator + "Alts");
this.defaultConfigFile = new File(this.configDirectory, "config.cfg");
this.baseFinderLogDirectory = new File(this.mainDirectory, "1.12.2" + File.separator + "Base Finder");

Expand All @@ -49,15 +46,9 @@ public ConfigManager() {
this.friendsDirectory.mkdirs();
}

if (!this.altsDirectory.exists()) {
this.altsDirectory.mkdirs();
}

if (!this.baseFinderLogDirectory.exists()) {
this.baseFinderLogDirectory.mkdirs();
}

this.altsFile = new File(this.altsDirectory, "alt_accounts.json");
}

/****************************************************************
Expand Down Expand Up @@ -229,34 +220,6 @@ private void loadFriends() {
}
}

/****************************************************************
* Alt Account Management
****************************************************************/

public List<String> loadAlts() {
if (!altsFile.exists()) return new ArrayList<>();
try (Reader reader = new FileReader(altsFile)) {
return GSON.fromJson(reader, new TypeToken<List<String>>() {
}.getType());
} catch (IOException e) {
e.printStackTrace();
}
return new ArrayList<>();
}

/**
* Saves alt accounts to a file.
*
* @param alts The list of alt accounts to save.
*/
public void saveAlts(List<String> alts) {
try (Writer writer = new FileWriter(altsFile)) {
GSON.toJson(alts, writer);
} catch (IOException e) {
e.printStackTrace();
}
}

/****************************************************************
* Base Finder Logging
****************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public String getName() {

@Override
public void execute(String[] args) {
Minecraft mc = Minecraft.getMinecraft();

if (lastDeathCoords == null) {
sendMessage("No death coordinates recorded yet.", true);
} else {
Expand All @@ -49,11 +47,9 @@ protected void sendMessage(String message, boolean isError) {

@SubscribeEvent
public void onPlayerDeath(LivingDeathEvent event) {
if (!event.getEntityLiving().world.isRemote) {
if (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving() == Minecraft.getMinecraft().player) {
lastDeathCoords = event.getEntityLiving().getPosition();
sendMessage("Death coordinates logged.", false);
}
if (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving() == Minecraft.getMinecraft().player) {
lastDeathCoords = event.getEntityLiving().getPosition();
sendMessage("Death coordinates logged.", false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
Color c2 = ClickGUI.INSTANCE.getEndColor();

switch (ClickGUI.INSTANCE.colorMode.value()) {
case Static:
case Animated:
c1 = new Color(ClickGUI.INSTANCE.getClientColor(10, (int) Panel.counter1[0]));
c2 = new Color(ClickGUI.INSTANCE.getClientColor(10, (int) (Panel.counter1[0] + 1)));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard;
import xyz.templecheats.templeclient.TempleClient;
import xyz.templecheats.templeclient.features.gui.clickgui.basic.ClickGuiScreen;
import xyz.templecheats.templeclient.features.gui.clickgui.basic.ClientGuiScreen;
Expand All @@ -21,6 +22,7 @@
import java.util.List;

import static xyz.templecheats.templeclient.features.gui.clickgui.basic.panels.Panel.calculateRotation;
import static xyz.templecheats.templeclient.features.gui.font.Fonts.font14;
import static xyz.templecheats.templeclient.features.gui.font.Fonts.font18;

public class ModuleButton extends Button implements IContainer {
Expand All @@ -29,12 +31,20 @@ public class ModuleButton extends Button implements IContainer {
private boolean open;
private long timeHovering;
private int progress;
private String bindLabel;

public ModuleButton(Module module) {
super(module.getName());
this.module = module;
this.progress = 0;

int keyCode = module.getKey();
if (keyCode == 0) {
this.bindLabel = "";
} else {
this.bindLabel = " [" + Keyboard.getKeyName(keyCode) + "]";
}

final List<Setting<?>> settings = TempleClient.settingsManager.getSettingsByMod(module);
if (!module.parent) {
this.items.add(new BindButton(module));
Expand All @@ -52,6 +62,16 @@ public ModuleButton(Module module) {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);

String displayText = this.module.getName();
if (ClickGUI.INSTANCE.showKey.booleanValue() && !this.bindLabel.isEmpty()) {
font18.drawString(displayText, this.x + 2.0F, this.y + 4.0F, -1, false);
float keyBindY = this.y + 4.0F + (font18.getFontHeight() - font14.getFontHeight()) / 2.0F;
font14.drawString(this.bindLabel, this.x + 2.0F + font18.getStringWidth(displayText), keyBindY, -1, false);
} else {
font18.drawString(displayText, this.x + 2.0F, this.y + 4.0F, -1, false);
}

if (!this.items.isEmpty()) {
if (module.submodule) {
font18.drawString(!this.open ? "+" : "-", this.x - 1.0f + (float) getWidth() - 8.0f, this.y + 4.0f, -1, false);
Expand Down Expand Up @@ -89,21 +109,23 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
}
}


@Override
public void drawScreenPost(int mouseX, int mouseY) {
if (this.isHovering(mouseX, mouseY)) {
if (ClickGUI.INSTANCE.description.booleanValue() && this.isHovering(mouseX, mouseY)) {
final String description = module.getDescription();
final float startX = mouseX + 7;
final float startY = mouseY + 7;
final float width = (float) font18.getStringWidth(description);
final float height = (float) font18.getFontHeight();
int color = ClickGUI.INSTANCE.getEndColor().getRGB();
int color = ClickGUI.INSTANCE.getStartColor().getRGB();
RenderUtil.drawOutlineRect(startX - 1, startY - 1, startX + width, startY + height, color);
RenderUtil.drawRect(startX - 1, startY - 1, startX + width, startY + height, 0x88000000);
font18.drawString(description, startX, startY, -1, false);
}
}


@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
Expand Down Expand Up @@ -186,4 +208,3 @@ public void setItems(List<Item> items) {
this.items = items;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,16 @@ private void drag(int mouseX, int mouseY) {

@Override
public void drawScreenPost(int mouseX, int mouseY) {
if (this.isHovering(mouseX, mouseY)) {
if (this.timeHovering == 0) {
this.timeHovering = System.currentTimeMillis();
}

if (System.currentTimeMillis() - this.timeHovering > 500) {
final String description = element.getDescription();
final float startX = mouseX + 7;
final float startY = mouseY + 7;
final float width = (float) font18.getStringWidth(description);
final float height = (float) font18.getFontHeight();

RenderUtil.drawRect(startX - 1, startY - 1, startX + width, startY + height, 0x88000000);
font18.drawString(description, startX, startY, -1, false);
}
} else {
this.timeHovering = 0;
if (ClickGUI.INSTANCE.description.booleanValue() && this.isHovering(mouseX, mouseY)) {
final String description = element.getDescription();
final float startX = mouseX + 7;
final float startY = mouseY + 7;
final float width = (float) font18.getStringWidth(description);
final float height = (float) font18.getFontHeight();
int color = ClickGUI.INSTANCE.getStartColor().getRGB();
RenderUtil.drawOutlineRect(startX - 1, startY - 1, startX + width, startY + height, color);
RenderUtil.drawRect(startX - 1, startY - 1, startX + width, startY + height, 0x88000000);
font18.drawString(description, startX, startY, -1, false);
}
}

Expand Down
Loading

0 comments on commit 05b1085

Please sign in to comment.