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

Sender class to organize

This commit is contained in:
hesham 2018-05-03 11:42:56 +03:00
parent ed1cbbf179
commit df46e0e55c
3 changed files with 17 additions and 0 deletions

BIN
libs/spigot-1.12.jar Normal file

Binary file not shown.

View File

@ -26,6 +26,7 @@ public class commands extends JavaPlugin {
String greetprefix = ChatColor.AQUA + "[" + ChatColor.BLUE + "greet" + ChatColor.AQUA + "] "; //[ greet ]
Player p = (Player) sender;
//use sender class
if(cmd.getName().equalsIgnoreCase("opcheck")) {
String pName = p.getDisplayName();

View File

@ -0,0 +1,16 @@
package i.hesh.greet;
import org.bukkit.*;
import org.bukkit.entity.Player;
public class sender {
private static final String PREFIX = ChatColor.AQUA + "[" + ChatColor.BLUE + "greet" + ChatColor.AQUA + "] "; //[ greet ]
public static void sendToPlayer(Player p, String msg, ChatColor c) {
p.sendMessage( PREFIX + c + msg);
}
public static void sendToAll() {}
}