Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 084f541

Browse files
committed
Fixed few bugs and added the feature to add challenges through config.yml, currently we just supports 10 challenges.
1 parent 94e61d0 commit 084f541

File tree

7 files changed

+23
-7
lines changed

7 files changed

+23
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>me.classy.funcommands</groupId>
66
<artifactId>FunCommands</artifactId>
7-
<version>3.0</version>
7+
<version>3.1</version>
88

99
<name>FunCommands</name>
1010

src/main/java/me/classy/funcommands/commands/ChallengeCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.bukkit.command.Command;
55
import org.bukkit.command.CommandExecutor;
66
import org.bukkit.command.CommandSender;
7+
import org.bukkit.configuration.file.FileConfiguration;
78
import org.bukkit.entity.Player;
89

910
import me.classy.funcommands.FunCommands;
@@ -13,7 +14,7 @@
1314
public class ChallengeCommand implements CommandExecutor {
1415

1516
private final FunCommands plugin;
16-
private final String[] message = {"Get 100m coins in SkyBlock in 100 days.", "Win the first BedWars game of the day for next 10 days.", "Reach Pinkpixel Network Level 10 in 100 days.", "You're bored? Join the Pinkpixel Network's Discord Server.", "Joined for the first time? Play a BedWars game and win it to get started.", "Wanna become cool? Register on our website and start talking with other player."};
17+
private final String[] message = {FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-1"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-2"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-3"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-4"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-5"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-6"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-7"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-8"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-9"), FunCommands.getPlugin(FunCommands.class).getConfig().getString("challenge-10")};
1718

1819
public ChallengeCommand(FunCommands plugin) {
1920
this.plugin = plugin;
@@ -24,7 +25,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
2425
command.getName().equalsIgnoreCase("takechallenge");
2526
Random random = new Random();
2627
int index = random.nextInt(message.length);
27-
sender.sendMessage(ChatColor.RED + message[index]);
28+
sender.sendMessage(ChatColor.AQUA + "Your challenge is: " + ChatColor.RED + message[index]);
2829
return true;
2930
}
3031
}

src/main/java/me/classy/funcommands/commands/DiscordCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
2929
}
3030

3131
private void executeDiscordCommand(Player player) {
32-
player.sendMessage(ChatColor.YELLOW + "Join our Discord server at: " + ChatColor.AQUA + ((FunCommands)FunCommands.getPlugin(FunCommands.class)).getConfig().getString("discordserverlink") + ChatColor.YELLOW + "!");
32+
player.sendMessage(ChatColor.YELLOW + "Join our Discord server at: " + ChatColor.AQUA + FunCommands.getPlugin(FunCommands.class).getConfig().getString("discordserverlink") + ChatColor.YELLOW + "!");
3333
}
3434
}

src/main/java/me/classy/funcommands/commands/ForumCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
2929
}
3030

3131
public void executeForumCommand(Player player) {
32-
player.sendMessage(ChatColor.YELLOW + "Visit our forum at: " + ChatColor.AQUA + ((FunCommands)FunCommands.getPlugin(FunCommands.class)).getConfig().getString("forums") + ChatColor.YELLOW + "!");
32+
player.sendMessage(ChatColor.YELLOW + "Visit our forum at: " + ChatColor.AQUA + FunCommands.getPlugin(FunCommands.class).getConfig().getString("forums") + ChatColor.YELLOW + "!");
3333
}
3434
}

src/main/java/me/classy/funcommands/commands/StoreCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
2929
}
3030

3131
private void executeStoreCommand(Player player) {
32-
player.sendMessage(ChatColor.YELLOW + "Visit our store at: " + ChatColor.AQUA + ((FunCommands)FunCommands.getPlugin(FunCommands.class)).getConfig().getString("store") + ChatColor.YELLOW + "!");
32+
player.sendMessage(ChatColor.YELLOW + "Visit our store at: " + ChatColor.AQUA + FunCommands.getPlugin(FunCommands.class).getConfig().getString("store") + ChatColor.YELLOW + "!");
3333
}
3434
}

src/main/resources/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Links
2+
13
forums: https://hypixel.net
24
store: https://store.hypixel.net
35
discordserverlink: https://discord.gg/hypixel
6+
7+
# Challenges
8+
9+
challenge-1: Your first challenge
10+
challenge-2: Your second challenge
11+
challenge-3: Your third challenge
12+
challenge-4: Your fourth challenge
13+
challenge-5: Your fifth challenge
14+
challenge-6: Your sixth challenge
15+
challenge-7: Your seventh challenge
16+
challenge-8: Your eighth challenge
17+
challenge-9: Your ninth challenge
18+
challenge-10: Your tenth challenge

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: FunCommands
22
author: ClassyCoder
33
main: me.classy.funcommands.FunCommands
4-
version: 3.0
4+
version: 3.1
55
api-version: 1.12.2
66
commands:
77
kaboom:

0 commit comments

Comments
 (0)