diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2023-06-27 18:26:40 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 18:26:40 +1000 |
commit | ba9c370c88f02b3bffff97d0a347e1c29f847d02 (patch) | |
tree | f2f1312e7fd0014533b2cc4d890b450e38d07a27 | |
parent | c09a19dbca495a518dd62abaa00ac9684751f52d (diff) | |
download | NotEnoughUpdates-ba9c370c88f02b3bffff97d0a347e1c29f847d02.tar.gz NotEnoughUpdates-ba9c370c88f02b3bffff97d0a347e1c29f847d02.tar.bz2 NotEnoughUpdates-ba9c370c88f02b3bffff97d0a347e1c29f847d02.zip |
Fix pv not having a skyblock check (#716)
Co-authored-by: nea <nea@nea.moe>
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt index da97f0d2..41cd6b0f 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt @@ -19,7 +19,6 @@ package io.github.moulberry.notenoughupdates.commands.misc -import com.mojang.brigadier.arguments.StringArgumentType.string import com.mojang.brigadier.context.CommandContext import io.github.moulberry.notenoughupdates.NotEnoughUpdates import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe @@ -36,7 +35,11 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @NEUAutoSubscribe class ProfileViewerCommands { companion object { - fun CommandContext<ICommandSender>.openPv(name: String) { + fun CommandContext<ICommandSender>.openPv(name: String?) { + if (!NotEnoughUpdates.INSTANCE.isOnSkyblock) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/pv ${name ?: ""}") + return + } if (!OpenGlHelper.isFramebufferEnabled()) { reply("${RED}Some parts of the profile viewer do not work with OptiFine Fast Render. Go to ESC > Options > Video Settings > Performance > Fast Render to disable it.") } @@ -46,7 +49,9 @@ class ProfileViewerCommands { return } - NotEnoughUpdates.profileViewer.loadPlayerByName(name) { profile -> + NotEnoughUpdates.profileViewer.loadPlayerByName( + name ?: Minecraft.getMinecraft().thePlayer.name + ) { profile -> if (profile == null) { reply("${RED}Invalid player name/API key. Maybe the API is down? Try /api new.") } else { @@ -64,9 +69,9 @@ class ProfileViewerCommands { event.command(name) { thenExecute { before() - openPv(Minecraft.getMinecraft().thePlayer.name) + openPv(null) } - thenArgument("player", string()) { player -> + thenArgument("player", RestArgumentType) { player -> suggestsList { Minecraft.getMinecraft().theWorld.playerEntities.map { it.name } } thenExecute { before() |