Skip to content

Commit 686294c

Browse files
committed
1.9.7
1 parent fff0aaa commit 686294c

File tree

12 files changed

+147
-18
lines changed

12 files changed

+147
-18
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dependencies {
6161
exclude module: 'gson'
6262
}
6363

64+
compile 'club.minnced:java-discord-rpc:2.0.2'
6465
}
6566

6667
processResources {

github/assets/capes.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

github/assets/donatecape.png

-162 KB
Binary file not shown.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod_id=templeclient
22
mod_name=TempleClient
33
mod_group=xyz.templecheats.templeclient
4-
mod_version=1.9.3
4+
mod_version=1.9.7
55
mod_author=["PhilipPanda"]
66
mod_description=a 1.12.2 Minecraft utility mod
77
minecraft_version=1.12.2
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package xyz.templecheats.templeclient;
2+
3+
import club.minnced.discord.rpc.DiscordEventHandlers;
4+
import club.minnced.discord.rpc.DiscordRPC;
5+
import club.minnced.discord.rpc.DiscordRichPresence;
6+
import net.minecraft.client.Minecraft;
7+
import net.minecraft.client.gui.GuiMainMenu;
8+
import xyz.templecheats.templeclient.features.module.modules.client.RPC;
9+
10+
public class DiscordPresence {
11+
private static final DiscordRPC rpc;
12+
public static DiscordRichPresence presence;
13+
private static Thread thread;
14+
15+
static {
16+
rpc = DiscordRPC.INSTANCE;
17+
presence = new DiscordRichPresence();
18+
}
19+
20+
public static void start() {
21+
DiscordEventHandlers handlers = new DiscordEventHandlers();
22+
rpc.Discord_Initialize("1273936190592253974", handlers, true, "");
23+
DiscordPresence.presence.startTimestamp = System.currentTimeMillis() / 1000L;
24+
25+
DiscordPresence.presence.details = Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu
26+
? "In the main menu."
27+
: "Playing Minecraft";
28+
29+
DiscordPresence.presence.state = RPC.INSTANCE.state.getStringValue();
30+
DiscordPresence.presence.largeImageKey = "temple-logo";
31+
DiscordPresence.presence.largeImageText = "Temple Client | 1.12.2";
32+
rpc.Discord_UpdatePresence(presence);
33+
34+
thread = new Thread(() -> {
35+
while (!Thread.currentThread().isInterrupted()) {
36+
rpc.Discord_RunCallbacks();
37+
38+
DiscordPresence.presence.details = Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu
39+
? "In the main menu."
40+
: "Playing Minecraft";
41+
42+
DiscordPresence.presence.state = RPC.INSTANCE.state.getStringValue();
43+
rpc.Discord_UpdatePresence(presence);
44+
45+
try {
46+
Thread.sleep(2000L);
47+
} catch (InterruptedException interruptedException) {
48+
}
49+
}
50+
}, "RPC-Callback-Handler");
51+
thread.start();
52+
}
53+
54+
public static void stop() {
55+
if (thread != null && !thread.isInterrupted()) {
56+
thread.interrupt();
57+
}
58+
rpc.Discord_Shutdown();
59+
}
60+
}

src/main/java/xyz/templecheats/templeclient/TempleClient.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import xyz.templecheats.templeclient.event.ForgeEventManager;
2222
import xyz.templecheats.templeclient.features.gui.font.FontUtils;
2323
import xyz.templecheats.templeclient.features.gui.menu.GuiEventsListener;
24+
import xyz.templecheats.templeclient.features.module.modules.client.RPC;
2425
import xyz.templecheats.templeclient.manager.*;
2526
import xyz.templecheats.templeclient.util.friend.FriendManager;
2627
import xyz.templecheats.templeclient.util.keys.KeyUtil;
@@ -33,7 +34,7 @@
3334
public class TempleClient {
3435
public static final String MODID = "templeclient";
3536
public static final String NAME = "Temple Client";
36-
public static final String VERSION = "1.9.6";
37+
public static final String VERSION = "1.9.7";
3738
public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
3839
public static String name = NAME + " " + VERSION;
3940
public static AnnotatedEventManager eventBus;
@@ -106,8 +107,19 @@ public void init(FMLInitializationEvent event) {
106107
configManager.loadAll();
107108
logger.info("Configurations loaded.");
108109

109-
Runtime.getRuntime().addShutdownHook(new Thread(configManager::saveAll));
110-
logger.info("Shutdown hook added for saving configurations.");
110+
if (moduleManager.getModule(RPC.class).isEnabled()) {
111+
RPC.INSTANCE.onEnable();
112+
logger.info("RPC module enabled and Discord Presence started.");
113+
}
114+
115+
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
116+
configManager.saveAll();
117+
if (RPC.INSTANCE.isEnabled()) {
118+
RPC.INSTANCE.onDisable();
119+
logger.info("RPC module disabled and Discord Presence stopped.");
120+
}
121+
}));
122+
logger.info("Shutdown hook added for saving configurations and stopping Discord Presence.");
111123
}
112124

113125
@SubscribeEvent
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package xyz.templecheats.templeclient.features.module.modules.client;
2+
3+
import org.lwjgl.input.Keyboard;
4+
import xyz.templecheats.templeclient.DiscordPresence;
5+
import xyz.templecheats.templeclient.features.module.Module;
6+
import xyz.templecheats.templeclient.util.setting.impl.BooleanSetting;
7+
import xyz.templecheats.templeclient.util.setting.impl.StringSetting;
8+
9+
public class RPC extends Module {
10+
/****************************************************************
11+
* Instances
12+
****************************************************************/
13+
public static RPC INSTANCE;
14+
15+
/****************************************************************
16+
* Settings
17+
****************************************************************/
18+
public final StringSetting state = new StringSetting("State", this, "Temple Client 1.12.2");
19+
20+
public RPC() {
21+
super("RPC", "Discord rich presence", Keyboard.KEY_NONE, Category.Client);
22+
INSTANCE = this;
23+
24+
this.registerSettings(state);
25+
}
26+
27+
@Override
28+
public void onEnable() {
29+
DiscordPresence.start();
30+
}
31+
32+
@Override
33+
public void onDisable() {
34+
DiscordPresence.stop();
35+
}
36+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package xyz.templecheats.templeclient.features.module.modules.movement;
2+
3+
import net.minecraft.init.Blocks;
4+
import org.lwjgl.input.Keyboard;
5+
import xyz.templecheats.templeclient.features.module.Module;
6+
import xyz.templecheats.templeclient.util.setting.impl.DoubleSetting;
7+
8+
public class IceSpeed extends Module {
9+
private final DoubleSetting speed = new DoubleSetting("Speed", this, 0.1f, 1.5f, 0.4f);
10+
11+
public IceSpeed() {
12+
super("IceSpeed", "Go fast on ice", Keyboard.KEY_NONE, Category.Movement);
13+
registerSettings(speed);
14+
}
15+
16+
17+
public void onUpdate() {
18+
Blocks.ICE.slipperiness = (float) this.speed.doubleValue();
19+
Blocks.PACKED_ICE.slipperiness = (float) this.speed.doubleValue();
20+
Blocks.FROSTED_ICE.slipperiness = (float) this.speed.doubleValue();
21+
}
22+
23+
public void onDisable() {
24+
Blocks.ICE.slipperiness = 0.98f;
25+
Blocks.PACKED_ICE.slipperiness = 0.98f;
26+
Blocks.FROSTED_ICE.slipperiness = 0.98f;
27+
}
28+
}

src/main/java/xyz/templecheats/templeclient/manager/CapeManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public class CapeManager {
2323
* Constants
2424
****************************************************************/
2525

26-
private static final String CAPE_UUIDS = "https://raw.githubusercontent.com/TempleDevelopment/Temple-Client/main/github/assets/capes.txt";
27-
private static final String CAPE_DIR = "https://raw.githubusercontent.com/TempleDevelopment/Temple-Client/main/github/assets/%s.png";
26+
private static final String CAPE_UUIDS = "https://raw.githubusercontent.com/TempleDevelopment/Temple-Client-Assets/main/assets/uuids/cape-uuids.txt";
27+
private static final String CAPE_DIR = "https://raw.githubusercontent.com/TempleDevelopment/Temple-Client-Assets/main/assets/images/capes/%s.png";
2828

2929
/****************************************************************
3030
* Fields

src/main/java/xyz/templecheats/templeclient/manager/ModuleManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public static void initMods() {
9393
addMod(new Panic());
9494
addMod(new Colors());
9595
addMod(new HUD());
96+
addMod(new RPC());
9697

9798
// Movement
9899
addMod(new EntityControl());
@@ -105,6 +106,7 @@ public static void initMods() {
105106
addMod(new Parkour());
106107
addMod(new NoSlow());
107108
addMod(new Safewalk());
109+
addMod(new IceSpeed());
108110
addMod(new Sprint());
109111
addMod(new NoFall());
110112
addMod(new Flight());

0 commit comments

Comments
 (0)