Skip to content

Commit

Permalink
Check if player is connected to MCC related server + give notice in t…
Browse files Browse the repository at this point in the history
…he bugreport that it was automatically generated
  • Loading branch information
derNiklaas committed Apr 4, 2024
1 parent aa6bff6 commit 05d98dd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.derniklaas.buildbugs

import de.derniklaas.buildbugs.utils.Utils
import net.fabricmc.api.ClientModInitializer
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
Expand Down Expand Up @@ -38,8 +39,12 @@ class BuildBugsClientEntrypoint : ClientModInitializer {
BugCreator.report()
}
if (bugreportKeybinding.wasPressed()) {
if(!Utils.isOnMCCServer()) {
Utils.sendErrorMessage("You are not connected to a MCC related server.")
return@register
}
val player = it.player ?: return@register
player.networkHandler.sendCommand("bugreport")
player.networkHandler.sendCommand("bugreport Generated using BuildBugs Mod - contact on discord: derniklaas")
}
}
}
Expand Down

0 comments on commit 05d98dd

Please sign in to comment.