本文整理汇总了Java中ch.njol.skript.SkriptAddon类的典型用法代码示例。如果您正苦于以下问题:Java SkriptAddon类的具体用法?Java SkriptAddon怎么用?Java SkriptAddon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SkriptAddon类属于ch.njol.skript包,在下文中一共展示了SkriptAddon类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: load
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
private static boolean load(final SkriptAddon addon, final String name) {
if (addon.getLanguageFileDirectory() == null)
return false;
final HashMap<String, String> l = load(addon.plugin.getResource(addon.getLanguageFileDirectory() + "/" + name + ".lang"), name);
final File f = new File(addon.plugin.getDataFolder(), addon.getLanguageFileDirectory() + File.separator + name + ".lang");
try {
if (f.exists())
l.putAll(load(new FileInputStream(f), name));
} catch (final FileNotFoundException e) {
assert false;
}
if (l.isEmpty())
return false;
if (!l.containsKey("version")) {
Skript.error(addon + "'s language file " + name + ".lang does not provide a version number!");
} else {
try {
final Version v = new Version("" + l.get("version"));
final Version lv = langVersion.get(addon.plugin);
assert lv != null; // set in loadDefault()
if (v.isSmallerThan(lv))
Skript.warning(addon + "'s language file " + name + ".lang is outdated, some messages will be english.");
} catch (final IllegalArgumentException e) {
Skript.error("Illegal version syntax in " + addon + "'s language file " + name + ".lang: " + e.getLocalizedMessage());
}
}
l.remove("version");
final HashMap<String, String> loc = localized;
if (loc != null)
loc.putAll(l);
else
assert false : addon + "; " + name;
return true;
}
开发者ID:nfell2009,项目名称:Skript,代码行数:35,代码来源:Language.java
示例2: get
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event e) {
ArrayList<String> cl = new ArrayList<>();
if (ty == 0) {
for (Plugin s : Bukkit.getServer().getPluginManager().getPlugins()) {
cl.add(s.getName());
}
} else {
cl.addAll(Skript.getAddons().stream().map(SkriptAddon::getName).collect(Collectors.toList()));
}
return cl.toArray(new String[cl.size()]);
}
开发者ID:tim740,项目名称:skUtilities,代码行数:14,代码来源:ExprLoadedList.java
示例3: getAddon
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
public static SkriptAddon getAddon() {
return addonInstance;
}
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:4,代码来源:QuarSk.java
示例4: getAddonInstance
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
public static SkriptAddon getAddonInstance() {
if (addon == null) {
addon = Skript.registerAddon(getInstance());
}
return addon;
}
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:7,代码来源:Main.java
示例5: getAddonInstance
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
public static SkriptAddon getAddonInstance() {
if (addonInstance == null) {
addonInstance = Skript.registerAddon(getInstance());
}
return addonInstance;
}
开发者ID:btk5h,项目名称:skript-mirror,代码行数:7,代码来源:SkriptMirror.java
示例6: enableMundoSKMetrics
import ch.njol.skript.SkriptAddon; //导入依赖的package包/类
public static void enableMundoSKMetrics() {
try {
Metrics metrics = new Metrics(Mundo.INSTANCE);
//Skript Version
Graph skriptVersion = metrics.createGraph("Skript Version");
skriptVersion.addPlotter(new Metrics.Plotter(Bukkit.getServer().getPluginManager().getPlugin("Skript").getDescription().getVersion()){
@Override
public int getValue() {
return 1;
}
});
Graph addons = metrics.createGraph("Skript Addons");
SkriptAddon[] addonlist = Skript.getAddons().toArray(new SkriptAddon[0]);
for (int i = 0; i < addonlist.length; i++) {
addons.addPlotter(new Metrics.Plotter((addonlist[i]).getName()) {
@Override
public int getValue() {
return 1;
}
});
}
Graph plugins = metrics.createGraph("Plugins");
Plugin[] pluginlist = Bukkit.getPluginManager().getPlugins();
for (int i = 0; i < pluginlist.length; i++) {
plugins.addPlotter(new Metrics.Plotter((pluginlist[i]).getName()) {
@Override
public int getValue() {
return 1;
}
});
}
if (MundoUtil.serverHasPlugin("ProtocolLib")) {
Graph protocolLibVersion = metrics.createGraph("ProtocolLib Version");
protocolLibVersion.addPlotter(new Plotter(Bukkit.getPluginManager().getPlugin("ProtocolLib").getDescription().getVersion()) {
@Override
public int getValue() {
return 1;
}
});
}
metrics.start();
Logging.info("Metrics have been enabled!");
} catch (Exception e) {
Logging.info("Metrics failed to enable");
Logging.reportException(Mundo.class, e);
}
}
开发者ID:MundoSK,项目名称:MundoSK,代码行数:54,代码来源:Metrics.java
注:本文中的ch.njol.skript.SkriptAddon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论