当前位置: 首页>>代码示例>>Java>>正文


Java ChangeServiceProviderEvent类代码示例

本文整理汇总了Java中org.spongepowered.api.event.service.ChangeServiceProviderEvent的典型用法代码示例。如果您正苦于以下问题:Java ChangeServiceProviderEvent类的具体用法?Java ChangeServiceProviderEvent怎么用?Java ChangeServiceProviderEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChangeServiceProviderEvent类属于org.spongepowered.api.event.service包,在下文中一共展示了ChangeServiceProviderEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newEco

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
/**
 * Listener is registered because of the @Listening annotation. No need to
 * attach it to your plugin, PlaceholderAPI will do this for you.
 */
@Listener
public void newEco(ChangeServiceProviderEvent event) {
	if (event.getService().equals(EconomyService.class)) {
		EconomyService s = (EconomyService) event.getNewProvider();
		if (s != null) {
			eco = true;
			this.service = s;
			this.def = service.getDefaultCurrency();
			this.currencies.clear();
			service.getCurrencies().forEach(this::putCur);
		} else {
			eco = false;
		}
	}
}
 
开发者ID:rojo8399,项目名称:PlaceholderAPI,代码行数:20,代码来源:Defaults.java

示例2: onServiceChanged

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onServiceChanged(ChangeServiceProviderEvent event) {
	if (!enabled)
		return;

	if (event.getService().equals(EconomyService.class))
		economyManager = new EconomyManager((EconomyService) event.getNewProviderRegistration().getProvider());

	if (event.getService().equals(UserStorageService.class))
		userStorageService = (UserStorageService) event.getNewProviderRegistration().getProvider();
}
 
开发者ID:DevOnTheRocks,项目名称:StickyChunk,代码行数:12,代码来源:StickyChunk.java

示例3: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
	if(disabled) return;
	if (event.getService().equals(PermissionService.class)) {
		permissionsservice = (PermissionService) event.getNewProviderRegistration().getProvider();
	}
   }
 
开发者ID:NamelessMC,项目名称:Nameless-Plugin,代码行数:8,代码来源:NamelessPlugin.java

示例4: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event)
{
	if (event.getService().equals(EconomyService.class))
	{
		economyService = (EconomyService) event.getNewProviderRegistration().getProvider();
	}
}
 
开发者ID:Arckenver,项目名称:Nations,代码行数:9,代码来源:NationsPlugin.java

示例5: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
	if (event.getService().equals(EconomyService.class)) {
		economyService = (EconomyService) event.getNewProvider();
	} else if (event.getService().equals(LanguageService.class)) {
		LanguageService languageService = (LanguageService) event.getNewProvider();
		translator = languageService.registerTranslation(this); //add this plugin to langswitch
	}
}
 
开发者ID:DosMike,项目名称:VillagerShops,代码行数:10,代码来源:VillagerShops.java

示例6: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
    if (event.getService().equals(EconomyService.class) && !late) {
        Object raw = event.getNewProviderRegistration().getProvider();
        if (raw instanceof EconomyService) {
            foundProvider = true;
            economyService = (EconomyService) raw;
        } else {
            foundProvider = false;
        }
    }
}
 
开发者ID:Flibio,项目名称:JobsLite,代码行数:13,代码来源:JobsLite.java

示例7: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
    if (event.getService().equals(PermissionService.class)) {
        this.permservice = (PermissionService) event.getNewProviderRegistration().getProvider();
    }
}
 
开发者ID:poqdavid,项目名称:VirtualTool,代码行数:7,代码来源:VirtualTool.java

示例8: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
	if (event.getService().equals(EconomyService.class)) {
           econ = (EconomyService) event.getNewProviderRegistration().getProvider();
	}
}
 
开发者ID:FabioZumbi12,项目名称:Sponge-RankUpper,代码行数:7,代码来源:RankUpper.java

示例9: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
    if (event.getNewProvider() instanceof PermissionService && this.validateSpongeVersion()) {
        ((PermissionService) event.getNewProvider()).registerContextCalculator(new ClaimContextCalculator());
    }
}
 
开发者ID:MinecraftPortCentral,项目名称:GriefPrevention,代码行数:7,代码来源:GriefPreventionPlugin.java

示例10: onServiceChange

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onServiceChange(ChangeServiceProviderEvent event) {
    synchronized (this.serviceCallbacks) {
        this.serviceCallbacks.get(event.getService()).removeIf(objectPredicate -> !objectPredicate.test(event.getNewProvider()));
    }
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:7,代码来源:LanternServiceListeners.java

示例11: onChangeServiceProvider

import org.spongepowered.api.event.service.ChangeServiceProviderEvent; //导入依赖的package包/类
@Listener
public void onChangeServiceProvider(ChangeServiceProviderEvent event) {
    if (event.getService().equals(EconomyService.class)) {
        econ = (EconomyService) event.getNewProviderRegistration().getProvider();
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:7,代码来源:SpongeEconHandler.java


注:本文中的org.spongepowered.api.event.service.ChangeServiceProviderEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。