mirror of
https://bitbucket.org/HeshamTB/greet.git
synced 2024-12-25 20:25:30 +01:00
commit
5fcd47575d
@ -31,8 +31,6 @@ public class commands extends JavaPlugin {
|
||||
|
||||
String pName = p.getDisplayName();
|
||||
p.sendMessage(greetprefix + ChatColor.AQUA + "Hello " + pName+"! " );
|
||||
|
||||
|
||||
if (p.isOp()) {
|
||||
p.sendMessage(greetprefix+ChatColor.GREEN +"You are an Operator");
|
||||
//p.giveExp(5);
|
||||
@ -41,37 +39,24 @@ public class commands extends JavaPlugin {
|
||||
|
||||
p.sendMessage(greetprefix + ChatColor.GREEN +"You are not an Operator");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(cmd.getName().equalsIgnoreCase("count")) {
|
||||
//p.sendMessage(hesh());
|
||||
|
||||
int i = 1;
|
||||
p.sendMessage(greetprefix + ChatColor.GRAY + "Online Players :");
|
||||
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
|
||||
p.sendMessage(ChatColor.RED + "" + i + "- " + player.getName());
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if(cmd.getName().equalsIgnoreCase("kit1") && p.isOp()) {
|
||||
|
||||
if(cmd.getName().equalsIgnoreCase("kit1")) {
|
||||
ItemStack kit1p = new ItemStack(Material.STONE_PICKAXE);
|
||||
ItemStack kit1s = new ItemStack(Material.STONE_SWORD);
|
||||
ItemStack kit1a = new ItemStack(Material.STONE_AXE);
|
||||
ItemStack kit1t = new ItemStack(Material.TORCH,5);
|
||||
|
||||
p.sendMessage( greetprefix + ChatColor.AQUA + "Survival Kit");
|
||||
|
||||
p.getInventory().addItem(kit1p);
|
||||
p.getInventory().addItem(kit1s);
|
||||
p.getInventory().addItem(kit1a);
|
||||
p.getInventory().addItem(kit1t);
|
||||
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
}
|
||||
/*if(cmd.getName().equalsIgnoreCase("setspwan")) { // TODO: give option of new arg to set cords &
|
||||
p.setBedSpawnLocation(p.getLocation());
|
||||
@ -80,14 +65,4 @@ public class commands extends JavaPlugin {
|
||||
}*/ //failed to respwan (bed obstructed)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public String hesh() {
|
||||
String Players;
|
||||
Players = Bukkit.getServer().getOnlinePlayers().toString();
|
||||
|
||||
|
||||
return Players;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,18 @@
|
||||
package i.hesh.greet;
|
||||
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.ChatColor;
|
||||
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);
|
||||
|
||||
/** 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() {}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user