Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import meteordevelopment.meteorclient.utils.misc.text.MeteorClickEvent;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.*;
import net.minecraft.server.permissions.Permissions;
import net.minecraft.util.Tuple;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -265,7 +266,17 @@ public static MutableComponent formatCoords(Vec3 pos) {
String coordsString = String.format("(highlight)(underline)%.0f, %.0f, %.0f(default)", pos.x, pos.y, pos.z);
MutableComponent coordsText = formatMsg(coordsString, ChatFormatting.GRAY);

if (BaritoneUtils.IS_AVAILABLE) {
if (mc.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) {
Style style = coordsText.getStyle().applyFormats(ChatFormatting.BOLD)
.withHoverEvent(new HoverEvent.ShowText(
Component.literal("Teleport to coordinates")
))
.withClickEvent(new ClickEvent.SuggestCommand(
String.format("/tp @s %d %d %d", (int) pos.x, (int) pos.y, (int) pos.z)
));

coordsText.setStyle(style);
} else if (BaritoneUtils.IS_AVAILABLE) {
Style style = coordsText.getStyle().applyFormats(ChatFormatting.BOLD)
.withHoverEvent(new HoverEvent.ShowText(
Component.literal("Set as Baritone goal")
Expand Down
Loading