本文整理汇总了Java中org.spongepowered.api.event.game.state.GamePostInitializationEvent类的典型用法代码示例。如果您正苦于以下问题:Java GamePostInitializationEvent类的具体用法?Java GamePostInitializationEvent怎么用?Java GamePostInitializationEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GamePostInitializationEvent类属于org.spongepowered.api.event.game.state包,在下文中一共展示了GamePostInitializationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event) throws IOException
{
this.logger = mm.getLoggerFor(Portals.class);
this.path = mm.getPathFor(Portals.class);
reflector.getDefaultConverterManager().registerConverter(new DestinationConverter(), Destination.class);
Providers rManager = cm.getProviders();
rManager.register(this, new PortalParser(this), Portal.class);
rManager.register(this, new DestinationParser(this, i18n), Destination.class);
this.portalsDir = Files.createDirectories(path.resolve("portals"));
PortalCommands portals = new PortalCommands(cm, this, selector, reflector, i18n);
cm.addCommand(portals);
portals.addCommand(new PortalModifyCommand(cm, this, selector, i18n));
em.registerListener(Portals.class, new PortalListener(this, i18n));
this.loadPortals();
tm.runTimer(Portals.class, this::checkForEntitiesInPortals, 5, 5);
}
示例2: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
reflector.getDefaultConverterManager().registerConverter(new InetAddressConverter(), InetAddress.class);
this.configure(reflector.load(ApiConfig.class, moduleFolder.resolve("webapi.yml").toFile()));
try
{
this.start();
final ObjectMapper mapper = new ObjectMapper();
LoggerUtil.attachCallback(null, (f, a, t, msg) -> {
ObjectNode node = mapper.createObjectNode();
node.put("msg", msg);
this.fireEvent("console", node);
});
}
catch (ApiStartupException ex)
{
this.logger.error(ex, "The web API will not be available as the server failed to start properly...");
}
this.registerApiHandlers(ApiServer.class, new CommandController(i18n, tm, cm));
}
示例3: onPostInit
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Override
public void onPostInit(GamePostInitializationEvent event) {
CommandsConfig config = UltimateCore.get().getCommandsConfig();
CommentedConfigurationNode node = config.get();
boolean modified = false;
for (Command cmd : UltimateCore.get().getCommandService().getCommands()) {
CommentedConfigurationNode cmdnode = node.getNode("commands", cmd.getIdentifier());
if (cmdnode.getNode("cooldown").getValue() == null) {
modified = true;
cmdnode.getNode("cooldown").setComment("Time in seconds that a player has to wait between uses of the command. (0 to disable)");
cmdnode.getNode("cooldown").setValue("0s");
}
if (cmdnode.getNode("warmup").getValue() == null) {
modified = true;
cmdnode.getNode("warmup").setComment("Time in seconds that a player has to wait before the command is executed. (0 to disable)");
cmdnode.getNode("warmup").setValue("0s");
}
}
if (modified) {
config.save(node);
}
onReload(null);
new CommandtimerPermissions();
}
示例4: onPostInitialization
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event)
{
this.translation = new VirtualChestTranslation(this);
this.virtualChestActions = new VirtualChestActions(this);
this.commandAliases = new VirtualChestCommandAliases(this);
this.economyManager = new VirtualChestEconomyManager(this);
this.dispatcher = new VirtualChestInventoryDispatcher(this);
this.scriptManager = new VirtualChestJavaScriptManager(this);
this.permissionManager = new VirtualChestPermissionManager(this);
this.placeholderManager = new VirtualChestPlaceholderManager(this);
this.virtualChestCommandManager = new VirtualChestCommandManager(this);
this.actionIntervalManager = new VirtualChestActionIntervalManager(this);
}
示例5: onPostInit
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener(order = Order.POST)
public void onPostInit(GamePostInitializationEvent event) {
Optional<ProviderRegistration<PaginationService>> optService = Sponge.getGame().getServiceManager().getRegistration(PaginationService.class);
if (optService.isPresent()) {
PaginationService service = optService.get().getProvider();
Sponge.getGame().getServiceManager().setProvider(this, PaginationService.class, new TabbedPaginationService(service));
}
this.features.load();
}
示例6: onGamePostInitializationAfterPre
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener(order = Order.AFTER_PRE)
public void onGamePostInitializationAfterPre(GamePostInitializationEvent event) {
logger.info("Loading CustomItemLibrary...");
setupManagers();
setupService();
setupCommands();
logger.info("CustomItemLibrary loaded.");
}
示例7: onPostInitialization
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event) {
if (foundProvider) {
// Register events and commands
registerEvents();
registerCommands();
}
}
示例8: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
this.logger = mm.getLoggerFor(Protector.class);
this.modulePath = mm.getPathFor(Protector.class);
manager = new RegionManager(modulePath, reflector, logger);
ps.registerContextCalculator(new RegionContextCalculator(manager));
RegionCommands regionCmd = new RegionCommands(cm, selector, manager, i18n);
i18n.getCompositor().registerFormatter(new RegionFormatter());
cm.addCommand(regionCmd);
SettingsCommands settingsCmd = new SettingsCommands(manager, i18n, ps, pm, em, cm);
regionCmd.addCommand(settingsCmd);
}
示例9: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
this.logger = mm.getLoggerFor(Signmarket.class);
manager = new MarketSignManager(i18n, es, this, igf, plugin);
editModeListener = new EditModeCommand(cm, em, this, i18n, manager);
em.registerListener(Signmarket.class, new MarketSignListener(manager, this, i18n));
smCmds = new SignMarketCommands(cm, this, i18n);
cm.addCommand(smCmds);
perms = new MarketSignPerm(pm, smCmds);
}
示例10: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
Optional<EconomyService> economy = Sponge.getServiceManager().provide(EconomyService.class);
if (!economy.isPresent())
{
this.logger.error("Missing required EconomyService. Do you have a plugin installed that provides it?");
this.logger.info("Listeners and Commands will not be registered.");
return;
}
this.repairBlockManager = new RepairBlockManager(this, db, em, i18n, economy.get(), pm);
em.registerListener(Itemrepair.class, new ItemRepairListener(this, i18n));
cm.addCommand(new ItemRepairCommands(cm, this, em, i18n));
}
示例11: onEnable
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
em.registerListener(Spawn.class, new SpawnListener(pm));
cm.removeCommand("spawn", true); // unregister basics commands
cm.addCommands(cm, this, new SpawnCommands(this, i18n, pm));
}
示例12: onPostInitialization
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event) {
instance = this;
enabled = validateSpongeVersion();
}
示例13: onGamePostInit
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onGamePostInit(GamePostInitializationEvent event) {
}
示例14: onPostInitialize
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialize(GamePostInitializationEvent event) {
ClansImpl.getInstance().getClanPermissionManager().setInitialized();
}
示例15: onPostInit
import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInit(GamePostInitializationEvent e) {
if (db == null) return;
logger.info("Registering plugin commands");
registerCommands(Sponge.getCommandManager());
}