mirror of
https://github.com/nkomarn/harbor.git
synced 2025-01-05 07:07:34 +01:00
🧹 Clear cooldowns after night skip
This'll clear up some memory on lorger servers.
This commit is contained in:
parent
8ade4db803
commit
9fe4e387cd
@ -26,8 +26,7 @@ public class HarborCommand implements TabExecutor {
|
||||
Harbor.getHarbor().reloadConfig();
|
||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix
|
||||
+ "Reloaded configuration."));
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("forceskip")) {
|
||||
} else if (args[0].equalsIgnoreCase("forceskip")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix
|
||||
+ "This command requires you to be a player."));
|
||||
|
@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class BedListener implements Listener {
|
||||
private static final Map<UUID, Long> COOLDOWNS = new HashMap<>();
|
||||
public static final Map<UUID, Long> COOLDOWNS = new HashMap<>();
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onBedEnter(final PlayerBedEnterEvent event) {
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Statistic;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import xyz.nkomarn.Harbor.Harbor;
|
||||
import xyz.nkomarn.Harbor.listener.BedListener;
|
||||
import xyz.nkomarn.Harbor.util.Config;
|
||||
import xyz.nkomarn.Harbor.util.Messages;
|
||||
|
||||
@ -44,6 +45,7 @@ public class AccelerateNightTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
Checker.SKIPPING_WORLDS.remove(world);
|
||||
BedListener.COOLDOWNS.clear();
|
||||
Messages.sendRandomChatMessage(world, "messages.chat.night-skipped");
|
||||
this.cancel();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user