mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 12:01:20 +02:00
Merge branch 'bukkitupdate'
This commit is contained in:
@@ -2,6 +2,8 @@ package com.earth2me.essentials.register.payment;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
@@ -68,7 +70,8 @@ public class Methods {
|
|||||||
|
|
||||||
if(!plugin.isEnabled()) {
|
if(!plugin.isEnabled()) {
|
||||||
this.self = true;
|
this.self = true;
|
||||||
manager.enablePlugin(plugin);
|
Logger.getLogger("Minecraft").log(Level.SEVERE, name + " Plugin was found, but not enabled before Essentials. Read the Essentials thread for help.");
|
||||||
|
//manager.enablePlugin(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(plugin == null) continue;
|
if(plugin == null) continue;
|
||||||
|
@@ -7,8 +7,12 @@ 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;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.event.Event.Priority;
|
||||||
|
import org.bukkit.event.Event.Type;
|
||||||
import org.bukkit.event.player.PlayerChatEvent;
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerListener;
|
import org.bukkit.event.player.PlayerListener;
|
||||||
|
import org.bukkit.event.server.PluginEnableEvent;
|
||||||
|
import org.bukkit.event.server.ServerListener;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@@ -55,23 +59,32 @@ public class Permissions extends JavaPlugin {
|
|||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
|
|
||||||
if (Security == null) {//make sure we have only one instance
|
if (Security == null) {//make sure we have only one instance
|
||||||
Plugin p = (Plugin)(this.getServer() == null ? new GroupManager() : this.getServer().getPluginManager().getPlugin("GroupManager"));
|
Security = new NijikoPermissionsProxy(null);
|
||||||
if (p != null) {
|
}
|
||||||
if (!p.isEnabled()) {
|
|
||||||
if (this.getServer() == null) {
|
Plugin p = (this.getServer() == null) ? null : this.getServer().getPluginManager().getPlugin("GroupManager");
|
||||||
p.onEnable();
|
if (p != null) {
|
||||||
} else {
|
if (p.isEnabled()) {
|
||||||
this.getServer().getPluginManager().enablePlugin(p);
|
setGM(p);
|
||||||
}
|
} else {
|
||||||
}
|
if (this.getServer() != null) {
|
||||||
GroupManager gm = (GroupManager) p;
|
this.getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new ServerListener() {
|
||||||
groupManager = gm;
|
|
||||||
Security = new NijikoPermissionsProxy(gm);
|
@Override
|
||||||
} else {
|
public void onPluginEnable(PluginEnableEvent event)
|
||||||
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
{
|
||||||
this.getPluginLoader().disablePlugin(this);
|
if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
|
||||||
}
|
Permissions.this.setGM(event.getPlugin());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, Priority.Normal, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
||||||
|
this.getPluginLoader().disablePlugin(this);
|
||||||
|
}
|
||||||
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
||||||
if (pdfFile != null)
|
if (pdfFile != null)
|
||||||
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||||
@@ -81,17 +94,30 @@ public class Permissions extends JavaPlugin {
|
|||||||
//compiled code
|
//compiled code
|
||||||
//throw new RuntimeException("Compiled Code");
|
//throw new RuntimeException("Compiled Code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setGM(Plugin p) {
|
||||||
|
groupManager = (GroupManager)p;
|
||||||
|
((NijikoPermissionsProxy)Security).setGM(p);
|
||||||
|
}
|
||||||
|
|
||||||
public PermissionHandler getHandler() {
|
public PermissionHandler getHandler() {
|
||||||
//compiled code
|
//compiled code
|
||||||
//throw new RuntimeException("Compiled Code");
|
//throw new RuntimeException("Compiled Code");
|
||||||
//System.out.println("Alguem chamou o handler");
|
//System.out.println("Alguem chamou o handler");
|
||||||
checkEnable();
|
if (Security == null)
|
||||||
|
{
|
||||||
|
Security = new NijikoPermissionsProxy(null);
|
||||||
|
}
|
||||||
|
//checkEnable();
|
||||||
return Security;
|
return Security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupPermissions() {
|
public void setupPermissions() {
|
||||||
checkEnable();
|
if (Security == null)
|
||||||
|
{
|
||||||
|
Security = new NijikoPermissionsProxy(null);
|
||||||
|
}
|
||||||
|
//checkEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEnable() {
|
private void checkEnable() {
|
||||||
|
@@ -9,6 +9,7 @@ import java.io.File;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
import org.anjocaido.groupmanager.GroupManager;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.util.config.Configuration;
|
import org.bukkit.util.config.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -425,4 +426,9 @@ public class NijikoPermissionsProxy extends Control {
|
|||||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionDouble(name,permission);
|
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionDouble(name,permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGM(Plugin p)
|
||||||
|
{
|
||||||
|
this.plugin = (GroupManager)p;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: GroupManager
|
name: GroupManager
|
||||||
version: 1.0(alpha-5)
|
version: "1.0(alpha-5) [Zombie-Version, please switch to Permissions 3]"
|
||||||
main: org.anjocaido.groupmanager.GroupManager
|
main: org.anjocaido.groupmanager.GroupManager
|
||||||
website: http://www.anjocaido.info/
|
website: http://www.anjocaido.info/
|
||||||
description: Provides on-the-fly system for Permission system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
description: Provides on-the-fly system for Permission system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
||||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user