本文整理汇总了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;
}
}
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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
}
}
示例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;
}
}
}
示例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();
}
}
示例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();
}
}
示例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());
}
}
示例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()));
}
}
示例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();
}
}