updates 🎱

This commit is contained in:
Paul Reilly
2023-05-30 17:39:54 -05:00
parent b95a06fa7c
commit def84bd747
63 changed files with 1469 additions and 1195 deletions

View File

@ -16,25 +16,23 @@ public class CommonsBase extends JavaPlugin
}
@Override
public void onEnable()
public void onDisable()
{
getRegistrations().getServiceRegistry().register(this, eventBus);
getExecutor().getSync()
.execute(() -> getRegistrations()
.getServiceRegistry()
.startAll());
getRegistrations().getServiceRegistry()
.stopAll();
getRegistrations().getServiceRegistry()
.unregister(EventBus.class, eventBus);
}
@Override
public void onDisable()
public void onEnable()
{
getRegistrations().getServiceRegistry().stopAll();
getRegistrations().getServiceRegistry().unregister(EventBus.class, eventBus);
}
public Registration getRegistrations()
{
return registration;
getRegistrations().getServiceRegistry()
.register(this, eventBus);
getExecutor().getSync()
.execute(() -> getRegistrations()
.getServiceRegistry()
.startAll());
}
public FreedomExecutor getExecutor()
@ -42,6 +40,11 @@ public class CommonsBase extends JavaPlugin
return executor;
}
public Registration getRegistrations()
{
return registration;
}
public EventBus getEventBus()
{
return eventBus;

View File

@ -1,12 +1,11 @@
package me.totalfreedom.base;
import me.totalfreedom.data.GroupRegistry;
import me.totalfreedom.data.BanRegistry;
import me.totalfreedom.data.ConfigRegistry;
import me.totalfreedom.data.EventRegistry;
import me.totalfreedom.data.GroupRegistry;
import me.totalfreedom.data.ModuleRegistry;
import me.totalfreedom.data.ServiceRegistry;
import me.totalfreedom.data.UserRegistry;
import me.totalfreedom.data.EventRegistry;
public class Registration
{
@ -15,7 +14,6 @@ public class Registration
private final ServiceRegistry serviceRegistry;
private final ModuleRegistry moduleRegistry;
private final GroupRegistry groupRegistry;
private final BanRegistry banRegistry;
private final ConfigRegistry configRegistry;
public Registration()
@ -25,8 +23,7 @@ public class Registration
this.serviceRegistry = new ServiceRegistry();
this.moduleRegistry = new ModuleRegistry();
this.groupRegistry = new GroupRegistry();
this.banRegistry = new BanRegistry();
this.configRegistry = new ConfigRegistry();
this.configRegistry = new ConfigRegistry();
}
public ModuleRegistry getModuleRegistry()
@ -54,11 +51,6 @@ public class Registration
return groupRegistry;
}
public BanRegistry getBanRegistry()
{
return banRegistry;
}
public ConfigRegistry getConfigRegistry()
{
return configRegistry;