use of org.spongepowered.common.service.permission.SpongeContextCalculator in project SpongeForge by SpongePowered.
the class SpongeMod method onPreInit.
@Subscribe
public void onPreInit(FMLPreInitializationEvent event) {
try {
SpongeImpl.getGame().getEventManager().registerListeners(SpongeImpl.getPlugin().getInstance().get(), SpongeInternalListeners.getInstance());
registerService(ChunkTicketManager.class, new SpongeChunkTicketManager());
SpongeBootstrap.initializeServices();
SpongeBootstrap.initializeCommands();
SpongeImpl.getRegistry().preInit();
SpongeModMessageHandler.init();
Preconditions.checkArgument(Class.forName("org.spongepowered.api.entity.ai.task.AbstractAITask").getSuperclass().equals(SpongeEntityAICommonSuperclass.class));
MinecraftForge.EVENT_BUS.register(new SpongeEventHooks());
SpongeInternalListeners.getInstance().registerServiceCallback(PermissionService.class, input -> input.registerContextCalculator(new SpongeContextCalculator()));
// Add the SyncScheduler as a listener for ServerTickEvents
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(this.game.getChannelRegistrar());
if (event.getSide().isServer()) {
SpongeHooks.enableThreadContentionMonitoring();
}
} catch (Throwable t) {
this.controller.errorOccurred(this, t);
}
}
Aggregations