use of au.com.mineauz.minigames.objects.MinigamePlayer in project Minigames by AddstarMC.
the class JuggernautMechanic method minigameStart.
@EventHandler
private void minigameStart(StartMinigameEvent event) {
if (event.getMinigame().getMechanic() == this) {
Minigame mgm = event.getMinigame();
mgm.getScoreboardManager().registerNewTeam("juggernaut");
mgm.getScoreboardManager().getTeam("juggernaut").setPrefix(ChatColor.RED.toString());
MinigamePlayer j = assignNewJuggernaut(event.getPlayers(), null);
JuggernautModule.getMinigameModule(event.getMinigame()).setJuggernaut(j);
}
}
use of au.com.mineauz.minigames.objects.MinigamePlayer in project Minigames by AddstarMC.
the class MenuItemList method onDoubleClick.
@Override
public ItemStack onDoubleClick() {
MinigamePlayer ply = getContainer().getViewer();
ply.setNoClose(true);
ply.getPlayer().closeInventory();
ply.sendInfoMessage("Enter the name of the option into chat for " + getName() + ", the menu will automatically reopen in 10s if nothing is entered.");
ply.setManualEntry(this);
if (MinigameUtils.listToString(options).getBytes().length > 16000) {
ply.sendInfoMessage("Unfortunately there are too many options to provide a list in game. Perhaps use the WIKI");
} else {
ply.sendInfoMessage("Possible Options: " + MinigameUtils.listToString(options));
}
getContainer().startReopenTimer(10);
return null;
}
use of au.com.mineauz.minigames.objects.MinigamePlayer in project Minigames by AddstarMC.
the class MenuItemPotionAdd method onClick.
@Override
public ItemStack onClick() {
MinigamePlayer ply = getContainer().getViewer();
ply.setNoClose(true);
ply.getPlayer().closeInventory();
ply.sendInfoMessage("Enter a potion using the syntax below into chat, the menu will automatically reopen in 30s if nothing is entered.");
ply.sendInfoMessage("PotionName, level, duration (duration can be \"inf\")");
ply.setManualEntry(this);
getContainer().startReopenTimer(30);
return null;
}
use of au.com.mineauz.minigames.objects.MinigamePlayer in project Minigames by AddstarMC.
the class MenuItemString method onDoubleClick.
@Override
public ItemStack onDoubleClick() {
MinigamePlayer ply = getContainer().getViewer();
ply.setNoClose(true);
ply.getPlayer().closeInventory();
ply.sendMessage("Enter string value into chat for " + getName() + ", the menu will automatically reopen in 20s if nothing is entered.", MinigameMessageType.INFO);
if (allowNull) {
ply.sendInfoMessage("Enter \"null\" to remove the string value");
}
ply.setManualEntry(this);
getContainer().startReopenTimer(20);
return null;
}
use of au.com.mineauz.minigames.objects.MinigamePlayer in project Minigames by AddstarMC.
the class MinigameManager method sendMinigameMessage.
public void sendMinigameMessage(final Minigame minigame, final String message, MinigameMessageType type, final List<MinigamePlayer> exclude) {
if (!minigame.getShowPlayerBroadcasts()) {
return;
}
String finalMessage;
if (type == null) {
type = MinigameMessageType.INFO;
}
switch(type) {
case ERROR:
finalMessage = ChatColor.RED + "[Minigames] " + ChatColor.WHITE;
break;
case INFO:
default:
finalMessage = ChatColor.AQUA + "[Minigames] " + ChatColor.WHITE;
break;
}
finalMessage += message;
final List<MinigamePlayer> sendto = new ArrayList<>();
Collections.copy(minigame.getPlayers(), sendto);
sendto.addAll(minigame.getSpectators());
if (exclude != null) {
sendto.removeAll(exclude);
}
for (final MinigamePlayer pl : sendto) {
pl.sendInfoMessage(finalMessage);
}
}
Aggregations