merge cleanup

This commit is contained in:
Tobias Ottenweller 2012-03-10 15:39:42 +01:00
parent 7346044eea
commit 4db38606f2

View File

@ -11,6 +11,7 @@ import org.bukkit.Location;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.mcteam.ancientgates.commands.*; import org.mcteam.ancientgates.commands.*;
import org.mcteam.ancientgates.gson.Gson; import org.mcteam.ancientgates.gson.Gson;
@ -72,8 +73,9 @@ public class Plugin extends JavaPlugin
Gate.load(); Gate.load();
// Register events // Register events
getServer().getPluginManager().registerEvents(this.playerListener, this); PluginManager pm = this.getServer().getPluginManager();
getServer().getPluginManager().registerEvents(this.blockListener, this); pm.registerEvents(this.playerListener, this);
pm.registerEvents(this.blockListener, this);
log("Enabled"); log("Enabled");
} }
@ -90,13 +92,15 @@ public class Plugin extends JavaPlugin
// Commands // Commands
// -------------------------------------------- // // -------------------------------------------- //
@SuppressWarnings("unchecked") public String getBaseCommand()
public String getBaseCommand() { {
if (this.baseCommand != null) { if (this.baseCommand != null)
return this.baseCommand; return this.baseCommand;
}
Map<String, Map<String, Object>> Commands = (Map<String, Map<String, Object>>) this.getDescription().getCommands(); Map<String, Map<String, Object>> Commands = this.getDescription().getCommands();
this.baseCommand = Commands.keySet().iterator().next(); this.baseCommand = Commands.keySet().iterator().next();
return this.baseCommand; return this.baseCommand;
} }