mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Add HomeListEvent and WarpListEvent
This commit is contained in:
1 parent
fbe82a46a0
commit
5f3958bb5b
14 files changed
+310
-70
No files matched your search
@@ -33,8 +33,9 @@ public class PublicHomeCommand extends CommandBase implements TabCompletable, Co
|
||||
return;
|
||||
}
|
||||
|
||||
onlineUser.sendMessage(plugin.getCache().getPublicHomeList(onlineUser, plugin.getLocales(), publicHomes,
|
||||
plugin.getSettings().listItemsPerPage, 1));
|
||||
plugin.getCache().getPublicHomeList(onlineUser, plugin.getLocales(),
|
||||
publicHomes, plugin.getSettings().listItemsPerPage, 1)
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
});
|
||||
case 1 -> {
|
||||
final String homeName = args[0];
|
||||
@@ -92,7 +93,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompletable, Co
|
||||
}
|
||||
|
||||
plugin.getLoggingAdapter().log(Level.INFO, "Teleporting " + playerToTeleport.username + " to "
|
||||
+ home.owner.username + "." + home.meta.name);
|
||||
+ home.owner.username + "." + home.meta.name);
|
||||
plugin.getTeleportManager().teleport(playerToTeleport, home)
|
||||
.thenAccept(result -> plugin.getTeleportManager().finishTeleport(playerToTeleport, result));
|
||||
});
|
||||
@@ -107,7 +108,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompletable, Co
|
||||
return args.length > 1 ? Collections.emptyList() : publicHomes
|
||||
.stream()
|
||||
.filter(publicHomeIdentifier -> publicHomeIdentifier.split(Pattern.quote("."))[1].toLowerCase()
|
||||
.startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
||||
.startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user