aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ProfileViewerCommands.kt15
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()