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

JavaDoc for sender class

This commit is contained in:
hesham 2018-05-03 14:28:49 +03:00
parent faee743a28
commit b8191a6da5
2 changed files with 10 additions and 17 deletions

View File

@ -31,8 +31,6 @@ public class commands extends JavaPlugin {
String pName = p.getDisplayName(); String pName = p.getDisplayName();
p.sendMessage(greetprefix + ChatColor.AQUA + "Hello " + pName+"! " ); p.sendMessage(greetprefix + ChatColor.AQUA + "Hello " + pName+"! " );
if (p.isOp()) { if (p.isOp()) {
p.sendMessage(greetprefix+ChatColor.GREEN +"You are an Operator"); p.sendMessage(greetprefix+ChatColor.GREEN +"You are an Operator");
//p.giveExp(5); //p.giveExp(5);
@ -41,24 +39,18 @@ public class commands extends JavaPlugin {
p.sendMessage(greetprefix + ChatColor.GREEN +"You are not an Operator"); p.sendMessage(greetprefix + ChatColor.GREEN +"You are not an Operator");
} }
} }
if(cmd.getName().equalsIgnoreCase("count")) { if(cmd.getName().equalsIgnoreCase("count")) {
//p.sendMessage(hesh());
int i = 1; int i = 1;
p.sendMessage(greetprefix + ChatColor.GRAY + "Online Players :"); p.sendMessage(greetprefix + ChatColor.GRAY + "Online Players :");
for(Player player : Bukkit.getOnlinePlayers()) { for(Player player : Bukkit.getOnlinePlayers()) {
p.sendMessage(ChatColor.RED + "" + i + "- " + player.getName()); p.sendMessage(ChatColor.RED + "" + i + "- " + player.getName());
i++; i++;
} }
} }
if(cmd.getName().equalsIgnoreCase("kit1") && p.isOp()) { if(cmd.getName().equalsIgnoreCase("kit1") && p.isOp()) {
p.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE)); p.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
@ -73,6 +65,4 @@ public class commands extends JavaPlugin {
}*/ //failed to respwan (bed obstructed) }*/ //failed to respwan (bed obstructed)
return true; return true;
} }
} }

View File

@ -6,10 +6,13 @@ import org.bukkit.entity.Player;
public class sender { public class sender {
private static final String PREFIX = ChatColor.AQUA + "[" + ChatColor.BLUE + "greet" + ChatColor.AQUA + "] "; //[ greet ] 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); /** Sends a chat message to the Player*/
public static void sendToPlayer(Player player, String msg, ChatColor color) {
player.sendMessage( PREFIX + color + msg);
} }
/**Sends a chat message to all online players*/
public static void sendToAll() {} public static void sendToAll() {}