Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.dbzjp.oneshot;
- import org.bukkit.Bukkit;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.Plugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class EndMethod {
- private static Plugin plugin = Bukkit.getPluginManager().getPlugin("OneShot");
- static int task;
- static int task2;
- public static void End(Player p) {
- Main.IsRebooting = true;
- for(Player all : Bukkit.getOnlinePlayers()) {
- Title title = new Title("§6Fin de la partie", "§aGagnant: §8" + p.getName());
- title.send(all);
- all.sendMessage(Main.prefix + "§cRedémarrage du serveur dans 10 secondes");
- }
- task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
- @Override
- public void run() {
- for(Player all : Bukkit.getOnlinePlayers()) {
- all.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 10, 255));
- all.sendMessage(Main.prefix + "§eMerci d'avoir joué !");
- all.performCommand("/hub");
- Bukkit.dispatchCommand(Bukkit.getConsoleSender(), plugin.getConfig().getString("stop-server-command"));
- }
- }
- }, 10*20);
- }
- public static void Endbytime() {
- Main.IsRebooting = true;
- for(Player all : Bukkit.getOnlinePlayers()) {
- Title title = new Title("§6Fin de la partie", "§8Match nul");
- title.send(all);
- all.sendMessage(Main.prefix + "§cRedémarrage du serveur dans 10 secondes");
- }
- task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
- @Override
- public void run() {
- for(Player all : Bukkit.getOnlinePlayers()) {
- all.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 10, 255));
- all.sendMessage(Main.prefix + "§eMerci d'avoir joué !");
- all.performCommand("/hub");
- Bukkit.dispatchCommand(Bukkit.getConsoleSender(), plugin.getConfig().getString("stop-server-command"));
- }
- }
- }, 10*20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement