Fixed empty check in PluginCommand

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-01-20 03:08:15 +00:00
parent 81023892fe
commit f0ab429e01
2 changed files with 1 additions and 4 deletions

View file

@ -1,7 +1,5 @@
package org.bukkit.command;
import java.awt.Color;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@ -17,7 +15,7 @@ public final class PluginCommand extends Command {
public boolean execute(Player player, String commandLabel, String[] args) {
boolean cmdSuccess = owningPlugin.onCommand(player, this, commandLabel, args);
if (!cmdSuccess && usageMessage != "") {
if (!cmdSuccess && !usageMessage.isEmpty()) {
String tmpMsg = usageMessage.replace("<command>", commandLabel);
String[] usageLines = tmpMsg.split("\\n");
for(String line: usageLines) {

View file

@ -217,7 +217,6 @@ public final class SimplePluginManager implements PluginManager {
*/
public void registerEvent(Event.Type type, Listener listener, Priority priority, Plugin plugin) {
PriorityQueue<RegisteredListener> eventListeners = listeners.get(type);
int position = 0;
if (eventListeners == null) {
eventListeners = new PriorityQueue<RegisteredListener>(11,