Ignore "Testing" boostergroup when announcing activation

This commit is contained in:
Shaun Bennett 2016-08-03 14:24:49 -05:00
parent ca13b8f29e
commit a61906acfa

View File

@ -79,17 +79,24 @@ public class GameBoosterManager extends MiniPlugin
public void onActivate(BoosterActivateEvent event) public void onActivate(BoosterActivateEvent event)
{ {
Booster booster = event.getBooster(); Booster booster = event.getBooster();
boolean isTesting = event.getBoosterGroup().equalsIgnoreCase("Testing");
if (event.getBoosterGroup().equals(_boosterGroup)) if (event.getBoosterGroup().equals(_boosterGroup))
{ {
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier for " + booster.getMultiplier() + "x Shards!")); Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier for " + booster.getMultiplier() + "x Shards!"));
} else }
else if (!isTesting)
{ {
Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!")); Bukkit.broadcastMessage(F.main("Amplifier", F.name(booster.getPlayerName()) + " has activated a Game Amplifier on " + F.elem(event.getBoosterGroup().replaceAll("_", " ")) + "!"));
} }
JsonMessage message = new JsonMessage(F.main("Amplifier", F.elem("Click here") + " to thank them and receive " + F.currency(GlobalCurrency.TREASURE_SHARD, BoosterThankManager.TIP_FOR_TIPPER) + "!")); if (event.getBoosterGroup().equals(_boosterGroup) || !isTesting)
message.click(ClickEvent.RUN_COMMAND, "/amplifier thank " + event.getBoosterGroup()); {
message.hover(HoverEvent.SHOW_TEXT, C.cGreen + "Click to Thank"); JsonMessage message = new JsonMessage(F.main("Amplifier", F.elem("Click here") + " to thank them and receive " + F.currency(GlobalCurrency.TREASURE_SHARD, BoosterThankManager.TIP_FOR_TIPPER) + "!"));
message.send(JsonMessage.MessageType.CHAT_BOX, UtilServer.getPlayers()); message.click(ClickEvent.RUN_COMMAND, "/amplifier thank " + event.getBoosterGroup());
message.hover(HoverEvent.SHOW_TEXT, C.cGreen + "Click to Thank");
message.send(JsonMessage.MessageType.CHAT_BOX, UtilServer.getPlayers());
}
} }
} }