Added null check and removed unused method from Fillr
This commit is contained in:
parent
267afcb0ea
commit
8eeb293d2b
@ -3,7 +3,6 @@ package org.bukkit.fillr;
|
|||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.plugin.*;
|
import org.bukkit.plugin.*;
|
||||||
import org.bukkit.plugin.java.*;
|
import org.bukkit.plugin.java.*;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.*;
|
import org.bukkit.event.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -31,8 +30,4 @@ public class Fillr extends JavaPlugin {
|
|||||||
listener = new FillrListener(getServer());
|
listener = new FillrListener(getServer());
|
||||||
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, listener, Event.Priority.Normal, this);
|
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, listener, Event.Priority.Normal, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCommand(Player player, String command, String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,16 @@ public class CommandParserYaml {
|
|||||||
|
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
for(Entry<String, Map<String, Object>> entry : map.entrySet()) {
|
for(Entry<String, Map<String, Object>> entry : map.entrySet()) {
|
||||||
String description = entry.getValue().get("description").toString();
|
Object d = entry.getValue().get("description");
|
||||||
String usageText = entry.getValue().get("usage").toString();
|
Object u = entry.getValue().get("usage");
|
||||||
|
String description = "";
|
||||||
|
String usageText = "";
|
||||||
|
|
||||||
|
if (d != null)
|
||||||
|
description = d.toString();
|
||||||
|
|
||||||
|
if (u != null)
|
||||||
|
usageText = u.toString();
|
||||||
|
|
||||||
cmds.add(new Command(entry.getKey(), description, usageText, plugin));
|
cmds.add(new Command(entry.getKey(), description, usageText, plugin));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user