mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Start refactor work
This commit is contained in:
1 parent
6a8851a446
commit
3e1ec09487
51 files changed
+2397
-2474
No files matched your search
@@ -173,13 +173,13 @@ public class Teleport {
|
||||
|
||||
// Dispatch the teleport event and update the player's last position
|
||||
plugin.getEventDispatcher().dispatchTeleportEvent(this);
|
||||
if (updateLastPosition && !plugin.getSettings().backCommandSaveOnTeleportEvent && type == TeleportType.TELEPORT) {
|
||||
if (updateLastPosition && !plugin.getSettings().isBackCommandSaveOnTeleportEvent() && type == TeleportType.TELEPORT) {
|
||||
plugin.getDatabase().setLastPosition(teleporter, teleporter.getPosition());
|
||||
}
|
||||
|
||||
// If the target position is local, finalize economy transactions and teleport the player
|
||||
if (!plugin.getSettings().crossServer || target.server.equals(plugin.getServerName())) {
|
||||
return teleporter.teleportLocally(target, plugin.getSettings().asynchronousTeleports);
|
||||
if (!plugin.getSettings().isCrossServer() || target.server.equals(plugin.getServerName())) {
|
||||
return teleporter.teleportLocally(target, plugin.getSettings().isAsynchronousTeleports());
|
||||
}
|
||||
|
||||
// If the target position is on another server, execute a cross-server teleport
|
||||
|
||||
@@ -89,7 +89,7 @@ public class TeleportBuilder {
|
||||
.findOnlinePlayer(teleporterUsername)
|
||||
.map(onlineUser -> (User) onlineUser)
|
||||
.or(() -> {
|
||||
if (plugin.getSettings().crossServer) {
|
||||
if (plugin.getSettings().isCrossServer()) {
|
||||
return plugin.getMessenger()
|
||||
.findPlayer(executor, teleporterUsername).join()
|
||||
.map(username -> new User(UUID.randomUUID(), username));
|
||||
@@ -208,7 +208,7 @@ public class TeleportBuilder {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
final User teleporter = this.teleporter.join();
|
||||
final Position target = this.target.join();
|
||||
final int warmupTime = plugin.getSettings().teleportWarmupTime;
|
||||
final int warmupTime = plugin.getSettings().getTeleportWarmupTime();
|
||||
|
||||
if (!(teleporter instanceof OnlineUser onlineUser)) {
|
||||
throw new IllegalStateException("Timed teleports can only be executed for local users");
|
||||
@@ -232,7 +232,7 @@ public class TeleportBuilder {
|
||||
if (localPlayer.isPresent()) {
|
||||
return CompletableFuture.supplyAsync(() -> Optional.of(localPlayer.get().getPosition()));
|
||||
}
|
||||
if (plugin.getSettings().crossServer) {
|
||||
if (plugin.getSettings().isCrossServer()) {
|
||||
return plugin.getMessenger()
|
||||
.findPlayer(executor, playerName)
|
||||
.thenApplyAsync(foundPlayer -> {
|
||||
|
||||
@@ -180,7 +180,7 @@ public class TimedTeleport extends Teleport {
|
||||
* @param message the message to send
|
||||
*/
|
||||
private void sendStatusMessage(@NotNull MineDown message) {
|
||||
switch (plugin.getSettings().teleportWarmupDisplay) {
|
||||
switch (plugin.getSettings().getTeleportWarmupDisplay()) {
|
||||
case ACTION_BAR -> teleporter.sendActionBar(message);
|
||||
case SUBTITLE -> teleporter.sendTitle(message, true);
|
||||
case TITLE -> teleporter.sendTitle(message, false);
|
||||
|
||||
Reference in new issue
Block a user