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

Merge pull request #4 from HeshamTB/dev

Dev
This commit is contained in:
HeshamTB 2018-05-03 14:54:04 +03:00 committed by GitHub
commit 5fcd47575d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 39 deletions

View File

@ -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);
@ -40,38 +38,25 @@ public class commands extends JavaPlugin {
else {
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")) {
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);
}
}
if(cmd.getName().equalsIgnoreCase("kit1") && p.isOp()) {
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;
}
}

View File

@ -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() {}