mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2025-07-04 22:46:41 +00:00
Init
This commit is contained in:
52
Commons/src/main/java/me/totalfreedom/base/CommonsBase.java
Normal file
52
Commons/src/main/java/me/totalfreedom/base/CommonsBase.java
Normal file
@ -0,0 +1,52 @@
|
||||
package me.totalfreedom.base;
|
||||
|
||||
import me.totalfreedom.event.EventBus;
|
||||
import me.totalfreedom.module.Module;
|
||||
import me.totalfreedom.utils.Identity;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.ServicePriority;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class CommonsBase implements Module<CommonsBase>
|
||||
{
|
||||
private final EventBus eventBus = new EventBus(this);
|
||||
|
||||
|
||||
@Override
|
||||
public void enable()
|
||||
{
|
||||
Bukkit.getServicesManager().register(EventBus.class,
|
||||
eventBus,
|
||||
JavaPlugin.getPlugin(CommonsJavaPlugin.class),
|
||||
ServicePriority.High);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identity getIdentity()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<CommonsBase> getRuntimeClass()
|
||||
{
|
||||
return CommonsBase.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonsBase getRuntimeInstance()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public RegisteredServiceProvider<EventBus> getEventBus() {
|
||||
return Bukkit.getServicesManager().getRegistration(EventBus.class);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user