1
0
mirror of https://bitbucket.org/HeshamTB/greet.git synced 2024-11-22 11:32:15 +01:00

util calss and flight event

This commit is contained in:
HeshamTB 2018-05-26 05:39:42 +03:00
parent e0c1f86938
commit c4fa7db950
3 changed files with 22 additions and 3 deletions

View File

@ -11,13 +11,14 @@ import org.bukkit.event.player.PlayerBedLeaveEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
public class events implements Listener {
private final String PREFIX = ChatColor.AQUA + "[" + ChatColor.BLUE + "5radl" + ChatColor.AQUA + "] "; //[ 5radl ]
Player p;
ChatColor aqua = ChatColor.AQUA;
ChatColor gray = ChatColor.GRAY;
private Player p;
private ChatColor aqua = ChatColor.AQUA;
private ChatColor gray = ChatColor.GRAY;
@EventHandler
public void player(PlayerJoinEvent e) {
@ -56,6 +57,10 @@ public class events implements Listener {
}
@EventHandler
public void player(PlayerItemConsumeEvent e) {e.getPlayer().sendMessage(ChatColor.BOLD+"nom nom nom!");}
public void player(PlayerToggleFlightEvent e) {
//if (e.getPlayer().isOp())
e.getPlayer().kickPlayer("ooops!. \n Dont cheat");
}

View File

@ -0,0 +1,14 @@
package i.hesh.greet;
import org.bukkit.ChatColor;
import org.bukkit.Server;
public class util {
private final static String PREFIX = ChatColor.AQUA + "[" + ChatColor.BLUE + "5radl" + ChatColor.AQUA + "] "; //[ 5radl ]
public static void broadcast(String msg, ChatColor color,Server server) {
server.broadcastMessage(PREFIX +color + msg);
}
}