First commit
This commit is contained in:
19
src/cz/marwland/mc/core/EventListener.java
Normal file
19
src/cz/marwland/mc/core/EventListener.java
Normal file
@ -0,0 +1,19 @@
|
||||
package cz.marwland.mc.core;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
|
||||
public class EventListener implements Listener {
|
||||
private final MarwCore plugin;
|
||||
|
||||
public EventListener(MarwCore plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void normalLogin(PlayerLoginEvent event) {
|
||||
plugin.getServer().broadcastMessage("Welcome " + event.getPlayer().getDisplayName() + "!");
|
||||
}
|
||||
|
||||
}
|
19
src/cz/marwland/mc/core/MarwCore.java
Normal file
19
src/cz/marwland/mc/core/MarwCore.java
Normal file
@ -0,0 +1,19 @@
|
||||
package cz.marwland.mc.core;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import cz.marwland.mc.core.cmd.First;
|
||||
|
||||
public class MarwCore extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getCommand("first").setExecutor(new First(this));
|
||||
getServer().getPluginManager().registerEvents(new EventListener(this), this);
|
||||
getLogger().info("Enabled!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
}
|
||||
}
|
22
src/cz/marwland/mc/core/cmd/First.java
Normal file
22
src/cz/marwland/mc/core/cmd/First.java
Normal file
@ -0,0 +1,22 @@
|
||||
package cz.marwland.mc.core.cmd;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import cz.marwland.mc.core.MarwCore;
|
||||
|
||||
public class First implements CommandExecutor {
|
||||
private final MarwCore plugin;
|
||||
|
||||
public First(MarwCore plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
plugin.getLogger().info("Hello?");
|
||||
sender.sendMessage("henlo");
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user