Revert Plugin to Interface, added PluginBase

Fixed Tests, moved TestPlugin out of messaging

By: Feildmaster <admin@feildmaster.com>
This commit is contained in:
Bukkit/Spigot
2012-02-29 18:46:09 -06:00
parent fa6a95bc3f
commit 5ebb8d2b3e
9 changed files with 63 additions and 75 deletions

View File

@@ -0,0 +1,31 @@
package org.bukkit.plugin;
/**
* Represents a base {@link Plugin}
* <p />
* Extend this class if your plugin is not a {@link org.bukkit.plugin.java.JavaPlugin}
*/
public abstract class PluginBase implements Plugin {
@Override
public final int hashCode() {
return getName().hashCode();
}
@Override
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Plugin)) {
return false;
}
return getName().equals(((Plugin) obj).getName());
}
public final String getName() {
return getDescription().getName();
}
}