Skip to content

Commit 7d83542

Browse files
b2
2 parents 840aa57 + 1d77912 commit 7d83542

File tree

15 files changed

+176
-36
lines changed

15 files changed

+176
-36
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
1111
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1212

1313

14-
version = "b1"
14+
version = "b2"
1515
group = "dev.hause" // https://maven.apache.org/guides/mini/guide-naming-conventions.html
1616
archivesBaseName = "squeakerbot"
1717

src/main/java/dev/hause/squeakerbot/SqueakerBot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class SqueakerBot
1616
{
1717
public static final String MODID = "squeakerbot";
1818
public static final String NAME = "SqueakerBot";
19-
public static final String VERSION = "b1";
19+
public static final String VERSION = "b2";
2020
public static CommandManager cm = new CommandManager();
21-
public static Logger LOGGER = LogManager.getLogger(SqueakerBot.class);
21+
public static Logger LOGGER = LogManager.getLogger("SqueakerBot");
2222

2323
@EventHandler
2424
public void preInit(FMLPreInitializationEvent event)

src/main/java/dev/hause/squeakerbot/command/Command.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
package dev.hause.squeakerbot.command;
22

3+
import java.lang.annotation.*;
34
import net.minecraft.client.Minecraft;
45

56
public class Command {
6-
7-
String command;
8-
String[] aliases;
7+
98
public Minecraft mc = Minecraft.getMinecraft();
109

11-
public Command(String command, String[] aliases) {
12-
this.command = command;
13-
this.aliases = aliases;
10+
String command = getRegister().name();
11+
String[] aliases = getRegister().aliases();
12+
13+
@Retention(RetentionPolicy.RUNTIME)
14+
@Target(ElementType.TYPE)
15+
public @interface Register {
16+
17+
String name();
18+
19+
String[] aliases();
20+
1421
}
1522

23+
private Register getRegister() {
24+
return getClass().getAnnotation(Register.class);
25+
}
26+
27+
1628
public void onRun() {
1729

1830
}

src/main/java/dev/hause/squeakerbot/command/CommandManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ public void registerCommands() {
1111
commands.add(new Help());
1212
commands.add(new CoinFlip());
1313
commands.add(new AskGod());
14+
commands.add(new TallyHall());
15+
commands.add(new Toggle());
16+
commands.add(new About());
17+
commands.add(new Geolocate());
1418
}
1519

1620
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package dev.hause.squeakerbot.command.commands;
2+
3+
import dev.hause.squeakerbot.SqueakerBot;
4+
import dev.hause.squeakerbot.command.Command;
5+
import dev.hause.squeakerbot.util.ChatUtil;
6+
7+
@Command.Register(name = "About", aliases = {"About", "Credits"})
8+
public class About extends Command {
9+
10+
@Override
11+
public void onRun() {
12+
ChatUtil.sendChatMessage("SqueakerBot " + SqueakerBot.VERSION + " by HausemasterIssue. GitHub: https://github.com/HausemasterIssue/SqueakerBot.");
13+
}
14+
15+
}

src/main/java/dev/hause/squeakerbot/command/commands/AskGod.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44
import dev.hause.squeakerbot.command.Command;
55
import dev.hause.squeakerbot.util.ChatUtil;
66

7+
@Command.Register(name = "AskGod", aliases = {"AskGod", "Ask", "God"})
78
public class AskGod extends Command {
89

9-
private static String[] replies = {"> [SqueakerBot] It is certain.", "> [SqueakerBot] My sources say no.", "> [SqueakerBot] Absolutley.",
10-
"> [SqueakerBot] Never.", "> [SqueakerBot] Perhaps.", "> [SqueakerBot] Reply hazy. Ask again later.", "> [SqueakerBot] Based off your tone, no.",
11-
"> [SqueakerBot] In the future, yes.", "> [SqueakerBot] Better not tell you now.", "> [SqueakerBot] It is highly unlikely.",
12-
"> [SqueakerBot] Do not ask that question ever again.", "> [SqueakerBot] Yes.", "> [SqueakerBot] Not in a trillion years.", "> [SqueakerBot] I do not know.",
13-
"> [SqueakerBot] For sure.", "> [SqueakerBot] No."};
10+
private static String[] replies = {"It is certain.", "My sources say no.", "Absolutley.",
11+
"Never.", "Perhaps.", "Reply hazy. Ask again later.", "Based off your tone, no.",
12+
"In the future, yes.", "Better not tell you now.", "It is highly unlikely.",
13+
"Do not ask that question ever again.", "Yes.", "Not in a trillion years.", "I do not know.",
14+
"For sure.", "No."};
1415

1516

16-
public AskGod() {
17-
super("AskGod", new String[] {"AskGod", "Ask"});
18-
}
19-
2017
@Override
2118
public void onRun() {
2219
Random random = new Random();

src/main/java/dev/hause/squeakerbot/command/commands/CoinFlip.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
import dev.hause.squeakerbot.command.Command;
55
import dev.hause.squeakerbot.util.ChatUtil;
66

7+
@Command.Register(name = "CoinFlip", aliases = {"Coin", "Flip", "Tails", "Heads"})
78
public class CoinFlip extends Command {
89

9-
private static String[] outcomes = {"> [SqueakerBot] The coin flip results in Heads!", "> [SqueakerBot] The coin flip results in Tails!"};
10-
11-
public CoinFlip() {
12-
super("CoinFlip", new String[] {"CoinFlip", "Coin", "Flip"});
13-
}
10+
private static String[] outcomes = {"The coin flip results in Heads!", "The coin flip results in Tails!"};
1411

1512
@Override
1613
public void onRun() {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package dev.hause.squeakerbot.command.commands;
2+
3+
import java.util.Random;
4+
import dev.hause.squeakerbot.command.Command;
5+
import dev.hause.squeakerbot.listener.ChatListener;
6+
import dev.hause.squeakerbot.util.ChatUtil;
7+
import dev.hause.squeakerbot.util.QueryUtil;
8+
9+
@Command.Register(name = "Geolocate", aliases = {"Find", "Locate"})
10+
public class Geolocate extends Command {
11+
12+
private static QueryUtil queryUtil = new QueryUtil();
13+
14+
@Override
15+
public void onRun() {
16+
String name = queryUtil.getQuery(ChatListener.parsedCommand);
17+
Random random = new Random();
18+
if(name.equalsIgnoreCase("You didn't enter a person to geolocate!") ) {
19+
ChatUtil.sendChatMessage(name);
20+
return;
21+
}
22+
ChatUtil.sendChatMessage(name + "'s exact coordinates are " + "X: " + 1 + (20 - 1) * + random.nextDouble() + " Y: " + + 1 + (20 - 1) * + random.nextDouble());
23+
}
24+
25+
}

src/main/java/dev/hause/squeakerbot/command/commands/Help.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
import dev.hause.squeakerbot.command.Command;
44
import dev.hause.squeakerbot.util.ChatUtil;
55

6+
@Command.Register(name = "Help", aliases = {"Commands"})
67
public class Help extends Command {
78

8-
public Help() {
9-
super("Help", new String[] {"Help", "Commands"});
10-
}
11-
129
@Override
1310
public void onRun() {
14-
ChatUtil.sendChatMessage("> [SqueakerBot] Commands (3): Help, CoinFlip, AskGod");
11+
ChatUtil.sendChatMessage("Commands (6): Help, CoinFlip, AskGod, TallyHall, About, Geolocate");
1512
}
1613

1714
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package dev.hause.squeakerbot.command.commands;
2+
3+
import java.util.Random;
4+
import dev.hause.squeakerbot.command.Command;
5+
import dev.hause.squeakerbot.util.ChatUtil;
6+
7+
@Command.Register(name = "TallyHall", aliases = {"Based", "Music", "Songs", "TheHall", "Hall", "Tally"})
8+
public class TallyHall extends Command {
9+
10+
private static String[] links = {"https://www.youtube.com/watch?v=ipYafcHd0jA", "https://www.youtube.com/watch?v=I8sUC-dsW8A",
11+
"https://www.youtube.com/watch?v=A-ZUo62N7Kc", "https://www.youtube.com/watch?v=-krA-ubCQqg", "https://www.youtube.com/watch?v=TIt4i8AmryQ",
12+
"https://www.youtube.com/watch?v=HnwemKW9H3s", "https://www.youtube.com/watch?v=xLirITfSCVY", "https://www.youtube.com/watch?v=Q-4IXcKkK1U",
13+
"https://www.youtube.com/watch?v=nHjaNDGgYEA", "https://www.youtube.com/watch?v=KrXJu-6ZcAQ", "https://www.youtube.com/watch?v=OFi8748c9Ew",
14+
"https://www.youtube.com/watch?v=1RliQKR6jXM", "https://www.youtube.com/watch?v=CgcTf6JYxsE", "https://www.youtube.com/watch?v=IawfoCuBV3c",
15+
"https://www.youtube.com/watch?v=OjGzOJ5IiSM", "https://www.youtube.com/watch?v=tRnMWzz44gA", "https://www.youtube.com/watch?v=5_QwMRE-BKc",
16+
"https://www.youtube.com/watch?v=7Q0ge00LmwM", "https://www.youtube.com/watch?v=rfUeWe7u364"};
17+
18+
private static String[] applause = {"You have great music taste: ", "Here's your vibes: ", "Enjoy!: ", "Listen, you'll love it: ",
19+
"Your tunes, sir: ", "Tally Hall!: ", "Go that extra mile: ", "Depression is gone: ", "A gem: ", "This one's a banger",
20+
"Poggers song: ", "Le tunes have arrived: ", "Amazing choice: ", "Have a great day friend: ", "The Tally Hall: ", "Epic vibe: ",
21+
"A cool band: ", "Mega based tune: ", "Great choice!: "};
22+
23+
@Override
24+
public void onRun() {
25+
Random random = new Random();
26+
ChatUtil.sendChatMessage((applause[random.nextInt(18)]) + (links[random.nextInt(18)]));
27+
}
28+
29+
}

0 commit comments

Comments
 (0)