mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
More work on commands
This commit is contained in:
33 files changed
+445
-382
No files matched your search
@@ -11,6 +11,7 @@ import java.util.Optional;
|
||||
|
||||
public class WarpsManager {
|
||||
private final HuskHomes plugin;
|
||||
|
||||
protected WarpsManager(@NotNull HuskHomes plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@@ -53,7 +54,14 @@ public class WarpsManager {
|
||||
}
|
||||
|
||||
public void relocateWarp(@NotNull String name, @NotNull Position position) {
|
||||
createWarp(name, position, true);
|
||||
final Optional<Warp> optionalWarp = plugin.getDatabase().getWarp(name);
|
||||
if (optionalWarp.isEmpty()) {
|
||||
throw new ValidationException(ValidationException.Type.NOT_FOUND);
|
||||
}
|
||||
|
||||
final Warp warp = optionalWarp.get();
|
||||
warp.update(position);
|
||||
plugin.getDatabase().saveWarp(warp);
|
||||
}
|
||||
|
||||
public void renameHome(@NotNull String name, @NotNull String newName) throws ValidationException {
|
||||
|
||||
Reference in new issue
Block a user