mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
feat: actually set the world spawn on /setspawn, close #622
This commit is contained in:
8 files changed
+48
-7
No files matched your search
@@ -161,6 +161,13 @@ public interface HuskHomes extends Task.Supplier, EventDispatcher, SafetyResolve
|
||||
: getServerSpawn().map(spawn -> spawn.getPosition(getServerName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the spawn position of a world on the server.
|
||||
*
|
||||
* @param position The new spawn world and coordinates.
|
||||
*/
|
||||
void setWorldSpawn(@NotNull Position position);
|
||||
|
||||
/**
|
||||
* Returns the {@link Server} the plugin is on.
|
||||
*
|
||||
|
||||
@@ -30,7 +30,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class EditHomeCommand extends SavedPositionCommand<Home> {
|
||||
|
||||
@@ -29,7 +29,9 @@ import net.william278.huskhomes.util.TransactionResolver;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class RtpCommand extends Command implements UserListTabProvider {
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public class SetSpawnCommand extends InGameCommand {
|
||||
} else {
|
||||
plugin.setServerSpawn(position);
|
||||
}
|
||||
plugin.runSync(() -> plugin.setWorldSpawn(position));
|
||||
} catch (ValidationException e) {
|
||||
e.dispatchWarpError(executor, plugin, global.getWarpName());
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user