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.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class Example extends JavaPlugin implements Listener {
|
public class Example extends JavaPlugin {
|
||||||
|
|
||||||
private Plugin main;
|
private Plugin main;
|
||||||
|
|
||||||
|
@ -28,14 +28,10 @@ public class Example extends JavaPlugin implements Listener {
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.main = this;
|
this.main = this;
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(new Example(), this);
|
Bukkit.getServer().getPluginManager().registerEvents(new Luisteren() ,this);
|
||||||
this.getCommand("test").setExecutor(new TestCommand());
|
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
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
if (!cmd.getName().equalsIgnoreCase("test")) return true;
|
if (!cmd.getName().equalsIgnoreCase("test")) return true;
|
||||||
KingdomPlayer kdp = UltimateKingdom.Players().getPlayer((Player) sender);
|
KingdomPlayer kdp = UltimateKingdom.Players().getPlayer((Player) sender);
|
||||||
sender.sendMessage(kdp.getKingdom().getName());
|
sender.sendMessage(kdp.getKingdom().getName());
|
||||||
|
}
|
||||||
|
|
||||||
// if (sender instanceof Player) {
|
|
||||||
// Player player = (Player) sender;
|
|
||||||
|
|
||||||
// Here we need to give items to our player
|
|
||||||
// }
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user