diff --git a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java
index e1d7f75d..8a2cf55f 100644
--- a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java
+++ b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java
@@ -36,7 +36,6 @@ import org.bukkit.Bukkit;
import org.bukkit.ChunkSnapshot;
import org.bukkit.Material;
import org.bukkit.entity.Player;
-import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
@@ -52,6 +51,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Consumer;
import java.util.logging.Level;
import java.util.stream.Collectors;
@@ -72,7 +72,7 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
private Spawn serverSpawn;
private UnsafeBlocks unsafeBlocks;
private Set pluginHooks;
- private List registeredCommands;
+ private List commands;
private Server server;
@Nullable
@@ -98,57 +98,54 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
public void onEnable() {
// Initialize HuskHomes
final AtomicBoolean initialized = new AtomicBoolean(true);
- try {
- // Create adventure audience
- this.audiences = BukkitAudiences.create(this);
+ // Create adventure audience
+ this.audiences = BukkitAudiences.create(this);
- // Load settings and locales
- log(Level.INFO, "Loading plugin configuration settings & locales...");
- initialized.set(reload());
- if (initialized.get()) {
- log(Level.INFO, "Successfully loaded plugin configuration settings & locales");
- } else {
- throw new IllegalStateException("Failed to load plugin configuration settings and/or locales");
- }
+ // Load settings and locales
+ log(Level.INFO, "Loading plugin configuration settings & locales...");
+ initialized.set(reload());
+ if (initialized.get()) {
+ log(Level.INFO, "Successfully loaded plugin configuration settings & locales");
+ } else {
+ throw new IllegalStateException("Failed to load plugin configuration settings and/or locales");
+ }
- // Initialize the database
- log(Level.INFO, "Attempting to establish connection to the database...");
- final Database.DatabaseType databaseType = settings.getDatabaseType();
- this.database = switch (databaseType == null ? Database.DatabaseType.MYSQL : databaseType) {
- case MYSQL -> new MySqlDatabase(this);
- case SQLITE -> new SqLiteDatabase(this);
- };
- initialized.set(this.database.initialize());
- if (initialized.get()) {
- log(Level.INFO, "Successfully established a connection to the database");
- } else {
- throw new IllegalStateException("Failed to establish a connection to the database. " + "Please check the supplied database credentials in the config file");
- }
+ // Initialize the database
+ log(Level.INFO, "Attempting to establish connection to the database...");
+ final Database.DatabaseType databaseType = settings.getDatabaseType();
+ this.database = switch (databaseType == null ? Database.DatabaseType.MYSQL : databaseType) {
+ case MYSQL -> new MySqlDatabase(this);
+ case SQLITE -> new SqLiteDatabase(this);
+ };
+ initialized.set(this.database.initialize());
+ if (initialized.get()) {
+ log(Level.INFO, "Successfully established a connection to the database");
+ } else {
+ throw new IllegalStateException("Failed to establish a connection to the database. " +
+ "Please check the supplied database credentials in the config file");
+ }
- // Initialize the network messenger if proxy mode is enabled
- if (getSettings().isCrossServer()) {
- log(Level.INFO, "Initializing the network messenger...");
+ // Initialize the network messenger if proxy mode is enabled
+ if (getSettings().isCrossServer()) {
+ initialize("message broker", (plugin) -> {
broker = switch (settings.getBrokerType()) {
case PLUGIN_MESSAGE -> new PluginMessageBroker(this);
case REDIS -> new RedisBroker(this);
};
broker.initialize();
- log(Level.INFO, "Successfully initialized the network messenger.");
- }
+ });
+ }
- // Prepare the validator
- this.validator = new Validator(this);
+ // Prepare the validator
+ this.validator = new Validator(this);
+ this.cache = new Cache(this);
+ this.manager = new Manager(this);
- // Initialize the cache
- this.cache = new Cache(this);
+ // Initialize the RTP engine with the default normal distribution engine
+ setRandomTeleportEngine(new NormalDistributionEngine(this));
- // Prepare the home and warp position manager
- this.manager = new Manager(this);
-
- // Initialize the RTP engine with the default normal distribution engine
- setRandomTeleportEngine(new NormalDistributionEngine(this));
-
- // Register plugin hooks (Economy, Maps, Plan)
+ // Register plugin hooks (Economy, Maps, Plan)
+ initialize("hooks", (plugin) -> {
this.pluginHooks = new HashSet<>();
if (settings.doEconomy()) {
if (Bukkit.getPluginManager().getPlugin("RedisEconomy") != null) {
@@ -178,66 +175,46 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
if (pluginHooks.size() > 0) {
pluginHooks.forEach(PluginHook::initialize);
- log(Level.INFO, "Registered " + pluginHooks.size() + " plugin hooks: " + pluginHooks.stream().map(PluginHook::getHookName).collect(Collectors.joining(", ")));
+ log(Level.INFO, "Registered " + pluginHooks.size() + " plugin hooks: " + pluginHooks.stream()
+ .map(PluginHook::getHookName)
+ .collect(Collectors.joining(", ")));
}
+ });
- // Register events
- log(Level.INFO, "Registering events...");
- this.eventListener = new BukkitEventListener(this);
- log(Level.INFO, "Successfully registered events listener");
+ // Register events
+ initialize("events", (plugin) -> this.eventListener = new BukkitEventListener(this));
- // Register permissions
- log(Level.INFO, "Registering permissions & commands...");
- Arrays.stream(Permission.values()).forEach(permission -> getServer().getPluginManager().addPermission(new org.bukkit.permissions.Permission(permission.node, switch (permission.defaultAccess) {
- case EVERYONE -> PermissionDefault.TRUE;
- case NOBODY -> PermissionDefault.FALSE;
- case OPERATORS -> PermissionDefault.OP;
- })));
+ // Register commands
+ initialize("commands", (plugin) -> this.commands = Arrays.stream(BukkitCommand.Type.values())
+ .map(type -> {
+ final Command command = type.getCommand();
+ if (settings.isCommandDisabled(command)) {
+ new BukkitCommand(new DisabledCommand(this), this).register();
+ return null;
+ } else {
+ new BukkitCommand(command, this).register();
+ return type.getCommand();
+ }
+ })
+ .filter(Objects::nonNull)
+ .collect(Collectors.toList()));
- // Register commands
- this.registeredCommands = new ArrayList<>();
- Arrays.stream(BukkitCommand.Type.values()).forEach(commandType -> {
- // If the command is disabled, use the disabled CommandBase
- if (settings.getDisabledCommands().stream().anyMatch(disabledCommand -> {
- final String command = (disabledCommand.startsWith("/") ? disabledCommand.substring(1) : disabledCommand);
- return command.equalsIgnoreCase(commandType.getCommand().getName()) || commandType.getCommand().getAliases().stream().anyMatch(alias -> alias.equalsIgnoreCase(command));
- })) {
- new BukkitCommand(new DisabledCommand(this), this).register();
- return;
- }
+ // Hook into bStats metrics
+ initialize("metrics", (plugin) -> this.registerMetrics(METRICS_ID));
- // Otherwise, register the command
- final Command command = commandType.getCommand();
- this.registeredCommands.add(command);
- new BukkitCommand(command, this).register();
- });
- log(Level.INFO, "Successfully registered permissions & commands.");
-
- // Hook into bStats metrics
- registerMetrics(METRICS_ID);
-
- // Check for updates
- if (settings.doCheckForUpdates()) {
- log(Level.INFO, "Checking for updates...");
- getLatestVersionIfOutdated().thenAccept(newestVersion -> newestVersion.ifPresent(newVersion -> log(Level.WARNING, "An update is available for HuskHomes, v" + newVersion + " (Currently running v" + getVersion() + ")")));
- }
- } catch (IllegalStateException exception) {
- log(Level.SEVERE, exception.getMessage());
- initialized.set(false);
- } catch (Exception exception) {
- log(Level.SEVERE, "An unhandled exception occurred initializing HuskHomes!", exception);
- initialized.set(false);
- } finally {
- // Validate initialization
- if (initialized.get()) {
- log(Level.INFO, "Successfully enabled HuskHomes v" + getVersion());
- } else {
- log(Level.SEVERE, "Failed to initialize HuskHomes. The plugin will now be disabled");
- getServer().getPluginManager().disablePlugin(this);
- }
+ // Check for updates
+ if (settings.doCheckForUpdates()) {
+ log(Level.INFO, "Checking for updates...");
+ getLatestVersionIfOutdated().thenAccept(newestVersion -> newestVersion.ifPresent(newVersion -> log(Level.WARNING, "An update is available for HuskHomes, v" + newVersion + " (Currently running v" + getVersion() + ")")));
}
}
+ private void initialize(@NotNull String name, @NotNull Consumer runner) {
+ log(Level.INFO, "Initializing " + name + "...");
+ runner.accept(this);
+ log(Level.INFO, "Successfully initialized " + name);
+ }
+
@Override
public void onDisable() {
if (this.eventListener != null) {
@@ -339,19 +316,17 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
@Override
public void setServerSpawn(@NotNull Location location) {
- final Spawn newSpawn = new Spawn(location);
- this.serverSpawn = newSpawn;
try {
- Annotaml.create(new File(getDataFolder(), "spawn.yml"), newSpawn);
- } catch (IOException e) {
+ this.serverSpawn = Annotaml.create(new File(getDataFolder(), "spawn.yml"), new Spawn(location)).get();
+
+ // Update the world spawn location, too
+ BukkitAdapter.adaptLocation(location).ifPresent(bukkitLocation -> {
+ assert bukkitLocation.getWorld() != null;
+ bukkitLocation.getWorld().setSpawnLocation(bukkitLocation);
+ });
+ } catch (IOException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
log(Level.WARNING, "Failed to save server spawn to disk", e);
}
-
- // Update the world spawn location, too
- BukkitAdapter.adaptLocation(location).ifPresent(bukkitLocation -> {
- assert bukkitLocation.getWorld() != null;
- bukkitLocation.getWorld().setSpawnLocation(bukkitLocation);
- });
}
@Override
@@ -401,7 +376,7 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
@Override
@NotNull
public List getCommands() {
- return registeredCommands;
+ return commands;
}
@Override
@@ -496,7 +471,7 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
@Override
public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, byte[] message) {
if (broker != null && broker instanceof PluginMessageBroker pluginMessenger
- && getSettings().getBrokerType() == Broker.Type.PLUGIN_MESSAGE) {
+ && getSettings().getBrokerType() == Broker.Type.PLUGIN_MESSAGE) {
pluginMessenger.onReceive(channel, BukkitUser.adapt(player), message);
}
}
diff --git a/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java b/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java
index ac19b423..5c36e097 100644
--- a/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java
+++ b/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java
@@ -43,6 +43,8 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
final PluginCommand pluginCommand = Objects.requireNonNull(plugin.getCommand(command.getName()));
pluginCommand.setExecutor(this);
pluginCommand.setTabCompleter(this);
+ pluginCommand.setDescription(command.getDescription());
+ pluginCommand.setPermission(command.getPermission());
// Register commodore TAB completion
if (CommodoreProvider.isSupported() && plugin.getSettings().doBrigadierTabCompletion()) {
diff --git a/bukkit/src/main/java/net/william278/huskhomes/user/BukkitUser.java b/bukkit/src/main/java/net/william278/huskhomes/user/BukkitUser.java
index 35bb82c8..d4abe5e2 100644
--- a/bukkit/src/main/java/net/william278/huskhomes/user/BukkitUser.java
+++ b/bukkit/src/main/java/net/william278/huskhomes/user/BukkitUser.java
@@ -5,7 +5,7 @@ import net.kyori.adventure.audience.Audience;
import net.william278.huskhomes.BukkitHuskHomes;
import net.william278.huskhomes.position.Location;
import net.william278.huskhomes.position.Position;
-import net.william278.huskhomes.teleport.TeleportResult;
+import net.william278.huskhomes.teleport.TeleportationException;
import net.william278.huskhomes.util.BukkitAdapter;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -16,7 +16,6 @@ import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
@@ -24,18 +23,7 @@ import java.util.stream.Collectors;
*/
public class BukkitUser extends OnlineUser {
- /**
- * Number of ticks to wait before {@link #sendPluginMessage(String, byte[]) sending a plugin message}.
- *
- * This is needed because it is not possible to have players dispatch plugin messages in certain circumstance,
- * such as on the tick that they join the server.
- */
- private static final long PLUGIN_MESSAGE_DISPATCH_DELAY = 3L;
-
- // Instance of the implementing plugin
private final BukkitHuskHomes plugin;
-
- // The Bukkit player
private final Player player;
private BukkitUser(@NotNull Player player) {
@@ -55,20 +43,6 @@ public class BukkitUser extends OnlineUser {
return new BukkitUser(player);
}
- /**
- * Get an online {@link BukkitUser} by their exact username
- *
- * @param username the UUID of the player to find
- * @return an {@link Optional} containing the {@link BukkitUser} if found; {@link Optional#empty()} otherwise
- */
- public static Optional get(@NotNull String username) {
- final Player player = Bukkit.getPlayerExact(username);
- if (player != null) {
- return Optional.of(adapt(player));
- }
- return Optional.empty();
- }
-
@Override
public Position getPosition() {
return new Position(BukkitAdapter.adaptLocation(player.getLocation())
@@ -95,10 +69,13 @@ public class BukkitUser extends OnlineUser {
@Override
- public @NotNull Map getPermissions() {
- return player.getEffectivePermissions().stream().collect(
- Collectors.toMap(PermissionAttachmentInfo::getPermission,
- PermissionAttachmentInfo::getValue, (a, b) -> b));
+ @NotNull
+ public Map getPermissions() {
+ return player.getEffectivePermissions().stream()
+ .collect(Collectors.toMap(
+ PermissionAttachmentInfo::getPermission,
+ PermissionAttachmentInfo::getValue, (a, b) -> b
+ ));
}
@Override
@@ -108,38 +85,43 @@ public class BukkitUser extends OnlineUser {
}
@Override
- public CompletableFuture teleportLocally(@NotNull Location location, boolean asynchronous) {
- final Optional bukkitLocation = BukkitAdapter.adaptLocation(location);
- if (bukkitLocation.isEmpty()) {
- return CompletableFuture.completedFuture(TeleportResult.FAILED_INVALID_WORLD);
+ public void teleportLocally(@NotNull Location location, boolean asynchronous) throws TeleportationException {
+ final Optional resolvedLocation = BukkitAdapter.adaptLocation(location);
+ if (resolvedLocation.isEmpty() || resolvedLocation.get().getWorld() == null) {
+ throw new TeleportationException(TeleportationException.Type.WORLD_NOT_FOUND);
}
- assert bukkitLocation.get().getWorld() != null;
- if (!bukkitLocation.get().getWorld().getWorldBorder().isInside(bukkitLocation.get())) {
- return CompletableFuture.completedFuture(TeleportResult.FAILED_ILLEGAL_COORDINATES);
+
+ final org.bukkit.Location bukkitLocation = resolvedLocation.get();
+ if (!bukkitLocation.getWorld().getWorldBorder().isInside(resolvedLocation.get())) {
+ throw new TeleportationException(TeleportationException.Type.ILLEGAL_TARGET_COORDINATES);
}
- final CompletableFuture resultCompletableFuture = new CompletableFuture<>();
+
Bukkit.getScheduler().runTask(plugin, () -> {
if (asynchronous) {
- PaperLib.teleportAsync(player, bukkitLocation.get(), PlayerTeleportEvent.TeleportCause.PLUGIN)
- .thenAccept(result -> resultCompletableFuture.complete(
- result ? TeleportResult.COMPLETED_LOCALLY : TeleportResult.FAILED_INVALID_WORLD));
+ PaperLib.teleportAsync(player, bukkitLocation, PlayerTeleportEvent.TeleportCause.PLUGIN);
} else {
- player.teleport(bukkitLocation.get(), PlayerTeleportEvent.TeleportCause.PLUGIN);
- resultCompletableFuture.complete(TeleportResult.COMPLETED_LOCALLY);
+ player.teleport(bukkitLocation, PlayerTeleportEvent.TeleportCause.PLUGIN);
}
});
- return resultCompletableFuture;
}
+ /**
+ * Get the player momentum and return if they are moving
+ *
+ * @return {@code true} if the player is moving, {@code false} otherwise
+ **/
@Override
public boolean isMoving() {
- // Get the player momentum and return if they are moving
return player.getVelocity().length() >= 0.1;
}
+ /**
+ * Return the value of the player's "vanished" metadata tag if they have it
+ *
+ * @return {@code true} if the player is vanished, {@code false} otherwise
+ */
@Override
public boolean isVanished() {
- // Return the value of the player's "vanished" metadata tag if they have it
return player.getMetadata("vanished")
.stream()
.map(MetadataValue::asBoolean)
@@ -148,14 +130,10 @@ public class BukkitUser extends OnlineUser {
}
/**
- * Send a Bukkit plugin message
- *
- * @implNote This is dispatched after {@link #PLUGIN_MESSAGE_DISPATCH_DELAY a delay} to ensure that the player
- * is ready to send receive messages
+ * Send a Bukkit plugin message to the player
*/
public void sendPluginMessage(@NotNull String channel, final byte[] message) {
- Bukkit.getScheduler().runTaskLater(plugin,
- () -> player.sendPluginMessage(plugin, channel, message), PLUGIN_MESSAGE_DISPATCH_DELAY);
+ player.sendPluginMessage(plugin, channel, message);
}
/**
diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml
index 1460a53c..5b9840a0 100644
--- a/bukkit/src/main/resources/plugin.yml
+++ b/bukkit/src/main/resources/plugin.yml
@@ -28,12 +28,12 @@ commands:
usage: /delhome
edithome:
usage: /edithome [rename|description|relocate|privacy] [args]
- publichome:
- usage: /publichome [.]
- aliases: [phome]
- publichomelist:
- usage: /publichomelist [page]
- aliases: [phomelist, phomes]
+ phome:
+ usage: /phome [.]
+ aliases: [publichome]
+ phomelist:
+ usage: /phomelist [page]
+ aliases: [publichomelist, phomes]
warp:
usage: /warp
setwarp:
diff --git a/common/src/main/java/net/william278/huskhomes/Cache.java b/common/src/main/java/net/william278/huskhomes/Cache.java
index e775c36a..90f3798d 100644
--- a/common/src/main/java/net/william278/huskhomes/Cache.java
+++ b/common/src/main/java/net/william278/huskhomes/Cache.java
@@ -55,15 +55,7 @@ public class Cache {
.filter(player -> !player.isVanished())
.map(User::getUsername)
.toList());
-//todo
-// if (plugin.getSettings().isCrossServer()) {
-// return plugin.getMessenger()
-// .getOnlinePlayerNames(requester)
-// .thenApply(networkedPlayers -> {
-// getPlayers().addAll(Set.of(networkedPlayers));
-// return getPlayers();
-// });
-// }
+
return CompletableFuture.completedFuture(getPlayers());
}
diff --git a/common/src/main/java/net/william278/huskhomes/HuskHomes.java b/common/src/main/java/net/william278/huskhomes/HuskHomes.java
index 52433080..e2c1d99c 100644
--- a/common/src/main/java/net/william278/huskhomes/HuskHomes.java
+++ b/common/src/main/java/net/william278/huskhomes/HuskHomes.java
@@ -325,7 +325,7 @@ public interface HuskHomes extends TaskRunner, EventDispatcher {
default Optional getCommand(@NotNull Class type) {
return getCommands().stream()
- .filter(command -> command.getClass().isInstance(type))
+ .filter(command -> command.getClass() == type)
.findFirst()
.map(type::cast);
}
diff --git a/common/src/main/java/net/william278/huskhomes/command/EditHomeCommand.java b/common/src/main/java/net/william278/huskhomes/command/EditHomeCommand.java
index 2747783f..3140313c 100644
--- a/common/src/main/java/net/william278/huskhomes/command/EditHomeCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/EditHomeCommand.java
@@ -87,6 +87,7 @@ public class EditHomeCommand extends SavedPositionCommand {
}
private void setHomeDescription(@NotNull CommandUser executor, @NotNull Home home, boolean ownerEditing, @NotNull String[] args) {
+ final String oldDescription = home.getMeta().getDescription();
final Optional optionalDescription = parseGreedyString(args, 1);
if (optionalDescription.isEmpty()) {
plugin.getLocales().getLocale("error_invalid_syntax",
@@ -106,11 +107,11 @@ public class EditHomeCommand extends SavedPositionCommand {
}
if (ownerEditing) {
- plugin.getLocales().getLocale("edit_home_update_description", home.getName(), newDescription)
+ plugin.getLocales().getLocale("edit_home_update_description", home.getName(), oldDescription, newDescription)
.ifPresent(executor::sendMessage);
} else {
plugin.getLocales().getLocale("edit_home_update_description_other", home.getOwner().getUsername(),
- home.getName(), newDescription)
+ home.getName(), oldDescription, newDescription)
.ifPresent(executor::sendMessage);
}
});
diff --git a/common/src/main/java/net/william278/huskhomes/command/RtpCommand.java b/common/src/main/java/net/william278/huskhomes/command/RtpCommand.java
index 07cd6664..4ec6581f 100644
--- a/common/src/main/java/net/william278/huskhomes/command/RtpCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/RtpCommand.java
@@ -64,7 +64,7 @@ public class RtpCommand extends Command {
.orElseThrow(() -> new IllegalStateException("No user data found for " + teleporter.getUsername()));
final Instant currentTime = Instant.now();
if (executor.equals(teleporter) && !currentTime.isAfter(user.getRtpCooldown()) &&
- !executor.hasPermission(getPermission("bypass_cooldown"))) {
+ !executor.hasPermission(getPermission("bypass_cooldown"))) {
plugin.getLocales().getLocale("error_rtp_cooldown",
Long.toString(currentTime.until(user.getRtpCooldown(), ChronoUnit.MINUTES) + 1))
.ifPresent(executor::sendMessage);
@@ -74,7 +74,7 @@ public class RtpCommand extends Command {
plugin.getLocales().getLocale("teleporting_random_generation")
.ifPresent(teleporter::sendMessage);
final Optional position = plugin.getRandomTeleportEngine()
- .getRandomPosition(teleporter.getPosition().getWorld(), removeFirstArg(args));
+ .getRandomPosition(teleporter.getPosition().getWorld(), args.length > 1 ? removeFirstArg(args) : args);
if (position.isEmpty()) {
plugin.getLocales().getLocale("error_rtp_randomization_timeout")
.ifPresent(executor::sendMessage);
diff --git a/common/src/main/java/net/william278/huskhomes/command/SetHomeCommand.java b/common/src/main/java/net/william278/huskhomes/command/SetHomeCommand.java
index 8b23ec91..86409654 100644
--- a/common/src/main/java/net/william278/huskhomes/command/SetHomeCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/SetHomeCommand.java
@@ -31,7 +31,10 @@ public class SetHomeCommand extends SetPositionCommand {
plugin.getManager().homes().createHome(setter, event.getName(), event.getPosition());
} catch (ValidationException e) {
e.dispatchHomeError(setter, false, plugin, event.getName());
+ return;
}
+ plugin.getLocales().getLocale("set_home_success", event.getName())
+ .ifPresent(setter::sendMessage);
});
}
diff --git a/common/src/main/java/net/william278/huskhomes/command/SetWarpCommand.java b/common/src/main/java/net/william278/huskhomes/command/SetWarpCommand.java
index 4abdc62d..c923beec 100644
--- a/common/src/main/java/net/william278/huskhomes/command/SetWarpCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/SetWarpCommand.java
@@ -18,7 +18,10 @@ public class SetWarpCommand extends SetPositionCommand {
plugin.getManager().warps().createWarp(event.getName(), event.getPosition());
} catch (ValidationException e) {
e.dispatchWarpError(setter, plugin, event.getName());
+ return;
}
+ plugin.getLocales().getLocale("set_warp_success", event.getName())
+ .ifPresent(setter::sendMessage);
});
}
}
diff --git a/common/src/main/java/net/william278/huskhomes/command/TpaAllCommand.java b/common/src/main/java/net/william278/huskhomes/command/TpaAllCommand.java
index dc70ded8..2cdd7d02 100644
--- a/common/src/main/java/net/william278/huskhomes/command/TpaAllCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/TpaAllCommand.java
@@ -31,7 +31,7 @@ public class TpaAllCommand extends InGameCommand {
}
plugin.getManager().requests().sendTeleportAllRequest(executor);
- plugin.getLocales().getLocale("teleporting_all_players")
+ plugin.getLocales().getLocale("tpaall_request_sent")
.ifPresent(executor::sendMessage);
}
diff --git a/common/src/main/java/net/william278/huskhomes/command/WarpCommand.java b/common/src/main/java/net/william278/huskhomes/command/WarpCommand.java
index 57df6709..b704b4ca 100644
--- a/common/src/main/java/net/william278/huskhomes/command/WarpCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/WarpCommand.java
@@ -4,6 +4,7 @@ import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.position.Warp;
import net.william278.huskhomes.teleport.Teleportable;
import net.william278.huskhomes.user.CommandUser;
+import net.william278.huskhomes.user.OnlineUser;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -15,6 +16,16 @@ public class WarpCommand extends SavedPositionCommand {
super("warp", List.of(), Warp.class, List.of(), plugin);
}
+ @Override
+ public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
+ if (args.length == 0) {
+ plugin.getCommand(WarpListCommand.class)
+ .ifPresent(command -> command.showWarpList(executor, 1));
+ return;
+ }
+ super.execute(executor, args);
+ }
+
@Override
public void execute(@NotNull CommandUser executor, @NotNull Warp warp, @NotNull String[] args) {
if (plugin.getSettings().isPermissionRestrictWarps()) {
diff --git a/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java b/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java
index 0fdaebd7..a23a4d08 100644
--- a/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java
+++ b/common/src/main/java/net/william278/huskhomes/command/WarpListCommand.java
@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
public class WarpListCommand extends ListCommand {
protected WarpListCommand(@NotNull HuskHomes plugin) {
- super("homelist", List.of("homes"), "[player] [page]", plugin);
+ super("warplist", List.of("warps"), "[player] [page]", plugin);
}
@Override
diff --git a/common/src/main/java/net/william278/huskhomes/config/Locales.java b/common/src/main/java/net/william278/huskhomes/config/Locales.java
index fe666b08..259ca5dc 100644
--- a/common/src/main/java/net/william278/huskhomes/config/Locales.java
+++ b/common/src/main/java/net/william278/huskhomes/config/Locales.java
@@ -41,6 +41,9 @@ public class Locales {
* @return An {@link Optional} containing the locale corresponding to the id, if it exists
*/
public Optional getRawLocale(@NotNull String localeId) {
+ if (!rawLocales.containsKey(localeId)) { // debug
+ return Optional.of(localeId + " (missing locale)"); // debug
+ } // debug
return Optional.ofNullable(rawLocales.get(localeId)).map(StringEscapeUtils::unescapeJava);
}
diff --git a/common/src/main/java/net/william278/huskhomes/config/Settings.java b/common/src/main/java/net/william278/huskhomes/config/Settings.java
index 4792ecae..5c60852b 100644
--- a/common/src/main/java/net/william278/huskhomes/config/Settings.java
+++ b/common/src/main/java/net/william278/huskhomes/config/Settings.java
@@ -3,6 +3,7 @@ package net.william278.huskhomes.config;
import net.william278.annotaml.YamlComment;
import net.william278.annotaml.YamlFile;
import net.william278.annotaml.YamlKey;
+import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.database.Database;
import net.william278.huskhomes.hook.EconomyHook;
import net.william278.huskhomes.hook.MapHook;
@@ -490,8 +491,12 @@ public class Settings {
return warpsOnMap;
}
- public List getDisabledCommands() {
- return disabledCommands;
+ public boolean isCommandDisabled(Command type) {
+ return disabledCommands.stream().anyMatch(disabled -> {
+ final String command = (disabled.startsWith("/") ? disabled.substring(1) : disabled);
+ return command.equalsIgnoreCase(type.getName())
+ || type.getAliases().stream().anyMatch(alias -> alias.equalsIgnoreCase(command));
+ });
}
public boolean doBrigadierTabCompletion() {
diff --git a/common/src/main/java/net/william278/huskhomes/listener/EventListener.java b/common/src/main/java/net/william278/huskhomes/listener/EventListener.java
index 05457571..d2b1ff81 100644
--- a/common/src/main/java/net/william278/huskhomes/listener/EventListener.java
+++ b/common/src/main/java/net/william278/huskhomes/listener/EventListener.java
@@ -63,28 +63,30 @@ public class EventListener {
/**
* Handle inbound cross-server teleports
*
- * @param onlineUser user to handle the checks for
+ * @param teleporter user to handle the checks for
*/
- private void handleInboundTeleport(@NotNull OnlineUser onlineUser) {
- plugin.getDatabase().getCurrentTeleport(onlineUser).ifPresent(teleport -> {
+ private void handleInboundTeleport(@NotNull OnlineUser teleporter) {
+ plugin.getDatabase().getCurrentTeleport(teleporter).ifPresent(teleport -> {
if (teleport.getType() == Teleport.Type.RESPAWN) {
- final Optional bedPosition = onlineUser.getBedSpawnPosition();
+ final Optional bedPosition = teleporter.getBedSpawnPosition();
if (bedPosition.isEmpty()) {
plugin.getLocalCachedSpawn()
.map(spawn -> spawn.getPosition(plugin.getServerName()))
- .ifPresent(position -> onlineUser.teleportLocally(position,
+ .ifPresent(position -> teleporter.teleportLocally(position,
plugin.getSettings().isAsynchronousTeleports()));
- onlineUser.sendTranslatableMessage("block.minecraft.spawn.not_valid");
+ teleporter.sendTranslatableMessage("block.minecraft.spawn.not_valid");
} else {
- onlineUser.teleportLocally(bedPosition.get(), plugin.getSettings().isAsynchronousTeleports());
+ teleporter.teleportLocally(bedPosition.get(), plugin.getSettings().isAsynchronousTeleports());
}
- plugin.getDatabase().setCurrentTeleport(onlineUser, null);
- plugin.getDatabase().setRespawnPosition(onlineUser, bedPosition.orElse(null));
+ plugin.getDatabase().setCurrentTeleport(teleporter, null);
+ plugin.getDatabase().setRespawnPosition(teleporter, bedPosition.orElse(null));
return;
}
- onlineUser.teleportLocally((Position) teleport.getTarget(), plugin.getSettings().isAsynchronousTeleports());
- plugin.getDatabase().setCurrentTeleport(onlineUser, null);
+ teleporter.teleportLocally((Position) teleport.getTarget(), plugin.getSettings().isAsynchronousTeleports());
+ plugin.getDatabase().setCurrentTeleport(teleporter, null);
+ plugin.getLocales().getLocale("teleporting_complete")
+ .ifPresent(teleporter::sendMessage);
});
}
@@ -97,14 +99,6 @@ public class EventListener {
// Remove this user's home cache
plugin.getCache().getHomes().remove(onlineUser.getUsername());
- // Update the cached player list using another online player if possible
- plugin.getOnlineUsers()
- .stream()
- .filter(onlinePlayer -> !onlinePlayer.equals(onlineUser))
- .findAny()
- .ifPresent(updater -> plugin.getCache().updatePlayerListCache(plugin, updater));
-
-
// Set offline position
plugin.getDatabase().setOfflinePosition(onlineUser, onlineUser.getPosition());
}
diff --git a/common/src/main/java/net/william278/huskhomes/manager/RequestsManager.java b/common/src/main/java/net/william278/huskhomes/manager/RequestsManager.java
index 40a6a13a..ac2d02ad 100644
--- a/common/src/main/java/net/william278/huskhomes/manager/RequestsManager.java
+++ b/common/src/main/java/net/william278/huskhomes/manager/RequestsManager.java
@@ -163,6 +163,7 @@ public class RequestsManager {
.payload(Payload.withTeleportRequest(request))
.target(targetUser)
.build().send(plugin.getMessenger(), requester);
+ return;
}
throw new IllegalArgumentException("Player not found");
}
diff --git a/common/src/main/java/net/william278/huskhomes/network/Broker.java b/common/src/main/java/net/william278/huskhomes/network/Broker.java
index f4164460..ef82984e 100644
--- a/common/src/main/java/net/william278/huskhomes/network/Broker.java
+++ b/common/src/main/java/net/william278/huskhomes/network/Broker.java
@@ -62,7 +62,7 @@ public abstract class Broker {
*
* @throws RuntimeException if the broker fails to initialize
*/
- public abstract void initialize() throws RuntimeException;
+ public abstract void initialize() throws IllegalStateException;
/**
* Send a message to the broker
diff --git a/common/src/main/java/net/william278/huskhomes/network/PluginMessageBroker.java b/common/src/main/java/net/william278/huskhomes/network/PluginMessageBroker.java
index 99081626..3282ad19 100644
--- a/common/src/main/java/net/william278/huskhomes/network/PluginMessageBroker.java
+++ b/common/src/main/java/net/william278/huskhomes/network/PluginMessageBroker.java
@@ -32,7 +32,7 @@ public class PluginMessageBroker extends Broker {
}
@Override
- public void initialize() throws RuntimeException {
+ public void initialize() throws IllegalStateException {
plugin.initializePluginChannels();
}
diff --git a/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java b/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java
index 76ccc1c3..307bb932 100644
--- a/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java
+++ b/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java
@@ -21,7 +21,7 @@ public class RedisBroker extends PluginMessageBroker {
}
@Override
- public void initialize() throws RuntimeException {
+ public void initialize() throws IllegalStateException {
super.initialize();
final String password = plugin.getSettings().getRedisPassword();
@@ -51,7 +51,7 @@ public class RedisBroker extends PluginMessageBroker {
final Message message = plugin.getGson().fromJson(encodedMessage, Message.class);
plugin.getOnlineUsers().stream()
.filter(online -> message.getTarget().equals(Message.TARGET_ALL)
- || online.getUsername().equals(message.getTarget()))
+ || online.getUsername().equals(message.getTarget()))
.forEach(receiver -> handle(receiver, message));
}
}, getSubChannelId());
diff --git a/common/src/main/java/net/william278/huskhomes/position/Home.java b/common/src/main/java/net/william278/huskhomes/position/Home.java
index 5791bde4..54b7a4df 100644
--- a/common/src/main/java/net/william278/huskhomes/position/Home.java
+++ b/common/src/main/java/net/william278/huskhomes/position/Home.java
@@ -13,10 +13,8 @@ public class Home extends SavedPosition {
private final User owner;
private boolean isPublic;
- public Home(double x, double y, double z, float yaw, float pitch,
- @NotNull World world, @NotNull String server,
- @NotNull PositionMeta positionMeta, @NotNull UUID uuid,
- @NotNull User owner, boolean isPublic) {
+ public Home(double x, double y, double z, float yaw, float pitch, @NotNull World world, @NotNull String server,
+ @NotNull PositionMeta positionMeta, @NotNull UUID uuid, @NotNull User owner, boolean isPublic) {
super(x, y, z, yaw, pitch, world, server, positionMeta, uuid);
this.owner = owner;
this.setPublic(isPublic);
diff --git a/common/src/main/java/net/william278/huskhomes/position/Server.java b/common/src/main/java/net/william278/huskhomes/position/Server.java
index 5570f5b8..3fb3fbc4 100644
--- a/common/src/main/java/net/william278/huskhomes/position/Server.java
+++ b/common/src/main/java/net/william278/huskhomes/position/Server.java
@@ -19,6 +19,7 @@ public class Server {
/**
* Default server identifier
*/
+ @NotNull
public static String getDefaultServerName() {
try {
final Path serverDirectory = Path.of(System.getProperty("user.dir"));
diff --git a/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java b/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java
index 6fa4360d..8e405242 100644
--- a/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java
+++ b/common/src/main/java/net/william278/huskhomes/teleport/Teleport.java
@@ -85,6 +85,8 @@ public class Teleport {
fireEvent((event) -> {
executeEconomyActions();
teleporter.teleportLocally(localTarget.get().getPosition(), async);
+ plugin.getLocales().getLocale("teleporting_complete")
+ .ifPresent(teleporter::sendMessage);
});
return;
}
@@ -96,6 +98,8 @@ public class Teleport {
.type(Message.Type.TELEPORT_TO_NETWORKED_POSITION)
.target(username.name())
.build().send(plugin.getMessenger(), executor);
+ plugin.getLocales().getLocale("teleporting_complete")
+ .ifPresent(teleporter::sendMessage);
});
return;
}
@@ -105,10 +109,24 @@ public class Teleport {
fireEvent((event) -> {
executeEconomyActions();
- teleporter.teleportLocally((Position) target, async);
+
+ final Position target = (Position) this.target;
+ if (plugin.getSettings().isCrossServer() && target.getServer().equals(plugin.getServerName())) {
+ teleporter.teleportLocally(target, async);
+ plugin.getLocales().getLocale("teleporting_complete")
+ .ifPresent(teleporter::sendMessage);
+ return;
+ }
+
+ plugin.getDatabase().setCurrentTeleport(teleporter, this);
+ plugin.getMessenger().changeServer(teleporter, target.getServer());
});
}
+ private void teleport(@NotNull OnlineUser teleporter, @NotNull Position target) {
+
+ }
+
@NotNull
private Optional resolveLocalTeleporter() throws TeleportationException {
if (this.teleporter instanceof Username username) {
diff --git a/common/src/main/java/net/william278/huskhomes/teleport/TeleportationException.java b/common/src/main/java/net/william278/huskhomes/teleport/TeleportationException.java
index 2518fad1..b6667fe4 100644
--- a/common/src/main/java/net/william278/huskhomes/teleport/TeleportationException.java
+++ b/common/src/main/java/net/william278/huskhomes/teleport/TeleportationException.java
@@ -16,6 +16,8 @@ public class TeleportationException extends IllegalArgumentException {
ALREADY_WARMING_UP,
ECONOMY_ACTION_FAILED,
WARMUP_ALREADY_MOVING,
+ WORLD_NOT_FOUND,
+ ILLEGAL_TARGET_COORDINATES,
CANNOT_TELEPORT_TO_SELF
}
@@ -33,6 +35,12 @@ public class TeleportationException extends IllegalArgumentException {
case CANNOT_TELEPORT_TO_SELF -> plugin.getLocales()
.getLocale("error_teleport_request_self")
.ifPresent(user::sendMessage);
+ case ILLEGAL_TARGET_COORDINATES -> plugin.getLocales()
+ .getLocale("error_illegal_target_coordinates")
+ .ifPresent(user::sendMessage);
+ case WORLD_NOT_FOUND -> plugin.getLocales()
+ .getLocale("error_invalid_world")
+ .ifPresent(user::sendMessage);
}
}
}
diff --git a/common/src/main/java/net/william278/huskhomes/user/OnlineUser.java b/common/src/main/java/net/william278/huskhomes/user/OnlineUser.java
index 937d731c..b1b86626 100644
--- a/common/src/main/java/net/william278/huskhomes/user/OnlineUser.java
+++ b/common/src/main/java/net/william278/huskhomes/user/OnlineUser.java
@@ -142,7 +142,7 @@ public abstract class OnlineUser extends User implements Teleportable, CommandUs
* @param location the {@link Location} to teleport the player to
* @param asynchronous if the teleport should be asynchronous
*/
- public abstract CompletableFuture teleportLocally(@NotNull Location location, boolean asynchronous);
+ public abstract void teleportLocally(@NotNull Location location, boolean asynchronous);
/**
* Send a plugin message to the user
diff --git a/common/src/main/resources/locales/bg-bg.yml b/common/src/main/resources/locales/bg-bg.yml
index 414a9989..e7105d51 100644
--- a/common/src/main/resources/locales/bg-bg.yml
+++ b/common/src/main/resources/locales/bg-bg.yml
@@ -12,7 +12,7 @@ teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#00fb9a)'
tpa_request_sent: '[You sent a teleport request asking to teleport to](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
tpahere_request_sent: '[You sent a teleport request asking](#00fb9a) [%1%](#00fb9a bold) [to teleport to you.](#00fb9a)'
-tpaall_request_sent: '[You sent a teleport request asking](#00fb9a) [%1%](#00fb9a bold) [player(s) to teleport to you.](#00fb9a)'
+tpaall_request_sent: '[You sent a teleport request to every player asking them to teleport to you.](#00fb9a)'
tpa_request_received: '[%1%](#00fb9a bold) [has requested to teleport to you.](#00fb9a)'
tpahere_request_received: '[%1%](#00fb9a bold) [has requested that you teleport to them.](#00fb9a)'
teleport_request_buttons: '[Options:](gray) [[✔ Accept…]](#00fb9a show_text=fb9a&Accept teleport request\n&8Click to accept %1%''s request run_command=/huskhomes:tpaccept %1%) [[❌ Decline…]](#ff3300 show_text=ff3300&Decline teleport request\n&8Click to decline %1%''s request run_command=/huskhomes:tpdeny %1%)'
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Public Homes:](#00fb9a) [(%1%-%2% of](#00fb9a
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Click to suggest command suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Редактирайте уарп'
back_command_description: 'Върнете се на предишната си позиция или където сте умряли'
homelist_command_description: 'Списък с Вашите домове'
warplist_command_description: 'Вижте списък с уарпове'
-publichomelist_command_description: 'Вижте списъка с публични домове'
-publichome_command_description: 'Телепортирайте се до публичен дом'
+phomelist_command_description: 'Вижте списъка с публични домове'
+phome_command_description: 'Телепортирайте се до публичен дом'
tp_command_description: 'Телепортирайте се до друг играч или локация'
tphere_command_description: 'Телепортирайте друг играч до Вас'
tpa_command_description: 'Заявете да се телепортирате до друг играч'
diff --git a/common/src/main/resources/locales/de-de.yml b/common/src/main/resources/locales/de-de.yml
index 6a6aea5c..a98e248a 100644
--- a/common/src/main/resources/locales/de-de.yml
+++ b/common/src/main/resources/locales/de-de.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Öffentliche Homes:](#00fb9a) [(%1%-%2% von](
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% von](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Befehlsliste](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Klicke, um den Befehl im Chat einzufügen command suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Ändere einen Warp'
back_command_description: 'Kehre zu deiner letzten Position oder zu deinem Todespunkt zurück'
homelist_command_description: 'Erhalte eine Liste deiner Homes'
warplist_command_description: 'Siehe die Liste der Warps'
-publichomelist_command_description: 'Siehe die Liste der öffentlichen Homes'
-publichome_command_description: 'Teleportiere dich zu einem öffentlichen Home'
+phomelist_command_description: 'Siehe die Liste der öffentlichen Homes'
+phome_command_description: 'Teleportiere dich zu einem öffentlichen Home'
tp_command_description: 'Teleportiere dich zu einem Spieler oder zu einer Position'
tphere_command_description: 'Teleportiere einen Spieler zu dir'
tpa_command_description: 'Frage einem Spieler sich zu ihm zu teleportieren'
diff --git a/common/src/main/resources/locales/en-gb.yml b/common/src/main/resources/locales/en-gb.yml
index 2d08eb56..487f4665 100644
--- a/common/src/main/resources/locales/en-gb.yml
+++ b/common/src/main/resources/locales/en-gb.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Public Homes:](#00fb9a) [(%1%-%2% of](#00fb9a
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Click to suggest command suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Edit a warp'
back_command_description: 'Return to your previous position, or where you died'
homelist_command_description: 'Get a list of your homes'
warplist_command_description: 'View the list of warps'
-publichomelist_command_description: 'View the list of public homes'
-publichome_command_description: 'Teleport to a public home'
+phomelist_command_description: 'View the list of public homes'
+phome_command_description: 'Teleport to a public home'
tp_command_description: 'Teleport to another player or location'
tphere_command_description: 'Teleport another player to you'
tpa_command_description: 'Request to teleport to another player'
diff --git a/common/src/main/resources/locales/es-es.yml b/common/src/main/resources/locales/es-es.yml
index b8ca0cb2..781cc5b4 100644
--- a/common/src/main/resources/locales/es-es.yml
+++ b/common/src/main/resources/locales/es-es.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Public Homes:](#00fb9a) [(%1%-%2% of](#00fb9a
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[GreenShield](#green bold) [| lista de comandos](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Clic para sugerir el comando suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Editar un warp'
back_command_description: 'Volver a su posición anterior, o donde murió'
homelist_command_description: 'Obtenga una lista de sus casas'
warplist_command_description: 'Ver la lista de warps'
-publichomelist_command_description: 'Ver la lista de casas públicos'
-publichome_command_description: 'Teletransporte a una vivienda pública'
+phomelist_command_description: 'Ver la lista de casas públicos'
+phome_command_description: 'Teletransporte a una vivienda pública'
tp_command_description: 'Teletransportarse a otro jugador o lugar'
tphere_command_description: 'Teletransportar a otro jugador hacia ti'
tpa_command_description: 'Solicitud de teletransporte a otro jugador'
diff --git a/common/src/main/resources/locales/it-it.yml b/common/src/main/resources/locales/it-it.yml
index 3fb6d8d8..05ae4ae5 100644
--- a/common/src/main/resources/locales/it-it.yml
+++ b/common/src/main/resources/locales/it-it.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Home pubbliche:](#00fb9a) [(%1%-%2% of](#00fb
warp_list_page_title: '[Lista Warp:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Lista comandi](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Clicca per usare il comando suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Modifica un warp'
back_command_description: 'Ritorna in una tua posizione precedente, o dove sei morto.'
homelist_command_description: 'Ricevi una lista delle tue home'
warplist_command_description: 'Ricevi una lista dei warp esistenti'
-publichomelist_command_description: 'Ricevi una lista delle home pubbliche'
-publichome_command_description: 'Teletrasportati in una home pubblica'
+phomelist_command_description: 'Ricevi una lista delle home pubbliche'
+phome_command_description: 'Teletrasportati in una home pubblica'
tp_command_description: 'Teletrasportati nella posizione di un altro giocatore'
tphere_command_description: 'Teletrasporta un altro giocatore da te'
tpa_command_description: 'Richiedi ad un altro giocatore di teletrasportarti da lui'
diff --git a/common/src/main/resources/locales/pl.yml b/common/src/main/resources/locales/pl.yml
index b9c66186..7e9d905f 100644
--- a/common/src/main/resources/locales/pl.yml
+++ b/common/src/main/resources/locales/pl.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Public Homes:](#00fb9a) [(%1%-%2% of](#00fb9a
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Click to suggest command suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Edit a warp'
back_command_description: 'Return to your previous position, or where you died'
homelist_command_description: 'Get a list of your homes'
warplist_command_description: 'View the list of warps'
-publichomelist_command_description: 'View the list of public homes'
-publichome_command_description: 'Teleport to a public home'
+phomelist_command_description: 'View the list of public homes'
+phome_command_description: 'Teleport to a public home'
tp_command_description: 'Teleport to another player or location'
tphere_command_description: 'Teleport another player to you'
tpa_command_description: 'Request to teleport to another player'
diff --git a/common/src/main/resources/locales/tr-tr.yml b/common/src/main/resources/locales/tr-tr.yml
index fe39927f..b55375b0 100644
--- a/common/src/main/resources/locales/tr-tr.yml
+++ b/common/src/main/resources/locales/tr-tr.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Herkese Açık Evler:](#00fb9a) [(%1%-%2% of]
warp_list_page_title: '[Warplar:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Komut Listesi](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Komut önermek için tıklayın suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Warpları düzenler'
back_command_description: 'Önceki konumunuza veya öldüğünüz yere dönüdürür'
homelist_command_description: 'Evlerinizin bir listesini alır'
warplist_command_description: 'Warp listesini görünütler'
-publichomelist_command_description: 'Herkese açık evlerin listesini görüntüler'
-publichome_command_description: 'Herkese açık bir eve ışınlar'
+phomelist_command_description: 'Herkese açık evlerin listesini görüntüler'
+phome_command_description: 'Herkese açık bir eve ışınlar'
tp_command_description: 'Başka bir oyuncuya veya konuma ışınlar'
tphere_command_description: 'Başka bir oyuncuyu sana ışınlar'
tpa_command_description: 'Başka bir oyuncuya ışınlanma isteği atar'
diff --git a/common/src/main/resources/locales/uk-ua.yml b/common/src/main/resources/locales/uk-ua.yml
index d6e564fa..6118611a 100644
--- a/common/src/main/resources/locales/uk-ua.yml
+++ b/common/src/main/resources/locales/uk-ua.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ Public Homes:](#00fb9a) [(%1%-%2% of](#00fb9a
warp_list_page_title: '[Warps:](#00fb9a) [(%1%-%2% of](#00fb9a) [%3%](#00fb9a bold)[)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7Click to suggest command suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: 'Редагувати варп'
back_command_description: 'Повернутися на попередню позицію, або місце смерті'
homelist_command_description: 'Cписок моїх домівок'
warplist_command_description: 'Cписок варпів'
-publichomelist_command_description: 'Cписок публічних домівок'
-publichome_command_description: 'Телепортуватися до публічної домівки'
+phomelist_command_description: 'Cписок публічних домівок'
+phome_command_description: 'Телепортуватися до публічної домівки'
tp_command_description: 'Телепортуватися до іншого гравця чи на позицію'
tphere_command_description: 'Телепортувати гравця до себе'
tpa_command_description: 'Надіслати гравцеві запит на телепортацію'
diff --git a/common/src/main/resources/locales/zh-cn.yml b/common/src/main/resources/locales/zh-cn.yml
index 49b575df..7a0258b8 100644
--- a/common/src/main/resources/locales/zh-cn.yml
+++ b/common/src/main/resources/locales/zh-cn.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ 公共家:](#00fb9a) [(%1%-%2% 共](#00fb9a)
warp_list_page_title: '[地标:](#00fb9a) [(%1%-%2% 共](#00fb9a) [%3%](#00fb9a bold)[ 个)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| 指令列表](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7点击使用命令 suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: '编辑地标'
back_command_description: '返回到上次传送或死亡的位置'
homelist_command_description: '您的家列表'
warplist_command_description: '地标列表'
-publichomelist_command_description: '公开家的列表'
-publichome_command_description: '传送至公开的家'
+phomelist_command_description: '公开家的列表'
+phome_command_description: '传送至公开的家'
tp_command_description: '传送到玩家或坐标'
tphere_command_description: '将该玩家传送至您这里'
tpa_command_description: '请求传送到该玩家'
diff --git a/common/src/main/resources/locales/zh-tw.yml b/common/src/main/resources/locales/zh-tw.yml
index d835f2d1..79008329 100644
--- a/common/src/main/resources/locales/zh-tw.yml
+++ b/common/src/main/resources/locales/zh-tw.yml
@@ -64,7 +64,7 @@ public_home_list_page_title: '[☀ 公共家:](#00fb9a) [(%1%-%2% 共](#00fb9a)
warp_list_page_title: '[地標:](#00fb9a) [(%1%-%2% 共](#00fb9a) [%3%](#00fb9a bold)[ 個)](#00fb9a)\n'
command_list_title: '[HuskHomes](#00fb9a bold) [| 指令列表](#00fb9a)\n'
home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %3% run_command=/huskhomes:edithome %2%)'
-public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:publichome %2%)'
+public_home_list_item: '[[%1%]](show_text=fb9a&%1%\n&7☻ %3%\n&7ℹ %4% run_command=/huskhomes:phome %2%)'
warp_list_item: '[[%1%]](show_text=fb9a&%1%\n&7ℹ %2% run_command=/huskhomes:warp %1%)'
command_list_item: '[/%1%](#00fb9a show_text=&7點擊使用指令 suggest_command=/%1%) [%2%](gray show_text=fb9a&/%1%\n&7%3%)'
list_item_divider: ' [•](gray) '
@@ -155,8 +155,8 @@ editwarp_command_description: '編輯地標'
back_command_description: '返回到上次傳送或死亡的位置'
homelist_command_description: '您的家列表'
warplist_command_description: '地標列表'
-publichomelist_command_description: '公開的家列表'
-publichome_command_description: '傳送至公開的家'
+phomelist_command_description: '公開的家列表'
+phome_command_description: '傳送至公開的家'
tp_command_description: '傳送至玩家或坐標'
tphere_command_description: '將該玩家傳送至您身邊'
tpa_command_description: '請求傳送到該玩家身邊'