replace BukkitRunnable to CancellableRunnable

This commit is contained in:
HSGamer 2023-08-20 21:33:29 +07:00
parent 64af17db42
commit 731e2d8691
51 changed files with 92 additions and 104 deletions

View File

@ -23,7 +23,6 @@ import org.jetbrains.annotations.Nullable;
import java.sql.*; import java.sql.*;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
public final class SQLDatabaseManager implements DatabaseManager { public final class SQLDatabaseManager implements DatabaseManager {

View File

@ -51,7 +51,6 @@ import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.TimeUnit;
public class PlayerListener implements Listener { public class PlayerListener implements Listener {
private final mcMMO plugin; private final mcMMO plugin;

View File

@ -2,7 +2,6 @@ package com.gmail.nossr50.listeners;
import com.gmail.nossr50.config.WorldBlacklist; import com.gmail.nossr50.config.WorldBlacklist;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -12,8 +11,6 @@ import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.event.world.WorldUnloadEvent; import org.bukkit.event.world.WorldUnloadEvent;
import java.util.concurrent.TimeUnit;
public class WorldListener implements Listener { public class WorldListener implements Listener {
private final mcMMO plugin; private final mcMMO plugin;

View File

@ -54,7 +54,6 @@ import com.gmail.nossr50.util.skills.SmeltingTracker;
import com.gmail.nossr50.util.upgrade.UpgradeManager; import com.gmail.nossr50.util.upgrade.UpgradeManager;
import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardManager;
import com.tcoded.folialib.FoliaLib; import com.tcoded.folialib.FoliaLib;
import com.tcoded.folialib.impl.ServerImplementation;
import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.shatteredlands.shatt.backup.ZipLibrary; import net.shatteredlands.shatt.backup.ZipLibrary;
import org.bstats.bukkit.Metrics; import org.bstats.bukkit.Metrics;
@ -76,7 +75,6 @@ import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
public class mcMMO extends JavaPlugin { public class mcMMO extends JavaPlugin {

View File

@ -3,9 +3,9 @@
//import com.gmail.nossr50.mcMMO; //import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.runnables.skills.AprilTask; //import com.gmail.nossr50.runnables.skills.AprilTask;
//import com.gmail.nossr50.util.Misc; //import com.gmail.nossr50.util.Misc;
//import org.bukkit.scheduler.BukkitRunnable; //import com.gmail.nossr50.util.CancellableRunnable;
// //
//public class CheckDateTask extends BukkitRunnable { //public class CheckDateTask extends CancellableRunnable {
// //
// @Override // @Override
// public void run() { // public void run() {

View File

@ -1,12 +1,12 @@
package com.gmail.nossr50.runnables; package com.gmail.nossr50.runnables;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import org.bukkit.entity.Mob; import org.bukkit.entity.Mob;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class MobDodgeMetaCleanup extends BukkitRunnable { public class MobDodgeMetaCleanup extends CancellableRunnable {
private final @NotNull Mob mob; private final @NotNull Mob mob;
private final @NotNull mcMMO pluginRef; private final @NotNull mcMMO pluginRef;

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.runnables; package com.gmail.nossr50.runnables;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.scheduler.BukkitRunnable;
public class MobHealthDisplayUpdaterTask extends BukkitRunnable { public class MobHealthDisplayUpdaterTask extends CancellableRunnable {
private final LivingEntity target; private final LivingEntity target;
public MobHealthDisplayUpdaterTask(LivingEntity target) { public MobHealthDisplayUpdaterTask(LivingEntity target) {

View File

@ -2,14 +2,14 @@ package com.gmail.nossr50.runnables;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.BlockUtils;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.List; import java.util.List;
public class PistonTrackerTask extends BukkitRunnable { public class PistonTrackerTask extends CancellableRunnable {
private final List<Block> blocks; private final List<Block> blocks;
private final BlockFace direction; private final BlockFace direction;
private final Block futureEmptyBlock; private final Block futureEmptyBlock;

View File

@ -4,11 +4,11 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.LogUtils; import com.gmail.nossr50.util.LogUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.scheduler.BukkitRunnable;
public class SaveTimerTask extends BukkitRunnable { public class SaveTimerTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
LogUtils.debug(mcMMO.p.getLogger(), "[User Data] Saving..."); LogUtils.debug(mcMMO.p.getLogger(), "[User Data] Saving...");

View File

@ -2,11 +2,11 @@ package com.gmail.nossr50.runnables;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.BlockUtils;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.scheduler.BukkitRunnable;
public class StickyPistonTrackerTask extends BukkitRunnable { public class StickyPistonTrackerTask extends CancellableRunnable {
private final BlockFace direction; private final BlockFace direction;
private final Block block; private final Block block;
private final Block movedBlock; private final Block movedBlock;

View File

@ -1,12 +1,12 @@
package com.gmail.nossr50.runnables; package com.gmail.nossr50.runnables;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class TravelingBlockMetaCleanup extends BukkitRunnable { public class TravelingBlockMetaCleanup extends CancellableRunnable {
private final @NotNull Entity entity; private final @NotNull Entity entity;
private final @NotNull mcMMO pluginRef; private final @NotNull mcMMO pluginRef;

View File

@ -1,8 +1,8 @@
package com.gmail.nossr50.runnables.backups; package com.gmail.nossr50.runnables.backups;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.LogUtils; import com.gmail.nossr50.util.LogUtils;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File; import java.io.File;
import java.text.ParseException; import java.text.ParseException;
@ -10,7 +10,7 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class CleanBackupsTask extends BukkitRunnable { public class CleanBackupsTask extends CancellableRunnable {
private static final String BACKUP_DIRECTORY = mcMMO.getMainDirectory() + "backup" + File.separator; private static final String BACKUP_DIRECTORY = mcMMO.getMainDirectory() + "backup" + File.separator;
private static final File BACKUP_DIR = new File(BACKUP_DIRECTORY); private static final File BACKUP_DIR = new File(BACKUP_DIRECTORY);

View File

@ -1,10 +1,10 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class McScoreboardKeepTask extends BukkitRunnable { public class McScoreboardKeepTask extends CancellableRunnable {
private final Player player; private final Player player;
public McScoreboardKeepTask(Player player) { public McScoreboardKeepTask(Player player) {

View File

@ -2,14 +2,14 @@ package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.Map; import java.util.Map;
public class McrankCommandAsyncTask extends BukkitRunnable { public class McrankCommandAsyncTask extends CancellableRunnable {
private final String playerName; private final String playerName;
private final CommandSender sender; private final CommandSender sender;
private final boolean useBoard, useChat; private final boolean useBoard, useChat;

View File

@ -3,19 +3,19 @@ package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.SkillTools; import com.gmail.nossr50.util.skills.SkillTools;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.Map; import java.util.Map;
/** /**
* Display the results of McrankCommandAsyncTask to the sender. * Display the results of McrankCommandAsyncTask to the sender.
*/ */
public class McrankCommandDisplayTask extends BukkitRunnable { public class McrankCommandDisplayTask extends CancellableRunnable {
private final Map<PrimarySkillType, Integer> skills; private final Map<PrimarySkillType, Integer> skills;
private final CommandSender sender; private final CommandSender sender;
private final String playerName; private final String playerName;

View File

@ -3,14 +3,14 @@ package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.datatypes.database.PlayerStat; import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.List; import java.util.List;
public class MctopCommandAsyncTask extends BukkitRunnable { public class MctopCommandAsyncTask extends CancellableRunnable {
private final CommandSender sender; private final CommandSender sender;
private final PrimarySkillType skill; private final PrimarySkillType skill;
private final int page; private final int page;

View File

@ -4,19 +4,19 @@ import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.List; import java.util.List;
/** /**
* Display the results of {@link MctopCommandAsyncTask} to the sender. * Display the results of {@link MctopCommandAsyncTask} to the sender.
*/ */
public class MctopCommandDisplayTask extends BukkitRunnable { public class MctopCommandDisplayTask extends CancellableRunnable {
private final List<PlayerStat> userStats; private final List<PlayerStat> userStats;
private final CommandSender sender; private final CommandSender sender;
private final PrimarySkillType skill; private final PrimarySkillType skill;

View File

@ -1,12 +1,12 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class NotifySquelchReminderTask extends BukkitRunnable { public class NotifySquelchReminderTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {

View File

@ -3,10 +3,10 @@ package com.gmail.nossr50.runnables.database;
import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitRunnable;
public class DatabaseConversionTask extends BukkitRunnable { public class DatabaseConversionTask extends CancellableRunnable {
private final DatabaseManager sourceDatabase; private final DatabaseManager sourceDatabase;
private final CommandSender sender; private final CommandSender sender;
private final String message; private final String message;

View File

@ -8,14 +8,14 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.LogUtils; import com.gmail.nossr50.util.LogUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillTools; import com.gmail.nossr50.util.skills.SkillTools;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitRunnable;
public class FormulaConversionTask extends BukkitRunnable { public class FormulaConversionTask extends CancellableRunnable {
private final CommandSender sender; private final CommandSender sender;
private final FormulaType formulaType; private final FormulaType formulaType;

View File

@ -18,7 +18,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level; import java.util.logging.Level;
public class UUIDUpdateAsyncTask implements Runnable { public class UUIDUpdateAsyncTask implements Runnable {

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.runnables.database; package com.gmail.nossr50.runnables.database;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.util.CancellableRunnable;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
public class UserPurgeTask extends BukkitRunnable { public class UserPurgeTask extends CancellableRunnable {
private final ReentrantLock lock = new ReentrantLock(); private final ReentrantLock lock = new ReentrantLock();
@Override @Override
public void run() { public void run() {

View File

@ -3,6 +3,7 @@ package com.gmail.nossr50.runnables.items;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.ChimaeraWing;
import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -10,9 +11,8 @@ import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
public class ChimaeraWingWarmup extends BukkitRunnable { public class ChimaeraWingWarmup extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
public ChimaeraWingWarmup(McMMOPlayer mcMMOPlayer) { public ChimaeraWingWarmup(McMMOPlayer mcMMOPlayer) {

View File

@ -4,6 +4,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -11,9 +12,8 @@ import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class TeleportationWarmup extends BukkitRunnable { public class TeleportationWarmup extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final McMMOPlayer mcMMOTarget; private final McMMOPlayer mcMMOTarget;

View File

@ -3,8 +3,8 @@ package com.gmail.nossr50.runnables.party;
import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID; import java.util.UUID;
public class PartyAutoKickTask extends BukkitRunnable { public class PartyAutoKickTask extends CancellableRunnable {
private final static long KICK_TIME = 24L * 60L * 60L * 1000L * mcMMO.p.getGeneralConfig().getAutoPartyKickTime(); private final static long KICK_TIME = 24L * 60L * 60L * 1000L * mcMMO.p.getGeneralConfig().getAutoPartyKickTime();
@Override @Override

View File

@ -1,10 +1,10 @@
package com.gmail.nossr50.runnables.player; package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.scheduler.BukkitRunnable;
public class ClearRegisteredXPGainTask extends BukkitRunnable { public class ClearRegisteredXPGainTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
for (McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) { for (McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) {

View File

@ -5,6 +5,7 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.runnables.commands.McScoreboardKeepTask;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.LogUtils; import com.gmail.nossr50.util.LogUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -12,9 +13,8 @@ import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class PlayerProfileLoadingTask extends BukkitRunnable { public class PlayerProfileLoadingTask extends CancellableRunnable {
private final Player player; private final Player player;
private int attempt = 0; private int attempt = 0;
@ -77,7 +77,7 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
new PlayerProfileLoadingTask(player, attempt).runTaskLaterAsynchronously(mcMMO.p, (100 + (attempt * 100L))); new PlayerProfileLoadingTask(player, attempt).runTaskLaterAsynchronously(mcMMO.p, (100 + (attempt * 100L)));
} }
private class ApplySuccessfulProfile extends BukkitRunnable { private class ApplySuccessfulProfile extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private ApplySuccessfulProfile(McMMOPlayer mcMMOPlayer) { private ApplySuccessfulProfile(McMMOPlayer mcMMOPlayer) {

View File

@ -1,9 +1,9 @@
package com.gmail.nossr50.runnables.player; package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.player.PlayerProfile;
import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.util.CancellableRunnable;
public class PlayerProfileSaveTask extends BukkitRunnable { public class PlayerProfileSaveTask extends CancellableRunnable {
private final PlayerProfile playerProfile; private final PlayerProfile playerProfile;
private final boolean isSync; private final boolean isSync;

View File

@ -1,10 +1,10 @@
package com.gmail.nossr50.runnables.player; package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class PlayerUpdateInventoryTask extends BukkitRunnable { public class PlayerUpdateInventoryTask extends CancellableRunnable {
private final Player player; private final Player player;
public PlayerUpdateInventoryTask(Player player) { public PlayerUpdateInventoryTask(Player player) {

View File

@ -1,9 +1,9 @@
package com.gmail.nossr50.runnables.player; package com.gmail.nossr50.runnables.player;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import org.bukkit.scheduler.BukkitRunnable;
public class PowerLevelUpdatingTask extends BukkitRunnable { public class PowerLevelUpdatingTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
if (!ScoreboardManager.powerLevelHeartbeat()) { if (!ScoreboardManager.powerLevelHeartbeat()) {

View File

@ -3,10 +3,10 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
import org.bukkit.scheduler.BukkitRunnable;
public class AbilityCooldownTask extends BukkitRunnable { public class AbilityCooldownTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final SuperAbilityType ability; private final SuperAbilityType ability;

View File

@ -4,6 +4,7 @@ import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
@ -12,9 +13,8 @@ import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class AbilityDisableTask extends BukkitRunnable { public class AbilityDisableTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final SuperAbilityType ability; private final SuperAbilityType ability;

View File

@ -2,15 +2,15 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.skills.alchemy.Alchemy; import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.BrewingStand; import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.Arrays; import java.util.Arrays;
public class AlchemyBrewCheckTask extends BukkitRunnable { public class AlchemyBrewCheckTask extends CancellableRunnable {
private final Player player; private final Player player;
private final BrewingStand brewingStand; private final BrewingStand brewingStand;
private final ItemStack[] oldInventory; private final ItemStack[] oldInventory;

View File

@ -7,6 +7,7 @@ import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.alchemy.Alchemy; import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@ -15,9 +16,8 @@ import org.bukkit.Material;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand; import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class AlchemyBrewTask extends BukkitRunnable { public class AlchemyBrewTask extends CancellableRunnable {
private static final double DEFAULT_BREW_SPEED = 1.0; private static final double DEFAULT_BREW_SPEED = 1.0;
private static final int DEFAULT_BREW_TICKS = 400; private static final int DEFAULT_BREW_TICKS = 400;

View File

@ -8,9 +8,9 @@
//import org.bukkit.ChatColor; //import org.bukkit.ChatColor;
//import org.bukkit.Statistic; //import org.bukkit.Statistic;
//import org.bukkit.entity.Player; //import org.bukkit.entity.Player;
//import org.bukkit.scheduler.BukkitRunnable; //import com.gmail.nossr50.util.CancellableRunnable;
// //
//public class AprilTask extends BukkitRunnable { //public class AprilTask extends CancellableRunnable {
// //
// @Override // @Override
// public void run() { // public void run() {

View File

@ -5,10 +5,10 @@ import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.scheduler.BukkitRunnable;
public class AwardCombatXpTask extends BukkitRunnable { public class AwardCombatXpTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final double baseXp; private final double baseXp;
private final PrimarySkillType primarySkillType; private final PrimarySkillType primarySkillType;

View File

@ -15,7 +15,7 @@
//import org.bukkit.entity.Player; //import org.bukkit.entity.Player;
//import org.bukkit.event.entity.EntityDamageEvent; //import org.bukkit.event.entity.EntityDamageEvent;
//import org.bukkit.inventory.ItemStack; //import org.bukkit.inventory.ItemStack;
//import org.bukkit.scheduler.BukkitRunnable; //import com.gmail.nossr50.util.CancellableRunnable;
//import org.jetbrains.annotations.NotNull; //import org.jetbrains.annotations.NotNull;
// //
//import java.util.HashMap; //import java.util.HashMap;
@ -23,7 +23,7 @@
//import java.util.Map; //import java.util.Map;
//import java.util.Map.Entry; //import java.util.Map.Entry;
// //
//public class BleedTimerTask extends BukkitRunnable { //public class BleedTimerTask extends CancellableRunnable {
// private static final @NotNull Map<LivingEntity, BleedContainer> bleedList = new HashMap<>(); // private static final @NotNull Map<LivingEntity, BleedContainer> bleedList = new HashMap<>();
// private static boolean isIterating = false; // private static boolean isIterating = false;
// //

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.meta.RecentlyReplantedCropMeta; import com.gmail.nossr50.datatypes.meta.RecentlyReplantedCropMeta;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.ParticleEffectUtils;
import org.bukkit.Location; import org.bukkit.Location;
@ -14,11 +15,10 @@ import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional; import org.bukkit.block.data.Directional;
import org.bukkit.block.data.type.Cocoa; import org.bukkit.block.data.type.Cocoa;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class DelayedCropReplant extends BukkitRunnable { public class DelayedCropReplant extends CancellableRunnable {
private final int desiredCropAge; private final int desiredCropAge;
private final Location cropLocation; private final Location cropLocation;
@ -110,7 +110,7 @@ public class DelayedCropReplant extends BukkitRunnable {
COCOA COCOA
} }
private static class PhysicsBlockUpdate extends BukkitRunnable { private static class PhysicsBlockUpdate extends CancellableRunnable {
private final Block plantBlock; private final Block plantBlock;
private final PlantAnchorType plantAnchorType; private final PlantAnchorType plantAnchorType;
private BlockFace plantFace; private BlockFace plantFace;
@ -160,7 +160,7 @@ public class DelayedCropReplant extends BukkitRunnable {
private static class markPlantAsOld extends BukkitRunnable { private static class markPlantAsOld extends CancellableRunnable {
private final Location cropLoc; private final Location cropLoc;

View File

@ -2,11 +2,11 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.BlockSnapshot; import com.gmail.nossr50.datatypes.BlockSnapshot;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.util.CancellableRunnable;
import java.util.ArrayList; import java.util.ArrayList;
public class DelayedHerbalismXPCheckTask extends BukkitRunnable { public class DelayedHerbalismXPCheckTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final ArrayList<BlockSnapshot> chorusBlocks; private final ArrayList<BlockSnapshot> chorusBlocks;

View File

@ -2,10 +2,10 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.experience.ExperienceBarManager;
import org.bukkit.scheduler.BukkitRunnable;
public class ExperienceBarHideTask extends BukkitRunnable { public class ExperienceBarHideTask extends CancellableRunnable {
public final McMMOPlayer mcMMOPlayer; public final McMMOPlayer mcMMOPlayer;
public final PrimarySkillType primarySkillType; public final PrimarySkillType primarySkillType;
public final ExperienceBarManager experienceBarManagerRef; public final ExperienceBarManager experienceBarManagerRef;

View File

@ -1,9 +1,9 @@
package com.gmail.nossr50.runnables.skills; package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.scheduler.BukkitRunnable;
public class HerbalismBlockUpdaterTask extends BukkitRunnable { public class HerbalismBlockUpdaterTask extends CancellableRunnable {
private final BlockState blockState; private final BlockState blockState;
public HerbalismBlockUpdaterTask(BlockState blockState) { public HerbalismBlockUpdaterTask(BlockState blockState) {

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.runnables.skills; package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.skills.fishing.FishingManager; import com.gmail.nossr50.skills.fishing.FishingManager;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.entity.FishHook; import org.bukkit.entity.FishHook;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class MasterAnglerTask extends BukkitRunnable { public class MasterAnglerTask extends CancellableRunnable {
private final @NotNull FishHook fishHook; private final @NotNull FishHook fishHook;
private final @NotNull FishingManager fishingManager; private final @NotNull FishingManager fishingManager;
private final int lureLevel; private final int lureLevel;

View File

@ -3,15 +3,15 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.skills.rupture.McMMOEntityDamageByRuptureEvent; import com.gmail.nossr50.events.skills.rupture.McMMOEntityDamageByRuptureEvent;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.ParticleEffectUtils;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class RuptureTask extends BukkitRunnable { public class RuptureTask extends CancellableRunnable {
public static final int DAMAGE_TICK_INTERVAL = 10; public static final int DAMAGE_TICK_INTERVAL = 10;
public static final int ANIMATION_TICK_INTERVAL = 1; public static final int ANIMATION_TICK_INTERVAL = 1;

View File

@ -2,11 +2,11 @@ package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
import org.bukkit.scheduler.BukkitRunnable;
public class SkillUnlockNotificationTask extends BukkitRunnable { public class SkillUnlockNotificationTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final SubSkillType subSkillType; private final SubSkillType subSkillType;
private final int rank; private final int rank;

View File

@ -4,10 +4,10 @@ import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
import org.bukkit.scheduler.BukkitRunnable;
public class ToolLowerTask extends BukkitRunnable { public class ToolLowerTask extends CancellableRunnable {
private final McMMOPlayer mcMMOPlayer; private final McMMOPlayer mcMMOPlayer;
private final ToolType tool; private final ToolType tool;

View File

@ -1,12 +1,12 @@
package com.gmail.nossr50.skills.archery; package com.gmail.nossr50.skills.archery;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.UUID; import java.util.UUID;
public class TrackedEntity extends BukkitRunnable { public class TrackedEntity extends CancellableRunnable {
private final LivingEntity livingEntity; private final LivingEntity livingEntity;
private final UUID id; private final UUID id;
private int arrowCount; private int arrowCount;

View File

@ -39,7 +39,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.*; import java.util.*;
@ -112,7 +111,7 @@ public class HerbalismManager extends SkillManager {
} }
} }
private class CheckBushAge extends BukkitRunnable { private class CheckBushAge extends CancellableRunnable {
@NotNull Block block; @NotNull Block block;
@NotNull McMMOPlayer mmoPlayer; @NotNull McMMOPlayer mmoPlayer;

View File

@ -2,13 +2,13 @@ package com.gmail.nossr50.skills.taming;
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class TrackedTamingEntity extends BukkitRunnable { public class TrackedTamingEntity extends CancellableRunnable {
private final @NotNull LivingEntity livingEntity; private final @NotNull LivingEntity livingEntity;
private final @NotNull CallOfTheWildType callOfTheWildType; private final @NotNull CallOfTheWildType callOfTheWildType;
private final @NotNull Player player; private final @NotNull Player player;

View File

@ -31,7 +31,6 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.concurrent.TimeUnit;
public class NotificationManager { public class NotificationManager {

View File

@ -12,6 +12,7 @@ import com.gmail.nossr50.events.scoreboard.ScoreboardObjectiveEventReason;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.child.FamilyTree; import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.CancellableRunnable;
import com.gmail.nossr50.util.LogUtils; import com.gmail.nossr50.util.LogUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
@ -22,7 +23,6 @@ import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Objective;
@ -88,7 +88,7 @@ public class ScoreboardWrapper {
public BukkitTask updateTask = null; public BukkitTask updateTask = null;
private class ScoreboardQuickUpdate extends BukkitRunnable { private class ScoreboardQuickUpdate extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
updateSidebar(); updateSidebar();
@ -98,7 +98,7 @@ public class ScoreboardWrapper {
public BukkitTask revertTask = null; public BukkitTask revertTask = null;
private class ScoreboardChangeTask extends BukkitRunnable { private class ScoreboardChangeTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
tryRevertBoard(); tryRevertBoard();
@ -108,7 +108,7 @@ public class ScoreboardWrapper {
public BukkitTask cooldownTask = null; public BukkitTask cooldownTask = null;
private class ScoreboardCooldownTask extends BukkitRunnable { private class ScoreboardCooldownTask extends CancellableRunnable {
@Override @Override
public void run() { public void run() {
// Stop updating if it's no longer something displaying cooldowns // Stop updating if it's no longer something displaying cooldowns

View File

@ -23,7 +23,6 @@ import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;
@ -40,7 +39,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
public final class CombatUtils { public final class CombatUtils {