Fix crash at plugin load
This commit is contained in:
parent
a566c95087
commit
e30e60da28
1 changed files with 9 additions and 8 deletions
|
@ -8,20 +8,21 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
|
||||
|
||||
public class HelloWorldPlugin extends JavaPlugin {
|
||||
|
||||
|
||||
public static Scoreboard board;
|
||||
public static Objective hardcoreTimeDead;
|
||||
public static AbstractMap<String,String> deathMap = new HashMap<String,String>();
|
||||
|
||||
public void onEnable(){
|
||||
public static Objective hardcoreTimeDead;
|
||||
public static AbstractMap<String, String> deathMap = new HashMap<String, String>();
|
||||
|
||||
public void onEnable() {
|
||||
registerCommands();
|
||||
getServer().getPluginManager().registerEvents(new DeathListener(this), this);
|
||||
board = Bukkit.getServer().getScoreboardManager().getMainScoreboard();
|
||||
hardcoreTimeDead = board.registerNewObjective("hardcoreTimeDead", "dummy");
|
||||
if (board.getObjective("hardcoreTimeDead") == null)
|
||||
hardcoreTimeDead = board.registerNewObjective("hardcoreTimeDead", "dummy");
|
||||
}
|
||||
public void registerCommands(){
|
||||
|
||||
public void registerCommands() {
|
||||
getCommand("HelloWorld").setExecutor(new HelloWorld(this));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue