mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Finish command refactoring
This commit is contained in:
1 parent
34eb2c1f54
commit
8b809b6b5b
34 files changed
+427
-589
No files matched your search
@@ -2,6 +2,7 @@ package net.william278.huskhomes.command;
|
|||||||
|
|
||||||
import me.lucko.commodore.CommodoreProvider;
|
import me.lucko.commodore.CommodoreProvider;
|
||||||
import net.william278.huskhomes.BukkitHuskHomes;
|
import net.william278.huskhomes.BukkitHuskHomes;
|
||||||
|
import net.william278.huskhomes.teleport.TeleportRequest;
|
||||||
import net.william278.huskhomes.user.BukkitUser;
|
import net.william278.huskhomes.user.BukkitUser;
|
||||||
import org.bukkit.command.*;
|
import org.bukkit.command.*;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -34,7 +35,7 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command,
|
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command,
|
||||||
@NotNull String alias, @NotNull String[] args) {
|
@NotNull String alias, @NotNull String[] args) {
|
||||||
return this.command.suggest(sender instanceof Player player ? BukkitUser.adapt(player) : plugin.getConsole(), args);
|
return this.command.getSuggestions(sender instanceof Player player ? BukkitUser.adapt(player) : plugin.getConsole(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register() {
|
public void register() {
|
||||||
@@ -99,8 +100,8 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
|||||||
EDIT_WARP_COMMAND(new EditWarpCommand(BukkitHuskHomes.getInstance())),
|
EDIT_WARP_COMMAND(new EditWarpCommand(BukkitHuskHomes.getInstance())),
|
||||||
TP_COMMAND(new TpCommand(BukkitHuskHomes.getInstance())),
|
TP_COMMAND(new TpCommand(BukkitHuskHomes.getInstance())),
|
||||||
TP_HERE_COMMAND(new TpHereCommand(BukkitHuskHomes.getInstance())),
|
TP_HERE_COMMAND(new TpHereCommand(BukkitHuskHomes.getInstance())),
|
||||||
TPA_COMMAND(new TpaCommand(BukkitHuskHomes.getInstance())),
|
TPA_COMMAND(new TeleportRequestCommand(BukkitHuskHomes.getInstance(), TeleportRequest.Type.TPA)),
|
||||||
TPA_HERE_COMMAND(new TpaHereCommand(BukkitHuskHomes.getInstance())),
|
TPA_HERE_COMMAND(new TeleportRequestCommand(BukkitHuskHomes.getInstance(), TeleportRequest.Type.TPA_HERE)),
|
||||||
TPACCEPT_COMMAND(new TpRespondCommand(BukkitHuskHomes.getInstance(), true)),
|
TPACCEPT_COMMAND(new TpRespondCommand(BukkitHuskHomes.getInstance(), true)),
|
||||||
TPDECLINE_COMMAND(new TpRespondCommand(BukkitHuskHomes.getInstance(), false)),
|
TPDECLINE_COMMAND(new TpRespondCommand(BukkitHuskHomes.getInstance(), false)),
|
||||||
RTP_COMMAND(new RtpCommand(BukkitHuskHomes.getInstance())),
|
RTP_COMMAND(new RtpCommand(BukkitHuskHomes.getInstance())),
|
||||||
|
|||||||
@@ -154,9 +154,9 @@ public interface HuskHomes extends TaskRunner, EventDispatcher {
|
|||||||
*
|
*
|
||||||
* @return the {@link Position} of the spawn, or an empty {@link Optional} if it has not been set
|
* @return the {@link Position} of the spawn, or an empty {@link Optional} if it has not been set
|
||||||
*/
|
*/
|
||||||
default Optional<? extends Position> getSpawn() {
|
default Optional<Position> getSpawn() {
|
||||||
return getSettings().isCrossServer() && getSettings().isGlobalSpawn()
|
return getSettings().isCrossServer() && getSettings().isGlobalSpawn()
|
||||||
? getDatabase().getWarp(getSettings().getGlobalSpawnName())
|
? getDatabase().getWarp(getSettings().getGlobalSpawnName()).map(warp -> (Position) warp)
|
||||||
: getLocalCachedSpawn().map(spawn -> spawn.getPosition(getServerName()));
|
: getLocalCachedSpawn().map(spawn -> spawn.getPosition(getServerName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ public abstract class Command extends Node implements TabProvider {
|
|||||||
|
|
||||||
private final String usage;
|
private final String usage;
|
||||||
|
|
||||||
protected Command(@NotNull String name, @NotNull List<String> aliases, @NotNull String usage,
|
protected Command(@NotNull String name, @NotNull List<String> aliases, @NotNull String usage, @NotNull HuskHomes plugin) {
|
||||||
@NotNull HuskHomes plugin) {
|
|
||||||
super(name, aliases, plugin);
|
super(name, aliases, plugin);
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
}
|
}
|
||||||
@@ -65,4 +64,9 @@ public abstract class Command extends Node implements TabProvider {
|
|||||||
return Map.of();
|
return Map.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final HuskHomes getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.user.CommandUser;
|
||||||
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public abstract class InGameCommand extends Command {
|
||||||
|
|
||||||
|
protected InGameCommand(@NotNull String name, @NotNull List<String> aliases, @NotNull String usage,
|
||||||
|
@NotNull HuskHomes plugin) {
|
||||||
|
super(name, aliases, usage, plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
||||||
|
if (!(executor instanceof OnlineUser user)) {
|
||||||
|
plugin.getLocales().getLocale("error_in_game_only")
|
||||||
|
.ifPresent(executor::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.execute(user, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void execute(@NotNull OnlineUser executor, @NotNull String[] args);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,14 +1,18 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.position.Position;
|
||||||
|
import net.william278.huskhomes.position.World;
|
||||||
import net.william278.huskhomes.teleport.Teleportable;
|
import net.william278.huskhomes.teleport.Teleportable;
|
||||||
import net.william278.huskhomes.user.CommandUser;
|
import net.william278.huskhomes.user.CommandUser;
|
||||||
import net.william278.huskhomes.user.ConsoleUser;
|
import net.william278.huskhomes.user.ConsoleUser;
|
||||||
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public abstract class Node implements Executable {
|
public abstract class Node implements Executable {
|
||||||
|
|
||||||
@@ -86,6 +90,17 @@ public abstract class Node implements Executable {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Optional<Float> parseFloatArg(@NotNull String[] args, int index) {
|
||||||
|
try {
|
||||||
|
if (args.length > index) {
|
||||||
|
return Optional.of(Float.parseFloat(args[index]));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
protected Optional<Double> parseDoubleArg(@NotNull String[] args, int index) {
|
protected Optional<Double> parseDoubleArg(@NotNull String[] args, int index) {
|
||||||
try {
|
try {
|
||||||
if (args.length > index) {
|
if (args.length > index) {
|
||||||
@@ -97,6 +112,25 @@ public abstract class Node implements Executable {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Optional<Double> parseCoordinateArg(@NotNull String[] args, int index, double relativeTo) {
|
||||||
|
try {
|
||||||
|
if (args.length > index) {
|
||||||
|
final String arg = args[index];
|
||||||
|
if (arg.startsWith("~")) {
|
||||||
|
final String coordinate = arg.substring(1);
|
||||||
|
if (coordinate.isBlank()) {
|
||||||
|
return Optional.of(relativeTo);
|
||||||
|
}
|
||||||
|
return Optional.of(relativeTo + Double.parseDouble(coordinate));
|
||||||
|
}
|
||||||
|
return Optional.of(Double.parseDouble(arg));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
protected Optional<String> parseStringArg(@NotNull String[] args, int index) {
|
protected Optional<String> parseStringArg(@NotNull String[] args, int index) {
|
||||||
if (args.length > index) {
|
if (args.length > index) {
|
||||||
return Optional.of(args[index]);
|
return Optional.of(args[index]);
|
||||||
@@ -104,6 +138,19 @@ public abstract class Node implements Executable {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Optional<World> parseWorldArg(@NotNull String[] args, int index) {
|
||||||
|
if (args.length > index) {
|
||||||
|
final String worldName = args[index];
|
||||||
|
final World.Environment environment = worldName.endsWith("_the_end") ? World.Environment.THE_END :
|
||||||
|
worldName.endsWith("nether") ? World.Environment.NETHER : World.Environment.OVERWORLD;
|
||||||
|
return Optional.of(plugin.getWorlds().stream()
|
||||||
|
.filter(world -> world.getName().equalsIgnoreCase(worldName))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(new World(worldName, new UUID(0, 0), environment)));
|
||||||
|
}
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
protected Optional<String> parseGreedyString(@NotNull String[] args, int startIndex) {
|
protected Optional<String> parseGreedyString(@NotNull String[] args, int startIndex) {
|
||||||
if (args.length > startIndex) {
|
if (args.length > startIndex) {
|
||||||
final StringJoiner sentence = new StringJoiner(" ");
|
final StringJoiner sentence = new StringJoiner(" ");
|
||||||
@@ -115,9 +162,39 @@ public abstract class Node implements Executable {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Position getBasePosition(@NotNull CommandUser executor) {
|
||||||
|
return executor instanceof OnlineUser user ? user.getPosition() : plugin.getSpawn()
|
||||||
|
.orElse(new Position(0, 0, 0, 0, 0, plugin.getWorlds().get(0), plugin.getServerName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Optional<Position> parsePositionArgs(@NotNull Position basePosition, @NotNull String[] args, int startIndex) {
|
||||||
|
// Parse x, y, and z
|
||||||
|
final Optional<Double> x = parseCoordinateArg(args, startIndex, basePosition.getX());
|
||||||
|
final Optional<Double> y = parseCoordinateArg(args, startIndex + 1, basePosition.getY());
|
||||||
|
final Optional<Double> z = parseCoordinateArg(args, startIndex + 2, basePosition.getZ());
|
||||||
|
if (x.isEmpty() || y.isEmpty() || z.isEmpty()) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse world and server name
|
||||||
|
final Optional<World> world = parseWorldArg(args, startIndex + 3);
|
||||||
|
final Optional<String> server = parseStringArg(args, startIndex + 4);
|
||||||
|
|
||||||
|
// Parse yaw, pitch
|
||||||
|
int angleStartIndex = (world.isEmpty() ? 3 : server.isEmpty() ? 4 : 5);
|
||||||
|
final Optional<Float> yaw = parseFloatArg(args, startIndex + angleStartIndex);
|
||||||
|
final Optional<Float> pitch = parseFloatArg(args, startIndex + angleStartIndex + 1);
|
||||||
|
|
||||||
|
return Optional.of(new Position(x.get(), y.get(), z.get(),
|
||||||
|
yaw.orElse(basePosition.getYaw()), pitch.orElse(basePosition.getPitch()),
|
||||||
|
world.orElse(basePosition.getWorld()), server.orElse(basePosition.getServer())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected Optional<Teleportable> resolveTeleportable(@NotNull CommandUser executor, @NotNull String[] args) {
|
protected Optional<Teleportable> resolveTeleportable(@NotNull CommandUser executor, @NotNull String[] args) {
|
||||||
return parseStringArg(args, 0).map(Teleportable::username)
|
return parseStringArg(args, 0).map(Teleportable::username)
|
||||||
.or(() -> executor instanceof Teleportable ? Optional.of((Teleportable) executor) : Optional.empty());
|
.or(() -> executor instanceof Teleportable ? Optional.of((Teleportable) executor) : Optional.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,35 +1,28 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
import net.william278.huskhomes.user.CommandUser;
|
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public abstract class SetPositionCommand extends Command {
|
public abstract class SetPositionCommand extends InGameCommand {
|
||||||
|
|
||||||
protected SetPositionCommand(@NotNull String name, @NotNull HuskHomes plugin) {
|
protected SetPositionCommand(@NotNull String name, @NotNull HuskHomes plugin) {
|
||||||
super(name, List.of(), "<name>", plugin);
|
super(name, List.of(), "<name>", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (!(executor instanceof OnlineUser user)) {
|
final Optional<String> name = parseStringArg(args, 0);
|
||||||
plugin.getLocales().getLocale("error_in_game_only")
|
if (name.isEmpty()) {
|
||||||
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
.ifPresent(executor::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Optional<String> name = parseStringArg(args, 0);
|
this.execute(executor, name.get());
|
||||||
if (name.isEmpty()) {
|
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
|
||||||
.ifPresent(user::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.execute(user, name.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void execute(@NotNull OnlineUser setter, @NotNull String name);
|
protected abstract void execute(@NotNull OnlineUser setter, @NotNull String name);
|
||||||
|
|||||||
@@ -2,28 +2,21 @@ package net.william278.huskhomes.command;
|
|||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
import net.william278.huskhomes.position.Position;
|
import net.william278.huskhomes.position.Position;
|
||||||
import net.william278.huskhomes.user.CommandUser;
|
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.util.ValidationException;
|
import net.william278.huskhomes.util.ValidationException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SetSpawnCommand extends Command {
|
public class SetSpawnCommand extends InGameCommand {
|
||||||
|
|
||||||
protected SetSpawnCommand(@NotNull HuskHomes plugin) {
|
protected SetSpawnCommand(@NotNull HuskHomes plugin) {
|
||||||
super("setspawn", List.of(), "", plugin);
|
super("setspawn", List.of(), "", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (!(executor instanceof OnlineUser user)) {
|
final Position position = executor.getPosition();
|
||||||
plugin.getLocales().getLocale("error_in_game_only")
|
|
||||||
.ifPresent(executor::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Position position = user.getPosition();
|
|
||||||
try {
|
try {
|
||||||
if (plugin.getSettings().isCrossServer() && plugin.getSettings().isGlobalSpawn()) {
|
if (plugin.getSettings().isCrossServer() && plugin.getSettings().isGlobalSpawn()) {
|
||||||
final String warpName = plugin.getSettings().getGlobalSpawnName();
|
final String warpName = plugin.getSettings().getGlobalSpawnName();
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.manager.RequestsManager;
|
||||||
|
import net.william278.huskhomes.teleport.TeleportRequest;
|
||||||
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class TeleportRequestCommand extends InGameCommand implements UserListTabProvider {
|
||||||
|
|
||||||
|
private final TeleportRequest.Type requestType;
|
||||||
|
|
||||||
|
protected TeleportRequestCommand(@NotNull HuskHomes plugin, @NotNull TeleportRequest.Type requestType) {
|
||||||
|
super(requestType == TeleportRequest.Type.TPA ? "tpa" : "tpahere", List.of(), "<player>", plugin);
|
||||||
|
this.requestType = requestType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||||
|
final RequestsManager manager = plugin.getManager().requests();
|
||||||
|
if (manager.isIgnoringRequests(onlineUser)) {
|
||||||
|
plugin.getLocales().getLocale("error_ignoring_teleport_requests")
|
||||||
|
.ifPresent(onlineUser::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Optional<String> optionalTarget = parseStringArg(args, 0);
|
||||||
|
if (optionalTarget.isEmpty()) {
|
||||||
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
|
.ifPresent(onlineUser::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String target = optionalTarget.get();
|
||||||
|
if (target.equalsIgnoreCase(onlineUser.getUsername())) {
|
||||||
|
plugin.getLocales().getLocale("error_teleport_request_self")
|
||||||
|
.ifPresent(onlineUser::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
manager.sendTeleportRequest(onlineUser, target, requestType);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
plugin.getLocales().getLocale("error_player_not_found", target)
|
||||||
|
.ifPresent(onlineUser::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin.getLocales()
|
||||||
|
.getLocale(requestType == TeleportRequest.Type.TPA ? "tpa" : "tpahere" + "_request_sent", target)
|
||||||
|
.ifPresent(onlineUser::sendMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.network.Message;
|
||||||
|
import net.william278.huskhomes.network.Payload;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.position.Position;
|
import net.william278.huskhomes.position.Position;
|
||||||
import net.william278.huskhomes.teleport.Teleport;
|
import net.william278.huskhomes.teleport.Teleport;
|
||||||
@@ -9,42 +11,32 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TpAllCommand extends Command {
|
public class TpAllCommand extends InGameCommand {
|
||||||
|
|
||||||
protected TpAllCommand(@NotNull HuskHomes implementor) {
|
protected TpAllCommand(@NotNull HuskHomes plugin) {
|
||||||
super("tpall", Permission.COMMAND_TPALL, implementor);
|
super("tpall", List.of(), "", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (args.length != 0) {
|
final Position targetPosition = executor.getPosition();
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpaall")
|
for (OnlineUser user : plugin.getOnlineUsers()) {
|
||||||
.ifPresent(onlineUser::sendMessage);
|
Teleport.builder(plugin)
|
||||||
return;
|
.teleporter(user)
|
||||||
|
.target(targetPosition)
|
||||||
|
.toTeleport().execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine players to teleport and teleport them
|
if (plugin.getSettings().isCrossServer()) {
|
||||||
plugin.getCache().updatePlayerListCache(plugin, onlineUser).thenAccept(fetchedPlayers -> {
|
Message.builder()
|
||||||
final List<String> players = fetchedPlayers.stream()
|
.target(Message.TARGET_ALL)
|
||||||
.filter(userName -> !userName.equalsIgnoreCase(onlineUser.getUsername())).toList();
|
.type(Message.Type.TELEPORT_TO_POSITION)
|
||||||
if (players.isEmpty()) {
|
.payload(Payload.withPosition(targetPosition))
|
||||||
plugin.getLocales().getLocale("error_no_players_online").ifPresent(onlineUser::sendMessage);
|
.build().send(plugin.getMessenger(), executor);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send a message
|
|
||||||
plugin.getLocales().getLocale("teleporting_all_players", Integer.toString(players.size()))
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
|
|
||||||
// Teleport every player
|
|
||||||
final Position targetPosition = onlineUser.getPosition();
|
|
||||||
players.forEach(playerName -> Teleport.builder(plugin, onlineUser)
|
|
||||||
.setTeleporter(playerName)
|
|
||||||
.setTarget(targetPosition)
|
|
||||||
.toTeleport()
|
|
||||||
.thenAccept(Teleport::execute));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
plugin.getLocales().getLocale("teleporting_all_players")
|
||||||
|
.ifPresent(executor::sendMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,220 +1,90 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.teleport.*;
|
||||||
|
import net.william278.huskhomes.user.CommandUser;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.position.Position;
|
import net.william278.huskhomes.position.Position;
|
||||||
import net.william278.huskhomes.position.Server;
|
|
||||||
import net.william278.huskhomes.position.World;
|
|
||||||
import net.william278.huskhomes.teleport.Teleport;
|
|
||||||
import net.william278.huskhomes.util.Permission;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class TpCommand extends Command implements TabProvider, ConsoleExecutable {
|
public class TpCommand extends Command implements TabProvider {
|
||||||
|
|
||||||
protected TpCommand(@NotNull HuskHomes implementor) {
|
protected TpCommand(@NotNull HuskHomes implementor) {
|
||||||
super("tp", Permission.COMMAND_TP, implementor, "tpo");
|
super("tp", List.of("tpo"), "[<player|position>] [target]", implementor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
||||||
// Ensure a valid target was found
|
switch (args.length) {
|
||||||
final Optional<TeleportTarget> teleportTarget = getTeleportTarget(args, onlineUser);
|
case 1 -> {
|
||||||
if (teleportTarget.isEmpty()) {
|
if (!(executor instanceof OnlineUser user)) {
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tp <target> [destination]")
|
plugin.getLocales().getLocale("error_in_game_only")
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine the player to teleport
|
|
||||||
final String targetPlayerToTeleport = ((teleportTarget.get() instanceof TargetPlayer) && args.length == 2)
|
|
||||||
? args[0] : ((teleportTarget.get() instanceof TargetPosition)
|
|
||||||
? args.length > 3 ? (isCoordinate(args[1]) && isCoordinate(args[2]) && isCoordinate(args[3]) ? args[0] : onlineUser.getUsername())
|
|
||||||
: onlineUser.getUsername() : onlineUser.getUsername());
|
|
||||||
|
|
||||||
// Find the online user to teleport
|
|
||||||
plugin.getCache().updatePlayerListCache(plugin, onlineUser).thenRun(() -> {
|
|
||||||
// Get the list of potential teleports, filtered against vanished players, but ensuring the executor is in the list
|
|
||||||
final Set<String> players = plugin.getCache().getPlayers();
|
|
||||||
players.add(onlineUser.getUsername());
|
|
||||||
|
|
||||||
// Find the player to teleport
|
|
||||||
final String playerToTeleport = players.stream()
|
|
||||||
.filter(user -> user.equalsIgnoreCase(targetPlayerToTeleport)).findFirst()
|
|
||||||
.or(() -> Optional.ofNullable(targetPlayerToTeleport.equals("@s") ? onlineUser.getUsername() : null))
|
|
||||||
.or(() -> plugin.getCache().getPlayers().stream().filter(user -> user.toLowerCase().startsWith(targetPlayerToTeleport)).findFirst())
|
|
||||||
.orElse(null);
|
|
||||||
|
|
||||||
// Ensure the player to teleport exists
|
|
||||||
if (playerToTeleport == null) {
|
|
||||||
plugin.getLocales().getLocale("error_player_not_found", targetPlayerToTeleport)
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure the user has permission to teleport the player to teleport
|
|
||||||
if (!playerToTeleport.equals(onlineUser.getUsername())) {
|
|
||||||
if (!onlineUser.hasPermission(Permission.COMMAND_TP_OTHER.node)) {
|
|
||||||
plugin.getLocales().getLocale("error_no_permission")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute the teleport
|
|
||||||
if (teleportTarget.get() instanceof TargetPlayer targetPlayer) {
|
|
||||||
// Carry out the teleport to a player, by name
|
|
||||||
Teleport.builder(plugin, onlineUser)
|
|
||||||
.setTeleporter(playerToTeleport)
|
|
||||||
.setTarget(targetPlayer.playerName)
|
|
||||||
.toTeleport()
|
|
||||||
.thenAccept(teleport -> teleport.execute().thenAccept(result -> {
|
|
||||||
if (result.successful()) {
|
|
||||||
result.getTeleporter()
|
|
||||||
.flatMap(teleporter -> plugin.getLocales().getLocale("teleporting_other_complete",
|
|
||||||
teleporter.getUsername(), targetPlayer.playerName))
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
} else {
|
|
||||||
plugin.getLocales().getLocale("error_player_not_found", targetPlayer.playerName)
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
} else if (teleportTarget.get() instanceof TargetPosition targetPosition) {
|
|
||||||
// Handle coordinate teleport targets
|
|
||||||
if (!onlineUser.hasPermission(Permission.COMMAND_TP_TO_COORDINATES.node)) {
|
|
||||||
plugin.getLocales().getLocale("error_no_permission").ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Carry out the teleport to a position
|
this.execute(executor, user, Target.username(args[0]), args);
|
||||||
Teleport.builder(plugin, onlineUser)
|
|
||||||
.setTeleporter(playerToTeleport)
|
|
||||||
.setTarget(targetPosition.position)
|
|
||||||
.toTeleport()
|
|
||||||
.thenAccept(teleport -> teleport.execute().thenAccept(result -> {
|
|
||||||
if (!result.successful() || playerToTeleport.equalsIgnoreCase(onlineUser.getUsername()) || result.getDestination().isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Position destination = result.getDestination().get();
|
|
||||||
result.getTeleporter()
|
|
||||||
.flatMap(teleporter -> plugin.getLocales()
|
|
||||||
.getLocale("teleporting_other_complete_position", teleporter.getUsername(),
|
|
||||||
Integer.toString((int) destination.getX()),
|
|
||||||
Integer.toString((int) destination.getY()),
|
|
||||||
Integer.toString((int) destination.getZ())))
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
});
|
case 2 -> execute(executor, Teleportable.username(args[0]), Target.username(args[1]), args);
|
||||||
|
default -> {
|
||||||
|
final Position basePosition = getBasePosition(executor);
|
||||||
|
Optional<Position> target = parsePositionArgs(basePosition, args, 0);
|
||||||
|
if (target.isPresent()) {
|
||||||
|
if (!(executor instanceof OnlineUser user)) {
|
||||||
|
plugin.getLocales().getLocale("error_in_game_only")
|
||||||
|
.ifPresent(executor::sendMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.execute(executor, user, target.get(), args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
target = parsePositionArgs(basePosition, args, 1);
|
||||||
|
if (target.isPresent() && args.length >= 1) {
|
||||||
|
this.execute(executor, Teleportable.username(args[0]), target.get(), args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
|
.ifPresent(executor::sendMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Execute a teleport
|
||||||
* Determines the teleport target from a set of arguments, which may be comprised of usernames and/or position
|
private void execute(@NotNull CommandUser executor, @NotNull Teleportable teleportable, @NotNull Target target,
|
||||||
* coordinates with a world and server.
|
@NotNull String[] args) {
|
||||||
*
|
|
||||||
* @param args The arguments to parse.
|
|
||||||
* @param relativeTo The position to use as a relative reference. This is used for relative coordinate handling
|
|
||||||
* (e.g. {@code ~-10 ~ ~20})
|
|
||||||
* @return The teleport target, if it could be parsed, otherwise and empty {@link Optional}.
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
private Optional<TeleportTarget> getTeleportTarget(@NotNull String[] args, @NotNull OnlineUser relativeTo) {
|
|
||||||
if (args.length == 1 || args.length == 2) {
|
|
||||||
return Optional.of(new TargetPlayer(args[args.length - 1]));
|
|
||||||
}
|
|
||||||
if (args.length > 2 && args.length < 7) {
|
|
||||||
final Optional<TeleportTarget> targetPosition = Position.parse(args, relativeTo.getPosition())
|
|
||||||
.map(TargetPosition::new);
|
|
||||||
return targetPosition.or(() -> Position.parse(Arrays.copyOfRange(args, 1, args.length),
|
|
||||||
relativeTo.getPosition()).map(TargetPosition::new));
|
|
||||||
}
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines if a string is a valid (relative) position coordinate double target.
|
|
||||||
*
|
|
||||||
* @param coordinate The string to check.
|
|
||||||
* @return {@code true} if the string is a valid coordinate, otherwise {@code false}.
|
|
||||||
*/
|
|
||||||
private boolean isCoordinate(@NotNull String coordinate) {
|
|
||||||
try {
|
try {
|
||||||
if (coordinate.startsWith("~")) {
|
final TeleportBuilder builder = Teleport.builder(plugin)
|
||||||
coordinate = coordinate.substring(1);
|
.teleporter(teleportable)
|
||||||
|
.target(target);
|
||||||
|
if (executor instanceof OnlineUser user) {
|
||||||
|
builder.executor(user);
|
||||||
}
|
}
|
||||||
if (coordinate.isBlank()) {
|
builder.toTeleport().execute();
|
||||||
return true;
|
} catch (TeleportationException e) {
|
||||||
}
|
e.displayMessage(executor, plugin, args);
|
||||||
Double.parseDouble(coordinate);
|
|
||||||
return true;
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConsoleExecute(@NotNull String[] args) {
|
|
||||||
if (args.length < 2 || args.length > 6) {
|
|
||||||
plugin.log(Level.WARNING, "Invalid syntax. Usage: tp <player> <destination>");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final OnlineUser playerToTeleport = plugin.findOnlinePlayer(args[0]).orElse(null);
|
|
||||||
if (playerToTeleport == null) {
|
|
||||||
plugin.log(Level.WARNING, "Player not found: " + args[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final TeleportTarget teleportTarget;
|
|
||||||
if (args.length == 2) {
|
|
||||||
teleportTarget = new TargetPlayer(args[1]);
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
teleportTarget = new TargetPosition(new Position(
|
|
||||||
Double.parseDouble(args[1]),
|
|
||||||
Double.parseDouble(args[2]),
|
|
||||||
Double.parseDouble(args[3]),
|
|
||||||
0f, 0f,
|
|
||||||
args.length >= 5 ? new World(args[4], UUID.randomUUID()) : plugin.getWorlds().get(0),
|
|
||||||
args.length == 6 ? new Server(args[5]) : plugin.getServerName()));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
plugin.log(Level.WARNING, "Invalid syntax. Usage: tp <player> <x> <y> <z> [world] [server]");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute the console teleport
|
|
||||||
final TeleportBuilder builder = Teleport.builder(plugin, playerToTeleport)
|
|
||||||
.setTeleporter(playerToTeleport.getUsername());
|
|
||||||
if (teleportTarget instanceof TargetPlayer targetPlayer) {
|
|
||||||
builder.setTarget(targetPlayer.playerName);
|
|
||||||
} else {
|
|
||||||
builder.setTarget(((TargetPosition) teleportTarget).position);
|
|
||||||
}
|
|
||||||
builder.toTeleport().thenAccept(teleport -> teleport.execute().thenAccept(result -> {
|
|
||||||
if (result.successful()) {
|
|
||||||
plugin.log(Level.INFO, "Successfully teleported " + playerToTeleport.getUsername());
|
|
||||||
} else {
|
|
||||||
plugin.log(Level.WARNING, "Failed to teleport " + playerToTeleport.getUsername() + " to " + teleportTarget);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
||||||
final boolean serveCoordinateCompletions = user != null && user.hasPermission(Permission.COMMAND_TP_TO_COORDINATES.node);
|
final Position basePosition = getBasePosition(user);
|
||||||
|
final boolean serveCoordinateCompletions = user.hasPermission(getPermission("coordinates"));
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0, 1 -> {
|
case 0, 1 -> {
|
||||||
final ArrayList<String> completions = new ArrayList<>();
|
final ArrayList<String> completions = new ArrayList<>();
|
||||||
completions.addAll(serveCoordinateCompletions
|
completions.addAll(serveCoordinateCompletions
|
||||||
? List.of("~", "~ ~", "~ ~ ~",
|
? List.of("~", "~ ~", "~ ~ ~",
|
||||||
Integer.toString((int) user.getPosition().getX()),
|
Integer.toString((int) basePosition.getX()),
|
||||||
((int) user.getPosition().getX() + " " + (int) user.getPosition().getY()),
|
((int) basePosition.getX() + " " + (int) basePosition.getY()),
|
||||||
((int) user.getPosition().getX() + " " + (int) user.getPosition().getY() + " " + (int) user.getPosition().getZ()))
|
((int) basePosition.getX() + " " + (int) basePosition.getY() + " " + (int) basePosition.getZ()))
|
||||||
: Collections.emptyList());
|
: List.of());
|
||||||
completions.addAll(plugin.getCache().getPlayers());
|
completions.addAll(plugin.getCache().getPlayers());
|
||||||
return completions.stream()
|
return completions.stream()
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
||||||
@@ -222,19 +92,16 @@ public class TpCommand extends Command implements TabProvider, ConsoleExecutable
|
|||||||
}
|
}
|
||||||
case 2 -> {
|
case 2 -> {
|
||||||
final ArrayList<String> completions = new ArrayList<>();
|
final ArrayList<String> completions = new ArrayList<>();
|
||||||
if (isCoordinate(args[0])) {
|
if (isCoordinate(args, 0)) {
|
||||||
if (user == null) {
|
completions.addAll(List.of("~", Integer.toString((int) basePosition.getY())));
|
||||||
return completions;
|
completions.addAll(List.of("~ ~", (int) basePosition.getY() + " " + (int) basePosition.getZ()));
|
||||||
}
|
|
||||||
completions.addAll(List.of("~", Integer.toString((int) user.getPosition().getY())));
|
|
||||||
completions.addAll(List.of("~ ~", (int) user.getPosition().getY() + " " + (int) user.getPosition().getZ()));
|
|
||||||
} else {
|
} else {
|
||||||
completions.addAll(serveCoordinateCompletions
|
completions.addAll(serveCoordinateCompletions
|
||||||
? List.of("~", "~ ~", "~ ~ ~",
|
? List.of("~", "~ ~", "~ ~ ~",
|
||||||
Integer.toString((int) user.getPosition().getX()),
|
Integer.toString((int) basePosition.getX()),
|
||||||
((int) user.getPosition().getX() + " " + (int) user.getPosition().getY()),
|
((int) basePosition.getX() + " " + (int) basePosition.getY()),
|
||||||
((int) user.getPosition().getX() + " " + (int) user.getPosition().getY() + " " + (int) user.getPosition().getZ()))
|
((int) basePosition.getX() + " " + (int) basePosition.getY() + " " + (int) basePosition.getZ()))
|
||||||
: Collections.emptyList());
|
: List.of());
|
||||||
completions.addAll(plugin.getCache().getPlayers());
|
completions.addAll(plugin.getCache().getPlayers());
|
||||||
}
|
}
|
||||||
return completions.stream()
|
return completions.stream()
|
||||||
@@ -243,17 +110,17 @@ public class TpCommand extends Command implements TabProvider, ConsoleExecutable
|
|||||||
}
|
}
|
||||||
case 3 -> {
|
case 3 -> {
|
||||||
final ArrayList<String> completions = new ArrayList<>();
|
final ArrayList<String> completions = new ArrayList<>();
|
||||||
if (isCoordinate(args[0]) && isCoordinate(args[1])) {
|
if (isCoordinate(args, 1) && isCoordinate(args, 2)) {
|
||||||
if (!serveCoordinateCompletions) {
|
if (!serveCoordinateCompletions) {
|
||||||
return completions;
|
return completions;
|
||||||
}
|
}
|
||||||
completions.addAll(List.of("~", Integer.toString((int) user.getPosition().getZ())));
|
completions.addAll(List.of("~", Integer.toString((int) basePosition.getZ())));
|
||||||
} else if (isCoordinate(args[1])) {
|
} else if (isCoordinate(args, 1)) {
|
||||||
if (!serveCoordinateCompletions) {
|
if (!serveCoordinateCompletions) {
|
||||||
return completions;
|
return completions;
|
||||||
}
|
}
|
||||||
completions.addAll(List.of("~", Integer.toString((int) user.getPosition().getY())));
|
completions.addAll(List.of("~", Integer.toString((int) basePosition.getY())));
|
||||||
completions.addAll(List.of("~ ~", (int) user.getPosition().getY() + " " + (int) user.getPosition().getZ()));
|
completions.addAll(List.of("~ ~", (int) basePosition.getY() + " " + (int) basePosition.getZ()));
|
||||||
}
|
}
|
||||||
return completions.stream()
|
return completions.stream()
|
||||||
.filter(s -> s.toLowerCase().startsWith(args[2].toLowerCase()))
|
.filter(s -> s.toLowerCase().startsWith(args[2].toLowerCase()))
|
||||||
@@ -261,54 +128,24 @@ public class TpCommand extends Command implements TabProvider, ConsoleExecutable
|
|||||||
}
|
}
|
||||||
case 4 -> {
|
case 4 -> {
|
||||||
final ArrayList<String> completions = new ArrayList<>();
|
final ArrayList<String> completions = new ArrayList<>();
|
||||||
if (isCoordinate(args[1]) && isCoordinate(args[2]) && !isCoordinate(args[0])) {
|
if (isCoordinate(args, 1) && isCoordinate(args, 2) && !isCoordinate(args, 0)) {
|
||||||
if (!serveCoordinateCompletions) {
|
if (!serveCoordinateCompletions) {
|
||||||
return completions;
|
return completions;
|
||||||
}
|
}
|
||||||
completions.addAll(List.of("~", Integer.toString((int) user.getPosition().getZ())));
|
completions.addAll(List.of("~", Integer.toString((int) basePosition.getZ())));
|
||||||
}
|
}
|
||||||
return completions.stream()
|
return completions.stream()
|
||||||
.filter(s -> s.toLowerCase().startsWith(args[3].toLowerCase()))
|
.filter(s -> s.toLowerCase().startsWith(args[3].toLowerCase()))
|
||||||
.sorted().collect(Collectors.toList());
|
.sorted().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
default -> {
|
default -> {
|
||||||
return Collections.emptyList();
|
return List.of();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private boolean isCoordinate(@NotNull String[] args, int index) {
|
||||||
* Represents a target position to teleport to
|
return parseCoordinateArg(args, index, 0d).isPresent();
|
||||||
*/
|
|
||||||
private static final class TargetPosition extends TeleportTarget {
|
|
||||||
/**
|
|
||||||
* The target {@link Position}
|
|
||||||
*/
|
|
||||||
private final Position position;
|
|
||||||
|
|
||||||
private TargetPosition(@NotNull Position position) {
|
|
||||||
this.position = position;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a target player to teleport to
|
|
||||||
*/
|
|
||||||
private static final class TargetPlayer extends TeleportTarget {
|
|
||||||
/**
|
|
||||||
* Name of the target player
|
|
||||||
*/
|
|
||||||
private final String playerName;
|
|
||||||
|
|
||||||
private TargetPlayer(@NotNull String playerName) {
|
|
||||||
this.playerName = playerName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Identifies the target of a teleport command operation
|
|
||||||
*/
|
|
||||||
private static abstract class TeleportTarget {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.teleport.Target;
|
||||||
|
import net.william278.huskhomes.teleport.Teleportable;
|
||||||
|
import net.william278.huskhomes.teleport.TeleportationException;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.teleport.Teleport;
|
import net.william278.huskhomes.teleport.Teleport;
|
||||||
import net.william278.huskhomes.util.Permission;
|
import net.william278.huskhomes.util.Permission;
|
||||||
@@ -9,53 +12,34 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class TpHereCommand extends Command implements TabProvider {
|
public class TpHereCommand extends InGameCommand implements UserListTabProvider {
|
||||||
|
|
||||||
protected TpHereCommand(@NotNull HuskHomes implementor) {
|
protected TpHereCommand(@NotNull HuskHomes plugin) {
|
||||||
super("tphere", Permission.COMMAND_TPHERE, implementor, "tpohere");
|
super("tphere", List.of("tpohere"), "<player>", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
CompletableFuture.runAsync(() -> {
|
final Optional<String> optionalTarget = parseStringArg(args, 0);
|
||||||
if (args.length != 1) {
|
if (optionalTarget.isEmpty()) {
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tphere <player>")
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String targetPlayerName = args[0];
|
|
||||||
plugin.findPlayer(onlineUser, targetPlayerName).thenAccept(teleporterName -> {
|
|
||||||
if (teleporterName.isEmpty()) {
|
|
||||||
plugin.getLocales().getLocale("error_player_not_found", targetPlayerName)
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Teleport.builder(plugin, onlineUser)
|
try {
|
||||||
.setTeleporter(teleporterName.get())
|
Teleport.builder(plugin)
|
||||||
.setTarget(onlineUser.getPosition())
|
.executor(executor)
|
||||||
.toTeleport()
|
.teleporter(optionalTarget.get())
|
||||||
.thenAccept(teleport -> teleport.execute().thenAccept(result -> {
|
.target(executor.getPosition())
|
||||||
if (result.successful()) {
|
.toTeleport().execute();
|
||||||
result.getTeleporter()
|
} catch (TeleportationException e) {
|
||||||
.flatMap(teleporter -> plugin.getLocales().getLocale("teleporting_other_complete",
|
e.displayMessage(executor, plugin, args);
|
||||||
teleporter.getUsername(), onlineUser.getUsername()))
|
}
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
|
||||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
|
||||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,35 +2,34 @@ package net.william278.huskhomes.command;
|
|||||||
|
|
||||||
import de.themoep.minedown.adventure.MineDown;
|
import de.themoep.minedown.adventure.MineDown;
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.manager.RequestsManager;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.user.SavedUser;
|
import net.william278.huskhomes.user.SavedUser;
|
||||||
import net.william278.huskhomes.util.Permission;
|
import net.william278.huskhomes.util.Permission;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class TpIgnoreCommand extends Command {
|
import java.util.List;
|
||||||
|
|
||||||
protected TpIgnoreCommand(@NotNull HuskHomes implementor) {
|
public class TpIgnoreCommand extends InGameCommand {
|
||||||
super("tpignore", Permission.COMMAND_TPIGNORE, implementor);
|
|
||||||
|
protected TpIgnoreCommand(@NotNull HuskHomes plugin) {
|
||||||
|
super("tpignore", List.of(), "", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||||
if (args.length != 0) {
|
final RequestsManager manager = plugin.getManager().requests();
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpignore")
|
final boolean isIgnoringRequests = !manager.isIgnoringRequests(onlineUser);
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update local value
|
final SavedUser user = plugin.getDatabase().getUserData(onlineUser.getUuid())
|
||||||
final boolean isIgnoringRequests = !plugin.getRequestManager().isIgnoringRequests(onlineUser);
|
.orElseThrow(() -> new IllegalStateException("User data not found for " + onlineUser.getUsername()));
|
||||||
plugin.getRequestManager().setIgnoringRequests(onlineUser, isIgnoringRequests);
|
user.setIgnoringTeleports(isIgnoringRequests);
|
||||||
|
manager.setIgnoringRequests(onlineUser, isIgnoringRequests);
|
||||||
|
plugin.getDatabase().updateUserData(user);
|
||||||
|
|
||||||
// Update value on the database and send a message | todo: Clean this up
|
plugin.getLocales().getRawLocale("tpignore_toggle_" + (isIgnoringRequests ? "on" : "off"),
|
||||||
plugin.getDatabase().getUserData(onlineUser.getUuid())
|
plugin.getLocales().getRawLocale("tpignore_toggle_button").orElse(""))
|
||||||
.thenAcceptAsync(userData -> userData.ifPresent(data -> plugin.getDatabase()
|
.map(MineDown::new)
|
||||||
.updateUserData(new SavedUser(onlineUser, data.homeSlots(), isIgnoringRequests, data.rtpCooldown()))
|
.ifPresent(onlineUser::sendMessage);
|
||||||
.thenRun(() -> plugin.getLocales().getRawLocale("tpignore_toggle_" + (isIgnoringRequests ? "on" : "off"),
|
|
||||||
plugin.getLocales().getRawLocale("tpignore_toggle_button").orElse(""))
|
|
||||||
.ifPresent(locale -> onlineUser.sendMessage(new MineDown(locale))))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,31 +4,22 @@ import net.william278.huskhomes.HuskHomes;
|
|||||||
import net.william278.huskhomes.position.Position;
|
import net.william278.huskhomes.position.Position;
|
||||||
import net.william278.huskhomes.teleport.Teleport;
|
import net.william278.huskhomes.teleport.Teleport;
|
||||||
import net.william278.huskhomes.teleport.TeleportationException;
|
import net.william278.huskhomes.teleport.TeleportationException;
|
||||||
import net.william278.huskhomes.user.CommandUser;
|
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.user.SavedUser;
|
import net.william278.huskhomes.user.SavedUser;
|
||||||
import net.william278.huskhomes.user.User;
|
import net.william278.huskhomes.user.User;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class TpOfflineCommand extends Command implements TabProvider {
|
public class TpOfflineCommand extends InGameCommand implements UserListTabProvider {
|
||||||
|
|
||||||
protected TpOfflineCommand(@NotNull HuskHomes plugin) {
|
protected TpOfflineCommand(@NotNull HuskHomes plugin) {
|
||||||
super("tpoffline", List.of(), "<player>", plugin);
|
super("tpoffline", List.of(), "<player>", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (!(executor instanceof OnlineUser user)) {
|
|
||||||
plugin.getLocales().getLocale("error_in_game_only")
|
|
||||||
.ifPresent(executor::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Optional<String> optionalUser = parseStringArg(args, 0);
|
final Optional<String> optionalUser = parseStringArg(args, 0);
|
||||||
if (optionalUser.isEmpty()) {
|
if (optionalUser.isEmpty()) {
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
|
||||||
@@ -45,7 +36,7 @@ public class TpOfflineCommand extends Command implements TabProvider {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.teleportToOfflinePosition(user, targetUserData.get(), args);
|
this.teleportToOfflinePosition(executor, targetUserData.get(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teleportToOfflinePosition(@NotNull OnlineUser user, @NotNull User target, @NotNull String[] args) {
|
private void teleportToOfflinePosition(@NotNull OnlineUser user, @NotNull User target, @NotNull String[] args) {
|
||||||
@@ -71,12 +62,4 @@ public class TpOfflineCommand extends Command implements TabProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
|
||||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
|
||||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,49 +2,32 @@ package net.william278.huskhomes.command;
|
|||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.util.Permission;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command used for responding to tp requests - can either be a /tpaccept or /tpdecline command, controlled by the
|
* A command used for responding to tp requests - can either be a /tpaccept or /tpdecline command, controlled by the
|
||||||
* acceptRequestCommand flag
|
* acceptRequestCommand flag
|
||||||
*/
|
*/
|
||||||
public class TpRespondCommand extends Command implements TabProvider {
|
public class TpRespondCommand extends InGameCommand implements UserListTabProvider {
|
||||||
|
|
||||||
private final boolean acceptRequestCommand;
|
private final boolean accept;
|
||||||
|
|
||||||
protected TpRespondCommand(@NotNull HuskHomes implementor, boolean acceptRequestCommand) {
|
protected TpRespondCommand(@NotNull HuskHomes plugin, boolean accept) {
|
||||||
super(acceptRequestCommand ? "tpaccept" : "tpdecline", acceptRequestCommand ? Permission.COMMAND_TPACCEPT : Permission.COMMAND_TPDECLINE, implementor);
|
super(accept ? "tpaccept" : "tpdecline", List.of(), "[player]", plugin);
|
||||||
this.acceptRequestCommand = acceptRequestCommand;
|
this.accept = accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (args.length > 1) {
|
final Optional<String> requesterName = parseStringArg(args, 0);
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/" + command + " [player]")
|
if (requesterName.isPresent()) {
|
||||||
.ifPresent(onlineUser::sendMessage);
|
plugin.getManager().requests().respondToTeleportRequestBySenderName(executor, requesterName.get(), accept);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
plugin.getManager().requests().respondToTeleportRequest(executor, accept);
|
||||||
if (args.length == 1) {
|
|
||||||
// Respond to the request from specified sender name
|
|
||||||
plugin.getRequestManager().respondToTeleportRequestBySenderName(onlineUser, args[0], acceptRequestCommand);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getRequestManager().respondToTeleportRequest(onlineUser, acceptRequestCommand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
|
||||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
|
||||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,63 +1,38 @@
|
|||||||
package net.william278.huskhomes.command;
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.network.Message;
|
||||||
|
import net.william278.huskhomes.network.Payload;
|
||||||
|
import net.william278.huskhomes.position.Position;
|
||||||
|
import net.william278.huskhomes.teleport.Teleport;
|
||||||
|
import net.william278.huskhomes.teleport.TeleportBuilder;
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
import net.william278.huskhomes.user.OnlineUser;
|
||||||
import net.william278.huskhomes.teleport.TeleportRequest;
|
import net.william278.huskhomes.teleport.TeleportRequest;
|
||||||
import net.william278.huskhomes.util.Permission;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class TpaAllCommand extends Command {
|
public class TpaAllCommand extends InGameCommand {
|
||||||
|
|
||||||
protected TpaAllCommand(@NotNull HuskHomes implementor) {
|
protected TpaAllCommand(@NotNull HuskHomes plugin) {
|
||||||
super("tpaall", Permission.COMMAND_TPA_ALL, implementor);
|
super("tpaall", List.of(), "", plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void execute(@NotNull OnlineUser executor, @NotNull String[] args) {
|
||||||
if (plugin.getRequestManager().isIgnoringRequests(onlineUser)) {
|
if (plugin.getManager().requests().isIgnoringRequests(executor)) {
|
||||||
plugin.getLocales().getLocale("error_ignoring_teleport_requests")
|
plugin.getLocales().getLocale("error_ignoring_teleport_requests")
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length != 0) {
|
plugin.getManager().requests().sendTeleportAllRequest(executor);
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpaall")
|
plugin.getLocales().getLocale("teleporting_all_players")
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine players to teleport and teleport them
|
|
||||||
plugin.getCache().updatePlayerListCache(plugin, onlineUser).thenAccept(playerList -> {
|
|
||||||
final List<String> players = plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(userName -> !userName.equalsIgnoreCase(onlineUser.getUsername())).toList();
|
|
||||||
if (players.isEmpty()) {
|
|
||||||
plugin.getLocales().getLocale("error_no_players_online").ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a teleport request to every player
|
|
||||||
final AtomicInteger counter = new AtomicInteger(0);
|
|
||||||
final List<CompletableFuture<Void>> sentRequestsFuture = new ArrayList<>();
|
|
||||||
players.forEach(playerName -> sentRequestsFuture.add(plugin.getRequestManager()
|
|
||||||
.sendTeleportRequest(onlineUser, playerName, TeleportRequest.Type.TPA_HERE)
|
|
||||||
.thenAccept(sent -> counter.addAndGet(sent.isPresent() ? 1 : 0))));
|
|
||||||
|
|
||||||
// Send a message when all requests have been sent
|
|
||||||
CompletableFuture.allOf(sentRequestsFuture.toArray(new CompletableFuture[0])).thenRun(() -> {
|
|
||||||
if (counter.get() == 0) {
|
|
||||||
plugin.getLocales().getLocale("error_no_players_online")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
plugin.getLocales().getLocale("tpaall_request_sent", Integer.toString(counter.get()))
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
package net.william278.huskhomes.command;
|
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
|
||||||
import net.william278.huskhomes.teleport.TeleportRequest;
|
|
||||||
import net.william278.huskhomes.util.Permission;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class TpaCommand extends Command implements TabProvider {
|
|
||||||
|
|
||||||
protected TpaCommand(@NotNull HuskHomes implementor) {
|
|
||||||
super("tpa", Permission.COMMAND_TPA, implementor);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
|
||||||
if (plugin.getRequestManager().isIgnoringRequests(onlineUser)) {
|
|
||||||
plugin.getLocales().getLocale("error_ignoring_teleport_requests")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.length == 1) {
|
|
||||||
plugin.getRequestManager()
|
|
||||||
.sendTeleportRequest(onlineUser, args[0], TeleportRequest.Type.TPA)
|
|
||||||
.thenAccept(sent -> {
|
|
||||||
if (sent.isEmpty()) {
|
|
||||||
if (args[0].equalsIgnoreCase(onlineUser.getUsername())) {
|
|
||||||
plugin.getLocales().getLocale("error_teleport_request_self")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getLocales().getLocale("error_player_not_found", args[0])
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getLocales().getLocale("tpa_request_sent", sent.get().getRecipientName())
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpa <player>")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
|
||||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
|
||||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
package net.william278.huskhomes.command;
|
|
||||||
|
|
||||||
import net.william278.huskhomes.HuskHomes;
|
|
||||||
import net.william278.huskhomes.user.OnlineUser;
|
|
||||||
import net.william278.huskhomes.teleport.TeleportRequest;
|
|
||||||
import net.william278.huskhomes.util.Permission;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class TpaHereCommand extends Command implements TabProvider {
|
|
||||||
|
|
||||||
protected TpaHereCommand(@NotNull HuskHomes implementor) {
|
|
||||||
super("tpahere", Permission.COMMAND_TPAHERE, implementor);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
|
||||||
if (plugin.getRequestManager().isIgnoringRequests(onlineUser)) {
|
|
||||||
plugin.getLocales().getLocale("error_ignoring_teleport_requests")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.length == 1) {
|
|
||||||
plugin.getRequestManager()
|
|
||||||
.sendTeleportRequest(onlineUser, args[0], TeleportRequest.Type.TPA_HERE)
|
|
||||||
.thenAccept(sent -> {
|
|
||||||
if (sent.isEmpty()) {
|
|
||||||
if (args[0].equalsIgnoreCase(onlineUser.getUsername())) {
|
|
||||||
plugin.getLocales().getLocale("error_teleport_request_self")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getLocales().getLocale("error_player_not_found", args[0])
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getLocales().getLocale("tpahere_request_sent", sent.get().getRecipientName())
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpahere <player>")
|
|
||||||
.ifPresent(onlineUser::sendMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public final List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
|
||||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
|
||||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
|
||||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package net.william278.huskhomes.command;
|
||||||
|
|
||||||
|
import net.william278.huskhomes.HuskHomes;
|
||||||
|
import net.william278.huskhomes.user.CommandUser;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public interface UserListTabProvider extends TabProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Nullable
|
||||||
|
default List<String> suggest(@NotNull CommandUser user, @NotNull String[] args) {
|
||||||
|
return args.length <= 1 ? getPlugin().getCache().getPlayers().stream()
|
||||||
|
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
||||||
|
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
HuskHomes getPlugin();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -115,6 +115,26 @@ public class RequestsManager {
|
|||||||
.findFirst());
|
.findFirst());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendTeleportAllRequest(@NotNull OnlineUser requester) {
|
||||||
|
final long expiry = Instant.now().getEpochSecond() + plugin.getSettings().getTeleportRequestExpiryTime();
|
||||||
|
final TeleportRequest request = new TeleportRequest(requester, TeleportRequest.Type.TPA_HERE, expiry);
|
||||||
|
for (OnlineUser onlineUser : plugin.getOnlineUsers()) {
|
||||||
|
if (onlineUser.equals(requester)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
request.setRecipientName(onlineUser.getUsername());
|
||||||
|
sendLocalTeleportRequest(request, onlineUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plugin.getSettings().isCrossServer()) {
|
||||||
|
Message.builder()
|
||||||
|
.type(Message.Type.TELEPORT_REQUEST)
|
||||||
|
.payload(Payload.withTeleportRequest(request))
|
||||||
|
.target(Message.TARGET_ALL)
|
||||||
|
.build().send(plugin.getMessenger(), requester);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a teleport request of the given type to the specified user, by name, if they exist.
|
* Sends a teleport request of the given type to the specified user, by name, if they exist.
|
||||||
*
|
*
|
||||||
@@ -122,7 +142,8 @@ public class RequestsManager {
|
|||||||
* @param targetUser The user to send the request to
|
* @param targetUser The user to send the request to
|
||||||
* @param type The type of request to send
|
* @param type The type of request to send
|
||||||
*/
|
*/
|
||||||
public void sendTeleportRequest(@NotNull OnlineUser requester, @NotNull String targetUser, @NotNull TeleportRequest.Type type) throws IllegalArgumentException {
|
public void sendTeleportRequest(@NotNull OnlineUser requester, @NotNull String targetUser,
|
||||||
|
@NotNull TeleportRequest.Type type) throws IllegalArgumentException {
|
||||||
final long expiry = Instant.now().getEpochSecond() + plugin.getSettings().getTeleportRequestExpiryTime();
|
final long expiry = Instant.now().getEpochSecond() + plugin.getSettings().getTeleportRequestExpiryTime();
|
||||||
final TeleportRequest request = new TeleportRequest(requester, type, expiry);
|
final TeleportRequest request = new TeleportRequest(requester, type, expiry);
|
||||||
final Optional<OnlineUser> localTarget = plugin.findOnlinePlayer(targetUser);
|
final Optional<OnlineUser> localTarget = plugin.findOnlinePlayer(targetUser);
|
||||||
@@ -130,7 +151,6 @@ public class RequestsManager {
|
|||||||
if (localTarget.get().equals(requester)) {
|
if (localTarget.get().equals(requester)) {
|
||||||
throw new IllegalArgumentException("Cannot send a teleport request to yourself");
|
throw new IllegalArgumentException("Cannot send a teleport request to yourself");
|
||||||
}
|
}
|
||||||
request.setRecipientName(localTarget.get().getUsername());
|
|
||||||
sendLocalTeleportRequest(request, localTarget.get());
|
sendLocalTeleportRequest(request, localTarget.get());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -156,6 +176,8 @@ public class RequestsManager {
|
|||||||
* sent because the recipient is ignoring requests or is vanished ({@link OnlineUser#isVanished()})
|
* sent because the recipient is ignoring requests or is vanished ({@link OnlineUser#isVanished()})
|
||||||
*/
|
*/
|
||||||
public void sendLocalTeleportRequest(@NotNull TeleportRequest request, @NotNull OnlineUser recipient) {
|
public void sendLocalTeleportRequest(@NotNull TeleportRequest request, @NotNull OnlineUser recipient) {
|
||||||
|
request.setRecipientName(recipient.getUsername());
|
||||||
|
|
||||||
// Silently ignore the request if the recipient is ignoring requests or is vanished
|
// Silently ignore the request if the recipient is ignoring requests or is vanished
|
||||||
if (isIgnoringRequests(recipient) || recipient.isVanished()) {
|
if (isIgnoringRequests(recipient) || recipient.isVanished()) {
|
||||||
request.setStatus(TeleportRequest.Status.IGNORED);
|
request.setStatus(TeleportRequest.Status.IGNORED);
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public class Message {
|
public class Message {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message target indicating all players
|
||||||
|
*/
|
||||||
|
public static final String TARGET_ALL = "ALL";
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
private UUID id;
|
private UUID id;
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import net.william278.huskhomes.user.OnlineUser;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import redis.clients.jedis.JedisPubSub;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redis message broker implementation
|
* Redis PubSub broker implementation
|
||||||
*/
|
*/
|
||||||
public class RedisBroker extends PluginMessageBroker {
|
public class RedisBroker extends PluginMessageBroker {
|
||||||
private JedisPool jedisPool;
|
private JedisPool jedisPool;
|
||||||
@@ -50,9 +50,9 @@ public class RedisBroker extends PluginMessageBroker {
|
|||||||
|
|
||||||
final Message message = plugin.getGson().fromJson(encodedMessage, Message.class);
|
final Message message = plugin.getGson().fromJson(encodedMessage, Message.class);
|
||||||
plugin.getOnlineUsers().stream()
|
plugin.getOnlineUsers().stream()
|
||||||
.filter(online -> online.getUsername().equalsIgnoreCase(message.getTarget()))
|
.filter(online -> message.getTarget().equals(Message.TARGET_ALL)
|
||||||
.findFirst()
|
|| online.getUsername().equals(message.getTarget()))
|
||||||
.ifPresent(receiver -> handle(receiver, message));
|
.forEach(receiver -> handle(receiver, message));
|
||||||
}
|
}
|
||||||
}, getSubChannelId());
|
}, getSubChannelId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ public class Teleport {
|
|||||||
// Teleport a local user
|
// Teleport a local user
|
||||||
final OnlineUser teleporter = localTeleporter.get();
|
final OnlineUser teleporter = localTeleporter.get();
|
||||||
if (target instanceof Username username) {
|
if (target instanceof Username username) {
|
||||||
final Optional<OnlineUser> localTarget = username.findLocally(plugin);
|
final Optional<OnlineUser> localTarget = username.name().equals("@s")
|
||||||
|
? Optional.of(executor) : username.findLocally(plugin);
|
||||||
if (localTarget.isPresent()) {
|
if (localTarget.isPresent()) {
|
||||||
fireEvent((event) -> {
|
fireEvent((event) -> {
|
||||||
executeEconomyActions();
|
executeEconomyActions();
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public class TeleportBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void validateTeleport() throws IllegalStateException {
|
private void validateTeleport() throws IllegalStateException {
|
||||||
|
if (teleporter == null) {
|
||||||
|
throw new IllegalStateException("Teleporter must be set");
|
||||||
|
}
|
||||||
if (executor == null) {
|
if (executor == null) {
|
||||||
if (teleporter instanceof OnlineUser onlineUser) {
|
if (teleporter instanceof OnlineUser onlineUser) {
|
||||||
executor = onlineUser;
|
executor = onlineUser;
|
||||||
@@ -44,9 +47,6 @@ public class TeleportBuilder {
|
|||||||
throw new IllegalStateException("Executor must be set if teleporter is not an OnlineUser");
|
throw new IllegalStateException("Executor must be set if teleporter is not an OnlineUser");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (teleporter == null) {
|
|
||||||
throw new IllegalStateException("Teleporter must be set");
|
|
||||||
}
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
throw new IllegalStateException("Target must be set");
|
throw new IllegalStateException("Target must be set");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ teleporting_action_bar_processing: '[Teleporting…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Телепортацията отказана!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Телепортацията отказана!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teleporting](#00fb9a) [%1%](#00fb9a bold) [player(s) to your position…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#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)'
|
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)'
|
tpahere_request_sent: '[You sent a teleport request asking](#00fb9a) [%1%](#00fb9a bold) [to teleport to you.](#00fb9a)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teleportiere…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Teleportation abgebrochen!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Teleportation abgebrochen!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[%1% wurde zu %2% teleportiert.](#00fb9a)'
|
teleporting_other_complete: '[%1% wurde zu %2% teleportiert.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[%1% wurde zu ⚐ x: %2%, y: %3%, z: %4% teleportiert.](#00fb9a)'
|
teleporting_other_complete_position: '[%1% wurde zu ⚐ x: %2%, y: %3%, z: %4% teleportiert.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teleportiere](#00fb9a) [%1%](#00fb9a bold) [Spieler zu deiner Position…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Eine zufällige sichere Position um dich zu teleportieren, wird gesucht…](#00fb9a)'
|
teleporting_random_generation: '[Eine zufällige sichere Position um dich zu teleportieren, wird gesucht…](#00fb9a)'
|
||||||
tpa_request_sent: '[Du hast](#00fb9a) [%1%](#00fb9a bold) [eine Teleportanfrage gesendet.](#00fb9a)'
|
tpa_request_sent: '[Du hast](#00fb9a) [%1%](#00fb9a bold) [eine Teleportanfrage gesendet.](#00fb9a)'
|
||||||
tpahere_request_sent: '[Du hast eine Teleportanfrage gestellt und](#00fb9a) [%1%](#00fb9a bold) [gebeten sich zu dir zu teleportieren.](#00fb9a)'
|
tpahere_request_sent: '[Du hast eine Teleportanfrage gestellt und](#00fb9a) [%1%](#00fb9a bold) [gebeten sich zu dir zu teleportieren.](#00fb9a)'
|
||||||
tpaall_request_sent: '[Du hast eine Teleportanfrage gestellt und](#00fb9a) [%1%](#00fb9a bold) [Spieler gebeten sich zu dir zu teleportieren.](#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) [hat darum gebeten, sich zu dir zu teleportieren.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [hat darum gebeten, sich zu dir zu teleportieren.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold) [hat darum gebeten, dass du dich zu ihm teleportierst.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold) [hat darum gebeten, dass du dich zu ihm teleportierst.](#00fb9a)'
|
||||||
teleport_request_buttons: '[Optionen:](gray) [[✔ Akzeptieren…]](#00fb9a show_text=�fb9a&Teleportanfrage akzeptieren\n&8Klicke, um die Teleportanfrage von %1% zu akzeptieren run_command=/huskhomes:tpaccept %1%) [[❌ Ablehnen…]](#ff3300 show_text=&#ff3300&Teleportanfrage ablehnen\n&8Klicke, um die Teleportanfrage von %1% abzulehnen run_command=/huskhomes:tpdeny %1%)'
|
teleport_request_buttons: '[Optionen:](gray) [[✔ Akzeptieren…]](#00fb9a show_text=�fb9a&Teleportanfrage akzeptieren\n&8Klicke, um die Teleportanfrage von %1% zu akzeptieren run_command=/huskhomes:tpaccept %1%) [[❌ Ablehnen…]](#ff3300 show_text=&#ff3300&Teleportanfrage ablehnen\n&8Klicke, um die Teleportanfrage von %1% abzulehnen run_command=/huskhomes:tpdeny %1%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teleporting…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Teleportation cancelled!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Teleportation cancelled!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teleporting](#00fb9a) [%1%](#00fb9a bold) [player(s) to your position…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#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)'
|
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)'
|
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)'
|
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)'
|
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%)'
|
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%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teletransportando...](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[¡Teleportación cancelada!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[¡Teleportación cancelada!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Teletransportado %1% a %2%.](#00fb9a)'
|
teleporting_other_complete: '[Teletransportado %1% a %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Teletransportado %1% a ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Teletransportado %1% a ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teletransportando a ](#00fb9a) [%1%](#00fb9a bold) [jugador(es) a su posición...](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#00fb9a)'
|
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#00fb9a)'
|
||||||
tpa_request_sent: '[Has enviado una solicitud de teletransporte a](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
tpa_request_sent: '[Has enviado una solicitud de teletransporte a](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
||||||
tpahere_request_sent: '[Has enviado una solicitud de teletransporte pidiendo a](#00fb9a) [%1%](#00fb9a bold) [que se teletransporte hacia ti.](#00fb9a)'
|
tpahere_request_sent: '[Has enviado una solicitud de teletransporte pidiendo a](#00fb9a) [%1%](#00fb9a bold) [que se teletransporte hacia ti.](#00fb9a)'
|
||||||
tpaall_request_sent: '[Has enviado una solicitud de teletransporte a](#00fb9a) [%1%](#00fb9a bold) [jugador(es) para teletransportarse hacia ti.](#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) [ha solicitado teletransportarse hacia ti.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [ha solicitado teletransportarse hacia ti.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold) [ha solicitado que te teletransportes a ellos.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold) [ha solicitado que te teletransportes a ellos.](#00fb9a)'
|
||||||
teleport_request_buttons: '[Opciones:](gray) [[✔ Aceptar…]](#00fb9a show_text=�fb9a&Aceptar solicitud de teletransporte\n&8Clic para aceptar la solicitud de %1%. run_command=/huskhomes:tpaccept %1%) [[❌ Rechazar…]](#ff3300 show_text=&#ff3300&Decline teleport request\n&8Clic para rechazar la solicitud de %1%. run_command=/huskhomes:tpdeny %1%)'
|
teleport_request_buttons: '[Opciones:](gray) [[✔ Aceptar…]](#00fb9a show_text=�fb9a&Aceptar solicitud de teletransporte\n&8Clic para aceptar la solicitud de %1%. run_command=/huskhomes:tpaccept %1%) [[❌ Rechazar…]](#ff3300 show_text=&#ff3300&Decline teleport request\n&8Clic para rechazar la solicitud de %1%. run_command=/huskhomes:tpdeny %1%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teletrasporto in corso...](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Teletrasporto cancellato!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Teletrasporto cancellato!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Hai teletrasportato %1% da %2%.](#00fb9a)'
|
teleporting_other_complete: '[Hai teletrasportato %1% da %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Hai telerasportato %1% a ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Hai telerasportato %1% a ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Stai teletrasportando](#00fb9a) [%1%](#00fb9a bold) [giocatore(i) nella tua posizione…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Ricerca di un punto di teletrasporto sicuro…](#00fb9a)'
|
teleporting_random_generation: '[Ricerca di un punto di teletrasporto sicuro…](#00fb9a)'
|
||||||
tpa_request_sent: '[Hai richiesto di teletrasportarti da](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
tpa_request_sent: '[Hai richiesto di teletrasportarti da](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
||||||
tpahere_request_sent: '[Hai richiesto il teletrasporto a](#00fb9a) [%1%](#00fb9a bold) [ verso la tua posizione.](#00fb9a)'
|
tpahere_request_sent: '[Hai richiesto il teletrasporto a](#00fb9a) [%1%](#00fb9a bold) [ verso la tua posizione.](#00fb9a)'
|
||||||
tpaall_request_sent: '[Hai chiesto a](#00fb9a) [%1%](#00fb9a bold) [ giocatore(i) di teletrasportarsi da te.](#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) [ha richiesto di teletrasportarsi da te.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [ha richiesto di teletrasportarsi da te.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold) [ha richiesto di teletrasportarti da lui.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold) [ha richiesto di teletrasportarti da lui.](#00fb9a)'
|
||||||
teleport_request_buttons: '[Opzioni:](gray) [[✔ Accetta…]](#00fb9a show_text=�fb9a&Accetta la richiesta di teletrasporto\n&8Clicca per accettare la richiesta di %1% 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%)'
|
teleport_request_buttons: '[Opzioni:](gray) [[✔ Accetta…]](#00fb9a show_text=�fb9a&Accetta la richiesta di teletrasporto\n&8Clicca per accettare la richiesta di %1% 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%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teleporting…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Teleportacja anulowana!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Teleportacja anulowana!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teleporting](#00fb9a) [%1%](#00fb9a bold) [player(s) to your position…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#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)'
|
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)'
|
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)'
|
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)'
|
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%)'
|
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%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Işınlanılıyor…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Işınlanma iptal edildi!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Işınlanma iptal edildi!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[%1% den %2% ye ışınlanıldı.](#00fb9a)'
|
teleporting_other_complete: '[%1% den %2% ye ışınlanıldı.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[%1% ⚐ konumuna ışınlandı x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[%1% ⚐ konumuna ışınlandı x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[%1%](#00fb9a bold) [oyuncu(lar) konumunuza ışınlanıyor……](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Sizi ışınlamak için güvenli bir rasgele konum aranıyor…](#00fb9a)'
|
teleporting_random_generation: '[Sizi ışınlamak için güvenli bir rasgele konum aranıyor…](#00fb9a)'
|
||||||
tpa_request_sent: '[%1%](#00fb9a bold) [hedefine ışınlanmak için bir ışınlanma isteği gönderdiniz.](#00fb9a)'
|
tpa_request_sent: '[%1%](#00fb9a bold) [hedefine ışınlanmak için bir ışınlanma isteği gönderdiniz.](#00fb9a)'
|
||||||
tpahere_request_sent: '[%1%](#00fb9a bold) [adlı oyuncunun size ışınlanmasını isteyen bir ışınlanma isteği gönderdiniz.](#00fb9a)'
|
tpahere_request_sent: '[%1%](#00fb9a bold) [adlı oyuncunun size ışınlanmasını isteyen bir ışınlanma isteği gönderdiniz.](#00fb9a)'
|
||||||
tpaall_request_sent: '[%1%](#00fb9a bold) [oyuncunun size ışınlanmasını isteyen bir ışınlanma isteği gönderdiniz.](#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) [size ışınlanmak istiyor.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [size ışınlanmak istiyor.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold)[, ona ışınlanmanızı istiyor.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold)[, ona ışınlanmanızı istiyor.](#00fb9a)'
|
||||||
teleport_request_buttons: '[Seçenekler:](gray) [[✔ Kabul et…]](#00fb9a show_text=�fb9a&Işınlanma isteğini kabul et\n&8%1% adlı oyuncunun isteğini kabul etmek için tıklayın run_command=/huskhomes:tpaccept %1%) [[❌ Reddet…]](#ff3300 show_text=&#ff3300&Işınlanmayı reddet request\n&8%1% adlı oyuncunun isteğini reddetmek için tıklayın run_command=/huskhomes:tpdeny %1%)'
|
teleport_request_buttons: '[Seçenekler:](gray) [[✔ Kabul et…]](#00fb9a show_text=�fb9a&Işınlanma isteğini kabul et\n&8%1% adlı oyuncunun isteğini kabul etmek için tıklayın run_command=/huskhomes:tpaccept %1%) [[❌ Reddet…]](#ff3300 show_text=&#ff3300&Işınlanmayı reddet request\n&8%1% adlı oyuncunun isteğini reddetmek için tıklayın run_command=/huskhomes:tpdeny %1%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[Teleporting…](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[Телепортацію скасовано!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[Телепортацію скасовано!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
teleporting_other_complete: '[Teleported %1% to %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[Teleported %1% to ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[Teleporting](#00fb9a) [%1%](#00fb9a bold) [player(s) to your position…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[Finding a safe random position to teleport you to…](#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)'
|
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)'
|
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)'
|
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)'
|
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%)'
|
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%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[传送……](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[传送取消!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[传送取消!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[将 %1% 传送到 %2%.](#00fb9a)'
|
teleporting_other_complete: '[将 %1% 传送到 %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[将 %1% 传送到 ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[将 %1% 传送到 ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[将](#00fb9a) [%1%](#00fb9a bold) [名玩家传送到您的位置…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[正在寻找一个安全的随机位置传送您…](#00fb9a)'
|
teleporting_random_generation: '[正在寻找一个安全的随机位置传送您…](#00fb9a)'
|
||||||
tpa_request_sent: '[已发送传送请求, 传送到](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
tpa_request_sent: '[已发送传送请求, 传送到](#00fb9a) [%1%](#00fb9a bold)[.](#00fb9a)'
|
||||||
tpahere_request_sent: '[已发送传送请求, 请求](#00fb9a) [%1%](#00fb9a bold) [传送过来.](#00fb9a)'
|
tpahere_request_sent: '[已发送传送请求, 请求](#00fb9a) [%1%](#00fb9a bold) [传送过来.](#00fb9a)'
|
||||||
tpaall_request_sent: '[已发送传送请求, 请求](#00fb9a) [%1%](#00fb9a bold) [传送过来.](#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) [请求传送过来.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [请求传送过来.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold) [请求您传送过去.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold) [请求您传送过去.](#00fb9a)'
|
||||||
teleport_request_buttons: '[选项:](gray) [[✔ 接受…]](#00fb9a show_text=�fb9a&接受传送请求\n&8点击接受 %1% 的请求 run_command=/huskhomes:tpaccept %1%) [[❌ 拒绝…]](#ff3300 show_text=&#ff3300&拒绝传送请求\n&8点击拒绝 %1% 的请求 run_command=/huskhomes:tpdeny %1%)'
|
teleport_request_buttons: '[选项:](gray) [[✔ 接受…]](#00fb9a show_text=�fb9a&接受传送请求\n&8点击接受 %1% 的请求 run_command=/huskhomes:tpaccept %1%) [[❌ 拒绝…]](#ff3300 show_text=&#ff3300&拒绝传送请求\n&8点击拒绝 %1% 的请求 run_command=/huskhomes:tpdeny %1%)'
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ teleporting_action_bar_processing: '[傳送中……](#00fb9a)'
|
|||||||
teleporting_action_bar_cancelled: '[傳送取消!](#ff7e5e)'
|
teleporting_action_bar_cancelled: '[傳送取消!](#ff7e5e)'
|
||||||
teleporting_other_complete: '[將 %1% 傳送到 %2%.](#00fb9a)'
|
teleporting_other_complete: '[將 %1% 傳送到 %2%.](#00fb9a)'
|
||||||
teleporting_other_complete_position: '[將 %1% 傳送到 ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
teleporting_other_complete_position: '[將 %1% 傳送到 ⚐ x: %2%, y: %3%, z: %4%.](#00fb9a)'
|
||||||
teleporting_all_players: '[將](#00fb9a) [%1%](#00fb9a bold) [名玩家傳送到您的位置…](#00fb9a)'
|
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'
|
||||||
teleporting_random_generation: '[正在尋找一個安全的隨機位置…](#00fb9a)'
|
teleporting_random_generation: '[正在尋找一個安全的隨機位置…](#00fb9a)'
|
||||||
tpa_request_sent: '[您發送了一個傳送請求給](#00fb9a) [%1%](#00fb9a bold)'
|
tpa_request_sent: '[您發送了一個傳送請求給](#00fb9a) [%1%](#00fb9a bold)'
|
||||||
tpahere_request_sent: '[您發送了一個傳送請求, 請求](#00fb9a) [%1%](#00fb9a bold) [傳送過來.](#00fb9a)'
|
tpahere_request_sent: '[您發送了一個傳送請求, 請求](#00fb9a) [%1%](#00fb9a bold) [傳送過來.](#00fb9a)'
|
||||||
tpaall_request_sent: '[你向所有玩家發送了一個傳送請求,要求](#00fb9a) [%1%](#00fb9a bold) [個玩家傳送到你身邊!.](#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) [請求傳送過來.](#00fb9a)'
|
tpa_request_received: '[%1%](#00fb9a bold) [請求傳送過來.](#00fb9a)'
|
||||||
tpahere_request_received: '[%1%](#00fb9a bold) [請求您傳送過去.](#00fb9a)'
|
tpahere_request_received: '[%1%](#00fb9a bold) [請求您傳送過去.](#00fb9a)'
|
||||||
teleport_request_buttons: '[傳送請求:](gray) [[✔ 接受…]](#00fb9a show_text=�fb9a&接受傳送請求\n&8點擊接受 %1% 的請求 run_command=/huskhomes:tpaccept %1%) [[❌ 拒絕…]](#ff3300 show_text=&#ff3300&拒絕傳送請求\n&8點擊拒絕 %1% 的請求 run_command=/huskhomes:tpdeny %1%)'
|
teleport_request_buttons: '[傳送請求:](gray) [[✔ 接受…]](#00fb9a show_text=�fb9a&接受傳送請求\n&8點擊接受 %1% 的請求 run_command=/huskhomes:tpaccept %1%) [[❌ 拒絕…]](#ff3300 show_text=&#ff3300&拒絕傳送請求\n&8點擊拒絕 %1% 的請求 run_command=/huskhomes:tpdeny %1%)'
|
||||||
|
|||||||
Reference in new issue
Block a user