refactor: significantly refactor internals, remove Sponge (#708)

* feat: start database refactor

Adds database migrations

* refactor: refactor database system

Now supports migrations

* refactor: begin major internals rewrite

move to using provider-style interfaces similar to huskclaims
bukkit done, still need to do fabric and sponge

* refactor: remove sponge, checkstyle

Low usage and high maintenance time cost. We will examine Forge instead in the future.

* refactor: implement refactoring changes on fabric

also fix various refactor quirks on Bukkit

* refactor: tidy metrics logic

* build: bump deps
This commit is contained in:
William authored and GitHub committed 2024-10-28 20:49:57 +00:00
1 parent 05bcad9249
commit ffe995ef5f
162 files changed
+3890 -5730

No files matched your search

@@ -30,10 +30,15 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Optional;
public class TpOfflineCommand extends InGameCommand implements UserListTabProvider {
public class TpOfflineCommand extends InGameCommand implements UserListTabCompletable {
protected TpOfflineCommand(@NotNull HuskHomes plugin) {
super("tpoffline", List.of(), "<player>", plugin);
super(
List.of("tpoffline"),
"<player>",
plugin
);
setOperatorCommand(true);
}
@@ -47,7 +52,7 @@ public class TpOfflineCommand extends InGameCommand implements UserListTabProvid
}
final Optional<User> targetUserData = plugin.getDatabase()
.getUserDataByName(optionalUser.get())
.getUser(optionalUser.get())
.map(SavedUser::getUser);
if (targetUserData.isEmpty()) {
plugin.getLocales().getLocale("error_player_not_found", optionalUser.get())
@@ -61,12 +66,12 @@ public class TpOfflineCommand extends InGameCommand implements UserListTabProvid
private void teleportToOfflinePosition(@NotNull OnlineUser user, @NotNull User target, @NotNull String[] args) {
final Optional<Position> position = plugin.getDatabase().getOfflinePosition(target);
if (position.isEmpty()) {
plugin.getLocales().getLocale("error_no_offline_position", target.getUsername())
plugin.getLocales().getLocale("error_no_offline_position", target.getName())
.ifPresent(user::sendMessage);
return;
}
plugin.getLocales().getLocale("teleporting_offline_player", target.getUsername())
plugin.getLocales().getLocale("teleporting_offline_player", target.getName())
.ifPresent(user::sendMessage);
Teleport.builder(plugin)
.teleporter(user)