forked from ChomeNS/chomens-bot-java
improve rtp
This commit is contained in:
parent
604b14270a
commit
094ca5018b
1 changed files with 6 additions and 7 deletions
|
@ -1,9 +1,9 @@
|
|||
package land.chipmunk.chayapak.chomens_bot.commands;
|
||||
|
||||
import land.chipmunk.chayapak.chomens_bot.Bot;
|
||||
import land.chipmunk.chayapak.chomens_bot.chatParsers.data.MutablePlayerListEntry;
|
||||
import land.chipmunk.chayapak.chomens_bot.command.Command;
|
||||
import land.chipmunk.chayapak.chomens_bot.command.CommandContext;
|
||||
import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
|
||||
import land.chipmunk.chayapak.chomens_bot.util.NumberUtilities;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
@ -39,23 +39,22 @@ public class RandomTeleportCommand implements Command {
|
|||
public Component execute(CommandContext context, String[] args, String[] fullArgs) {
|
||||
final Bot bot = context.bot();
|
||||
|
||||
final String stringDisplayName = ComponentUtilities.stringify(context.displayName());
|
||||
final MutablePlayerListEntry sender = context.sender();
|
||||
|
||||
final int positionX = NumberUtilities.between(1_000, 10_000);
|
||||
final int positionZ = NumberUtilities.between(1_000, 10_000);
|
||||
final int positionX = NumberUtilities.between(1_000, 1_000_000);
|
||||
final int positionZ = NumberUtilities.between(1_000, 1_000_000);
|
||||
final String stringPosition = positionX + " 100 " + positionZ; // very 100 y
|
||||
|
||||
context.sendOutput(
|
||||
Component.empty()
|
||||
.append(Component.text("Teleporting "))
|
||||
.append(context.displayName().color(NamedTextColor.AQUA))
|
||||
.append(sender.displayName().color(NamedTextColor.AQUA))
|
||||
.append(Component.text(" to ").color(NamedTextColor.WHITE))
|
||||
.append(Component.text(stringPosition).color(NamedTextColor.GREEN))
|
||||
.append(Component.text("...").color(NamedTextColor.WHITE))
|
||||
);
|
||||
|
||||
// TODO: Use UUID instead of display name because it is a bad idea!!11
|
||||
bot.core().run("essentials:teleport " + stringDisplayName + " " + stringPosition);
|
||||
bot.core().run("essentials:teleport " + sender.profile().getIdAsString() + " " + stringPosition);
|
||||
|
||||
return Component.text("success");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue