Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
use nextEntityOrSender in /nu project
Browse files Browse the repository at this point in the history
  • Loading branch information
Librazy committed Feb 11, 2019
1 parent 328b7be commit 8935510
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/main/java/cat/nyaa/nyaautils/CommandHandler.java
Expand Up @@ -157,29 +157,7 @@ public void commandProject(CommandSender sender, Arguments args) {
double pitch = args.nextDouble();
double speed = args.nextDouble();
int duration = args.nextInt();
String pName = args.next();
Entity ent;
final Entity p;
UUID uid;
if (pName == null) {
if (sender instanceof Player) {
pName = ((Player) sender).getUniqueId().toString();
} else {
sender.sendMessage(I18n.format("user.project.missing_name"));
return;
}
}
try {
uid = UUID.fromString(pName);
ent = Bukkit.getEntity(uid);
} catch (Exception e) {
ent = Bukkit.getPlayer(pName);
if (ent == null) {
sender.sendMessage(I18n.format("user.project.player_not_online", pName));
return;
}
}
p = ent;
final Entity p = args.nextEntityOrSender();

new BukkitRunnable() {
final int d = duration;
Expand Down

0 comments on commit 8935510

Please sign in to comment.