本文整理匯總了Java中org.bukkit.permissions.Permission.setDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java Permission.setDefault方法的具體用法?Java Permission.setDefault怎麽用?Java Permission.setDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.permissions.Permission
的用法示例。
在下文中一共展示了Permission.setDefault方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: UpdateChecker
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
public UpdateChecker(Plugin plugin, String spigotFullId) {
this.plugin = plugin;
this.spigotId = spigotFullId;
try {
this.spigotUrl = new URL("https://www.spigotmc.org/resources/" + spigotId + "/");
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid spigot id: " + spigotId);
}
this.logger = plugin.getLogger();
permission = new Permission(plugin.getName() + ".update");
permission.setDefault(PermissionDefault.OP);
Bukkit.getPluginManager().addPermission(permission);
setInterval(20*60*30);//30 minutes
message = buildMessage();
}
示例2: Initialize
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
@Override
public boolean Initialize()
{
//TODO------Change all the class instances to use this one instance instead of KitConfig.getInstance()
instance = KitConfig.getInstance();
int x = 0;
ConfigurationSection sec = instance.getKitSection(getInternalName());
if(sec == null)
{
sec = instance.createKitSection(getInternalName());
x++;
}
x += ConfigManager.setDefaultIfNotSet(sec, "Name", getInternalName());
x += ConfigManager.setDefaultIfNotSet(sec, "Kit Description", getDefaultDescription());
x += ConfigManager.setDefaultIfNotSet(sec, "Disable", false);
x += ConfigManager.setDefaultIfNotSet(sec, "Free", false);
x += setDefaults(sec);
if(x > 0)
instance.saveConfig();
this.isFree = sec.getBoolean("Free");
if(sec.getBoolean("Disable"))
return false;
loadKitStuff(sec);
if(instance.useDefaultPermissions())
{
Permission perm = new Permission("Anni.Kits."+getName());
perm.setDefault(PermissionDefault.FALSE);
Bukkit.getPluginManager().addPermission(perm);
perm.recalculatePermissibles();
}
icon = getIcon();
setUp();
this.loadout = getFinalLoadout().addNavCompass().finalizeLoadout();
return true;
}