当前位置: 首页>>代码示例>>Java>>正文


Java SwornPlugin类代码示例

本文整理汇总了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());
	}
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:19,代码来源:ResourceHandler.java

示例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);
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:19,代码来源:ConfigTest.java

示例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;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:10,代码来源:CmdHelp.java

示例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;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:9,代码来源:CmdReload.java

示例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());
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:9,代码来源:Command.java

示例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;
	}
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:21,代码来源:ItemUtil.java

示例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;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:21,代码来源:ItemUtil.java

示例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;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:8,代码来源:AbstractGUI.java

示例9: PaginatedCommand

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public PaginatedCommand(SwornPlugin plugin)
{
	super(plugin);
	this.linesPerPage = 10;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:6,代码来源:PaginatedCommand.java

示例10: VaultHandler

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public VaultHandler(SwornPlugin handler)
{
	super(handler, "Vault");
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:5,代码来源:VaultHandler.java

示例11: CommandHandler

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public CommandHandler(SwornPlugin plugin)
{
	this.plugin = plugin;
	this.registeredCommands = new ArrayList<>();
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:6,代码来源:CommandHandler.java

示例12: LogHandler

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public LogHandler(SwornPlugin plugin, Logger logger)
{
	this.plugin = plugin;
	this.logger = logger;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:6,代码来源:LogHandler.java

示例13: PermissionHandler

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public PermissionHandler(SwornPlugin plugin)
{
	this(plugin.getName());
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:5,代码来源:PermissionHandler.java

示例14: parse

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public static void parse(SwornPlugin plugin, FileConfiguration config, Object object)
{
	parse(plugin, config, object.getClass(), object);
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:5,代码来源:ConfigParser.java

示例15: GUIHandler

import net.dmulloy2.SwornPlugin; //导入依赖的package包/类
public GUIHandler(SwornPlugin plugin)
{
	this.open = new HashMap<>();
	plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:6,代码来源:GUIHandler.java


注:本文中的net.dmulloy2.SwornPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。