Skip to content

Commit

Permalink
fix update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
hank9999 committed May 3, 2020
1 parent cda96b4 commit 2a41754
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@
import com.github.hank9999.keywordblock.KeywordBlock;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.Plugin;

import java.util.Timer;
import java.util.TimerTask;


public class Timer_Update {
private boolean is_first = true;
private Plugin plugin;

public Timer_Update() {
this.plugin = KeywordBlock.plugin;
final Timer timer = new Timer(true); // We use a timer cause the Bukkit scheduler is affected by server lags
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (!KeywordBlock.plugin.isEnabled()) { // Plugin was disabled
if (!plugin.isEnabled()) { // Plugin was disabled
timer.cancel();
return;
}
Expand Down

0 comments on commit 2a41754

Please sign in to comment.