use of au.com.mineauz.minigames.minigame.modules.TreasureHuntModule in project Minigames by AddstarMC.
the class SetMaxHeightCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
if (args != null) {
if (args[0].matches("[0-9]+")) {
int num = Integer.parseInt(args[0]);
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(minigame);
thm.setMaxHeight(num);
sender.sendMessage(ChatColor.GRAY + "Maximum height variance for " + minigame + " has been set to " + num);
return true;
}
}
return false;
}
use of au.com.mineauz.minigames.minigame.modules.TreasureHuntModule in project Minigames by AddstarMC.
the class HintCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
MinigamePlayer player = plugin.pdata.getMinigamePlayer((Player) sender);
if (args != null) {
Minigame mgm = plugin.mdata.getMinigame(args[0]);
if (mgm != null && mgm.getMinigameTimer() != null && mgm.getType() == MinigameType.GLOBAL && mgm.getMechanicName().equals("treasure_hunt")) {
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(mgm);
if (thm.hasTreasureLocation() && !thm.isTreasureFound()) {
thm.getHints(player);
} else {
player.sendMessage(ChatColor.GRAY + mgm.getName(false) + " is currently not running.");
}
} else if (mgm == null || mgm.getType() != MinigameType.GLOBAL) {
player.sendMessage(ChatColor.RED + "There is no treasure hunt running by the name \"" + args[0] + "\"");
}
} else {
List<Minigame> mgs = new ArrayList<Minigame>();
for (Minigame mg : plugin.mdata.getAllMinigames().values()) {
if (mg.getType() == MinigameType.GLOBAL && mg.getMechanicName().equals("treasure_hunt")) {
mgs.add(mg);
}
}
if (!mgs.isEmpty()) {
if (mgs.size() > 1) {
player.sendMessage(ChatColor.LIGHT_PURPLE + "Currently running Treasure Hunts:");
String treasures = "";
for (int i = 0; i < mgs.size(); i++) {
treasures += mgs.get(i).getName(false);
if (i != mgs.size() - 1) {
treasures += ", ";
}
}
player.sendMessage(ChatColor.GRAY + treasures);
} else {
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(mgs.get(0));
if (thm.hasTreasureLocation() && !thm.isTreasureFound()) {
thm.getHints(player);
} else {
player.sendMessage(ChatColor.GRAY + mgs.get(0).getName(false) + " is currently not running.");
}
}
} else if (mgs.isEmpty()) {
player.sendMessage(ChatColor.LIGHT_PURPLE + "There are no Treasure Hunt minigames currently running.");
}
}
return true;
}
use of au.com.mineauz.minigames.minigame.modules.TreasureHuntModule in project Minigames by AddstarMC.
the class SetMaxRadiusCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
if (args != null) {
if (args[0].matches("[0-9]+")) {
int max = Integer.parseInt(args[0]);
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(minigame);
thm.setMaxRadius(max);
sender.sendMessage(ChatColor.GRAY + "Maximum treasure spawn radius has been set to " + max + " for " + minigame.getName(false));
return true;
}
}
return false;
}
use of au.com.mineauz.minigames.minigame.modules.TreasureHuntModule in project Minigames by AddstarMC.
the class SetMaxTreasureCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
if (args != null) {
if (args[0].matches("[0-9]+")) {
int amount = Integer.parseInt(args[0]);
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(minigame);
thm.setMaxTreasure(amount);
sender.sendMessage(ChatColor.GRAY + "Maximum items has been set to " + amount + " for " + minigame);
return true;
}
}
return false;
}
use of au.com.mineauz.minigames.minigame.modules.TreasureHuntModule in project Minigames by AddstarMC.
the class SetMinTreasureCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Minigame minigame, String label, String[] args) {
if (args != null) {
if (args[0].matches("[0-9]+")) {
int amount = Integer.parseInt(args[0]);
TreasureHuntModule thm = TreasureHuntModule.getMinigameModule(minigame);
thm.setMinTreasure(amount);
sender.sendMessage(ChatColor.GRAY + "Minimum items has been set to " + amount + " for " + minigame);
return true;
}
}
return false;
}
Aggregations