io.github.parzivalExe.guiApi.commands.GuiXMLCommand.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guiapi-mc1.8 Show documentation
Show all versions of guiapi-mc1.8 Show documentation
With GuiAPI you can create Guis for your Bukkit/Spigot-Plugin in seconds while at the same time saving many lines of code
The newest version!
package io.github.parzivalExe.guiApi.commands
import io.github.parzivalExe.guiApi.Gui
import io.github.parzivalExe.guiApi.GuiApiInitializer
import io.github.parzivalExe.guiApi.PathOrigin
import io.github.parzivalExe.guiApi.components.Component
import io.github.parzivalExe.guiApi.components.ComponentClickAction
import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender
import org.bukkit.entity.Player
import org.bukkit.event.inventory.ClickType
import org.bukkit.event.inventory.InventoryAction
class GuiXMLCommand : CommandExecutor {
override fun onCommand(sender: CommandSender?, command: Command?, label: String?, args: Array?): Boolean {
if(sender is Player && args!!.size == 1) {
@Suppress("SpellCheckingInspection")
val gui = Gui.createGui("plugins/GuiAPI/Guis/${args[0]}", PathOrigin.SERVER_ORIGIN)
gui.openGui(sender)
return true
}
@Suppress("SpellCheckingInspection")
sender?.sendMessage("${GuiApiInitializer.PREFIX} The Command needs the name of the file: /guixml [fileName]")
return true
}
}