mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-02 13:31:54 +01:00
SEVERE error messages for other plugins, that try to manually enable Essentials, FakePermissions or GroupManager
This commit is contained in:
parent
27c84ceaac
commit
b63ae9b771
@ -96,6 +96,10 @@ public class Essentials extends JavaPlugin implements IEssentials
|
|||||||
|
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
|
if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) {
|
||||||
|
logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably "
|
||||||
|
+ Thread.currentThread().getStackTrace()[5].getClassName());
|
||||||
|
}
|
||||||
if (enableErrorLogging)
|
if (enableErrorLogging)
|
||||||
{
|
{
|
||||||
logger.addHandler(errorHandler);
|
logger.addHandler(errorHandler);
|
||||||
|
@ -3,6 +3,7 @@ package com.nijikokun.bukkit.Permissions;
|
|||||||
import com.nijiko.Misc;
|
import com.nijiko.Misc;
|
||||||
import com.nijiko.configuration.DefaultConfiguration;
|
import com.nijiko.configuration.DefaultConfiguration;
|
||||||
import com.nijiko.permissions.PermissionHandler;
|
import com.nijiko.permissions.PermissionHandler;
|
||||||
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
import org.anjocaido.groupmanager.GroupManager;
|
||||||
import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy;
|
import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy;
|
||||||
@ -55,6 +56,10 @@ public class Permissions extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) {
|
||||||
|
Logger.getLogger("Minecraft").log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably "
|
||||||
|
+ Thread.currentThread().getStackTrace()[5].getClassName());
|
||||||
|
}
|
||||||
Server = this.getServer();
|
Server = this.getServer();
|
||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
|
|
||||||
|
@ -63,6 +63,10 @@ public class GroupManager extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) {
|
||||||
|
logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably "
|
||||||
|
+ Thread.currentThread().getStackTrace()[5].getClassName());
|
||||||
|
}
|
||||||
GroupManager.logger.setUseParentHandlers(false);
|
GroupManager.logger.setUseParentHandlers(false);
|
||||||
GMLoggerHandler ch = new GMLoggerHandler();
|
GMLoggerHandler ch = new GMLoggerHandler();
|
||||||
GroupManager.logger.addHandler(ch);
|
GroupManager.logger.addHandler(ch);
|
||||||
|
Loading…
Reference in New Issue
Block a user