mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
edit home, warp commands, manager methods that accept warps/homes
This commit is contained in:
11 files changed
+299
-443
No files matched your search
@@ -43,7 +43,7 @@ public abstract class SavedPositionCommand<T extends SavedPosition> extends Comm
|
||||
final Optional<?> position = (positionType == Home.class
|
||||
? resolveHome(executor, name.get())
|
||||
: resolveWarp(executor, name.get()));
|
||||
position.ifPresent(p -> execute(executor, (T) p, args));
|
||||
position.ifPresent(p -> execute(executor, (T) p, removeFirstArg(args)));
|
||||
}
|
||||
|
||||
public abstract void execute(@NotNull CommandUser executor, @NotNull T position, @NotNull String[] arguments);
|
||||
@@ -52,7 +52,7 @@ public abstract class SavedPositionCommand<T extends SavedPosition> extends Comm
|
||||
if (homeName.contains(".")) {
|
||||
final String[] splitHomeName = homeName.split("\\.");
|
||||
final Optional<Home> optionalHome = plugin.getDatabase().getUserDataByName(splitHomeName[0])
|
||||
.flatMap(owner -> plugin.getDatabase().getHome(owner.user(), splitHomeName[1]));
|
||||
.flatMap(owner -> plugin.getDatabase().getHome(owner.getUser(), splitHomeName[1]));
|
||||
|
||||
if (optionalHome.isEmpty()) {
|
||||
plugin.getLocales().getLocale(executor.hasPermission(getOtherPermission())
|
||||
|
||||
Reference in new issue
Block a user