First two hooks working, updated sample
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
@@ -15,7 +15,6 @@ import java.util.regex.Matcher;
|
||||
import org.bukkit.Server;
|
||||
import java.util.regex.Pattern;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
|
||||
@@ -202,6 +201,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
position++;
|
||||
}
|
||||
} else {
|
||||
listeners = new ArrayList<RegisteredListener>();
|
||||
playerListeners.put(type, listeners);
|
||||
}
|
||||
|
||||
listeners.add(position, new RegisteredListener(listener, priority, plugin));
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.bukkit.plugin.PluginLoader;
|
||||
* Represents a Java plugin
|
||||
*/
|
||||
public abstract class JavaPlugin implements Plugin {
|
||||
private boolean isEnabled = false;
|
||||
private boolean isEnabled = true;
|
||||
private final PluginLoader loader;
|
||||
private final Server server;
|
||||
private final File file;
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
|
||||
switch (type) {
|
||||
case Join:
|
||||
trueListener.onPlayerJoin((PlayerJoinEvent)event);
|
||||
trueListener.onPlayerJoin((PlayerEvent)event);
|
||||
break;
|
||||
case Quit:
|
||||
trueListener.onPlayerQuit((PlayerQuitEvent)event);
|
||||
|
||||
Reference in New Issue
Block a user