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)
{
Booster booster = event.getBooster();
boolean isTesting = event.getBoosterGroup().equalsIgnoreCase("Testing");
if (event.getBoosterGroup().equals(_boosterGroup))
{
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("_", " ")) + "!"));
}
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.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());
if (event.getBoosterGroup().equals(_boosterGroup) || !isTesting)
{
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.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());
}
}
}