1.1
This commit is contained in:
parent
0371c889ea
commit
fac8abdf6c
|
@ -33,6 +33,7 @@ public final class ColorblindWar extends JavaPlugin {
|
||||||
if (game.isStarted()) {
|
if (game.isStarted()) {
|
||||||
game.stop(false);
|
game.stop(false);
|
||||||
}
|
}
|
||||||
|
GiftEffectManager.stopQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.io.yutian.colorblindwar.util.RandomUtil;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
@ -24,6 +25,15 @@ public class GiftEffectManager {
|
||||||
giftQueues.put(effectId, giftQueue);
|
giftQueues.put(effectId, giftQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void stopQueue() {
|
||||||
|
giftQueues.values().forEach(giftQueue -> {
|
||||||
|
BukkitTask task = giftQueue.getTask();
|
||||||
|
if (task != null && !task.isCancelled()) {
|
||||||
|
task.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static GiftQueue getGiftQueue(String effectId) {
|
public static GiftQueue getGiftQueue(String effectId) {
|
||||||
return giftQueues.get(effectId);
|
return giftQueues.get(effectId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user