Skip to content

Commit

Permalink
minor fix to broadcast & added list & fpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob S committed Jul 21, 2021
1 parent 816fab0 commit 3d5cb59
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;

import java.util.ArrayList;


public class snwcommands implements CommandExecutor {
Expand Down Expand Up @@ -609,7 +610,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
for (World w : Bukkit.getWorlds()) {
for (Player p : w.getPlayers()) {
p.sendMessage((""));
p.sendMessage("§3[§dParadisu Broadcast §bツ§3] §f§l» " + allArgs);
p.sendMessage("§3§l[§dParadisu Broadcast §bツ§3§l] §f§l» " + allArgs);
p.sendMessage((""));
}
}
Expand Down Expand Up @@ -703,6 +704,71 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
} else {player.sendMessage("§3[§dParadisu §bツ§3] §7You do not have permission to use that command."); }
return true;

case "list":
if (player.hasPermission("snw.list")) {
ArrayList<String> owners = new ArrayList<>();
ArrayList<String> devs = new ArrayList<>();
ArrayList<String> builders = new ArrayList<>();
ArrayList<String> staff = new ArrayList<>();
ArrayList<String> supporters = new ArrayList<>();
ArrayList<String> visitors = new ArrayList<>();
ArrayList<String> unknown = new ArrayList<>();
World w = Bukkit.getWorld("SuperNW");
Integer onlineammount = Bukkit.getOnlinePlayers().size();

for (Player all : Bukkit.getOnlinePlayers()) {

if (all.hasPermission("displayname.owner")) {
owners.add(all.getName());
} else if (all.hasPermission("displayname.dev")) {
devs.add(all.getName());
} else if (all.hasPermission("displayname.builder")) {
builders.add(all.getName());
} else if (all.hasPermission("displayname.staff")) {
staff.add(all.getName());
} else if (all.hasPermission("displayname.supporter")) {
supporters.add(all.getName());
} else if (all.hasPermission("displayname.visitor")) {
visitors.add(all.getName());
} else {
unknown.add(all.getName());
}

player.sendMessage("§3§l============ §d§oOnline Players §3§l============\n" +
" \n" +
"§3\uE006 §d»§f " + owners + "\n" +
"§e\uE002 §d»§f " + devs + "\n" +
"§c\uE001 §d»§f " + builders + "\n" +
"§a\uE005 §d»§f " + staff + "\n" +
"§d\uE008 §d»§f " + supporters + "\n" +
"§7\uE00A §d»§f " + visitors + "\n" );
}
} else {player.sendMessage("§3[§dParadisu §bツ§3] §7You do not have permission to use that command."); }
return true;

case "findplayercords":
if (player.hasPermission("snw.findplayercords")) {
if (args.length == 1) {
Player target = Bukkit.getPlayerExact(args[0]);
Location targetlocation = target.getLocation();
Integer tx = targetlocation.getBlockX();
Integer ty = targetlocation.getBlockY();
Integer tz = targetlocation.getBlockZ();
String tw = targetlocation.getWorld().getName();



player.sendMessage("§3[§dParadisu §bツ§3] §fThe player§3 " + args[0] + " §fis in §3" + tw + "§f at" +
" §3X » §d§o" + tx +
" §3Y » §d§o" + ty +
" §3Z » §d§o" + tz + "§f.");


} else { player.sendMessage("§3[§dParadisu §bツ§3] §fNot enough or too many args."); }
} else {player.sendMessage("§3[§dParadisu §bツ§3] §7You do not have permission to use that command."); }
return true;


default:
return false;
//complain
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/me/jakedadream/ParadisuPlugin/paradisumain.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public void onEnable() {
getCommand("sudo").setExecutor(new snwcommands());
getCommand("whomademe").setExecutor(new snwcommands());
getCommand("tempcmd").setExecutor(new snwcommands());
getCommand("list").setExecutor(new snwcommands());
getCommand("findplayercords").setExecutor(new snwcommands());
//
//
// getCommand("XYZ").setExecutor(new generalcommands());
Expand Down
13 changes: 11 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ParadisuPlugin
version: 2.2.1
version: 2.3.0
authors: [JakeDaDream, RealInstantRamen, andyinnie, _Kastle]
main: me.jakedadream.ParadisuPlugin.paradisumain
api-version: 1.16
Expand Down Expand Up @@ -151,4 +151,13 @@ commands:
usage: /<command>
tempcmd:
description: made for testing stuff idk
usage: /<command>
usage: /<command>
list:
description: makes a list of all online players
usage: /<command>
findplayercords:
description: finds a players world and cords
usage: /<commands> <args>
aliases:
- fpc
- findpc

0 comments on commit 3d5cb59

Please sign in to comment.