diff options
author | ingle <inglettronald@gmail.com> | 2022-09-23 22:24:48 -0500 |
---|---|---|
committer | ingle <inglettronald@gmail.com> | 2022-09-23 22:25:15 -0500 |
commit | 3cd5f5f32cd60c15e1c68862d28885f733473dad (patch) | |
tree | b58f43d7a27cfab3246b7b32a84ff1b8518dd3b9 /src/main/kotlin/dulkirmod/command | |
parent | 982f4e721ea20eaef3056050ad0b6a5058d24354 (diff) | |
download | DulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.tar.gz DulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.tar.bz2 DulkirMod-3cd5f5f32cd60c15e1c68862d28885f733473dad.zip |
Some things work now
Diffstat (limited to 'src/main/kotlin/dulkirmod/command')
5 files changed, 104 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/command/ClientCommandBase.kt b/src/main/kotlin/dulkirmod/command/ClientCommandBase.kt new file mode 100644 index 0000000..73a4fea --- /dev/null +++ b/src/main/kotlin/dulkirmod/command/ClientCommandBase.kt @@ -0,0 +1,18 @@ +package dulkirmod.command + +import net.minecraft.command.CommandBase +import net.minecraft.command.ICommandSender + +abstract class ClientCommandBase protected constructor(private val name: String) : CommandBase() { + override fun getCommandName(): String { + return name + } + + override fun getCommandUsage(sender: ICommandSender): String { + return "/$name" + } + + override fun canCommandSenderUseCommand(sender: ICommandSender): Boolean { + return true + } +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt b/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt new file mode 100644 index 0000000..40cdc6c --- /dev/null +++ b/src/main/kotlin/dulkirmod/command/EnchantRuneCommand.kt @@ -0,0 +1,24 @@ +package dulkirmod.command + +import dulkirmod.DulkirMod.Companion.config +import dulkirmod.DulkirMod.Companion.mc +import net.minecraft.command.CommandException +import net.minecraft.command.ICommandSender +import net.minecraft.util.ChatComponentText +import net.minecraft.util.EnumChatFormatting + +class EnchantRuneCommand : ClientCommandBase("enchantrune") { + @Throws(CommandException::class) + override fun processCommand(sender: ICommandSender, args: Array<String>) { + mc.thePlayer.addChatMessage( + ChatComponentText( + EnumChatFormatting.BLUE.toString() + "" + "Enchant rune hider toggled - now: " + + EnumChatFormatting.GREEN + !config.hideEnchantRune + ) + ) + config.hideEnchantRune = !config.hideEnchantRune + + config.markDirty() + config.writeData() + } +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/FairyCommand.kt b/src/main/kotlin/dulkirmod/command/FairyCommand.kt new file mode 100644 index 0000000..ba7a74b --- /dev/null +++ b/src/main/kotlin/dulkirmod/command/FairyCommand.kt @@ -0,0 +1,24 @@ +package dulkirmod.command + +import dulkirmod.DulkirMod.Companion.config +import dulkirmod.DulkirMod.Companion.mc +import net.minecraft.command.CommandException +import net.minecraft.command.ICommandSender +import net.minecraft.util.ChatComponentText +import net.minecraft.util.EnumChatFormatting + +class FairyCommand : ClientCommandBase("fairy") { + @Throws(CommandException::class) + override fun processCommand(sender: ICommandSender, args: Array<String>) { + mc.thePlayer.addChatMessage( + ChatComponentText( + EnumChatFormatting.BLUE.toString() + "Healer fairy hider toggled - now: " + + EnumChatFormatting.GREEN + !config.hideHealerFairy + ) + ) + config.hideHealerFairy = !config.hideHealerFairy + + config.markDirty() + config.writeData() + } +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/HelpCommand.kt b/src/main/kotlin/dulkirmod/command/HelpCommand.kt new file mode 100644 index 0000000..804cb5c --- /dev/null +++ b/src/main/kotlin/dulkirmod/command/HelpCommand.kt @@ -0,0 +1,28 @@ +package dulkirmod.command + +import net.minecraft.client.Minecraft +import net.minecraft.command.CommandException +import net.minecraft.command.ICommandSender +import net.minecraft.util.ChatComponentText +import net.minecraft.util.EnumChatFormatting + +class HelpCommand : ClientCommandBase("dulkirhelp") { + @Throws(CommandException::class) + override fun processCommand(sender: ICommandSender, args: Array<String>) { + Minecraft.getMinecraft().thePlayer.addChatMessage( + ChatComponentText( + EnumChatFormatting.GOLD.toString() + "" + EnumChatFormatting.BOLD + " HI THIS IS DULKIRMOD!" + ) + ) + Minecraft.getMinecraft().thePlayer.addChatMessage( + ChatComponentText( + EnumChatFormatting.GRAY.toString() + "/enchantrune - toggles enchant rune visibility." + ) + ) + Minecraft.getMinecraft().thePlayer.addChatMessage( + ChatComponentText( + EnumChatFormatting.GRAY.toString() + "/fairy - toggles healer fairy visibility." + ) + ) + } +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/command/SettingsCommand.kt b/src/main/kotlin/dulkirmod/command/SettingsCommand.kt new file mode 100644 index 0000000..5f16652 --- /dev/null +++ b/src/main/kotlin/dulkirmod/command/SettingsCommand.kt @@ -0,0 +1,10 @@ +package dulkirmod.command + +import dulkirmod.DulkirMod +import net.minecraft.command.ICommandSender + +class SettingsCommand : ClientCommandBase("dulkir") { + override fun processCommand(sender: ICommandSender?, args: Array<out String>?) { + DulkirMod.display = DulkirMod.config.gui() + } +}
\ No newline at end of file |