Skip to content

Commit

Permalink
Merge pull request #42 from Permanently/master
Browse files Browse the repository at this point in the history
Added a configurable option to change team colours
  • Loading branch information
ericyoondotcom authored Dec 27, 2020
2 parents 87d2383 + e5578ac commit f8675f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
.idea/
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.logging.Logger;

import static org.bukkit.Bukkit.getScoreboardManager;
import static org.bukkit.ChatColor.getByChar;

enum ManhuntTeam {
HUNTER,
Expand Down Expand Up @@ -59,17 +60,18 @@ public void onEnable() {
huntersTeam = board.getTeam("hunters");
runnersTeam = board.getTeam("speedrunners");
spectatorsTeam = board.getTeam("spectators");

if(huntersTeam == null){
huntersTeam = board.registerNewTeam("hunters");
huntersTeam.setColor(ChatColor.RED);
huntersTeam.setColor(getByChar(getConfig().getString("huntersColor", "&c").replace("&", "")));
}
if(runnersTeam == null){
runnersTeam = board.registerNewTeam("speedrunners");
runnersTeam.setColor(ChatColor.GREEN);
runnersTeam.setColor(getByChar(getConfig().getString("runnersColor", "&a").replace("&", "")));
}
if(spectatorsTeam == null){
spectatorsTeam = board.registerNewTeam("spectators");
spectatorsTeam.setColor(ChatColor.AQUA);
spectatorsTeam.setColor(getByChar(getConfig().getString("spectatorsColor", "&b").replace("&", "")));
}

discord = new DiscordManager(this);
Expand Down
6 changes: 5 additions & 1 deletion MinecraftManhunt/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ hunterRoleId: "XXXXX"
runnerRoleId: "XXXXX"
spectatorRoleId: "XXXXX"


# You can change the colours of the teams here.
# Only one colour is supported.
huntersColor: "&c"
runnersColor: "&a"
spectatorsColor: "&b"

# Please do not touch the value below!
uuid: ""
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ Edit the `plugins/MinecraftManhunt/config.yml` file with the following options:
hunterRoleId | The ID of the role to assign to Hunters. | string | Optional
runnnerRoleId | The ID of the role to assign to Runners. | string | Optional
spectatorRoleId | The ID of the role to assign to Spectators. | string | Optional
huntersColor | The color to give to Hunters. | string | Optional
runnersColor | The color to give to Runners. | string | Optional
spectatorsColor | The color to give Spectators. | string | Optional
uuid | Randomized id that is automatically assigned if `sendUsageData` is enabled. **Please do not touch this field.** | string | Do not set manually

> Note: if any of the role IDs are missing or invalid, no roles will be assigned.
Expand Down

0 comments on commit f8675f3

Please sign in to comment.