-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto check update Fix bug in detecting other command Replace '"' with "'" in plugin.yml Rename some class
- Loading branch information
Showing
11 changed files
with
124 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/github/hank9999/keywordblock/Event/ChatEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...com/github/hank9999/keywordblock/Lib.java → ...ithub/hank9999/keywordblock/Libs/Lib.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/github/hank9999/keywordblock/Update/Timer_Update.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.github.hank9999.keywordblock.Update; | ||
|
||
import com.github.hank9999.keywordblock.KeywordBlock; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
|
||
import java.util.Timer; | ||
import java.util.TimerTask; | ||
|
||
public class Timer_Update { | ||
private boolean is_first = true; | ||
|
||
public Timer_Update() { | ||
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 | ||
timer.cancel(); | ||
return; | ||
} | ||
Bukkit.getScheduler().runTask(KeywordBlock.plugin, () -> Update_Check()); | ||
} | ||
}, 0, 1000 * 60 * 60); | ||
} | ||
|
||
public void Update_Check() { | ||
new Update_Checker(KeywordBlock.plugin, 78091).getVersion(version -> { | ||
if (("v" + KeywordBlock.plugin.getDescription().getVersion()).equalsIgnoreCase(version)) { | ||
if (is_first) { | ||
KeywordBlock.plugin.getLogger().info(ChatColor.AQUA + "No new update available."); | ||
is_first = false; | ||
} | ||
} else { | ||
KeywordBlock.plugin.getLogger().info(ChatColor.AQUA + "A new update " + version + " available!"); | ||
KeywordBlock.plugin.getLogger().info(ChatColor.AQUA + "See it in https://www.spigotmc.org/resources/keywordblock.78091/"); | ||
} | ||
}); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...hank9999/keywordblock/Update_Checker.java → ...9/keywordblock/Update/Update_Checker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ub/hank9999/keywordblock/MetricsLite.java → ...9999/keywordblock/bStats/MetricsLite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters