本文整理汇总了Java中org.bukkit.plugin.Plugin.getConfig方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getConfig方法的具体用法?Java Plugin.getConfig怎么用?Java Plugin.getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.getConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpViolations
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
/**
* Helper method to add all violations to the violation map (this is where their values are declared)
* Add more of these as necessary...
*/
private void setUpViolations() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("ChatModerator");
FileConfiguration pluginConfig = plugin.getConfig();
Preconditions.checkArgument(plugin.isEnabled(), "plugin not enabled");
this.violations.put(DuplicateMessageViolation.class, new ViolationSet(pluginConfig.getDouble("filters.duplicate-messages.default-level", 1)));
this.violations.put(ServerIPViolation.class, new ViolationSet(pluginConfig.getDouble("filters.server-ip.default-level", 1)));
this.violations.put(RepeatedCharactersViolation.class, new ViolationSet(0));
this.violations.put(ProfanityViolation.class, new ViolationSet(pluginConfig.getDouble("filters.profanity.default-level", 1)));
this.violations.put(AllCapsViolation.class, new ViolationSet(pluginConfig.getDouble("filters.all-caps.default-level", 1)));
this.violations.put(LeetSpeakViolation.class, new ViolationSet(pluginConfig.getDouble("filters.leet.default-level", 1)));
this.violations.put(BubbleViolation.class, new ViolationSet(pluginConfig.getDouble("filters.bubble.default-level", 1)));
}
示例2: Config
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public Config(Plugin plugin) {
this(plugin.getConfig());
}