mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
@@ -55,7 +55,7 @@ public interface PluginLoader {
|
||||
|
||||
/**
|
||||
* Enables the specified plugin
|
||||
*
|
||||
* <p />
|
||||
* Attempting to enable a plugin that is already enabled will have no effect
|
||||
*
|
||||
* @param plugin Plugin to enable
|
||||
@@ -64,7 +64,7 @@ public interface PluginLoader {
|
||||
|
||||
/**
|
||||
* Disables the specified plugin
|
||||
*
|
||||
* <p />
|
||||
* Attempting to disable a plugin that is not enabled will have no effect
|
||||
*
|
||||
* @param plugin Plugin to disable
|
||||
|
@@ -8,7 +8,6 @@ import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.permissions.Permissible;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
||||
/**
|
||||
* Handles all plugin management from the Server
|
||||
@@ -25,7 +24,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Checks if the given plugin is loaded and returns it when applicable
|
||||
*
|
||||
* <p />
|
||||
* Please note that the name of the plugin is case-sensitive
|
||||
*
|
||||
* @param name Name of the plugin to check
|
||||
@@ -42,7 +41,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Checks if the given plugin is enabled or not
|
||||
*
|
||||
* <p />
|
||||
* Please note that the name of the plugin is case-sensitive.
|
||||
*
|
||||
* @param name Name of the plugin to check
|
||||
@@ -60,7 +59,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Loads the plugin in the specified file
|
||||
*
|
||||
* <p />
|
||||
* File must be valid according to the current enabled Plugin interfaces
|
||||
*
|
||||
* @param file File containing the plugin to load
|
||||
@@ -119,7 +118,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Enables the specified plugin
|
||||
*
|
||||
* <p />
|
||||
* Attempting to enable a plugin that is already enabled will have no effect
|
||||
*
|
||||
* @param plugin Plugin to enable
|
||||
@@ -128,7 +127,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Disables the specified plugin
|
||||
*
|
||||
* <p />
|
||||
* Attempting to disable a plugin that is not enabled will have no effect
|
||||
*
|
||||
* @param plugin Plugin to disable
|
||||
@@ -145,7 +144,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Adds a {@link Permission} to this plugin manager.
|
||||
*
|
||||
* <p />
|
||||
* If a permission is already defined with the given name of the new permission,
|
||||
* an exception will be thrown.
|
||||
*
|
||||
@@ -156,9 +155,9 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Removes a {@link Permission} registration from this plugin manager.
|
||||
*
|
||||
* <p />
|
||||
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
||||
*
|
||||
* <p />
|
||||
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
||||
*
|
||||
* @param perm Permission to remove
|
||||
@@ -167,9 +166,9 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Removes a {@link Permission} registration from this plugin manager.
|
||||
*
|
||||
* <p />
|
||||
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
||||
*
|
||||
* <p />
|
||||
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
||||
*
|
||||
* @param name Permission to remove
|
||||
@@ -186,7 +185,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Recalculates the defaults for the given {@link Permission}.
|
||||
*
|
||||
* <p />
|
||||
* This will have no effect if the specified permission is not registered here.
|
||||
*
|
||||
* @param perm Permission to recalculate
|
||||
@@ -195,7 +194,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Subscribes the given Permissible for information about the requested Permission, by name.
|
||||
*
|
||||
* <p />
|
||||
* If the specified Permission changes in any form, the Permissible will be asked to recalculate.
|
||||
*
|
||||
* @param permission Permission to subscribe to
|
||||
@@ -221,7 +220,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Subscribes to the given Default permissions by operator status
|
||||
*
|
||||
* <p />
|
||||
* If the specified defaults change in any form, the Permissible will be asked to recalculate.
|
||||
*
|
||||
* @param op Default list to subscribe to
|
||||
@@ -247,7 +246,7 @@ public interface PluginManager {
|
||||
|
||||
/**
|
||||
* Gets a set of all registered permissions.
|
||||
*
|
||||
* <p />
|
||||
* This set is a copy and will not be modified live.
|
||||
*
|
||||
* @return Set containing all current registered permissions
|
||||
|
@@ -168,7 +168,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
/**
|
||||
* Loads the plugin in the specified file
|
||||
*
|
||||
* <p />
|
||||
* File must be valid according to the current enabled Plugin interfaces
|
||||
*
|
||||
* @param file File containing the plugin to load
|
||||
@@ -183,7 +183,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
/**
|
||||
* Loads the plugin in the specified file
|
||||
*
|
||||
* <p />
|
||||
* File must be valid according to the current enabled Plugin interfaces
|
||||
*
|
||||
* @param file File containing the plugin to load
|
||||
@@ -226,7 +226,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
/**
|
||||
* Checks if the given plugin is loaded and returns it when applicable
|
||||
*
|
||||
* <p />
|
||||
* Please note that the name of the plugin is case-sensitive
|
||||
*
|
||||
* @param name Name of the plugin to check
|
||||
@@ -242,7 +242,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
/**
|
||||
* Checks if the given plugin is enabled or not
|
||||
*
|
||||
* <p />
|
||||
* Please note that the name of the plugin is case-sensitive.
|
||||
*
|
||||
* @param name Name of the plugin to check
|
||||
@@ -332,7 +332,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
*/
|
||||
public synchronized void callEvent(Event event) {
|
||||
for (RegisteredListener registration : getEventListeners(event.getType())) {
|
||||
if(!registration.getPlugin().isEnabled()) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -236,7 +236,7 @@ public abstract class JavaPlugin implements Plugin {
|
||||
|
||||
/**
|
||||
* Initializes this plugin with the given variables.
|
||||
*
|
||||
* <p />
|
||||
* This method should never be called manually.
|
||||
*
|
||||
* @param loader PluginLoader that is responsible for this plugin
|
||||
|
@@ -37,9 +37,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
||||
*/
|
||||
public class JavaPluginLoader implements PluginLoader {
|
||||
private final Server server;
|
||||
protected final Pattern[] fileFilters = new Pattern[] {
|
||||
Pattern.compile("\\.jar$"),
|
||||
};
|
||||
protected final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
|
||||
protected final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
|
||||
protected final Map<String, PluginClassLoader> loaders = new HashMap<String, PluginClassLoader>();
|
||||
|
||||
@@ -1006,7 +1004,7 @@ public class JavaPluginLoader implements PluginLoader {
|
||||
|
||||
if (plugin.isEnabled()) {
|
||||
server.getPluginManager().callEvent(new PluginDisableEvent(plugin));
|
||||
|
||||
|
||||
JavaPlugin jPlugin = (JavaPlugin) plugin;
|
||||
ClassLoader cloader = jPlugin.getClassLoader();
|
||||
|
||||
|
@@ -33,7 +33,7 @@ public final class PluginMessageListenerRegistration {
|
||||
|
||||
/**
|
||||
* Gets the plugin channel that this registration is about.
|
||||
*
|
||||
*
|
||||
* @return Plugin channel.
|
||||
*/
|
||||
public String getChannel() {
|
||||
|
@@ -362,7 +362,7 @@ public class StandardMessenger implements Messenger {
|
||||
|
||||
synchronized (incomingLock) {
|
||||
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(registration.getPlugin());
|
||||
|
||||
|
||||
if (registrations != null) {
|
||||
return registrations.contains(registration);
|
||||
}
|
||||
|
Reference in New Issue
Block a user