本文整理汇总了Java中org.bukkit.configuration.ConfigurationSection.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationSection.getBoolean方法的具体用法?Java ConfigurationSection.getBoolean怎么用?Java ConfigurationSection.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.configuration.ConfigurationSection
的用法示例。
在下文中一共展示了ConfigurationSection.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: craftPotionEffect
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public static PotionEffect craftPotionEffect(String name, ConfigurationSection section) {
if(section == null){
Error.MISSING.add();
return null;
}
PotionEffectType effect = PotionEffectType.getByName(name);
if( effect == null ) {
ErrorLogger.addError(name + " is not a valid potion effect type !");
return null;
}
int duration = section.getInt(Node.DURATION.get(), 120)*20;
int amplifier = section.getInt(Node.LEVEL.get(), 1) - 1;
boolean ambient = section.getBoolean(Node.AMBIANT.get(), true);
boolean particles = section.getBoolean(Node.PARTICLE.get(), true);
return new PotionEffect(effect, duration, amplifier, ambient, particles);
}
示例2: CPChannelState
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPChannelState(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
channel = VanillaPlusCore.getChannelManager().get(section.getString(Node.CHANNEL.get()), true);
switchIn = section.getBoolean("SWITCH_IN", false);
switchOut = section.getBoolean("SWITCH_OUT", false);
if(!switchIn){
muteIn = section.getBoolean("MUTE_IN", false);
if(!muteIn)
unmuteIn = section.getBoolean("UNMUTE_IN", false);
}
if(!switchOut){
muteOut = section.getBoolean("MUTE_OUT", false);
if(!muteOut)
unmuteOut = section.getBoolean("UNMUTE_OUT", false);
}
if(!( switchIn || switchOut || muteIn || muteOut || unmuteIn || unmuteOut ))
Error.INVALID.add();
}
示例3: init
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public void init(VanillaPlusCore core) {
if(core == null)return;
ConfigurationSection section = ConfigUtils.getYaml(core.getInstance(), "Versus", false);
if(section == null)return;
ErrorLogger.addPrefix("Versus.yml");
ConfigurationSection settings = section.getConfigurationSection(Node.SETTINGS.get());
ErrorLogger.addPrefix(Node.SETTINGS.get());
if(settings == null){
Error.INVALID.add();
}else{
ipvpDefault = core.getMessageManager().get(settings.getString("IPVP_DEFAULT"));
pveDefault = core.getMessageManager().get(settings.getString("PVE_DEFAULT"));
pvpDefault = core.getMessageManager().get(settings.getString("PVP_DEFAULT"));
offlineDeath = core.getMessageManager().get(settings.getString("OFFLINE_DEATH"));
log = settings.getBoolean("LOG", false);
respawn = RespawnType.valueOf(settings.getString("RESPAWN_TYPE", "SPEC"));
}
ErrorLogger.removePrefix();
ErrorLogger.removePrefix();
}
示例4: CPMessagePrivate
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPMessagePrivate(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
if(instance == null){
instance = this;
new BukkitRunnable() {
@Override
public void run() {
for(Entry<VPPlayer, HashMap<VPPlayer, LiteEntry<Integer, Integer>>>entry : history.entrySet()){
if(entry.getValue() == null || entry.getValue().isEmpty()){
history.remove(entry.getKey());
}
for(Entry<VPPlayer, LiteEntry<Integer, Integer>>pEntry : entry.getValue().entrySet()){
if(pEntry.getValue() == null || pEntry.getValue().getValue() >=29){
entry.getValue().remove(pEntry.getKey());
}else{
pEntry.getValue().setValue(pEntry.getValue().getValue()+1);
}
}
if(entry.getValue().isEmpty()){
history.remove(entry.getKey());
}
}
}
}.runTaskLater(VanillaPlus.getInstance(), 20);
}
if(section.contains("CHANNEL_SPY")){
spy = VanillaPlusCore.getChannelManager().get(section.getString("CHANNEL_SPY"), true);
messageSpy = manager.get(section.getString("MESSAGE_SPY"));
if(spy == null || messageSpy == null){
ErrorLogger.addError("SPY error");
}
}
bypassChannelMute = section.getBoolean("BYPASS_CHANNEL_MUTE", false);
messageFrom = manager.get(section.getString(Node.MESSAGE_FROM.get()));
messageTo = manager.get(section.getString(Node.MESSAGE_TO.get()));
messageToLockMP = manager.get(section.getString("MESSAGE_TO_LOCKED"));
min = section.getInt("MIN", 0);
if(min < 0)
min = 0;
}
示例5: CPMessageSend
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPMessageSend(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
message = manager.get(section.getString(Node.MESSAGE.get()));
all = section.getBoolean("ALL", false);
priv = section.getBoolean("PRIVATE", false);
other = new Requirement(section.get(Node.OTHER_REQUIREMENT.get()), manager.getComponentManager());
successOther = manager.get(section.getString(Node.SUCCESS.getOther()));
}
示例6: reload
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
/**
* Reload the configuration.
*/
public void reload(FileConfiguration configuration) {
this.configuration = configuration;
for (CheckType check : CheckType.values()) {
String checkName = check.getCheckName().toLowerCase();
ConfigurationSection section = configuration.getConfigurationSection(checkName);
boolean isEnabled = configuration.getBoolean(checkName + ".enabled");
// if were not enabled, continue.
if (!isEnabled) {
continue;
}
// collect the violation levels from the config.
int banViolations = section.getInt("ban");
int cancelViolations = section.getInt("cancel-vl");
int notifyViolations = section.getInt("notify");
// populate the map with the new check data.
boolean cancelCheck = section.getBoolean("cancel");
CHECK_DATA.remove(check);
CheckData data = new CheckData(notifyViolations, cancelViolations, banViolations, cancelCheck, banViolations > 0);
CHECK_DATA.put(check, data);
Arc.getPlugin().getLogger().info("Finished getting data for check: " + checkName);
}
}
示例7: CPProfil
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPProfil(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
setting = PlayerSettings.valueOf(section.getString("PLAYER_SETTING"));
if(setting == null)
ErrorLogger.addError("PLAYER_SETTING " + Error.INVALID.getMessage());
switchState = section.getBoolean("SWITCH", false);
enable = section.getBoolean("ENABLE", false);
}
示例8: RequirementStat
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public RequirementStat(ConfigurationSection section, MComponentManager manager) {
ErrorLogger.addPrefix(Node.ID.get());
this.stat = VanillaPlusCore.getStatManager().get((short)section.getInt(Node.ID.get()), true);
ErrorLogger.removePrefix();
boolean keep = section.getBoolean("KEEP", false);
reset = section.getBoolean("RESET", false);
this.amount = section.getInt(Node.AMOUNT.get(), 0);
if(amount <= 0 && !reset){
ErrorLogger.addError(Node.AMOUNT.get() + " " + Error.INVALID.getMessage());
keep = true;
}
this.keep = keep;
format = manager.get(section.getString(Node.FORMAT.get(), "REQUIREMENT.STAT"));
}
示例9: RequirementTitle
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public RequirementTitle(ConfigurationSection section, MComponentManager manager) {
ErrorLogger.addPrefix(Node.ID.get());
this.title = VanillaPlusCore.getTitleManager().get(section.getInt(Node.ID.get()));
ErrorLogger.removePrefix();
boolean keep = section.getBoolean("KEEP", false);
this.keep = keep;
format = manager.get(section.getString(Node.FORMAT.get(), "REQUIREMENT.TITLE"));
}
示例10: Icon
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public Icon(ConfigurationSection section, MessageManager manager) {
if(section.getConfigurationSection(Node.ITEM.get())!=null){
ErrorLogger.addPrefix(Node.ITEM.get());
item = MinecraftUtils.loadItem(section.getConfigurationSection(Node.ITEM.get()));
ErrorLogger.removePrefix();
}
skullSelf = section.getBoolean("SKULL_SELF", false);
closeOnClick = section.getBoolean(Node.CLOSE.get(), false);
canMove = section.getBoolean(Node.MOVE.get(), false);
if(!canMove && item != null && item.getType() != Material.AIR)
item = MinecraftUtils.setExtra(item, FREEZE, "1");
if(item == null)
item = air;
if(skullSelf && item.getType() != Material.SKULL_ITEM)
skullSelf = false;
if(skullSelf)
item.setDurability((short) 3);
if(section.contains(Node.NAME_PATH.get())){
name = manager.getComponentManager().get(section.getString(Node.NAME_PATH.get()));
if(isStatic && name != null)
isStatic = false;
}
if(section.contains(Node.LORE_PATH.get())){
lore = new ArrayList<MComponent>();
if(!section.getStringList(Node.LORE_PATH.get()).isEmpty()) {
for(String key : section.getStringList(Node.LORE_PATH.get())){
MComponent temp = manager.getComponentManager().get(key);
if(temp == null)
continue;
lore.add(temp);
if(isStatic)
isStatic = false;
}
}else if(section.getString(Node.LORE_PATH.get()) != null) {
lore.add(manager.getComponentManager().get(section.getString(Node.LORE_PATH.get())));
}
}
}
示例11: IconAchievement
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public IconAchievement(ConfigurationSection section, MessageManager manager) {
this.achievement = VanillaPlusCore.getAchievementManager().get((short) section.getInt(Node.ID.get(), 0));
if(achievement == null){
ErrorLogger.addError(Node.ID.get() + Error.INVALID.getMessage());
return;
}
this.display = VanillaPlusCore.getAchievementManager().getDisplay((byte) section.getInt(Node.DISPLAY.get(), 0));
if(display == null)
ErrorLogger.addError(Node.DISPLAY.get() + Error.INVALID.getMessage());
showLockedRequirement = section.getBoolean("SHOW_LOCKED_REQUIREMENT", true);
showLockedReward = section.getBoolean("SHOW_LOCKED_REWARD", true);
showUnlockedRequirement = section.getBoolean("SHOW_UNLOCKED_REQUIREMENT", false);
showUnlockedReward = section.getBoolean("SHOW_UNLOCKED_REWARD", false);
if((showLockedRequirement || showUnlockedRequirement) && achievement.getRequirement() == null){
ErrorLogger.addError("Can't show unset requirement !");
showLockedRequirement = false;
showUnlockedRequirement = false;
}else if(showLockedRequirement || showUnlockedRequirement){
if(section.contains("REQUIREMENT_MESSAGE"))
this.requirementMessage = manager.getComponentManager().get(section.getString("REQUIREMENT_MESSAGE"));
}
if((showLockedReward || showUnlockedReward) && achievement.getReward() == null){
ErrorLogger.addError("Can't show unset reward !");
showLockedReward = false;
showUnlockedReward = false;
}else if (showLockedReward || showUnlockedReward) {
if(section.contains("REWARD_MESSAGE"))
this.rewardMessage = manager.getComponentManager().get(section.getString("REWARD_MESSAGE"));
}
}
示例12: CPMenuOpen
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPMenuOpen(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
close = section.getBoolean("CLOSE", false);
if(close)return;
String menuName = section.getString(Node.MENU.get());
if(menuName == null || menuName.isEmpty()){
Error.MISSING_NODE.add(Node.MENU.get());
}else{
menu = VanillaPlusCore.getMenuManager().get(section.getString(Node.MENU.get()), true);
}
view = section.getBoolean("VIEW", false);
if(view)
argumentRequired = 1;
}
示例13: CPCurrencySet
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPCurrencySet(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
defaultCurrency = VanillaPlusCore.getCurrencyManager().get((short) section.getInt(Node.CURRENCY.get()));
if(defaultCurrency == null){
ErrorLogger.addError(Node.CURRENCY.get());
Error.INVALID.add();
}
set = section.getBoolean("SET", false);
if(!set) remove = section.getBoolean(Node.REMOVE.get(), false);
else remove = false;
alreadyOther = manager.get(section.getString(Node.ALREADY.getOther()));
argumentRequired = 1;
}
示例14: Achievement
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
Achievement(short id,ConfigurationSection section, MComponentManager manager){
this.id = id;
name = manager.get(section.getString(Node.NAME_PATH.get()));
description = manager.get(section.getString(Node.LORE_PATH.get()));
announce = section.getBoolean("ANNOUNCE", true);
listen = section.getShortList("LISTEN");
}
示例15: CPTOD
import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public CPTOD(ConfigurationSection section, MessageManager manager, String name){
super(section, manager, name);
value = section.getInt(Node.VALUE.get(),0);
relative = section.getBoolean("RELATIVE");
}