This part of the API is brand-new.
It will be changed if there are any bugs, missing features or usability improvements.
It is not recommended relying on this part of the API, it will most likely change.
Draft
Our own usage and testing has shown that this part of the API is complete and seems bug free.
However, other plugins may have other use cases which are not covered by our testing.
Therefore, please go ahead and use this API part. Let us know if there are missing features or bugs.
This API part will be changed if there are more bugs, missing features or usability improvements.
Please use this part of the API and give us feedback!
Stable
Both our own and third party testing showed that this part of the API is complete.
Only bugs and major conceptual problems would lead to more changes.
This part of the API should be safe to use. We try to keep it compatible with previous versions if changes are needed.
If the native schedule types are not enough for you, this API enables you to create your own type.
To implement a new schedule type you have to create both the Schedule and the Scheduler class.
About this guide
This guide will show you how to create a custom schedule that runs every x ticks, just like a redstone clock.
While this does not make that much sense, it is a super simple example to show the principle.
The schedule class must hold all the schedules' data. When reloading BetonQuest will try to parse all packages and
construct new instances of this class.
Have a look at this example to see how to implement your own schedule.
Example Schedule
1 2 3 4 5 6 7 8 91011121314151617181920212223
publicclassMyCustomScheduleextendsSchedule{privatefinalintticks,rebootSleep;publicMyCustomSchedule(ScheduleIDscheduleID,ConfigurationSectioninstruction)throwsInstructionParseException{super(scheduleID,instruction);try{ticks=Integer.parseInt(getTime());}catch(NumberFormatExceptione){thrownewInstructionParseException("Time is not a number");}if(getCatchup()!=CatchupStrategy.NONE){thrownewInstructionParseException("Catchup "+getCatchup()+" is not supported by this schedule type");}rebootSleep=instruction.getInt("options.rebootSleep");}publicintgetTicks(){returnticks;}publicintgetRebootSleep(){returnrebootSleep;}}
The scheduler will receive parsed schedules using addSchedule(S) and hold them in the schedules map.
It should contain all the scheduling & schedule execution logic.
It is also responsible for catching up missed schedules, if they have a catchup strategy other than NONE defined.
Here is a pretty basic example, that does not provide any catchup logic: