Skip to content

Commit

Permalink
Opt to clear hunter/runner inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
Permanently committed Dec 29, 2020
1 parent dc8a23a commit 7e69855
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ public boolean onCommand(CommandSender commandSender, Command command, String la
player.setGameMode(GameMode.SURVIVAL);
player.setHealth(20.0);
player.setFoodLevel(20);
// player.getInventory().clear();

if (main.getConfig().getBoolean("clearRunnerInvOnStart", false)) {
player.getInventory().clear();
player.setExp(0);
}

main.runnersTeam.addEntry(player.getName());
if(!main.discord.assignRole(ManhuntTeam.RUNNER, player.getName())){
commandSender.sendMessage("Could not assign Discord role. Make sure the target's username is also their Discord nickname.");
Expand All @@ -297,7 +302,12 @@ public boolean onCommand(CommandSender commandSender, Command command, String la
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 20 * headStartDuration, 10));
player.setHealth(20.0);
player.setFoodLevel(20);
// player.getInventory().clear();

if (main.getConfig().getBoolean("clearHunterInvOnStart", false)) {
player.getInventory().clear();
player.setExp(0);
}

player.getInventory().addItem(new ItemStack(Material.COMPASS, 1));
main.huntersTeam.addEntry(player.getName());
if(!main.discord.assignRole(ManhuntTeam.HUNTER, player.getName())){
Expand Down
10 changes: 10 additions & 0 deletions MinecraftManhunt/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ huntersColor: "&c"
runnersColor: "&a"
spectatorsColor: "&b"

# You can change game preparations here.
# Depending on what environment you run this plugin in, this could erase your data.
# For example, if this is running on primary survival server, you may not want to clear inventory.

# Set to true to clear runner inventories and EXP when the game starts.
clearRunnerInvOnStart: false
# Set to true to clear hunter inventories and EXP when the game starts.
clearHunterInvOnStart: false


# Read the plugin README/description for more info on how to set up Discord integration!
enableDiscord: false
discordToken: "XXXXX"
Expand Down

0 comments on commit 7e69855

Please sign in to comment.