test
This commit is contained in:
parent
6d6c3279c5
commit
991e00f0ae
|
@ -16,7 +16,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Example extends JavaPlugin implements Listener {
|
||||
public class Example extends JavaPlugin {
|
||||
|
||||
private Plugin main;
|
||||
|
||||
|
@ -28,14 +28,10 @@ public class Example extends JavaPlugin implements Listener {
|
|||
@Override
|
||||
public void onEnable() {
|
||||
this.main = this;
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new Example(), this);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new Luisteren() ,this);
|
||||
this.getCommand("test").setExecutor(new TestCommand());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
13
src/main/java/me/map/example/Luisteren.java
Normal file
13
src/main/java/me/map/example/Luisteren.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package me.map.example;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class Luisteren implements Listener {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -11,15 +11,12 @@ public class TestCommand implements CommandExecutor {
|
|||
@Override
|
||||
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
|
||||
|
||||
if (!cmd.getName().equalsIgnoreCase("test")) return true;
|
||||
KingdomPlayer kdp = UltimateKingdom.Players().getPlayer((Player) sender);
|
||||
sender.sendMessage(kdp.getKingdom().getName());
|
||||
if (sender instanceof Player) {
|
||||
if (!cmd.getName().equalsIgnoreCase("test")) return true;
|
||||
KingdomPlayer kdp = UltimateKingdom.Players().getPlayer((Player) sender);
|
||||
sender.sendMessage(kdp.getKingdom().getName());
|
||||
}
|
||||
|
||||
// if (sender instanceof Player) {
|
||||
// Player player = (Player) sender;
|
||||
|
||||
// Here we need to give items to our player
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user