diff --git a/.gitignore b/.gitignore index 4788b4b..0e13eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,113 +1,11 @@ -# User-specific stuff -.idea/ - -*.iml -*.ipr -*.iws - -# IntelliJ -out/ - -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - target/ - pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup pom.xml.next - release.properties dependency-reduced-pom.xml buildNumber.properties .mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar .mvn/wrapper/maven-wrapper.jar -.flattened-pom.xml - -# Common working directory -run/ diff --git a/MCron.iml b/MCron.iml new file mode 100644 index 0000000..0b9e47f --- /dev/null +++ b/MCron.iml @@ -0,0 +1,41 @@ + + + + + + + BUKKIT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 71389c5..199c25e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,70 @@ -# MCron -Command scheduler. Just works like cron on Linux. +# MCron [![](https://img.shields.io/badge/Join-NewNanCity-yellow)](https://www.newnan.city) + +Command scheduler for minecraft server **(now only support Bukkit/Spigot/Paper)**. Just works like cron on Linux. + +--- + +I made this wheel because bukkit's scheduler may not work in time for using tick for time. For instance, if TPS of the server always fails reaching 20.0, then the delay of tasks may take more time than expected. + +Besides, many of current plugins are implemented with ticks counting. + +I need some tool to help server managers to create schedule tasks in simple way. It should be punctual, and powerful. Then I think of cron, a schedule tool in linux. + +I copied the syntax of cron, add a second part to support second-level schedule. The syntax looks like this: + +``` +[second] [minute] [hour] [dayOfMonth] [month] [dayOfWeek] (year) +``` + +## second + +Example: + +* `1` means run at second 1. +* `3,5,8-12` means `3,5,8,9,10,11,12` +* `*` means `0-59` +* `*/4` means `0,4,8,12,16,20,24,28,32,36,40,44,48,52,56` + * `*/2`, `*/3`, `*/4`, `*/5`, `*/6`, `*/10`, `*/12`, `*/15`, `*/20`, `*/30` is legal. + +## minute + +Same as second. + +## hour + +Familiar with second and minute. + +## day of month + +Familiar with second, minute and hour, but also support some special usage: + +* `W` means the first weekday of this month. +* `L` means the last day of this month. + +## month + +Familiar with second, minute and hour, but also accept words along with numbers. For example: + +* `jan`, `JAN`, `Jan`, `January`, `1` are same. + +## day of week + +Familiar with second, minute and hour, but also accept words along with numbers: + +* `mon`, `MON`, `Mon`, `Monday`, `1` are same. +* `0` and `7` are both stand for Sunday. + +Along with some special usage: + +* `wed#3` means the third wednesday of this month. + +## year (optional) + +Year part is optional. If it doesn't exist, it means `*`. + + +# How it works + +Mode 1: Virtual Wheels Tick. `tickOne` to find next available time. + +Mode 2: Rapid Locate. Using when initializing. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 29ee4a8..b80160c 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,10 @@ jitpack.io https://jitpack.io + + aikar + https://repo.aikar.co/content/groups/aikar/ + @@ -93,7 +97,7 @@ com.github.NewNanCity Violet - 1.0.4 + 1.0.5