Bukkit plugins, Help with { and }
This is my first day of java programing and i start with a bukkit plugin i got the basics down but i can't figure out where to place the { and } and because of that i get errors (using eclipse, i have downloaded everything because i tested with a simple onEnable println)
code so far:
Code:
package com.rosaage.Test;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.util.*;
import org.bukkit.command.*;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.Event.*;
import org.bukkit.event.player.PlayerListener;
public class TestPlugin extends JavaPlugin {
public void onDisable() {
System.out.println("[Ohh..] Goodbye world! Rosaage's test plugin is disabled!");
}
public void reloadCustomConfig() {
private FileConfiguration customConfig = null;
private File customConfigurationFile = null;
if (customConfigFile == null) {
customConfigFile = new File(getDataFolder(), "config.yml");
customConfig = YamlConfiguration.loadConfiguration(customConfigFile);
}
InputStream defConfigStream = getResource("config.yml");
if (defConfigStream != null) {
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
customConfig.setDefaults(defConfig);
}
public void onEnable() {
System.out.println( "[YAY!] Hello World! Rosaage's test plugin is enabled!" );
this.getServer().getPluginManager().registerEvent(Type.PLAYER_JOIN,
new PlayerListener() {
@Override
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage(getConfig().getString("message"));
}
},
this.getCommand("Killme").setExecutor(new CommandExecutor() {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return true;
}
Re: Bukkit plugins, Help with { and }
Quote:
This is my first day of java programing and i start with a bukkit plugin
What's a 'bukkit plugin'?
Since you're totally new to Java you would be better starting here: The Java™ Tutorials
db