use of au.com.mineauz.minigames.events.StopGlobalMinigameEvent in project Minigames by AddstarMC.
the class MinigameData method stopGlobalMinigame.
public void stopGlobalMinigame(Minigame minigame, MinigamePlayer caller) {
if (minigame.getType() == MinigameType.GLOBAL) {
StopGlobalMinigameEvent ev = new StopGlobalMinigameEvent(minigame, caller);
Bukkit.getPluginManager().callEvent(ev);
minigame.getMechanic().stopMinigame(minigame, caller);
minigame.setEnabled(false);
minigame.saveMinigame();
}
}
use of au.com.mineauz.minigames.events.StopGlobalMinigameEvent in project Minigames by AddstarMC.
the class MinigameManager method stopGlobalMinigame.
public void stopGlobalMinigame(final Minigame minigame, final MinigamePlayer caller) {
if (minigame.getType() == MinigameType.GLOBAL) {
final StopGlobalMinigameEvent ev = new StopGlobalMinigameEvent(minigame, caller);
Bukkit.getPluginManager().callEvent(ev);
minigame.getMechanic().stopMinigame(minigame, caller);
minigame.setEnabled(false);
final ResourcePackModule module = (ResourcePackModule) minigame.getModule("ResourcePack");
if (module != null) {
if (module.isEnabled()) {
final ResourcePack pack = PLUGIN.getResourceManager().getResourcePack("empty");
if (pack.isValid()) {
for (final MinigamePlayer player : minigame.getPlayers()) {
player.applyResourcePack(pack);
}
}
}
}
minigame.saveMinigame();
}
}
Aggregations