Fixed empty check in PluginCommand
This commit is contained in:
parent
79883d5ad6
commit
eee866bf25
@ -1,7 +1,5 @@
|
|||||||
package org.bukkit.command;
|
package org.bukkit.command;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@ -17,7 +15,7 @@ public final class PluginCommand extends Command {
|
|||||||
|
|
||||||
public boolean execute(Player player, String commandLabel, String[] args) {
|
public boolean execute(Player player, String commandLabel, String[] args) {
|
||||||
boolean cmdSuccess = owningPlugin.onCommand(player, this, commandLabel, args);
|
boolean cmdSuccess = owningPlugin.onCommand(player, this, commandLabel, args);
|
||||||
if (!cmdSuccess && usageMessage != "") {
|
if (!cmdSuccess && !usageMessage.isEmpty()) {
|
||||||
String tmpMsg = usageMessage.replace("<command>", commandLabel);
|
String tmpMsg = usageMessage.replace("<command>", commandLabel);
|
||||||
String[] usageLines = tmpMsg.split("\\n");
|
String[] usageLines = tmpMsg.split("\\n");
|
||||||
for(String line: usageLines) {
|
for(String line: usageLines) {
|
||||||
|
@ -217,7 +217,6 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
*/
|
*/
|
||||||
public void registerEvent(Event.Type type, Listener listener, Priority priority, Plugin plugin) {
|
public void registerEvent(Event.Type type, Listener listener, Priority priority, Plugin plugin) {
|
||||||
PriorityQueue<RegisteredListener> eventListeners = listeners.get(type);
|
PriorityQueue<RegisteredListener> eventListeners = listeners.get(type);
|
||||||
int position = 0;
|
|
||||||
|
|
||||||
if (eventListeners == null) {
|
if (eventListeners == null) {
|
||||||
eventListeners = new PriorityQueue<RegisteredListener>(11,
|
eventListeners = new PriorityQueue<RegisteredListener>(11,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user