Is a lib for java minecraft plugins to simplify Folia support implementation
Just for your information: Folia doesn't support any of
Bukkit.getScheduler().*
andBukkit.getServer().getScheduler().*
scheduling methods
Name | Link |
---|---|
Brewery (Fork) | GitHub |
InventoryRollbackPlus (Fork) | GitHub |
CraftBook (Fork) | GitHub |
PlaceholderAPI (Fork) | GitHub |
ImageOnMap (Fork) | GitHub |
BigDoors (Fork) | GitHub |
WorldGuardExtraFlags (Fork) | GitHub |
HorseTpWithMe (Fork) | GitHub |
BetterTridents (Fork) | GitHub |
HolographicDisplays (Fork) | GitHub |
Lucko helper (Fork) | GitHub |
HexNicks | GitHub |
WorldEdit (Unstable Fork) | GitHub |
SuperVanish (Fork) | GitHub |
TownyWaypoints (Fork) | GitHub |
private static TaskScheduler scheduler;
@Override
public void onEnable() {
//if your already have onEnable() just add next line to it
scheduler = UniversalScheduler.getScheduler(this);
}
public static TaskScheduler getScheduler() {
return scheduler;
}
Main.getScheduler().runTaskLater(() -> { //Main there is your plugin Main
Bukkit.broadcastMessage("Wow, it was scheduled");
});
MyScheduledTask task = Main.getScheduler().runTaskLater(() -> { //Main there is your plugin Main
Bukkit.broadcastMessage("Wow, it was scheduled");
}, 10L);
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.Anon8281</groupId>
<artifactId>UniversalScheduler</artifactId>
<version>[VERSION]</version>
<scope>compile</scope>
</dependency>
Shading:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.github.Anon8281:UniversalScheduler</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.github.Anon8281.universalScheduler</pattern>
<!-- Don't forget to replace -->
<shadedPattern>[YOUR_PLUGIN_PACKAGE].universalScheduler</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
repositories {
//...
maven { url 'https://jitpack.io' }
}
dependencies {
//...
implementation 'com.github.Anon8281:UniversalScheduler:[VERSION]'
}
Shading:
shadowJar {
//Don't forget to replace
relocate 'com.github.Anon8281.universalScheduler', '[YOUR_PLUGIN_PACKAGE].universalScheduler'
}