Java Code Examples for org.bukkit.plugin.Plugin#getLogger()

The following examples show how to use org.bukkit.plugin.Plugin#getLogger() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PaperLib.java    From PaperLib with MIT License 5 votes vote down vote up
/**
 * Can be called during plugin initialization to inform the server owner they should switch to Paper
 *
 * If you do not mind helping spread Paper, please call this in your plugin onEnable to help spread
 * awareness about Paper, and encourage them that your plugin is better when used with Paper!
 *
 * @param plugin Your plugin object
 */
public static void suggestPaper(@Nonnull Plugin plugin) {
    if (isPaper()) {
        return;
    }
    final String benefitsProperty = "paperlib.shown-benefits";
    final String pluginName = plugin.getDescription().getName();
    final Logger logger = plugin.getLogger();
    logger.warning("====================================================");
    logger.warning(" " + pluginName + " works better if you use Paper ");
    logger.warning(" as your server software. ");
    if (System.getProperty(benefitsProperty) == null) {
        System.setProperty(benefitsProperty, "1");
        logger.warning("  ");
        logger.warning(" Paper offers significant performance improvements,");
        logger.warning(" bug fixes, security enhancements and optional");
        logger.warning(" features for server owners to enhance their server.");
        logger.warning("  ");
        logger.warning(" Paper includes Timings v2, which is significantly");
        logger.warning(" better at diagnosing lag problems over v1.");
        logger.warning("  ");
        logger.warning(" All of your plugins should still work, and the");
        logger.warning(" Paper community will gladly help you fix any issues.");
        logger.warning("  ");
        logger.warning(" Join the Paper Community @ https://papermc.io");
    }
    logger.warning("====================================================");
}
 
Example 2
Source File: TabManager.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
public TabManager(Plugin plugin,
                  @Nullable DefaultProvider<Player, ? extends TabView> viewProvider,
                  @Nullable DefaultProvider<Player, ? extends TabEntry> playerEntryProvider) {

    if(viewProvider == null) viewProvider = new TabView.Factory();
    if(playerEntryProvider == null) playerEntryProvider = new PlayerTabEntry.Factory();

    this.logger = new ClassLogger(plugin.getLogger(), getClass());
    this.plugin = plugin;
    this.enabledViews = new DefaultMapAdapter<>(viewProvider, true);
    this.playerEntries = new DefaultMapAdapter<>(playerEntryProvider, true);
}
 
Example 3
Source File: GithubUpdateCheck.java    From AreaShop with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create a new GithubUpdateCheck with the required information.
 * @param plugin            The plugin to create it for (used for logging and checking version)
 * @param author            The author of the plugin as used on Github
 * @param repository        The repository name of the plugin on Github
 */
public GithubUpdateCheck(Plugin plugin, String author, String repository) {
	this.plugin = plugin;
	this.logger = plugin.getLogger();
	this.author = author;
	this.repository = repository;
	this.currentVersion = plugin.getDescription().getVersion();
	this.versionComparator = (latest, current) ->
			!latest.equalsIgnoreCase(current);

	this.checking = false;
	this.error = false;
	this.hasUpdate = false;
}
 
Example 4
Source File: BukkitLoggerFactory.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected Logger pluginLogger(Plugin plugin) {
    return plugin.getLogger();
}
 
Example 5
Source File: DatabaseManager.java    From Survival-Games with GNU General Public License v3.0 4 votes vote down vote up
public void setup(Plugin p){
    log = p.getLogger();
    connect();
}
 
Example 6
Source File: SpigetUpdate.java    From RedProtect with GNU General Public License v3.0 4 votes vote down vote up
public SpigetUpdate(Plugin plugin, int resourceId) {
    super(resourceId, plugin.getDescription().getVersion(), plugin.getLogger());
    this.plugin = plugin;
    setUserAgent("SpigetResourceUpdater/Bukkit");
}
 
Example 7
Source File: DefaultCommandExecution.java    From HeavySpleef with GNU General Public License v3.0 4 votes vote down vote up
public DefaultCommandExecution(Plugin plugin, String prefix) {
	this.plugin = plugin;
	this.logger = plugin.getLogger();
	this.prefix = prefix;
}