本文整理汇总了Java中net.dmulloy2.SwornPlugin类的典型用法代码示例。如果您正苦于以下问题:Java SwornPlugin类的具体用法?Java SwornPlugin怎么用?Java SwornPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwornPlugin类属于net.dmulloy2包,在下文中一共展示了SwornPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ResourceHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public ResourceHandler(SwornPlugin plugin, ClassLoader classLoader)
{
this.plugin = plugin;
try
{
if (plugin.getConfig().isSet("locale"))
locale = Locale.forLanguageTag(plugin.getConfig().getString("locale"));
if (locale == null)
locale = Locale.getDefault();
messages = ResourceBundle.getBundle("messages", locale, new FileResourceLoader(classLoader, plugin));
}
catch (MissingResourceException ex)
{
plugin.getLogHandler().log(Level.SEVERE, "Could not find resource bundle: {0}", ex.getKey());
}
}
示例2: beforeClass
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Throwable
{
BukkitTesting.prepare();
SwornPlugin plugin = mock(SwornPlugin.class);
when(plugin.getLogHandler()).thenReturn(new LogHandler(plugin, Logger.getGlobal()));
// Mock the config
YamlConfiguration config = new YamlConfiguration();
InputStream stream = Resources.getResource("config.yml").openStream();
InputStreamReader reader = new InputStreamReader(stream, Charsets.UTF_8);
config.load(reader);
when(plugin.getConfig()).thenReturn(config);
ConfigParser.parse(plugin, Config.class);
}
示例3: CmdHelp
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public CmdHelp(SwornPlugin plugin)
{
super(plugin);
this.name = "help";
this.addOptionalArg("page");
this.description = "Shows " + plugin.getName() + " help";
this.visibility = CommandVisibility.ALL;
this.usesPrefix = true;
}
示例4: CmdReload
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public CmdReload(SwornPlugin plugin)
{
super(plugin);
this.name = "reload";
this.description = "Reload " + plugin.getName();
this.permission = props().getReloadPerm();
this.usesPrefix = true;
}
示例5: Command
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public Command(SwornPlugin plugin)
{
this.plugin = plugin;
this.aliases = new ArrayList<>();
this.subCommands = new ArrayList<>();
this.syntaxes = new ArrayList<>();
syntaxes.add(new Syntax());
}
示例6: readItem
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
/**
* Safely reads an item, logging any exceptions.
*
* @param string String to parse
* @param plugin Plugin instance
* @return ItemStack, or null if parsing failed
* @see #readItem(String)
*/
public static ItemStack readItem(String string, SwornPlugin plugin)
{
try
{
return ItemUtil.readItem(string);
}
catch (Throwable ex)
{
plugin.getLogHandler().log(Level.WARNING, Util.getUsefulStack(ex, "parsing item \"" + string + "\""));
return null;
}
}
示例7: readItems
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
/**
* Safely reads a list of items, logging any exceptions.
*
* @param strings Strings to parse
* @param plugin Plugin instance
* @return List of ItemStacks
* @see #readItem(String)
*/
public static final List<ItemStack> readItems(List<String> strings, SwornPlugin plugin)
{
List<ItemStack> ret = new ArrayList<>();
for (String string : strings)
{
ItemStack item = readItem(string, plugin);
if (item != null)
ret.add(item);
}
return ret;
}
示例8: AbstractGUI
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public AbstractGUI(SwornPlugin plugin, Player player)
{
Validate.notNull(plugin, "plugin cannot be null");
Validate.notNull(player, "player cannot be null!");
this.player = player;
this.plugin = plugin;
}
示例9: PaginatedCommand
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public PaginatedCommand(SwornPlugin plugin)
{
super(plugin);
this.linesPerPage = 10;
}
示例10: VaultHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public VaultHandler(SwornPlugin handler)
{
super(handler, "Vault");
}
示例11: CommandHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public CommandHandler(SwornPlugin plugin)
{
this.plugin = plugin;
this.registeredCommands = new ArrayList<>();
}
示例12: LogHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public LogHandler(SwornPlugin plugin, Logger logger)
{
this.plugin = plugin;
this.logger = logger;
}
示例13: PermissionHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public PermissionHandler(SwornPlugin plugin)
{
this(plugin.getName());
}
示例14: parse
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public static void parse(SwornPlugin plugin, FileConfiguration config, Object object)
{
parse(plugin, config, object.getClass(), object);
}
示例15: GUIHandler
import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public GUIHandler(SwornPlugin plugin)
{
this.open = new HashMap<>();
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}