mirror of
https://github.com/plexusorg/Plex.git
synced 2025-06-29 14:56:43 +00:00
Many, many bug fixes
- Fix permission checks - Fix unban command - getOfflinePlexPlayer no longer uses cache - Register worlds before trying to load gamerules - Customizable ban messages
This commit is contained in:
@ -7,31 +7,42 @@ import dev.plex.services.impl.GameRuleService;
|
||||
import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class ServiceManager {
|
||||
public class ServiceManager
|
||||
{
|
||||
private final List<AbstractService> services = Lists.newArrayList();
|
||||
|
||||
public ServiceManager() {
|
||||
registerService(new BanService());
|
||||
public ServiceManager()
|
||||
{
|
||||
//registerService(new BanService());
|
||||
registerService(new GameRuleService());
|
||||
}
|
||||
|
||||
public void startServices() {
|
||||
for (AbstractService service : services) {
|
||||
if (!service.isRepeating()) {
|
||||
public void startServices()
|
||||
{
|
||||
for (AbstractService service : services)
|
||||
{
|
||||
if (!service.isRepeating())
|
||||
{
|
||||
Bukkit.getScheduler().runTask(Plex.get(), service::run);
|
||||
} else if (service.isRepeating() && service.isAsynchronous()) {
|
||||
}
|
||||
else if (service.isRepeating() && service.isAsynchronous())
|
||||
{
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(Plex.get(), service::run, 0, 20 * service.repeatInSeconds());
|
||||
} else if (service.isRepeating() && !service.isAsynchronous()) {
|
||||
}
|
||||
else if (service.isRepeating() && !service.isAsynchronous())
|
||||
{
|
||||
Bukkit.getScheduler().runTaskTimer(Plex.get(), service::run, 0, 20 * service.repeatInSeconds());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void registerService(AbstractService service) {
|
||||
private void registerService(AbstractService service)
|
||||
{
|
||||
services.add(service);
|
||||
}
|
||||
|
||||
public int serviceCount() {
|
||||
public int serviceCount()
|
||||
{
|
||||
return services.size();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user