Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #3 from Utility-Client/dcrp
Final Commit for 2.2
- Loading branch information
Showing
27 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Utility Client v2 | ||
|
||
### Credits | ||
Thanks to [Maurice Wohlkönig](https://github.com/whlk) for his [BOM-Remover Tool](https://www.mannaz.at/codebase/utf-byte-order-mark-bom-remover). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cd bundle_with_jar | ||
jar uf ../target/UtilityClient-2.1-1.8.8.jar * | ||
jar uf ../target/UtilityClient.jar * | ||
pause | ||
exit |
Binary file not shown.
Binary file added
BIN
+2.31 KB
bundle_with_jar/net/arikia/dev/drpc/DiscordEventHandlers$Builder.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.95 KB
bundle_with_jar/net/arikia/dev/drpc/DiscordRichPresence$Builder.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+220 Bytes
bundle_with_jar/net/arikia/dev/drpc/callbacks/DisconnectedCallback.class
Binary file not shown.
Binary file added
BIN
+210 Bytes
bundle_with_jar/net/arikia/dev/drpc/callbacks/ErroredCallback.class
Binary file not shown.
Binary file added
BIN
+211 Bytes
bundle_with_jar/net/arikia/dev/drpc/callbacks/JoinGameCallback.class
Binary file not shown.
Binary file added
BIN
+232 Bytes
bundle_with_jar/net/arikia/dev/drpc/callbacks/JoinRequestCallback.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+219 Bytes
bundle_with_jar/net/arikia/dev/drpc/callbacks/SpectateGameCallback.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package de.gamingcraft.discord; | ||
|
||
import de.gamingcraft.UtilityClient; | ||
import net.arikia.dev.drpc.DiscordEventHandlers; | ||
import net.arikia.dev.drpc.DiscordRPC; | ||
import net.arikia.dev.drpc.DiscordRichPresence; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.*; | ||
|
||
public class DiscordRP extends Thread { | ||
|
||
private static boolean shouldRun = false; | ||
|
||
@Override | ||
public void run() { | ||
super.run(); | ||
|
||
|
||
DiscordEventHandlers handlers = new DiscordEventHandlers.Builder().setReadyEventHandler((user) -> { | ||
System.out.println("[--:--:--] [DiscordWebhook/INFO]: Welcome " + user.username + "#" + user.discriminator + "!"); | ||
}).build(); | ||
DiscordRPC.discordInitialize("742760119984455701", handlers, true); | ||
shouldRun = true; | ||
|
||
Runtime.getRuntime().addShutdownHook(new Thread(() -> { | ||
System.out.println("Closing Discord hook."); | ||
DiscordRPC.discordShutdown(); | ||
})); | ||
} | ||
|
||
public void loop() { | ||
|
||
if(!shouldRun) return; | ||
|
||
if(Minecraft.getMinecraft().isSingleplayer()) { | ||
setRichPresence("Playing Singleplayer", ""); | ||
} | ||
|
||
if((!Minecraft.getMinecraft().isSingleplayer())) { | ||
if(Minecraft.getMinecraft().theWorld != null) { | ||
if(Minecraft.getMinecraft().theWorld.playerEntities.size() > 1) { | ||
setRichPresence("Playing Multiplayer", Minecraft.getMinecraft().getCurrentServerData().serverName); | ||
} | ||
} | ||
} | ||
|
||
if(Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu) { | ||
setRichPresence("In Menus", "Main Menu"); | ||
} | ||
|
||
if(Minecraft.getMinecraft().currentScreen instanceof GuiMultiplayer) { | ||
setRichPresence("In Menus", "Server List"); | ||
} | ||
|
||
if(Minecraft.getMinecraft().currentScreen instanceof GuiSelectWorld) { | ||
setRichPresence("In Menus", "World List"); | ||
} | ||
|
||
DiscordRPC.discordRunCallbacks(); | ||
} | ||
|
||
public void setRichPresence(String topText, String bottomText) { | ||
DiscordRichPresence.Builder presence = new DiscordRichPresence.Builder(bottomText); | ||
presence.setBigImage("utilityclient", UtilityClient.getName() + " " + UtilityClient.getVersion()); | ||
presence.setDetails(topText); | ||
DiscordRPC.discordUpdatePresence(presence.build()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
package net.minecraft; | ||
|
||
import net.minecraft.client.main.Main; | ||
|
||
import java.util.Arrays; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters