Skip to content

Commit

Permalink
1.4 added /fcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
udu3324 committed Aug 1, 2022
1 parent 208fdd9 commit 5e49490
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 25 deletions.
95 changes: 74 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,96 @@

<img align="right" src="https://raw.githubusercontent.com/udu3324/Hytools/main/src/main/resources/logo.png" height="200" width="200">


<img alt="GitHub" src="https://img.shields.io/github/license/udu3324/Hytools">
<img align="right" src="https://raw.githubusercontent.com/udu3324/Hytools/main/src/main/resources/logo.png" height="200" width="200">

<img alt="GitHub downloads" src="https://img.shields.io/github/downloads/udu3324/hytools/total">


<img alt="Latest release" src="https://img.shields.io/github/v/release/udu3324/Hytools">
<img alt="GitHub" src="https://img.shields.io/github/license/udu3324/Hytools">

<img alt="forge version support" src="https://img.shields.io/badge/mod%20loader-Forge 1.8.9-e04e14">


<img alt="GitHub downloads" src="https://img.shields.io/github/downloads/udu3324/hytools/total">



<img alt="Latest release" src="https://img.shields.io/github/v/release/udu3324/Hytools">



<img alt="forge version support" src="https://img.shields.io/badge/mod%20loader-Forge 1.8.9-e04e14">



# Hytools

A mod that has useful tools for Hypixel. Credit to the modding community for helping me make my first mod + Eye_Of_Wither for using /nick so I can create NickAlert.

**PartyGuess**
A tool that looks at chat and guesses players that are in a party. PartyGuess also checks if the first player in that party is friends with anyone else in the party. This tool works about **90%** of the time. This could fail if Hypixel decides to join everyone at the same time.


**FriendCheck**

A tool that checks if a player is friends with another player.

![](https://media.discordapp.net/attachments/919010475679825960/1003738888919064597/unknown.png)



**PartyGuess**

A tool that looks at chat and guesses players that are in a party. PartyGuess also checks if the first player in that party is friends with anyone else in the party. This tool works about **90%** of the time. This could fail if Hypixel decides to join everyone at the same time.

![](https://cdn.discordapp.com/attachments/697141987219865706/939448531834515477/WOMoDyAAAAAElFTkSuQmCC.png)

**NickAlert**
A tool that alerts if someone joined is nicked. This tool **will not reveal the person** behind the nick, but will just alert it in chat. This tool will half of the time. (uses mc api to check if username exists) You can enable NickAlertHypixelAPI to get more accuracy. (using hypixel api for nickalert is in the gray zone of being allowed. use at your own risk)


**NickAlert**

A tool that alerts if someone joined is nicked. This tool **will not reveal the person** behind the nick, but will just alert it in chat. This tool will half of the time. (uses mc api to check if username exists) You can enable NickAlertHypixelAPI to get more accuracy. (using hypixel api for nickalert is in the gray zone of being allowed. use at your own risk)

![](https://cdn.discordapp.com/attachments/626565405930160148/932033762508816454/unknown.png)

![](https://media.discordapp.net/attachments/956773599644090379/964672960873000980/unknown.png)



## Installation
Use the mod at your own risk. (this applies to all mods for hypixel)
Make sure you have [Forge 1.8.9](https://files.minecraftforge.net/net/minecraftforge/forge/index_1.8.9.html) installed. You can install the latest version of Hytools by clicking [here](https://github.com/udu3324/Hytools/releases/latest) and clicking on the jar.

Use the mod at your own risk. (this applies to all mods for hypixel)

Make sure you have [Forge 1.8.9](https://files.minecraftforge.net/net/minecraftforge/forge/index_1.8.9.html) installed. You can install the latest version of Hytools by clicking [here](https://github.com/udu3324/Hytools/releases/latest) and clicking on the jar.

Go to your mods folder (.minecraft/mods) and drag Hytools-#.#.#.jar into it. Tada! Hytools is installed.



## Commands
Here are the commands you can use to turn certain tools on and off with:
![](https://cdn.discordapp.com/attachments/697141987219865706/941520811276242944/unknown.png)

Here are the commands you can use to turn certain tools on and off with:

![](https://cdn.discordapp.com/attachments/919010475679825960/1003739858184974416/unknown.png)



## Build From Source
If you want to build your own jar of Hytools, you can.
1, Clone the repo
2, Extract the zip
3, Open a terminal and cd to the source code
4, Run `gradlew build`
5, Navigate to build/libs
Done! You should now see 2 jars generated. The sources jar is for devs only and not for end users to put in the mods folder.

If you want to build your own jar of Hytools, you can!

0, Make sure you have Java Development Kit 8 installed.

1, Clone the repository

2, Extract the zip

3, Open a terminal and cd to the source code

4, Run `gradlew build` or `.\gradlew build` depending on terminal

5, Navigate to build/libs

Done! You should now see 2 jars generated. The sources jar is for devs only and not for end users to put in the mods folder.



## Contribute
You can contribute by starring the repo, reporting issues, creating pull requests, and suggesting ideas.

You can contribute by starring the repo, reporting issues, creating pull requests, and suggesting ideas.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
maven { url 'https://repo.hypixel.net/repository/Hypixel/' }
}

version = "1.3.2"
version = "1.4"
group= "com.udu3324.hytools" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Hytools"

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/udu3324/hytools/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ public String getCommandUsage(ICommandSender sender) {

@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {

System.out.println(args.toString());

collection.put("partyguess", "1");
collection.put("partyguessfriends", "2");
collection.put("partyguessguilds", "3");
collection.put("nickalert", "4");
collection.put("nickalerthypixelapi", "4");
collection.put("nickalerthypixelapi", "5");

if (args.length < 1) {
sender.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.GOLD + "[+]= Hytools v" + Reference.VERSION + " by udu3324 =[+]\n"
+ EnumChatFormatting.GOLD + "Check out my GitHub! https://github.com/udu3324 \n\n"
+ EnumChatFormatting.GREEN + "/fcheck (player1) (player2) - checks if player 1 is friends with player 2\n"
+ EnumChatFormatting.DARK_AQUA + "/hytools partyguess [toggle/on/off] [toggled|" + Config.getPartyGuess() + "]\n"
+ EnumChatFormatting.DARK_GREEN + "/hytools partyguessfriends [toggle/on/off] [toggled|" + Config.getPartyGuessFriend() +"] \n"
+ EnumChatFormatting.GOLD + "/hytools partyguessguilds [toggle/on/off] [toggled|" + Config.getPartyGuessGuild() + "]\n"
Expand Down Expand Up @@ -188,7 +190,7 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
EnumChatFormatting.GREEN + command + " is now set to " + data + "."));
}

if (args.length > 3) {
if (args.length >= 3) {
sender.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.RED + "Too many arguments! You probably have a typo."));
return;
}
Expand Down
101 changes: 101 additions & 0 deletions src/main/java/com/udu3324/hytools/FCheck.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package com.udu3324.hytools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.udu3324.hytools.hyapi.FriendsOfUUID;
import com.udu3324.hytools.mcapi.IGN;
import com.udu3324.hytools.mcapi.UUID;

import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;

public class FCheck extends CommandBase {

private HashMap<String, String> collection = new HashMap<String, String>();

@Override
public String getCommandName() {
return "fcheck";
}

@Override
public String getCommandUsage(ICommandSender sender) {
return "fcheck <args>";
}

@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
if (args.length < 2) {
sender.addChatMessage(new ChatComponentText(
"\n" + EnumChatFormatting.RED + "Too little arguments! You probably have a typo."));
return;
}

if (args.length == 2) {
final String player1 = args[0];
final String player2 = args[1];

new Thread(new Runnable() {
@Override
public void run() {
try {
// check both players to see if they're real
String uuid1 = UUID.get(player1);
if (uuid1.equals("Not a IGN or UUID!")) {
Hytools.sendMessage("\u00A7C" + player1 + " is not a real player.");
return;
}

String uuid2 = UUID.get(player2);
if (uuid2.equals("Not a IGN or UUID!")) {
Hytools.sendMessage("\u00A7C" + player2 + " is not a real player.");
return;
}

// get the friends of player1
ArrayList<String> listOfFriends = FriendsOfUUID.get(uuid1);
if (listOfFriends == null) {
Hytools.sendMessage(
"\u00A74\u00A7lERROR! (player data couldn't be fetched) The API key has not been set yet. Please do \u00A7c\u00A7l/api new\u00A74\u00A7l to fix this.");
return;
}

// return result of player2 is found in friends list of player1
if (listOfFriends.contains(uuid2)) {
Hytools.sendMessage("\u00A7A" + IGN.get(uuid1) + " is friends with " + IGN.get(uuid2) + ".");
} else {
Hytools.sendMessage("\u00A7C" + IGN.get(uuid1) + " is not friends with " + IGN.get(uuid2) + ".");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}

if (args.length >= 3) {
sender.addChatMessage(new ChatComponentText(
"\n" + EnumChatFormatting.RED + "Too many arguments! You probably have a typo."));
return;
}

}

@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return true;
}

@Override
public int getRequiredPermissionLevel() {
return 0;
}
}
1 change: 1 addition & 0 deletions src/main/java/com/udu3324/hytools/Hytools.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void init(FMLInitializationEvent event) {

// register commands
ClientCommandHandler.instance.registerCommand(new Command());
ClientCommandHandler.instance.registerCommand(new FCheck());
}

@SubscribeEvent
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/udu3324/hytools/hyapi/FriendsOfUUID.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.udu3324.hytools.Hytools;

public class FriendsOfUUID {
//FriendsOfUUID.get(uuid) returns a arraylist of uuids of the friends of uuid provided
static int countOccurrences(String str, String word) {
int lastIndex = 0;
int count = 0;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/udu3324/hytools/hyapi/GuildOfUUID.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.udu3324.hytools.Hytools;

public class GuildOfUUID {
//GuildOfUUID.get(uuid) returns a arraylist of the guild they're in + the people in the guild
static int countOccurrences(String str, String word) {
int lastIndex = 0;
int count = 0;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/udu3324/hytools/mcapi/IGN.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.udu3324.hytools.Hytools;

public class IGN {
//IGN.get(str) returns ign from uuid or ign
public static String get(String str) throws Exception {
String url = "https://api.mojang.com/users/profiles/minecraft/" + str;
URL obj = new URL(url);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/udu3324/hytools/mcapi/UUID.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.udu3324.hytools.Hytools;

public class UUID {
//UUID.get(str) returns uuid from uuid or ign
public static String get(String str) throws Exception {
String url = "https://api.mojang.com/users/profiles/minecraft/" + str;
URL obj = new URL(url);
Expand Down

1 comment on commit 5e49490

@afkvido
Copy link
Contributor

@afkvido afkvido commented on 5e49490 Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hell yea

Please sign in to comment.