Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4b211e318 | ||
|
|
8e16b05c76 | ||
|
|
5532f33f82 | ||
|
|
68ce448030 | ||
|
|
51090f4e1d | ||
|
|
6a421a7078 | ||
|
|
b9050a46a9 | ||
|
|
3a4c03affe | ||
|
|
7430e35ec2 | ||
|
|
dc13279d44 | ||
|
|
fad61ee007 | ||
|
|
ef23b69d9c |
No files matched your search
@@ -1,22 +1,12 @@
|
|||||||
# KotlinBukkitAPI-Tooling
|
# KotlinBukkitAPI-Tooling
|
||||||
|
|
||||||
[](https://plugins.jetbrains.com/plugin/14913-kotlinbukkitapi-tooling/)
|
[](https://red-tea.gitbook.io/kotlinbukkitkit/genref/getting-started-with-idea-plugin)
|
||||||
|
|
||||||
The KotlinBukkitAPI Tooling is plugin for IntelliJ that helps developers using [KotlinBukkitAPI](https://github.com/DevSrSouza/KotlinBukkitAPI) and scripts for [Bukkript](https://github.com/DevSrSouza/Bukkript).
|
The KotlinBukkitKit Tooling is plugin for IntelliJ that helps developers using [KotlinBukkitKIT](https://github.com/CarcadeX/KotlinBukkitKit)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- [Menu Preview](#Menu-Preview)
|
- Generator of KotlinBukkitKIT project
|
||||||
- Tooling for [Bukkript Scripts](#Bukkript-Script).
|
|
||||||
|
|
||||||
## Menu Preview
|
![Preview] (https://red-tea.gitbook.io/~gitbook/image?url=https:%2F%2F630270463-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1PBqxCHnbDKJwzj8IhJk%252Fuploads%252Fo2jPveKWzw47uGTxMm2Q%252Fimage.png%3Falt=media%26token=403c70a1-fa12-435d-99c2-aab79493de97&width=400&dpr=3&quality=100&sign=5ca18a6e18c88ceb0b5a355577cfb45cadea88b46003ac032ac4f52d7cfe52b0)
|
||||||
|
|
||||||
When using KotlinBukkitAPI Menu DSL you have a good preview of how the slots are arranged in the Menu in the game.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## [Bukkript Script](https://github.com/DevSrSouza/Bukkript/)
|
|
||||||
|
|
||||||
The plugin provides out of the box Bukkript Script resolution (`.bk.kts` files).
|
|
||||||
|
|
||||||

|
|
||||||
@@ -1,64 +1,73 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.intellij") version "0.4.21"
|
id("org.jetbrains.intellij") version "1.17.2"
|
||||||
java
|
java
|
||||||
kotlin("jvm") version "1.4.0"
|
kotlin("jvm") version "1.9.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
val kotlinVersion = "1.4.0"
|
val kotlinVersion = "1.9.0"
|
||||||
val kotlinBukkitAPIVersion = "0.1.0-SNAPSHOT"
|
val kotlinBukkitAPIVersion = "1.0.0.2"
|
||||||
val bukkriptVersion = "0.1.0-SNAPSHOT"
|
|
||||||
|
|
||||||
group = "br.com.devsrsouza.kotlinbukkitapi"
|
group = "tech.carcadex.kotlinbukkitkit"
|
||||||
version = "0.0.4"
|
version = "0.0.2"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
mavenLocal()
|
||||||
maven("http://nexus.devsrsouza.com.br/repository/maven-public/")
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")
|
||||||
|
|
||||||
val changing = Action<ExternalModuleDependency> { isChanging = true }
|
|
||||||
api("br.com.devsrsouza.bukkript:script-definition-embedded:$bukkriptVersion", changing)
|
|
||||||
|
|
||||||
testCompile("junit", "junit", "4.12")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||||
intellij {
|
intellij {
|
||||||
version = "2020.2.1"
|
// version = "2023.3.3"
|
||||||
|
version.set("2023.3.3")
|
||||||
setPlugins("java", "Kotlin")
|
plugins.set(listOf("java", "Kotlin"))
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<JavaPluginConvention> {
|
tasks.withType<KotlinCompile> {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
kotlinOptions.jvmTarget = "17"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
compileJava {
|
||||||
|
sourceCompatibility = "17"
|
||||||
|
targetCompatibility = "17"
|
||||||
|
}
|
||||||
|
jar {
|
||||||
|
duplicatesStrategy = (DuplicatesStrategy.EXCLUDE)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
compileKotlin {
|
runIde {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
jbrVersion.set("jbr_jcef-17.0.9-windows-x64-b1087.11")
|
||||||
}
|
|
||||||
compileTestKotlin {
|
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
publishPlugin {
|
publishPlugin {
|
||||||
token(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken"))
|
token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken"))
|
||||||
|
channels.set(listOf("stable"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml") {
|
tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml") {
|
||||||
sinceBuild("201")
|
|
||||||
untilBuild("202.*")
|
|
||||||
|
|
||||||
pluginDescription("""
|
|
||||||
|
pluginDescription.set("""
|
||||||
<img src="https://github.com/DevSrSouza/KotlinBukkitAPI/raw/master/logo.png" width="417" height="161"/>
|
<img src="https://github.com/DevSrSouza/KotlinBukkitAPI/raw/master/logo.png" width="417" height="161"/>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
The KotlinBukkitAPI Tooling is plugin for IntelliJ that helps
|
The KotlinBukkitKit Tooling is plugin for IntelliJ that helps
|
||||||
<br />
|
<br />
|
||||||
developers using <a href="https://github.com/DevSrSouza/KotlinBukkitAPI">KotlinBukkitAPI</a> and scripts for <a href="https://github.com/DevSrSouza/Bukkript">Bukkript</a>.
|
developers using <a href="https://github.com/CarcadeX/KotlinBukkitKit-Tooling</a>.
|
||||||
<br />
|
<br />
|
||||||
This libraries help build extensions for Minecraft Server using Spigot server.
|
This libraries help build extensions for Minecraft Server using Spigot server.
|
||||||
|
|
||||||
@@ -67,7 +76,8 @@ tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml
|
|||||||
<br />
|
<br />
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href='https://github.com/DevSrSouza/Bukkript'>Bukkript</a></li>
|
|
||||||
|
<li<a href='https://github.com/CarcadeX/KotlinBukkitKit'>KotlinBukkitKit</a></li>
|
||||||
<li<a href='https://github.com/DevSrSouza/KotlinBukkitAPI-Tooling'>KotlinBukkitAPI-Tooling (this plugin)</a></li>
|
<li<a href='https://github.com/DevSrSouza/KotlinBukkitAPI-Tooling'>KotlinBukkitAPI-Tooling (this plugin)</a></li>
|
||||||
<li<a href='https://github.com/DevSrSouza/KotlinBukkitAPI'>KotlinBukkitAPI</a></li>
|
<li<a href='https://github.com/DevSrSouza/KotlinBukkitAPI'>KotlinBukkitAPI</a></li>
|
||||||
<li><a href='https://github.com/KotlinMinecraft/KotlinBukkitAPI-Examples'>KotlinBukkitAPI Examples</a></li>
|
<li><a href='https://github.com/KotlinMinecraft/KotlinBukkitAPI-Examples'>KotlinBukkitAPI Examples</a></li>
|
||||||
@@ -84,14 +94,12 @@ tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml
|
|||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
|
|
||||||
|
|
||||||
changeNotes("""
|
changeNotes.set("""
|
||||||
<h3>0.0.3</h3>
|
<h3>0.0.1</h3>
|
||||||
<br />
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>KotlinBukkitAPI Project Wizard</li>
|
<li>KotlinBukkitAPI Project Wizard</li>
|
||||||
<li>Menu Preview tab only avaiable on projects that was KotlinBukkitAPI or is a Bukkript script.</li>
|
<li>Menu Preview tab only avaiable on projects that was KotlinBukkitAPI.</li>
|
||||||
<li>Custom folder icons for highlight the Bukkript related folders.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
}
|
}
|
||||||
@@ -99,3 +107,6 @@ tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml
|
|||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy.cacheChangingModulesFor(120, "seconds")
|
resolutionStrategy.cacheChangingModulesFor(120, "seconds")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
@file:DependsOn("io.ktor:ktor-client-core:1.4.0")
|
||||||
|
@file:DependsOn("io.ktor:ktor-client-core-jvm:1.4.0")
|
||||||
|
@file:DependsOn("io.ktor:ktor-client-apache:1.4.0")
|
||||||
|
@file:DependsOn("io.ktor:ktor-client-json-jvm:1.4.0")
|
||||||
|
@file:DependsOn("io.ktor:ktor-client-gson:1.4.0")
|
||||||
|
|
||||||
|
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
|
||||||
|
|
||||||
|
// HTML
|
||||||
|
@file:DependsOn("it.skrape:skrapeit-core:1.0.0-alpha6")
|
||||||
|
@file:DependsOn("io.github.rybalkinsd:kohttp:0.12.0")
|
||||||
|
@file:DependsOn("org.jsoup:jsoup:1.13.1")
|
||||||
|
|
||||||
|
// IMAGE RESIZE
|
||||||
|
@file:DependsOn("com.sksamuel.scrimage:scrimage-core:4.0.6")
|
||||||
|
@file:DependsOn("com.sksamuel.scrimage:scrimage-formats-extra:4.0.6")
|
||||||
|
@file:DependsOn("ar.com.hjg:pngj:2.1.0")
|
||||||
|
@file:DependsOn("com.github.zh79325:open-gif:1.0.4")
|
||||||
|
|
||||||
|
// CODE GENERATIOn
|
||||||
|
@file:DependsOn("com.squareup:kotlinpoet:0.6.0")
|
||||||
|
|
||||||
|
import com.sksamuel.scrimage.ImmutableImage
|
||||||
|
import com.sksamuel.scrimage.ScaleMethod
|
||||||
|
import com.sksamuel.scrimage.nio.PngWriter
|
||||||
|
import com.squareup.kotlinpoet.FileSpec
|
||||||
|
import com.squareup.kotlinpoet.TypeSpec
|
||||||
|
import io.ktor.client.*
|
||||||
|
import io.ktor.client.engine.apache.*
|
||||||
|
import io.ktor.client.request.*
|
||||||
|
import it.skrape.core.htmlDocument
|
||||||
|
import it.skrape.extract
|
||||||
|
import it.skrape.skrape
|
||||||
|
import kotlinx.coroutines.flow.asFlow
|
||||||
|
import kotlinx.coroutines.flow.collect
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
|
import java.awt.Color
|
||||||
|
import java.awt.image.BufferedImage
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
data class Item(
|
||||||
|
val id: String,
|
||||||
|
val image: String,
|
||||||
|
)
|
||||||
|
|
||||||
|
var items = skrape {
|
||||||
|
val url = "https://www.deadmap.com/idlist"
|
||||||
|
|
||||||
|
extract {
|
||||||
|
htmlDocument {
|
||||||
|
findFirst("#idlist").findAll("tr") {
|
||||||
|
map {
|
||||||
|
val img = it.findFirst("img")
|
||||||
|
.attribute("src")
|
||||||
|
.replace(" ", "%20")
|
||||||
|
|
||||||
|
val id = it.findFirst("i").text
|
||||||
|
|
||||||
|
Item(id.removePrefix("minecraft:"), "https://www.deadmap.com/$img")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println(items.joinToString("\n"))
|
||||||
|
|
||||||
|
// FIXERS
|
||||||
|
val fixers = mapOf(
|
||||||
|
"staned" to "stained",
|
||||||
|
"dandelion_yellow" to "yellow_dye"
|
||||||
|
)
|
||||||
|
|
||||||
|
items = items.map { it.copy(fixers.entries.fold(it.id) { id, entry -> id.replace(entry.key, entry.value) }) }
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
|
val client = HttpClient(Apache)
|
||||||
|
|
||||||
|
val iconsFolder = File("../src/main/resources/assets/items-13").canonicalFile
|
||||||
|
iconsFolder.mkdirs()
|
||||||
|
|
||||||
|
items
|
||||||
|
.withIndex()
|
||||||
|
.asFlow()
|
||||||
|
.onEach { (index, item) ->
|
||||||
|
val (name, imageUrl) = item
|
||||||
|
println("Downloading item: $name ($index/${items.size - 1})")
|
||||||
|
|
||||||
|
val imageBytes = client.get<ByteArray>(imageUrl)
|
||||||
|
|
||||||
|
val image = ImmutableImage.loader()
|
||||||
|
.type(BufferedImage.TYPE_INT_ARGB)
|
||||||
|
.fromBytes(imageBytes)
|
||||||
|
.run {
|
||||||
|
val tags = metadata.tags()
|
||||||
|
val width = tags.first { it.name.contains("Width") }.rawValue.toInt()
|
||||||
|
val height = tags.first { it.name.contains("Height") }.rawValue.toInt()
|
||||||
|
|
||||||
|
if(width > 32 || height > 32) {
|
||||||
|
scaleTo(32, 32, ScaleMethod.FastScale)
|
||||||
|
} else this
|
||||||
|
}
|
||||||
|
|
||||||
|
image.output(PngWriter.NoCompression, File(iconsFolder, "$name.png"))
|
||||||
|
println("Complete download and resize: $name ($index/${items.size - 1})")
|
||||||
|
}
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
println("Generating MinecrateItem13 Enumeration")
|
||||||
|
|
||||||
|
FileSpec.builder("br.com.devsrsouza.kotlinbukkitapi.tooling.menu", "MinecraftItem13")
|
||||||
|
.addType(
|
||||||
|
TypeSpec.enumBuilder("MinecraftItem13")
|
||||||
|
.apply {
|
||||||
|
for ((id, _) in items) {
|
||||||
|
addEnumConstant(id.toUpperCase())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
.writeTo(File("../src/main/kotlin/").canonicalFile)
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
rootProject.name = "KotlinBukkitAPI-Tooling"
|
rootProject.name = "KotlinBukkitKit-Tooling"
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling
|
|
||||||
|
|
||||||
import com.intellij.ui.IconManager
|
|
||||||
import javax.swing.Icon
|
|
||||||
|
|
||||||
object Assets {
|
|
||||||
private fun load(path: String): Icon {
|
|
||||||
return IconManager.getInstance().getIcon(path, Assets::class.java)
|
|
||||||
}
|
|
||||||
|
|
||||||
private const val assetFolder = "/assets"
|
|
||||||
|
|
||||||
val KotlinBukkitAPIIcon = load("$assetFolder/icons/kotlinbukkitapi-icon.svg")
|
|
||||||
val Bukkript = load("$assetFolder/icons/bukkript.svg")
|
|
||||||
val FolderScript = load("$assetFolder/icons/folderScript.svg")
|
|
||||||
val FolderPlugins = load("$assetFolder/icons/folderPlugins.svg")
|
|
||||||
val FolderBukkript = load("$assetFolder/icons/folderBukkript.svg")
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import com.intellij.ide.actions.CreateFileFromTemplateAction
|
|
||||||
import com.intellij.ide.actions.CreateFileFromTemplateDialog
|
|
||||||
import com.intellij.openapi.project.Project
|
|
||||||
import com.intellij.psi.PsiDirectory
|
|
||||||
import com.intellij.psi.PsiFile
|
|
||||||
|
|
||||||
class BukkriptCreateNewFileAction : CreateFileFromTemplateAction(
|
|
||||||
BUKKRIPT_SCRIPT,
|
|
||||||
BUKKRIPT_DESCRIPTION,
|
|
||||||
BukkriptFileType.INSTANCE.icon
|
|
||||||
) {
|
|
||||||
override fun getActionName(
|
|
||||||
directory: PsiDirectory?,
|
|
||||||
newName: String,
|
|
||||||
templateName: String?
|
|
||||||
): String = BUKKRIPT_CREATE_SCRIPT_DESCRIPTION
|
|
||||||
|
|
||||||
override fun createFile(
|
|
||||||
name: String,
|
|
||||||
templateName: String,
|
|
||||||
dir: PsiDirectory
|
|
||||||
): PsiFile? = super.createFile("$name.bk", templateName, dir)
|
|
||||||
|
|
||||||
override fun buildDialog(
|
|
||||||
project: Project,
|
|
||||||
directory: PsiDirectory,
|
|
||||||
builder: CreateFileFromTemplateDialog.Builder
|
|
||||||
) {
|
|
||||||
builder.setTitle(BUKKRIPT_SCRIPT)
|
|
||||||
.addKind(
|
|
||||||
BUKKRIPT_FILE,
|
|
||||||
BukkriptFileType.INSTANCE.icon,
|
|
||||||
BUKKRIPT_SCRIPT
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.Assets
|
|
||||||
import com.intellij.openapi.fileTypes.LanguageFileType
|
|
||||||
import com.intellij.openapi.fileTypes.ex.FileTypeIdentifiableByVirtualFile
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile
|
|
||||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
|
||||||
import javax.swing.Icon
|
|
||||||
|
|
||||||
class BukkriptFileType : LanguageFileType(KotlinLanguage.INSTANCE), FileTypeIdentifiableByVirtualFile {
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
@JvmField
|
|
||||||
val INSTANCE = BukkriptFileType()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getIcon(): Icon? = Assets.Bukkript
|
|
||||||
|
|
||||||
override fun getName(): String = BUKKRIPT_FILE
|
|
||||||
|
|
||||||
override fun getDefaultExtension(): String = BUKKRIPT_EXTENSION
|
|
||||||
|
|
||||||
override fun getDescription(): String = BUKKRIPT_DESCRIPTION
|
|
||||||
|
|
||||||
override fun isMyFileType(file: VirtualFile): Boolean = file.name.isBukkriptScript()
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.Assets
|
|
||||||
import com.intellij.ide.IconProvider
|
|
||||||
import com.intellij.openapi.project.DumbAware
|
|
||||||
import com.intellij.psi.PsiElement
|
|
||||||
import com.intellij.psi.PsiFile
|
|
||||||
import javax.swing.Icon
|
|
||||||
|
|
||||||
class BukkriptIconProvider : IconProvider(), DumbAware {
|
|
||||||
override fun getIcon(element: PsiElement, flags: Int): Icon? {
|
|
||||||
if(element is PsiFile) {
|
|
||||||
val file = element.virtualFile
|
|
||||||
return when {
|
|
||||||
file.isBukkriptScript() -> BukkriptFileType.INSTANCE.icon
|
|
||||||
file.isScriptFolder() -> Assets.FolderScript
|
|
||||||
file.isPluginsFolder() -> Assets.FolderPlugins
|
|
||||||
file.isBukkriptFolder() -> Assets.FolderBukkript
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.utils.PathUtil
|
|
||||||
import java.io.File
|
|
||||||
import kotlin.script.experimental.intellij.ScriptDefinitionsProvider
|
|
||||||
import br.com.devsrsouza.bukkript.script.definition.BukkriptScript
|
|
||||||
|
|
||||||
class BukkriptScriptDefinitionProvider : ScriptDefinitionsProvider {
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val ID = "BukkriptScriptDefinition"
|
|
||||||
}
|
|
||||||
|
|
||||||
override val id: String
|
|
||||||
get() = ID
|
|
||||||
|
|
||||||
override fun getDefinitionClasses(): Iterable<String> {
|
|
||||||
return listOf("br.com.devsrsouza.bukkript.script.definition.BukkriptScript")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getDefinitionsClassPath(): Iterable<File> {
|
|
||||||
val jarFile = PathUtil.getResourcePathForClass(BukkriptScript::class.java)
|
|
||||||
|
|
||||||
return listOf(jarFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun useDiscovery(): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.Assets
|
|
||||||
import com.intellij.ide.projectView.PresentationData
|
|
||||||
import com.intellij.ide.projectView.ProjectViewNode
|
|
||||||
import com.intellij.ide.projectView.ProjectViewNodeDecorator
|
|
||||||
import com.intellij.packageDependencies.ui.PackageDependenciesNode
|
|
||||||
import com.intellij.ui.ColoredTreeCellRenderer
|
|
||||||
|
|
||||||
class BukkriptViewNodeDecorator : ProjectViewNodeDecorator {
|
|
||||||
override fun decorate(node: ProjectViewNode<*>, data: PresentationData) {
|
|
||||||
val file = node.virtualFile ?: return
|
|
||||||
|
|
||||||
val icon = when {
|
|
||||||
file.isScriptFolder() -> Assets.FolderScript
|
|
||||||
file.isPluginsFolder() -> Assets.FolderPlugins
|
|
||||||
file.isBukkriptFolder() -> Assets.FolderBukkript
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
|
|
||||||
if(icon != null) {
|
|
||||||
node.icon = icon
|
|
||||||
data.setIcon(icon)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun decorate(node: PackageDependenciesNode, cellRenderer: ColoredTreeCellRenderer) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
const val BUKKRIPT_EXTENSION = "bk.kts"
|
|
||||||
|
|
||||||
const val BUKKRIPT_SCRIPT = "Bukkript Script"
|
|
||||||
const val BUKKRIPT_FILE = "Bukkript File"
|
|
||||||
const val BUKKRIPT_DESCRIPTION = "Bukkript Script File for Bukkit"
|
|
||||||
const val BUKKRIPT_CREATE_SCRIPT_DESCRIPTION = "Create Bukkript Script"
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript
|
|
||||||
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
fun String.isBukkriptScript() = endsWith(".$BUKKRIPT_EXTENSION", true)
|
|
||||||
|
|
||||||
fun VirtualFile.isBukkriptScript() = name.isBukkriptScript()
|
|
||||||
|
|
||||||
fun VirtualFile.isScriptFolder(): Boolean {
|
|
||||||
if(name != "scripts") return false
|
|
||||||
|
|
||||||
val bukkriptFodler = parent ?: return false
|
|
||||||
|
|
||||||
return bukkriptFodler.isBukkriptFolder()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun VirtualFile.isPluginsFolder(): Boolean {
|
|
||||||
if(name != "plugins") return false
|
|
||||||
|
|
||||||
val rootServerFolder = parent ?: return false
|
|
||||||
|
|
||||||
return rootServerFolder.children?.find { it.name == "server.properties" } != null
|
|
||||||
}
|
|
||||||
|
|
||||||
fun VirtualFile.isBukkriptFolder(): Boolean {
|
|
||||||
if(name != "Bukkript") return false
|
|
||||||
|
|
||||||
val pluginsFolder = parent ?: return false
|
|
||||||
|
|
||||||
return pluginsFolder.name == "plugins"
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
data class MenuDeclaration(
|
|
||||||
val displayname: String,
|
|
||||||
val lines: Int,
|
|
||||||
val slots: List<MenuSlotDeclaration>
|
|
||||||
)
|
|
||||||
|
|
||||||
data class MenuSlotDeclaration(
|
|
||||||
val line: Int,
|
|
||||||
val slot: Int,
|
|
||||||
val itemId: Int?,
|
|
||||||
val isSelected: Boolean = false
|
|
||||||
)
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
import com.intellij.util.ImageLoader
|
|
||||||
import org.jetbrains.kotlin.utils.keysToMap
|
|
||||||
import java.awt.*
|
|
||||||
import javax.swing.JPanel
|
|
||||||
|
|
||||||
class InventoryComponent(
|
|
||||||
val declaration: MenuDeclaration
|
|
||||||
) : JPanel() {
|
|
||||||
companion object {
|
|
||||||
val CHEST_SCALE = 2
|
|
||||||
val CHEST_SINGLE_LINE_HEIGHT = 42
|
|
||||||
val CHEST_LINE_DIFF = 18
|
|
||||||
val CHEST_WIDTH = 176
|
|
||||||
|
|
||||||
private val minecraftFontResource = "/assets/fonts/Minecraftia-Regular.ttf"
|
|
||||||
private val spritesFolder = "/assets/sprites"
|
|
||||||
private val itemsSpriteFolder = "/assets/items"
|
|
||||||
|
|
||||||
// the selected-border is 36x36 and not 32x32
|
|
||||||
private val selectedBorderSizeDiff = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
private val lines = when {
|
|
||||||
declaration.lines > 6 -> 6
|
|
||||||
declaration.lines < 1 -> 1
|
|
||||||
else -> declaration.lines
|
|
||||||
}
|
|
||||||
|
|
||||||
private val spriteImage = ImageLoader.loadFromResource(
|
|
||||||
"$spritesFolder/chest-${lines}.png"
|
|
||||||
)!!
|
|
||||||
private val itemsImage = declaration.slots.filter {
|
|
||||||
it.line in 1..declaration.lines && it.slot in 1..9
|
|
||||||
}.keysToMap {
|
|
||||||
ImageLoader.loadFromResource("$itemsSpriteFolder/${it.itemId}-0.png")
|
|
||||||
//?.getScaledInstance(16, 16, Image.SCALE_FAST)
|
|
||||||
}
|
|
||||||
private val selectionImage = if(declaration.slots.any { it.isSelected })
|
|
||||||
ImageLoader.loadFromResource("$spritesFolder/selected-border.png")
|
|
||||||
else null
|
|
||||||
|
|
||||||
private val minecraftFont = Font.createFont(
|
|
||||||
Font.TRUETYPE_FONT,
|
|
||||||
this::class.java.getResource(minecraftFontResource).openStream()
|
|
||||||
).deriveFont(18.5f)
|
|
||||||
|
|
||||||
init {
|
|
||||||
isVisible = true
|
|
||||||
minimumSize = calculateDimension()
|
|
||||||
}
|
|
||||||
override fun paintComponent(g: Graphics) {
|
|
||||||
val g = g as Graphics2D
|
|
||||||
val oldTransform = g.transform
|
|
||||||
|
|
||||||
// drawing menu
|
|
||||||
g.scale(CHEST_SCALE.toDouble(), CHEST_SCALE.toDouble())
|
|
||||||
g.drawImage(spriteImage, 0, 0,this)
|
|
||||||
|
|
||||||
g.transform = oldTransform
|
|
||||||
|
|
||||||
// drawing items
|
|
||||||
for ((slot, texture) in itemsImage) {
|
|
||||||
val (x, y) = calculateXYForSlot(slot)
|
|
||||||
|
|
||||||
g.drawImage(texture ?: continue, x, y, this)
|
|
||||||
|
|
||||||
// if is selected draw selection border
|
|
||||||
if(slot.isSelected) {
|
|
||||||
g.drawImage(
|
|
||||||
selectionImage ?: continue,
|
|
||||||
x- selectedBorderSizeDiff,
|
|
||||||
y- selectedBorderSizeDiff,
|
|
||||||
this
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// drawing displayname
|
|
||||||
g.font = minecraftFont
|
|
||||||
g.color = Color.DARK_GRAY
|
|
||||||
g.drawString(declaration.displayname, 16, 40)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun calculateXYForSlot(menuSlotDeclaration: MenuSlotDeclaration): Pair<Int, Int> {
|
|
||||||
val topXPadding = 18 * CHEST_SCALE
|
|
||||||
val leftYPadding = 8 * CHEST_SCALE
|
|
||||||
val itemSize = 16 * CHEST_SCALE
|
|
||||||
val rightYPadding = 2 * CHEST_SCALE
|
|
||||||
val bottomXPadding = 2 * CHEST_SCALE
|
|
||||||
|
|
||||||
val itemXPos = menuSlotDeclaration.line -1
|
|
||||||
val itemYPos = menuSlotDeclaration.slot -1
|
|
||||||
|
|
||||||
val x = leftYPadding + (itemYPos * rightYPadding) + (itemYPos * itemSize)
|
|
||||||
val y = topXPadding + (itemXPos * bottomXPadding) + (itemXPos * itemSize)
|
|
||||||
|
|
||||||
return x to y
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun calculateDimension(): Dimension {
|
|
||||||
val height = CHEST_SINGLE_LINE_HEIGHT + (lines - 1) * CHEST_LINE_DIFF
|
|
||||||
|
|
||||||
return Dimension((CHEST_WIDTH * CHEST_SCALE).toInt(), (height * CHEST_SCALE).toInt())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
import com.intellij.openapi.editor.event.CaretEvent
|
|
||||||
import com.intellij.openapi.editor.event.CaretListener
|
|
||||||
import com.intellij.openapi.editor.event.DocumentEvent
|
|
||||||
import com.intellij.openapi.editor.event.DocumentListener
|
|
||||||
import com.intellij.openapi.fileEditor.*
|
|
||||||
import com.intellij.openapi.project.Project
|
|
||||||
import com.intellij.openapi.util.UserDataHolderBase
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile
|
|
||||||
import com.intellij.psi.PsiDocumentManager
|
|
||||||
import com.intellij.psi.util.forEachDescendantOfType
|
|
||||||
import com.intellij.ui.components.JBScrollPane
|
|
||||||
import com.intellij.ui.layout.panel
|
|
||||||
import com.intellij.util.Alarm
|
|
||||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
|
||||||
import java.awt.*
|
|
||||||
import java.beans.PropertyChangeListener
|
|
||||||
import javax.swing.*
|
|
||||||
|
|
||||||
class MenuPreviewFileEditor(
|
|
||||||
private val myProject: Project,
|
|
||||||
private val myFile: VirtualFile,
|
|
||||||
private val mainEditor: TextEditor
|
|
||||||
) : UserDataHolderBase(), FileEditor {
|
|
||||||
|
|
||||||
private val mySwingAlarm = Alarm(Alarm.ThreadToUse.SWING_THREAD, this)
|
|
||||||
private val myDocument = FileDocumentManager.getInstance().getDocument(myFile)!!
|
|
||||||
private val myUi = JPanel().apply {
|
|
||||||
layout = BorderLayout()
|
|
||||||
isVisible = true
|
|
||||||
minimumSize = Dimension(
|
|
||||||
InventoryComponent.CHEST_WIDTH * InventoryComponent.CHEST_SCALE + 10,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
private lateinit var currentScroll: JBScrollPane
|
|
||||||
private var currentSelectedLine: Int? = null
|
|
||||||
|
|
||||||
init {
|
|
||||||
rebuild(null)
|
|
||||||
|
|
||||||
// listen to the source code changes to rebuild the UI
|
|
||||||
myDocument.addDocumentListener(object : DocumentListener {
|
|
||||||
override fun beforeDocumentChange(event: DocumentEvent) {
|
|
||||||
mySwingAlarm.cancelAllRequests()
|
|
||||||
}
|
|
||||||
override fun documentChanged(event: DocumentEvent) {
|
|
||||||
mySwingAlarm.addRequest({
|
|
||||||
rebuild(currentScroll.viewport.viewPosition)
|
|
||||||
}, 50)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// listen to cursor changes to make a slot selectable
|
|
||||||
mainEditor.editor.caretModel.addCaretListener(object : CaretListener {
|
|
||||||
override fun caretPositionChanged(event: CaretEvent) {
|
|
||||||
currentSelectedLine = event.newPosition.line
|
|
||||||
rebuild(currentScroll.viewport.viewPosition)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fun rebuild(currentViewPosition: Point?) {
|
|
||||||
val tree = PsiDocumentManager.getInstance(myProject).getPsiFile(myDocument) ?: return
|
|
||||||
|
|
||||||
// clear the old UI
|
|
||||||
myUi.removeAll()
|
|
||||||
|
|
||||||
// create the scroll pane with a centralized component with the inventories
|
|
||||||
var menuCount = 0
|
|
||||||
currentScroll = JBScrollPane(
|
|
||||||
panel {
|
|
||||||
tree.forEachDescendantOfType<KtCallExpression> {
|
|
||||||
val declaration =
|
|
||||||
findMenuDeclaration(
|
|
||||||
it,
|
|
||||||
currentSelectedLine
|
|
||||||
)
|
|
||||||
if (declaration != null) {
|
|
||||||
row {
|
|
||||||
component(
|
|
||||||
InventoryComponent(
|
|
||||||
declaration
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
menuCount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.centerComponent(),
|
|
||||||
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
|
|
||||||
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
|
|
||||||
).apply {
|
|
||||||
if(currentViewPosition != null)
|
|
||||||
viewport.viewPosition = currentViewPosition
|
|
||||||
}
|
|
||||||
|
|
||||||
if(menuCount > 0) {
|
|
||||||
// add the scroll pane to the UI
|
|
||||||
myUi.add(
|
|
||||||
currentScroll,
|
|
||||||
BorderLayout.CENTER
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
myUi.add(
|
|
||||||
JLabel("Currently this source code has no menu declaration!")
|
|
||||||
.centerComponent(),
|
|
||||||
BorderLayout.CENTER
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun isModified(): Boolean = false
|
|
||||||
|
|
||||||
override fun isValid(): Boolean = true
|
|
||||||
|
|
||||||
override fun addPropertyChangeListener(listener: PropertyChangeListener) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun removePropertyChangeListener(listener: PropertyChangeListener) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getName(): String = "KotlinBukkitAPI Menu Viewer"
|
|
||||||
|
|
||||||
override fun setState(state: FileEditorState) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getComponent(): JComponent {
|
|
||||||
return myUi
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getPreferredFocusedComponent(): JComponent? {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getCurrentLocation(): FileEditorLocation? {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun dispose() {
|
|
||||||
mySwingAlarm.cancelAllRequests()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun JComponent.centerComponent(): JPanel {
|
|
||||||
return JPanel().apply {
|
|
||||||
isVisible = true
|
|
||||||
layout = GridBagLayout()
|
|
||||||
|
|
||||||
add(this@centerComponent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptFileType
|
|
||||||
import com.intellij.openapi.fileEditor.*
|
|
||||||
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider
|
|
||||||
import com.intellij.openapi.module.ModuleUtilCore
|
|
||||||
import com.intellij.openapi.project.Project
|
|
||||||
import com.intellij.openapi.roots.ModuleRootManager
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile
|
|
||||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
|
||||||
|
|
||||||
class MenuPreviewFileEditorProvider : WeighedFileEditorProvider() {
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val ID = "kotlinbukkitapi-menu-preview"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getEditorTypeId(): String = ID
|
|
||||||
|
|
||||||
override fun accept(project: Project, file: VirtualFile): Boolean {
|
|
||||||
|
|
||||||
val type = file.fileType
|
|
||||||
|
|
||||||
if(type == BukkriptFileType.INSTANCE) return true
|
|
||||||
|
|
||||||
if(type != KotlinFileType.INSTANCE) return false
|
|
||||||
|
|
||||||
val module = ModuleUtilCore.findModuleForFile(file, project) ?: return false
|
|
||||||
|
|
||||||
val root = ModuleRootManager.getInstance(module)
|
|
||||||
var hasKotlinBukkitAPI = false
|
|
||||||
|
|
||||||
root.orderEntries().withoutSdk().forEachLibrary {
|
|
||||||
if((it.name ?: "").contains("kotlinbukkitapi", true)) {
|
|
||||||
hasKotlinBukkitAPI = true
|
|
||||||
|
|
||||||
false
|
|
||||||
} else {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return hasKotlinBukkitAPI
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createEditor(project: Project, file: VirtualFile): FileEditor {
|
|
||||||
val editor: TextEditor = TextEditorProvider.getInstance().createEditor(project, file) as TextEditor
|
|
||||||
val preview =
|
|
||||||
MenuPreviewFileEditor(project, file, editor)
|
|
||||||
|
|
||||||
return TextEditorWithPreview(editor, preview, "KotlinBukkitAPI")
|
|
||||||
}
|
|
||||||
|
|
||||||
//override fun getPolicy(): FileEditorPolicy = FileEditorPolicy.HIDE_DEFAULT_EDITOR
|
|
||||||
override fun getPolicy(): FileEditorPolicy = FileEditorPolicy.PLACE_AFTER_DEFAULT_EDITOR
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,390 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
enum class MinecraftItem(val id: Int) {
|
|
||||||
AIR(0),
|
|
||||||
STONE(1),
|
|
||||||
GRASS(2),
|
|
||||||
DIRT(3),
|
|
||||||
COBBLESTONE(4),
|
|
||||||
WOOD(5),
|
|
||||||
SAPLING(6),
|
|
||||||
BEDROCK(7),
|
|
||||||
WATER(8),
|
|
||||||
STATIONARY_WATER(9),
|
|
||||||
LAVA(10), STATIONARY_LAVA(11),
|
|
||||||
SAND(12),
|
|
||||||
GRAVEL(13),
|
|
||||||
GOLD_ORE(14),
|
|
||||||
IRON_ORE(15),
|
|
||||||
COAL_ORE(16),
|
|
||||||
LOG(17),
|
|
||||||
LEAVES(18),
|
|
||||||
SPONGE(19),
|
|
||||||
GLASS(20),
|
|
||||||
LAPIS_ORE(21),
|
|
||||||
LAPIS_BLOCK(22),
|
|
||||||
DISPENSER(23),
|
|
||||||
SANDSTONE(24),
|
|
||||||
NOTE_BLOCK(25),
|
|
||||||
BED_BLOCK(26),
|
|
||||||
POWERED_RAIL(27),
|
|
||||||
DETECTOR_RAIL(28),
|
|
||||||
PISTON_STICKY_BASE(29),
|
|
||||||
WEB(30),
|
|
||||||
LONG_GRASS(31),
|
|
||||||
DEAD_BUSH(32),
|
|
||||||
PISTON_BASE(33),
|
|
||||||
PISTON_EXTENSION(34),
|
|
||||||
WOOL(35),
|
|
||||||
PISTON_MOVING_PIECE(36),
|
|
||||||
YELLOW_FLOWER(37),
|
|
||||||
RED_ROSE(38),
|
|
||||||
BROWN_MUSHROOM(39),
|
|
||||||
RED_MUSHROOM(40),
|
|
||||||
GOLD_BLOCK(41),
|
|
||||||
IRON_BLOCK(42),
|
|
||||||
DOUBLE_STEP(43),
|
|
||||||
STEP(44),
|
|
||||||
BRICK(45),
|
|
||||||
TNT(46),
|
|
||||||
BOOKSHELF(47),
|
|
||||||
MOSSY_COBBLESTONE(48),
|
|
||||||
OBSIDIAN(49),
|
|
||||||
TORCH(50),
|
|
||||||
FIRE(51),
|
|
||||||
MOB_SPAWNER(52),
|
|
||||||
WOOD_STAIRS(53),
|
|
||||||
CHEST(54),
|
|
||||||
REDSTONE_WIRE(55),
|
|
||||||
DIAMOND_ORE(56),
|
|
||||||
DIAMOND_BLOCK(57),
|
|
||||||
WORKBENCH(58),
|
|
||||||
CROPS(59),
|
|
||||||
SOIL(60),
|
|
||||||
FURNACE(61),
|
|
||||||
BURNING_FURNACE(62),
|
|
||||||
SIGN_POST(63),
|
|
||||||
WOODEN_DOOR(64),
|
|
||||||
LADDER(65),
|
|
||||||
RAILS(66),
|
|
||||||
COBBLESTONE_STAIRS(67),
|
|
||||||
WALL_SIGN(68),
|
|
||||||
LEVER(69),
|
|
||||||
STONE_PLATE(70),
|
|
||||||
IRON_DOOR_BLOCK(71),
|
|
||||||
WOOD_PLATE(72),
|
|
||||||
REDSTONE_ORE(73),
|
|
||||||
GLOWING_REDSTONE_ORE(74),
|
|
||||||
REDSTONE_TORCH_OFF(75),
|
|
||||||
REDSTONE_TORCH_ON(76),
|
|
||||||
STONE_BUTTON(77),
|
|
||||||
SNOW(78),
|
|
||||||
ICE(79),
|
|
||||||
SNOW_BLOCK(80),
|
|
||||||
CACTUS(81),
|
|
||||||
CLAY(82),
|
|
||||||
SUGAR_CANE_BLOCK(83),
|
|
||||||
JUKEBOX(84),
|
|
||||||
FENCE(85),
|
|
||||||
PUMPKIN(86),
|
|
||||||
NETHERRACK(87),
|
|
||||||
SOUL_SAND(88),
|
|
||||||
GLOWSTONE(89),
|
|
||||||
PORTAL(90),
|
|
||||||
JACK_O_LANTERN(91),
|
|
||||||
CAKE_BLOCK(92),
|
|
||||||
DIODE_BLOCK_OFF(93),
|
|
||||||
DIODE_BLOCK_ON(94),
|
|
||||||
STAINED_GLASS(95),
|
|
||||||
TRAP_DOOR(96),
|
|
||||||
MONSTER_EGGS(97),
|
|
||||||
SMOOTH_BRICK(98),
|
|
||||||
HUGE_MUSHROOM_1(99),
|
|
||||||
HUGE_MUSHROOM_2(100),
|
|
||||||
IRON_FENCE(101),
|
|
||||||
THIN_GLASS(102),
|
|
||||||
MELON_BLOCK(103),
|
|
||||||
PUMPKIN_STEM(104),
|
|
||||||
MELON_STEM(105),
|
|
||||||
VINE(106),
|
|
||||||
FENCE_GATE(107),
|
|
||||||
BRICK_STAIRS(108),
|
|
||||||
SMOOTH_STAIRS(109),
|
|
||||||
MYCEL(110),
|
|
||||||
WATER_LILY(111),
|
|
||||||
NETHER_BRICK(112),
|
|
||||||
NETHER_FENCE(113),
|
|
||||||
NETHER_BRICK_STAIRS(114),
|
|
||||||
NETHER_WARTS(115),
|
|
||||||
ENCHANTMENT_TABLE(116),
|
|
||||||
BREWING_STAND(117),
|
|
||||||
CAULDRON(118),
|
|
||||||
ENDER_PORTAL(119),
|
|
||||||
ENDER_PORTAL_FRAME(120),
|
|
||||||
ENDER_STONE(121),
|
|
||||||
DRAGON_EGG(122),
|
|
||||||
REDSTONE_LAMP_OFF(123),
|
|
||||||
REDSTONE_LAMP_ON(124),
|
|
||||||
WOOD_DOUBLE_STEP(125),
|
|
||||||
WOOD_STEP(126),
|
|
||||||
COCOA(127),
|
|
||||||
SANDSTONE_STAIRS(128),
|
|
||||||
EMERALD_ORE(129),
|
|
||||||
ENDER_CHEST(130),
|
|
||||||
TRIPWIRE_HOOK(131),
|
|
||||||
TRIPWIRE(132),
|
|
||||||
EMERALD_BLOCK(133),
|
|
||||||
SPRUCE_WOOD_STAIRS(134),
|
|
||||||
BIRCH_WOOD_STAIRS(135),
|
|
||||||
JUNGLE_WOOD_STAIRS(136),
|
|
||||||
COMMAND(137),
|
|
||||||
BEACON(138),
|
|
||||||
COBBLE_WALL(139),
|
|
||||||
FLOWER_POT(140),
|
|
||||||
CARROT(141),
|
|
||||||
POTATO(142),
|
|
||||||
WOOD_BUTTON(143),
|
|
||||||
SKULL(144),
|
|
||||||
ANVIL(145),
|
|
||||||
TRAPPED_CHEST(146),
|
|
||||||
GOLD_PLATE(147),
|
|
||||||
IRON_PLATE(148),
|
|
||||||
REDSTONE_COMPARATOR_OFF(149),
|
|
||||||
REDSTONE_COMPARATOR_ON(150),
|
|
||||||
DAYLIGHT_DETECTOR(151),
|
|
||||||
REDSTONE_BLOCK(152),
|
|
||||||
QUARTZ_ORE(153),
|
|
||||||
HOPPER(154),
|
|
||||||
QUARTZ_BLOCK(155),
|
|
||||||
QUARTZ_STAIRS(156),
|
|
||||||
ACTIVATOR_RAIL(157),
|
|
||||||
DROPPER(158),
|
|
||||||
STAINED_CLAY(159),
|
|
||||||
STAINED_GLASS_PANE(160),
|
|
||||||
LEAVES_2(161),
|
|
||||||
LOG_2(162),
|
|
||||||
ACACIA_STAIRS(163),
|
|
||||||
DARK_OAK_STAIRS(164),
|
|
||||||
SLIME_BLOCK(165),
|
|
||||||
BARRIER(166),
|
|
||||||
IRON_TRAPDOOR(167),
|
|
||||||
PRISMARINE(168),
|
|
||||||
SEA_LANTERN(169),
|
|
||||||
HAY_BLOCK(170),
|
|
||||||
CARPET(171),
|
|
||||||
HARD_CLAY(172),
|
|
||||||
COAL_BLOCK(173),
|
|
||||||
PACKED_ICE(174),
|
|
||||||
DOUBLE_PLANT(175),
|
|
||||||
STANDING_BANNER(176),
|
|
||||||
WALL_BANNER(177),
|
|
||||||
DAYLIGHT_DETECTOR_INVERTED(178),
|
|
||||||
RED_SANDSTONE(179),
|
|
||||||
RED_SANDSTONE_STAIRS(180),
|
|
||||||
DOUBLE_STONE_SLAB2(181),
|
|
||||||
STONE_SLAB2(182),
|
|
||||||
SPRUCE_FENCE_GATE(183),
|
|
||||||
BIRCH_FENCE_GATE(184),
|
|
||||||
JUNGLE_FENCE_GATE(185),
|
|
||||||
DARK_OAK_FENCE_GATE(186),
|
|
||||||
ACACIA_FENCE_GATE(187),
|
|
||||||
SPRUCE_FENCE(188),
|
|
||||||
BIRCH_FENCE(189),
|
|
||||||
JUNGLE_FENCE(190),
|
|
||||||
DARK_OAK_FENCE(191),
|
|
||||||
ACACIA_FENCE(192),
|
|
||||||
SPRUCE_DOOR(193),
|
|
||||||
BIRCH_DOOR(194),
|
|
||||||
JUNGLE_DOOR(195),
|
|
||||||
ACACIA_DOOR(196),
|
|
||||||
DARK_OAK_DOOR(197),
|
|
||||||
|
|
||||||
// ----- Item Separator -----
|
|
||||||
IRON_SPADE(256),
|
|
||||||
IRON_PICKAXE(257),
|
|
||||||
IRON_AXE(258),
|
|
||||||
FLINT_AND_STEEL(259),
|
|
||||||
APPLE(260),
|
|
||||||
BOW(261),
|
|
||||||
ARROW(262), COAL(263),
|
|
||||||
DIAMOND(264),
|
|
||||||
IRON_INGOT(265),
|
|
||||||
GOLD_INGOT(266),
|
|
||||||
IRON_SWORD(267),
|
|
||||||
WOOD_SWORD(268),
|
|
||||||
WOOD_SPADE(269),
|
|
||||||
WOOD_PICKAXE(270),
|
|
||||||
WOOD_AXE(271),
|
|
||||||
STONE_SWORD(272),
|
|
||||||
STONE_SPADE(273),
|
|
||||||
STONE_PICKAXE(274),
|
|
||||||
STONE_AXE(275),
|
|
||||||
DIAMOND_SWORD(276),
|
|
||||||
DIAMOND_SPADE(277),
|
|
||||||
DIAMOND_PICKAXE(278),
|
|
||||||
DIAMOND_AXE(279),
|
|
||||||
STICK(280),
|
|
||||||
BOWL(281),
|
|
||||||
MUSHROOM_SOUP(282),
|
|
||||||
GOLD_SWORD(283),
|
|
||||||
GOLD_SPADE(284),
|
|
||||||
GOLD_PICKAXE(285),
|
|
||||||
GOLD_AXE(286),
|
|
||||||
STRING(287),
|
|
||||||
FEATHER(288),
|
|
||||||
SULPHUR(289),
|
|
||||||
WOOD_HOE(290),
|
|
||||||
STONE_HOE(291),
|
|
||||||
IRON_HOE(292),
|
|
||||||
DIAMOND_HOE(293),
|
|
||||||
GOLD_HOE(294),
|
|
||||||
SEEDS(295),
|
|
||||||
WHEAT(296),
|
|
||||||
BREAD(297),
|
|
||||||
LEATHER_HELMET(298),
|
|
||||||
LEATHER_CHESTPLATE(299),
|
|
||||||
LEATHER_LEGGINGS(300),
|
|
||||||
LEATHER_BOOTS(301),
|
|
||||||
CHAINMAIL_HELMET(302),
|
|
||||||
CHAINMAIL_CHESTPLATE(303),
|
|
||||||
CHAINMAIL_LEGGINGS(304),
|
|
||||||
CHAINMAIL_BOOTS(305),
|
|
||||||
IRON_HELMET(306),
|
|
||||||
IRON_CHESTPLATE(307),
|
|
||||||
IRON_LEGGINGS(308),
|
|
||||||
IRON_BOOTS(309),
|
|
||||||
DIAMOND_HELMET(310),
|
|
||||||
DIAMOND_CHESTPLATE(311),
|
|
||||||
DIAMOND_LEGGINGS(312),
|
|
||||||
DIAMOND_BOOTS(313),
|
|
||||||
GOLD_HELMET(314),
|
|
||||||
GOLD_CHESTPLATE(315),
|
|
||||||
GOLD_LEGGINGS(316),
|
|
||||||
GOLD_BOOTS(317),
|
|
||||||
FLINT(318),
|
|
||||||
PORK(319),
|
|
||||||
GRILLED_PORK(320),
|
|
||||||
PAINTING(321),
|
|
||||||
GOLDEN_APPLE(322),
|
|
||||||
SIGN(323),
|
|
||||||
WOOD_DOOR(324),
|
|
||||||
BUCKET(325),
|
|
||||||
WATER_BUCKET(326),
|
|
||||||
LAVA_BUCKET(327),
|
|
||||||
MINECART(328),
|
|
||||||
SADDLE(329),
|
|
||||||
IRON_DOOR(330),
|
|
||||||
REDSTONE(331),
|
|
||||||
SNOW_BALL(332),
|
|
||||||
BOAT(333),
|
|
||||||
LEATHER(334),
|
|
||||||
MILK_BUCKET(335),
|
|
||||||
CLAY_BRICK(336),
|
|
||||||
CLAY_BALL(337),
|
|
||||||
SUGAR_CANE(338),
|
|
||||||
PAPER(339),
|
|
||||||
BOOK(340),
|
|
||||||
SLIME_BALL(341),
|
|
||||||
STORAGE_MINECART(342),
|
|
||||||
POWERED_MINECART(343),
|
|
||||||
EGG(344),
|
|
||||||
COMPASS(345),
|
|
||||||
FISHING_ROD(346),
|
|
||||||
WATCH(347),
|
|
||||||
GLOWSTONE_DUST(348),
|
|
||||||
RAW_FISH(349),
|
|
||||||
COOKED_FISH(350),
|
|
||||||
INK_SACK(351),
|
|
||||||
BONE(352),
|
|
||||||
SUGAR(353),
|
|
||||||
CAKE(354),
|
|
||||||
BED(355),
|
|
||||||
DIODE(356),
|
|
||||||
COOKIE(357),
|
|
||||||
MAP(358),
|
|
||||||
SHEARS(359),
|
|
||||||
MELON(360),
|
|
||||||
PUMPKIN_SEEDS(361),
|
|
||||||
MELON_SEEDS(362),
|
|
||||||
RAW_BEEF(363),
|
|
||||||
COOKED_BEEF(364),
|
|
||||||
RAW_CHICKEN(365),
|
|
||||||
COOKED_CHICKEN(366),
|
|
||||||
ROTTEN_FLESH(367),
|
|
||||||
ENDER_PEARL(368),
|
|
||||||
BLAZE_ROD(369),
|
|
||||||
GHAST_TEAR(370),
|
|
||||||
GOLD_NUGGET(371),
|
|
||||||
NETHER_STALK(372),
|
|
||||||
|
|
||||||
POTION(373),
|
|
||||||
GLASS_BOTTLE(374),
|
|
||||||
SPIDER_EYE(375),
|
|
||||||
FERMENTED_SPIDER_EYE(376),
|
|
||||||
BLAZE_POWDER(377),
|
|
||||||
MAGMA_CREAM(378),
|
|
||||||
BREWING_STAND_ITEM(379),
|
|
||||||
CAULDRON_ITEM(380),
|
|
||||||
EYE_OF_ENDER(381),
|
|
||||||
SPECKLED_MELON(382),
|
|
||||||
MONSTER_EGG(383),
|
|
||||||
EXP_BOTTLE(384),
|
|
||||||
FIREBALL(385),
|
|
||||||
BOOK_AND_QUILL(386),
|
|
||||||
WRITTEN_BOOK(387),
|
|
||||||
EMERALD(388),
|
|
||||||
ITEM_FRAME(389),
|
|
||||||
FLOWER_POT_ITEM(390),
|
|
||||||
CARROT_ITEM(391),
|
|
||||||
POTATO_ITEM(392),
|
|
||||||
BAKED_POTATO(393),
|
|
||||||
POISONOUS_POTATO(394),
|
|
||||||
EMPTY_MAP(395),
|
|
||||||
GOLDEN_CARROT(396),
|
|
||||||
SKULL_ITEM(397),
|
|
||||||
CARROT_STICK(398),
|
|
||||||
NETHER_STAR(399),
|
|
||||||
PUMPKIN_PIE(400),
|
|
||||||
FIREWORK(401),
|
|
||||||
FIREWORK_CHARGE(402),
|
|
||||||
ENCHANTED_BOOK(403),
|
|
||||||
REDSTONE_COMPARATOR(404),
|
|
||||||
NETHER_BRICK_ITEM(405),
|
|
||||||
QUARTZ(406),
|
|
||||||
EXPLOSIVE_MINECART(407),
|
|
||||||
HOPPER_MINECART(408),
|
|
||||||
PRISMARINE_SHARD(409),
|
|
||||||
PRISMARINE_CRYSTALS(410),
|
|
||||||
RABBIT(411),
|
|
||||||
COOKED_RABBIT(412),
|
|
||||||
RABBIT_STEW(413),
|
|
||||||
RABBIT_FOOT(414),
|
|
||||||
RABBIT_HIDE(415),
|
|
||||||
ARMOR_STAND(416),
|
|
||||||
IRON_BARDING(417),
|
|
||||||
GOLD_BARDING(418),
|
|
||||||
DIAMOND_BARDING(419),
|
|
||||||
LEASH(420),
|
|
||||||
NAME_TAG(421),
|
|
||||||
COMMAND_MINECART(422),
|
|
||||||
MUTTON(423),
|
|
||||||
COOKED_MUTTON(424),
|
|
||||||
BANNER(425),
|
|
||||||
SPRUCE_DOOR_ITEM(427),
|
|
||||||
BIRCH_DOOR_ITEM(428),
|
|
||||||
JUNGLE_DOOR_ITEM(429),
|
|
||||||
ACACIA_DOOR_ITEM(430),
|
|
||||||
DARK_OAK_DOOR_ITEM(431),
|
|
||||||
GOLD_RECORD(2256),
|
|
||||||
GREEN_RECORD(2257),
|
|
||||||
RECORD_3(2258),
|
|
||||||
RECORD_4(2259),
|
|
||||||
RECORD_5(2260),
|
|
||||||
RECORD_6(2261),
|
|
||||||
RECORD_7(2262),
|
|
||||||
RECORD_8(2263),
|
|
||||||
RECORD_9(2264),
|
|
||||||
RECORD_10(2265),
|
|
||||||
RECORD_11(2266),
|
|
||||||
RECORD_12(2267);
|
|
||||||
}
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.menu
|
|
||||||
|
|
||||||
import com.intellij.psi.util.collectDescendantsOfType
|
|
||||||
import com.intellij.psi.util.findDescendantOfType
|
|
||||||
import org.jetbrains.kotlin.builtins.getReceiverTypeFromFunctionType
|
|
||||||
import org.jetbrains.kotlin.builtins.getReturnTypeFromFunctionType
|
|
||||||
import org.jetbrains.kotlin.builtins.isExtensionFunctionType
|
|
||||||
import org.jetbrains.kotlin.idea.core.util.getLineNumber
|
|
||||||
import org.jetbrains.kotlin.idea.debugger.sequence.psi.resolveType
|
|
||||||
import org.jetbrains.kotlin.idea.intentions.isMethodCall
|
|
||||||
import org.jetbrains.kotlin.idea.refactoring.fqName.fqName
|
|
||||||
import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName
|
|
||||||
import org.jetbrains.kotlin.idea.references.mainReference
|
|
||||||
import org.jetbrains.kotlin.psi.*
|
|
||||||
import org.jetbrains.kotlin.types.typeUtil.isUnit
|
|
||||||
|
|
||||||
private val menuFqSupportedNames = listOf(
|
|
||||||
"br.com.devsrsouza.kotlinbukkitapi.dsl.menu.menu",
|
|
||||||
"br.com.devsrsouza.bukkript.script.definition.api.menu"
|
|
||||||
)
|
|
||||||
|
|
||||||
fun findMenuDeclaration(
|
|
||||||
element: KtCallExpression,
|
|
||||||
currentSelectedLine: Int? = null
|
|
||||||
): MenuDeclaration? {
|
|
||||||
val simpleName = "menu"
|
|
||||||
|
|
||||||
if (!element.isCallFrom(simpleName, menuFqSupportedNames)) return null
|
|
||||||
|
|
||||||
val menuFunction = element.findDescendantOfType<KtCallExpression> {
|
|
||||||
isMenuCall(it)
|
|
||||||
} ?: return null
|
|
||||||
|
|
||||||
// TODO: Support named parameters
|
|
||||||
|
|
||||||
val displayName = menuFunction.valueArguments.getOrNull(0)?.text?.replace("\"", "") ?: return null
|
|
||||||
val lines = menuFunction.valueArguments.getOrNull(1)?.text?.toIntOrNull() ?: return null
|
|
||||||
|
|
||||||
val menuLambdaBlock = element.findDescendantOfType<KtLambdaExpression> {
|
|
||||||
it.isBuilderBlockFor("br.com.devsrsouza.kotlinbukkitapi.dsl.menu.MenuDSL")
|
|
||||||
} ?: return null
|
|
||||||
|
|
||||||
val slotFqName = listOf("br.com.devsrsouza.kotlinbukkitapi.dsl.menu.slot")
|
|
||||||
val slotSimpleName = "slot"
|
|
||||||
|
|
||||||
val slotCalls = menuLambdaBlock.collectDescendantsOfType<KtCallExpression> {
|
|
||||||
it.isCallFrom(slotSimpleName, slotFqName)
|
|
||||||
}.mapNotNull {
|
|
||||||
|
|
||||||
val args = it.valueArguments
|
|
||||||
|
|
||||||
// TODO: support named parameters
|
|
||||||
|
|
||||||
val line = args.getOrNull(0)?.text?.toIntOrNull() ?: return@mapNotNull null
|
|
||||||
val slot = args.getOrNull(1)?.text?.toIntOrNull() ?: return@mapNotNull null
|
|
||||||
|
|
||||||
// TODO: support just slot: slot(15, item(...)) {}
|
|
||||||
|
|
||||||
val itemValue = args.getOrNull(2) ?: return@mapNotNull null
|
|
||||||
val expression = itemValue.getArgumentExpression() ?: return@mapNotNull null
|
|
||||||
|
|
||||||
val materialExpression = expression.findDescendantOfType<KtDotQualifiedExpression> {
|
|
||||||
it.text.startsWith("Material")
|
|
||||||
&& it.receiverExpression.mainReference?.resolve()?.getKotlinFqName()?.asString()
|
|
||||||
?.equals("org.bukkit.Material") == true
|
|
||||||
} ?: return@mapNotNull null
|
|
||||||
|
|
||||||
val typeExpression = materialExpression.selectorExpression as? KtNameReferenceExpression ?: return@mapNotNull null
|
|
||||||
val materialName = typeExpression.text ?: return@mapNotNull null
|
|
||||||
|
|
||||||
val item = runCatching { MinecraftItem.valueOf(materialName) }.getOrNull()
|
|
||||||
|
|
||||||
val isSelected = it.getLineNumber() == currentSelectedLine
|
|
||||||
|
|
||||||
MenuSlotDeclaration(
|
|
||||||
line,
|
|
||||||
slot,
|
|
||||||
item?.id,
|
|
||||||
isSelected
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return MenuDeclaration(displayName, lines, slotCalls)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isMenuCall(it: KtCallExpression) =
|
|
||||||
it.isCallFrom("menu", menuFqSupportedNames)
|
|
||||||
|
|
||||||
fun KtLambdaExpression.isBuilderBlockFor(fqName: String): Boolean {
|
|
||||||
val type = resolveType()
|
|
||||||
|
|
||||||
val extensionFunctionType = type.isExtensionFunctionType
|
|
||||||
|
|
||||||
if(!extensionFunctionType) return false
|
|
||||||
|
|
||||||
val returnTypeFromFunctionType = type.getReturnTypeFromFunctionType()
|
|
||||||
val receiverTypeFromFunctionType = type.getReceiverTypeFromFunctionType() ?: return false
|
|
||||||
val receiverFqName = receiverTypeFromFunctionType.fqName ?: return false
|
|
||||||
|
|
||||||
return returnTypeFromFunctionType.isUnit() && receiverFqName.asString().equals(fqName)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun KtCallExpression.isCallFrom(
|
|
||||||
simpleName: String,
|
|
||||||
fqNames: List<String>
|
|
||||||
): Boolean {
|
|
||||||
return text.startsWith(simpleName) && fqNames.any { isMethodCall(it) }
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
|
||||||
|
|
||||||
const val PLUGIN_YML = "0.3.0"
|
|
||||||
const val SHADOW_PLUGIN = "6.0.0"
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
|
||||||
|
|
||||||
object Versions {
|
|
||||||
val `v0_1_0-SNAPSHOT` = KotlinBukkitAPIVersion("0.1.0-SNAPSHOT")
|
|
||||||
|
|
||||||
val ALL = arrayOf(
|
|
||||||
`v0_1_0-SNAPSHOT`
|
|
||||||
)
|
|
||||||
|
|
||||||
val LAST = `v0_1_0-SNAPSHOT`
|
|
||||||
|
|
||||||
val visitorAll = ALL.associate { it.version to it }
|
|
||||||
|
|
||||||
fun fromString(version: String) = visitorAll[version]
|
|
||||||
}
|
|
||||||
|
|
||||||
data class KotlinBukkitAPIVersion(
|
|
||||||
val version: String,
|
|
||||||
val kotlinVersion: String = "1.4.0"
|
|
||||||
) {
|
|
||||||
override fun toString(): String {
|
|
||||||
return version
|
|
||||||
}
|
|
||||||
|
|
||||||
private val group = "br.com.devsrsouza.kotlinbukkitapi"
|
|
||||||
|
|
||||||
val repositories = listOf(
|
|
||||||
"http://nexus.devsrsouza.com.br/repository/maven-public/",
|
|
||||||
"https://oss.jfrog.org/oss-snapshot-local/",
|
|
||||||
"http://nexus.okkero.com/repository/maven-releases/",
|
|
||||||
"https://repo.codemc.org/repository/maven-public"
|
|
||||||
)
|
|
||||||
|
|
||||||
val dependencies = listOf(
|
|
||||||
"${group}:core:$version",
|
|
||||||
"${group}:serialization:$version",
|
|
||||||
"${group}:plugins:$version",
|
|
||||||
"${group}:exposed:$version",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
|
||||||
|
|
||||||
enum class ServerType {
|
|
||||||
SPIGOT, PAPERMC
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
|
||||||
|
|
||||||
enum class ServerVersion(val displayName: String) {
|
|
||||||
v1_8("1.8"),
|
|
||||||
v1_9("1.9"),
|
|
||||||
v1_12("1.12"),
|
|
||||||
v1_13("1.13"),
|
|
||||||
v1_14("1.14"),
|
|
||||||
v1_15("1.15"),
|
|
||||||
v1_16("1.16");
|
|
||||||
|
|
||||||
override fun toString(): String {
|
|
||||||
return displayName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package tech.carcadex.kotlinbukkitkit.tooling
|
||||||
|
|
||||||
|
import com.intellij.ui.IconManager
|
||||||
|
import javax.swing.Icon
|
||||||
|
|
||||||
|
object Assets {
|
||||||
|
private fun load(path: String): Icon {
|
||||||
|
return IconManager.getInstance().getIcon(path, ClassLoader.getSystemClassLoader())
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val assetFolder = "/assets"
|
||||||
|
|
||||||
|
val KotlinBukkitAPIIcon =
|
||||||
|
tech.carcadex.kotlinbukkitkit.tooling.Assets.load("${tech.carcadex.kotlinbukkitkit.tooling.Assets.assetFolder}/icons/kotlinbukkitapi-icon.svg")
|
||||||
|
val Bukkript =
|
||||||
|
tech.carcadex.kotlinbukkitkit.tooling.Assets.load("${tech.carcadex.kotlinbukkitkit.tooling.Assets.assetFolder}/icons/bukkript.svg")
|
||||||
|
val FolderScript =
|
||||||
|
tech.carcadex.kotlinbukkitkit.tooling.Assets.load("${tech.carcadex.kotlinbukkitkit.tooling.Assets.assetFolder}/icons/folderScript.svg")
|
||||||
|
val FolderPlugins =
|
||||||
|
tech.carcadex.kotlinbukkitkit.tooling.Assets.load("${tech.carcadex.kotlinbukkitkit.tooling.Assets.assetFolder}/icons/folderPlugins.svg")
|
||||||
|
val FolderBukkript =
|
||||||
|
tech.carcadex.kotlinbukkitkit.tooling.Assets.load("${tech.carcadex.kotlinbukkitkit.tooling.Assets.assetFolder}/icons/folderBukkript.svg")
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils.addAtGrid
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.utils.addAtGrid
|
||||||
import com.intellij.ide.util.projectWizard.*
|
import com.intellij.ide.util.projectWizard.*
|
||||||
import com.intellij.uiDesigner.core.*
|
import com.intellij.uiDesigner.core.*
|
||||||
import javax.swing.*
|
import javax.swing.*
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.creator.*
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.creator.*
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils.backgroundTask
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.utils.backgroundTask
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils.get
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.utils.get
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils.invokeLater
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.utils.invokeLater
|
||||||
import com.intellij.codeInsight.actions.ReformatCodeProcessor
|
import com.intellij.codeInsight.actions.ReformatCodeProcessor
|
||||||
import com.intellij.ide.actions.ImportModuleAction
|
import com.intellij.ide.actions.ImportModuleAction
|
||||||
import com.intellij.ide.util.projectWizard.JavaModuleBuilder
|
import com.intellij.ide.util.projectWizard.JavaModuleBuilder
|
||||||
|
import com.intellij.ide.util.projectWizard.ModuleBuilder
|
||||||
import com.intellij.ide.util.projectWizard.WizardContext
|
import com.intellij.ide.util.projectWizard.WizardContext
|
||||||
import com.intellij.openapi.Disposable
|
import com.intellij.openapi.Disposable
|
||||||
import com.intellij.openapi.application.ApplicationManager
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
import com.intellij.openapi.application.ModalityState
|
import com.intellij.openapi.application.ModalityState
|
||||||
|
import com.intellij.openapi.module.ModuleType
|
||||||
import com.intellij.openapi.project.DumbAwareRunnable
|
import com.intellij.openapi.project.DumbAwareRunnable
|
||||||
import com.intellij.openapi.projectRoots.JavaSdk
|
import com.intellij.openapi.projectRoots.JavaSdk
|
||||||
import com.intellij.openapi.projectRoots.SdkTypeId
|
import com.intellij.openapi.projectRoots.SdkTypeId
|
||||||
@@ -28,12 +30,12 @@ import java.nio.file.Path
|
|||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import javax.swing.Icon
|
import javax.swing.Icon
|
||||||
|
|
||||||
class KBAPIModuleBuilder : JavaModuleBuilder() {
|
class KBAPIModuleBuilder : ModuleBuilder() {
|
||||||
override fun getPresentableName(): String = KBAPIModuleType.NAME
|
override fun getPresentableName(): String = KBAPIModuleType.NAME
|
||||||
override fun getNodeIcon(): Icon = KBAPIModuleType.ICON
|
override fun getNodeIcon(): Icon = KBAPIModuleType.ICON
|
||||||
override fun getGroupName(): String = KBAPIModuleType.NAME
|
override fun getGroupName(): String = KBAPIModuleType.NAME
|
||||||
override fun getBuilderId(): String? = "KOTLINBUKKITAPI_MODULE"
|
override fun getBuilderId(): String? = "KOTLINBUKKITAPI_MODULE"
|
||||||
override fun getWeight() = BUILD_SYSTEM_WEIGHT - 1
|
|
||||||
override fun isSuitableSdkType(sdkType: SdkTypeId?): Boolean = sdkType === JavaSdk.getInstance()
|
override fun isSuitableSdkType(sdkType: SdkTypeId?): Boolean = sdkType === JavaSdk.getInstance()
|
||||||
|
|
||||||
val config = KBAPIModuleConfig()
|
val config = KBAPIModuleConfig()
|
||||||
@@ -50,6 +52,8 @@ class KBAPIModuleBuilder : JavaModuleBuilder() {
|
|||||||
|
|
||||||
val gradleBuildFile = generateGradleBuildFile(root).createIfNotExists()
|
val gradleBuildFile = generateGradleBuildFile(root).createIfNotExists()
|
||||||
val gradleSettingFile = generateGradleSettingsFile(root).createIfNotExists()
|
val gradleSettingFile = generateGradleSettingsFile(root).createIfNotExists()
|
||||||
|
generateConfigFile(root).createIfNotExists()
|
||||||
|
generateMessagesFile(root).createIfNotExists()
|
||||||
|
|
||||||
gradleBuildFile.appendText(generateGradleBuildFileContent(config))
|
gradleBuildFile.appendText(generateGradleBuildFileContent(config))
|
||||||
gradleSettingFile.appendText(generateGradleSettingsFileContent(config))
|
gradleSettingFile.appendText(generateGradleSettingsFileContent(config))
|
||||||
@@ -83,6 +87,11 @@ class KBAPIModuleBuilder : JavaModuleBuilder() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getModuleType(): ModuleType<*> {
|
||||||
|
return KBAPIModuleType()
|
||||||
|
}
|
||||||
|
|
||||||
override fun getParentGroup() = KBAPIModuleType.NAME
|
override fun getParentGroup() = KBAPIModuleType.NAME
|
||||||
|
|
||||||
override fun createWizardSteps(wizardContext: WizardContext, modulesProvider: ModulesProvider) = arrayOf(
|
override fun createWizardSteps(wizardContext: WizardContext, modulesProvider: ModulesProvider) = arrayOf(
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.Plugin
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.Plugin
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.ServerType
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.ServerType
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.ServerVersion
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.ServerVersion
|
||||||
|
|
||||||
data class KBAPIModuleConfig(
|
data class KBAPIModuleConfig(
|
||||||
var artifactGroup: String = "com.example",
|
var artifactGroup: String = "com.example",
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.Assets
|
import tech.carcadex.kotlinbukkitkit.tooling.Assets
|
||||||
import com.intellij.openapi.module.ModuleType
|
import com.intellij.openapi.module.ModuleType
|
||||||
import javax.swing.Icon
|
import javax.swing.Icon
|
||||||
|
|
||||||
class KBAPIModuleType : ModuleType<KBAPIModuleBuilder>("kotlinbukkitapi") {
|
class KBAPIModuleType : ModuleType<KBAPIModuleBuilder>("kotlinbukkitkit") {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val NAME = "KotlinBukkitAPI"
|
val NAME = "KotlinBukkitKit"
|
||||||
val DESCRIPTION = "KotlinBukkitAPI Quick"
|
val DESCRIPTION = "KotlinBukkitKit Quick"
|
||||||
val ICON = Assets.KotlinBukkitAPIIcon
|
val ICON = tech.carcadex.kotlinbukkitkit.tooling.Assets.KotlinBukkitAPIIcon
|
||||||
val INSTANCE = KBAPIModuleType()
|
val INSTANCE = KBAPIModuleType()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.*
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.*
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils.*
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.utils.*
|
||||||
import com.intellij.ide.util.projectWizard.ModuleWizardStep
|
import com.intellij.ide.util.projectWizard.ModuleWizardStep
|
||||||
import com.intellij.openapi.ui.Splitter
|
import com.intellij.openapi.ui.Splitter
|
||||||
import com.intellij.ui.IdeBorderFactory
|
import com.intellij.ui.IdeBorderFactory
|
||||||
@@ -53,10 +53,10 @@ class KBAPIWizardStep(
|
|||||||
align = TdAlign.CENTER_LEFT
|
align = TdAlign.CENTER_LEFT
|
||||||
) {
|
) {
|
||||||
td(JLabel("Server API Version:"))
|
td(JLabel("Server API Version:"))
|
||||||
td(JComboBox(ServerVersion.values()).apply { serverApiVersionCB = this })
|
td(JComboBox(ServerVersion.values().reversedArray()).apply { serverApiVersionCB = this })
|
||||||
td(JLabel("Server:"))
|
td(JLabel("Server:"))
|
||||||
td(JComboBox(ServerType.values()).apply { serverForkCB = this })
|
td(JComboBox(ServerType.values()).apply { serverForkCB = this })
|
||||||
td(JLabel("KotlinBukkitAPI:"))
|
td(JLabel("KotlinBukkitKit:"))
|
||||||
td(JComboBox(Versions.ALL).apply {
|
td(JComboBox(Versions.ALL).apply {
|
||||||
kotlinBukkitAPIVersionCB = this
|
kotlinBukkitAPIVersionCB = this
|
||||||
selectedItem = Versions.LAST
|
selectedItem = Versions.LAST
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
|
const val PLUGIN_YML = "0.6.0"
|
||||||
|
const val SHADOW_PLUGIN = "7.1.2"
|
||||||
|
const val KSP = "1.9.0-1.0.11"
|
||||||
|
const val RUN_PAPER = "2.1.0"
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard
|
||||||
|
|
||||||
|
object Versions {
|
||||||
|
val `1-0-0-3-SNAPSHOT` = KotlinBukkitAPIVersion("1.0.0.3-SNAPSHOT")
|
||||||
|
|
||||||
|
val ALL = arrayOf(
|
||||||
|
`1-0-0-3-SNAPSHOT`
|
||||||
|
)
|
||||||
|
|
||||||
|
val LAST = `1-0-0-3-SNAPSHOT`
|
||||||
|
|
||||||
|
val visitorAll = ALL.associate { it.version to it }
|
||||||
|
|
||||||
|
fun fromString(version: String) = visitorAll[version]
|
||||||
|
}
|
||||||
|
|
||||||
|
data class KotlinBukkitAPIVersion(
|
||||||
|
val version: String,
|
||||||
|
val kotlinVersion: String = "1.9.23"
|
||||||
|
) {
|
||||||
|
override fun toString(): String {
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
private val group = "tech.carcadex"
|
||||||
|
|
||||||
|
val repositories = listOf(
|
||||||
|
"https://hub.spigotmc.org/nexus/content/repositories/snapshots/",
|
||||||
|
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
|
||||||
|
)
|
||||||
|
|
||||||
|
val dependencies = listOf(
|
||||||
|
"${group}:kotlinbukkitkit-architecture:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-extensions:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-serialization:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-messages:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-commands:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-utility:\$kbk_version",
|
||||||
|
"${group}:kotlinbukkitkit-menu:\$kbk_version",
|
||||||
|
|
||||||
|
"org.jetbrains.kotlin:kotlin-stdlib",
|
||||||
|
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2",
|
||||||
|
"org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1",
|
||||||
|
"com.github.cryptomorin:XSeries:9.2.0"
|
||||||
|
)
|
||||||
|
|
||||||
|
val dependenciesCompileOnly = listOf(
|
||||||
|
"org.jetbrains:annotations:24.0.0",
|
||||||
|
)
|
||||||
|
|
||||||
|
val kspModules = listOf(
|
||||||
|
"${group}:kotlinbukkitkit-genref:$version"
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
data class Plugin(
|
data class Plugin(
|
||||||
val name: String,
|
val name: String,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.ServerVersion.*
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.ServerVersion.*
|
||||||
|
|
||||||
private val worldEdit = "com.sk89q.worldedit"
|
private val worldEdit = "com.sk89q.worldedit"
|
||||||
|
|
||||||
@@ -15,14 +15,15 @@ val ALL_PLUGINS = listOf(
|
|||||||
Plugin(
|
Plugin(
|
||||||
"WorldEdit",
|
"WorldEdit",
|
||||||
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1.5") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
|
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1.5") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
|
||||||
+ listOf(v1_13, v1_14, v1_15, v1_16).asPluginVersion("7.2.0-SNAPSHOT") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
|
+ listOf(v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19).asPluginVersion("7.2.14-SNAPSHOT") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
|
||||||
|
+ listOf(v1_20).asPluginVersion("7.3.0-SNAPSHOT") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
|
||||||
,
|
,
|
||||||
setOf("http://maven.sk89q.com/repo/")
|
setOf("http://maven.sk89q.com/repo/")
|
||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
"WorldGuard",
|
"WorldGuard",
|
||||||
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1") { setOf("com.sk89q:worldguard:$it") }
|
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1") { setOf("com.sk89q:worldguard:$it") }
|
||||||
+ listOf(v1_13, v1_14, v1_15, v1_16).asPluginVersion("7.0.4-SNAPSHOT") { setOf("com.sk89q.worldguard:worldguard-core:$it", "com.sk89q.worldguard:worldguard-bukkit:$it") }
|
+ listOf(v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19, v1_20).asPluginVersion("7.0.4-SNAPSHOT") { setOf("com.sk89q.worldguard:worldguard-core:$it", "com.sk89q.worldguard:worldguard-bukkit:$it") }
|
||||||
,
|
,
|
||||||
setOf("http://maven.sk89q.com/repo/")
|
setOf("http://maven.sk89q.com/repo/")
|
||||||
),
|
),
|
||||||
@@ -33,17 +34,17 @@ val ALL_PLUGINS = listOf(
|
|||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
"LuckPerms",
|
"LuckPerms",
|
||||||
allVersion("5.1") { setOf("net.luckperms:api:$it") },
|
allVersion("5.4") { setOf("net.luckperms:api:$it") },
|
||||||
setOf() // mavenCentral
|
setOf() // mavenCentral
|
||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
"ProtocolLib",
|
"ProtocolLib",
|
||||||
allVersion("4.5.1") { setOf("com.comphenix.protocol:ProtocolLib:$it") },
|
allVersion("5.1.0") { setOf("com.comphenix.protocol:ProtocolLib:$it") },
|
||||||
setOf("http://repo.dmulloy2.net/nexus/repository/public/")
|
setOf("http://repo.dmulloy2.net/nexus/repository/public/")
|
||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
"PlaceholderAPI",
|
"PlaceholderAPI",
|
||||||
allVersion("2.9.2") { setOf("me.clip:placeholderapi:$it") },
|
allVersion("2.11.5") { setOf("me.clip:placeholderapi:$it") },
|
||||||
setOf("http://repo.extendedclip.com/content/repositories/placeholderapi/")
|
setOf("http://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
@@ -57,11 +58,11 @@ val ALL_PLUGINS = listOf(
|
|||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
"TitleAPI",
|
"TitleAPI",
|
||||||
allVersion("1.7.6") { setOf("com.github.ConnorLinfoot:TitleAPI:$it") },
|
allVersion("1.8.1") { setOf("com.github.ConnorLinfoot:TitleAPI:$it") },
|
||||||
setOf("https://jitpack.io")),
|
setOf("https://jitpack.io")),
|
||||||
Plugin(
|
Plugin(
|
||||||
"ViaVersion",
|
"ViaVersion",
|
||||||
allVersion("3.1.0") { setOf("us.myles:viaversion-common:$it") },
|
allVersion("4.9.3") { setOf("us.myles:viaversion-common:$it") },
|
||||||
setOf("https://repo.viaversion.com/")
|
setOf("https://repo.viaversion.com/")
|
||||||
),
|
),
|
||||||
Plugin(
|
Plugin(
|
||||||
@@ -74,6 +75,21 @@ val ALL_PLUGINS = listOf(
|
|||||||
allVersion("1.6.0") { setOf("org.inventivetalent:hologramapi:$it") },
|
allVersion("1.6.0") { setOf("org.inventivetalent:hologramapi:$it") },
|
||||||
setOf("https://repo.inventivetalent.org/content/groups/public/")
|
setOf("https://repo.inventivetalent.org/content/groups/public/")
|
||||||
),
|
),
|
||||||
|
Plugin(
|
||||||
|
"NoDropX",
|
||||||
|
allVersion("1.0.3c") { setOf("com.github.iRedTea:NoDropX:$it") },
|
||||||
|
setOf("https://jitpack.io")
|
||||||
|
),
|
||||||
|
Plugin(
|
||||||
|
"EssentialsX",
|
||||||
|
allVersion("2.20.1") { setOf("net.essentialsx:EssentialsX:$it") },
|
||||||
|
setOf("https://repo.essentialsx.net/releases/")
|
||||||
|
),
|
||||||
|
Plugin(
|
||||||
|
"Multiverse-Core",
|
||||||
|
allVersion("4.3.1") { setOf("com.onarandombox.multiversecore:Multiverse-Core:$it") },
|
||||||
|
setOf("https://repo.onarandombox.com/content/groups/public/")
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
inline fun allVersion(version: String, dependencies: (String) -> Set<String>): List<PluginVersion> = ServerVersion.values().map { PluginVersion(version, it, dependencies(version)) }
|
inline fun allVersion(version: String, dependencies: (String) -> Set<String>): List<PluginVersion> = ServerVersion.values().map { PluginVersion(version, it, dependencies(version)) }
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
class PluginVersion(
|
class PluginVersion(
|
||||||
val version: String,
|
val version: String,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
data class ServerAPI(
|
data class ServerAPI(
|
||||||
val version: ServerVersion,
|
val version: ServerVersion,
|
||||||
@@ -14,7 +14,11 @@ val ServerAPI.dependencies: List<String> get() {
|
|||||||
ServerVersion.v1_13 -> "1.13.2-R0.1-SNAPSHOT"
|
ServerVersion.v1_13 -> "1.13.2-R0.1-SNAPSHOT"
|
||||||
ServerVersion.v1_14 -> "1.14.4-R0.1-SNAPSHOT"
|
ServerVersion.v1_14 -> "1.14.4-R0.1-SNAPSHOT"
|
||||||
ServerVersion.v1_15 -> "1.15.2-R0.1-SNAPSHOT"
|
ServerVersion.v1_15 -> "1.15.2-R0.1-SNAPSHOT"
|
||||||
ServerVersion.v1_16 -> "1.16.2-R0.1-SNAPSHOT"
|
ServerVersion.v1_16 -> "1.16.5-R0.1-SNAPSHOT"
|
||||||
|
ServerVersion.v1_17 -> "1.17.1-R0.1-SNAPSHOT"
|
||||||
|
ServerVersion.v1_18 -> "1.18.2-R0.1-SNAPSHOT"
|
||||||
|
ServerVersion.v1_19 -> "1.19.4-R0.1-SNAPSHOT"
|
||||||
|
ServerVersion.v1_20 -> "1.20.4-R0.1-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
val dependency = when(serverType) {
|
val dependency = when(serverType) {
|
||||||
@@ -22,10 +26,13 @@ val ServerAPI.dependencies: List<String> get() {
|
|||||||
ServerType.PAPERMC -> {
|
ServerType.PAPERMC -> {
|
||||||
val v17 = "org.github.paperspigot:paperspigot-api"
|
val v17 = "org.github.paperspigot:paperspigot-api"
|
||||||
val v19 = "com.destroystokyo.paper:paper-api"
|
val v19 = "com.destroystokyo.paper:paper-api"
|
||||||
|
val v20 = "io.papermc.paper:paper-api"
|
||||||
|
|
||||||
when(version) {
|
when(version) {
|
||||||
ServerVersion.v1_8 -> "$v17:$versionName"
|
ServerVersion.v1_8 -> "$v17:$versionName"
|
||||||
else -> "$v19:$versionName"
|
ServerVersion.v1_9, ServerVersion.v1_12, ServerVersion.v1_13,
|
||||||
|
ServerVersion.v1_14, ServerVersion.v1_15, ServerVersion.v1_16 -> "$v19:$versionName";
|
||||||
|
else -> "$v20:$versionName"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
|
enum class ServerType {
|
||||||
|
SPIGOT, PAPERMC
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
|
||||||
|
|
||||||
|
enum class ServerVersion(val displayName: String, val maxVersion: String, val minor: Int,) {
|
||||||
|
v1_8("1.8", "1.8.9", 8),
|
||||||
|
v1_9("1.9", "1.9.4", 9),
|
||||||
|
v1_12("1.12", "1.12.2", 12),
|
||||||
|
v1_13("1.13", "1.13.2", 13),
|
||||||
|
v1_14("1.14", "1.14.4", 14),
|
||||||
|
v1_15("1.15", "1.15.2", 15),
|
||||||
|
v1_16("1.16", "1.16.5", 16),
|
||||||
|
v1_17("1.17", "1.17.1", 17),
|
||||||
|
v1_18("1.18", "1.18.2", 18),
|
||||||
|
v1_19("1.19", "1.19.4", 19),
|
||||||
|
v1_20("1.20", "1.20.4", 20),;
|
||||||
|
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return displayName
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.creator
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.creator
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.KBAPIModuleConfig
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.*
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.PLUGIN_YML
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.ServerAPI
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.SHADOW_PLUGIN
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.dependencies
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.ServerAPI
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.repositories
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.dependencies
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.repositories
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
fun generateGradleBuildFile(
|
fun generateGradleBuildFile(
|
||||||
@@ -16,11 +14,23 @@ fun generateGradleSettingsFile(
|
|||||||
root: File
|
root: File
|
||||||
): File = File(root, "settings.gradle.kts")
|
): File = File(root, "settings.gradle.kts")
|
||||||
|
|
||||||
|
fun generateConfigFile(
|
||||||
|
root: File
|
||||||
|
): File = File(root, "src/main/resources/config.yml")
|
||||||
|
|
||||||
|
fun generateMessagesFile(
|
||||||
|
root: File
|
||||||
|
): File = File(root, "src/main/resources/messages.yml")
|
||||||
|
|
||||||
fun generateGradleBuildFileContent(
|
fun generateGradleBuildFileContent(
|
||||||
config: KBAPIModuleConfig
|
config: KBAPIModuleConfig
|
||||||
): String = with(config) {
|
): String = with(config) {
|
||||||
val kbapiDependencies = kbAPIVersion.dependencies
|
val kbapiDependencies = kbAPIVersion.dependencies
|
||||||
.dependenciesAsGradle(with = ", changing")
|
.dependenciesAsGradle(if (config.serverVersion.minor >= 16) "library" else "implementation")
|
||||||
|
val kbapiDependenciesCompileOnly = kbAPIVersion.dependenciesCompileOnly
|
||||||
|
.dependenciesAsGradle("compileOnly")
|
||||||
|
val kspModules = kbAPIVersion.kspModules.dependenciesAsGradle("ksp")
|
||||||
|
val kspDependencies = kbAPIVersion.kspModules.dependenciesAsGradle()
|
||||||
|
|
||||||
val kbapiRepositories = kbAPIVersion.repositories
|
val kbapiRepositories = kbAPIVersion.repositories
|
||||||
.repositoriesAsGradle()
|
.repositoriesAsGradle()
|
||||||
@@ -40,21 +50,25 @@ fun generateGradleBuildFileContent(
|
|||||||
.repositoriesAsGradle()
|
.repositoriesAsGradle()
|
||||||
|
|
||||||
|
|
||||||
val plugins = externalPlugins.joinToString { "\"${it.name}\"" }
|
val plugins = (externalPlugins.map{ "\"${it.name}\"" }).joinToString()
|
||||||
|
|
||||||
return """
|
return """
|
||||||
|
|// More about the setup here: https://red-tea.gitbook.io/kotlinbukkitkit
|
||||||
|plugins {
|
|plugins {
|
||||||
| kotlin("jvm") version "${kbAPIVersion.kotlinVersion}"
|
| kotlin("jvm") version "${kbAPIVersion.kotlinVersion}"
|
||||||
| kotlin("plugin.serialization") version "${kbAPIVersion.kotlinVersion}"
|
| kotlin("plugin.serialization") version "${kbAPIVersion.kotlinVersion}"
|
||||||
| id("net.minecrell.plugin-yml.bukkit") version "$PLUGIN_YML"
|
| id("net.minecrell.plugin-yml.bukkit") version "$PLUGIN_YML"
|
||||||
| id("com.github.johnrengelman.shadow") version "$SHADOW_PLUGIN"
|
| id("com.github.johnrengelman.shadow") version "$SHADOW_PLUGIN"
|
||||||
|
| id("xyz.jpenilla.run-paper") version "$RUN_PAPER"
|
||||||
|
| id("com.google.devtools.ksp") version "$KSP"
|
||||||
|}
|
|}
|
||||||
|
|
|
|
||||||
|group = "$artifactGroup"
|
|group = "$artifactGroup"
|
||||||
|version = "$artifactVersion"
|
|version = "$artifactVersion"
|
||||||
|
|val kbk_version = "${config.kbAPIVersion.version}"
|
||||||
|
|
|
|
||||||
|repositories {
|
|repositories {
|
||||||
| jcenter()
|
| mavenCentral()
|
||||||
| // minecraft
|
| // minecraft
|
||||||
|$serverRepositories
|
|$serverRepositories
|
||||||
|
|
|
|
||||||
@@ -72,38 +86,44 @@ fun generateGradleBuildFileContent(
|
|||||||
|$serverDependencies
|
|$serverDependencies
|
||||||
|
|
|
|
||||||
| //kotlinbukkitapi
|
| //kotlinbukkitapi
|
||||||
| val changing = Action<ExternalModuleDependency> { isChanging = true }
|
|
||||||
|$kbapiDependencies
|
|$kbapiDependencies
|
||||||
|
|$kbapiDependenciesCompileOnly
|
||||||
|
|
|
||||||
|
| //ksp
|
||||||
|
|$kspDependencies
|
||||||
|
|$kspModules
|
||||||
|
|
|
|
||||||
| //plugins
|
| //plugins
|
||||||
|$pluginDependencies
|
|$pluginDependencies
|
||||||
|}
|
|}
|
||||||
|
|
|
|
||||||
|bukkit {
|
|bukkit {
|
||||||
| main = "${packageName}.${pluginMainName}"
|
| main = "${packageName}.${pluginMainName}Plugin"
|
||||||
| depend = listOf("KotlinBukkitAPI"${plugins.mapIfNotBlank { ", $it" }})
|
| depend = listOf($plugins)
|
||||||
| description = "$description"
|
| description = "$description"
|
||||||
| author = "$author"
|
| author = "$author"
|
||||||
| website = "$website"
|
| website = "$website"
|
||||||
|
| apiVersion = "${config.serverVersion.displayName}"
|
||||||
|}
|
|}
|
||||||
|
|
|
|
||||||
|tasks {
|
|tasks {
|
||||||
| compileKotlin {
|
|
||||||
| kotlinOptions.jvmTarget = "1.8"
|
|
||||||
| kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.time.ExperimentalTime,kotlin.ExperimentalStdlibApi"
|
|
||||||
| }
|
|
||||||
| compileTestKotlin {
|
|
||||||
| kotlinOptions.jvmTarget = "1.8"
|
|
||||||
| kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.time.ExperimentalTime,kotlin.ExperimentalStdlibApi"
|
|
||||||
| }
|
|
||||||
| shadowJar {
|
| shadowJar {
|
||||||
| classifier = null
|
| dependencies {
|
||||||
|
| exclude(dependency("org.jetbrains:*:*"))
|
||||||
|
| }
|
||||||
| }
|
| }
|
||||||
|
| runServer {
|
||||||
|
| minecraftVersion("${config.serverVersion.maxVersion}")
|
||||||
|
| }
|
||||||
|}
|
|}
|
||||||
|
|
|
|
||||||
|configurations.all {
|
|
|
||||||
| resolutionStrategy.cacheChangingModulesFor(120, "seconds")
|
|sourceSets {
|
||||||
|
| main {
|
||||||
|
| kotlin.srcDirs.add(File("build/generated/ksp"))
|
||||||
|
| }
|
||||||
|}
|
|}
|
||||||
|
|
|
||||||
""".trimMargin()
|
""".trimMargin()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,9 +132,15 @@ private inline fun List<String>.dependenciesAsGradle(configuration: String = "co
|
|||||||
"$configuration(\"${it}\"$with)"
|
"$configuration(\"${it}\"$with)"
|
||||||
}.prependIndent(DEFAULT_INDENTATION)
|
}.prependIndent(DEFAULT_INDENTATION)
|
||||||
|
|
||||||
|
|
||||||
private inline fun List<String>.repositoriesAsGradle(): String =
|
private inline fun List<String>.repositoriesAsGradle(): String =
|
||||||
joinToString("\n") {
|
joinToString("\n") {
|
||||||
"maven(\"${it}\")"
|
"""
|
||||||
|
|maven {
|
||||||
|
| url = uri("$it")
|
||||||
|
| isAllowInsecureProtocol = true
|
||||||
|
|}
|
||||||
|
""".trimMargin()
|
||||||
}.prependIndent(DEFAULT_INDENTATION)
|
}.prependIndent(DEFAULT_INDENTATION)
|
||||||
|
|
||||||
fun generateGradleSettingsFileContent(
|
fun generateGradleSettingsFileContent(
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.creator
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.creator
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.KBAPIModuleConfig
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.KBAPIModuleConfig
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
fun generatePluginPackageFolder(
|
fun generatePluginPackageFolder(
|
||||||
@@ -19,16 +19,18 @@ fun generatePluginMainFileContent(
|
|||||||
return """
|
return """
|
||||||
package $packageName
|
package $packageName
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.architecture.KotlinPlugin
|
import tech.carcadex.kotlinbukkitkit.architecture.KotlinPlugin
|
||||||
|
import tech.carcadex.kotlinbukkitkit.genref.plugin.annotations.OnDisable
|
||||||
|
import tech.carcadex.kotlinbukkitkit.genref.plugin.annotations.Plugin
|
||||||
|
|
||||||
class $pluginMainName : KotlinPlugin() {
|
@Plugin
|
||||||
override fun onPluginEnable() {
|
fun KotlinPlugin.start() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPluginDisable() {
|
@OnDisable
|
||||||
|
fun KotlinPlugin.stop() {
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.creator
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.creator
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.KBAPIModuleConfig
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.KBAPIModuleConfig
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
const val DEFAULT_INDENTATION = " "
|
const val DEFAULT_INDENTATION = " "
|
||||||
@@ -19,4 +19,4 @@ fun File.createIfNotExists(): File = apply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val KBAPIModuleConfig.packageName get() = "${artifactGroup}.${artifactId.toLowerCase()}"
|
val KBAPIModuleConfig.packageName get() = "${artifactGroup}.${artifactId.toLowerCase()}"
|
||||||
val KBAPIModuleConfig.pluginMainName get() = "${artifactId}Plugin"
|
val KBAPIModuleConfig.pluginMainName get() = artifactId
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.utils
|
||||||
|
|
||||||
import br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.bukkit.Plugin
|
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.Plugin
|
||||||
import com.intellij.ui.CheckboxTree
|
import com.intellij.ui.CheckboxTree
|
||||||
import com.intellij.ui.CheckedTreeNode
|
import com.intellij.ui.CheckedTreeNode
|
||||||
import com.intellij.ui.SimpleTextAttributes
|
import com.intellij.ui.SimpleTextAttributes
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.utils
|
||||||
|
|
||||||
import com.intellij.openapi.application.ApplicationManager
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
import com.intellij.openapi.application.ModalityState
|
import com.intellij.openapi.application.ModalityState
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.utils
|
package tech.carcadex.kotlinbukkitkit.tooling.wizard.utils
|
||||||
|
|
||||||
import com.intellij.ui.ScrollPaneFactory
|
import com.intellij.ui.ScrollPaneFactory
|
||||||
import com.intellij.ui.components.JBScrollPane
|
import com.intellij.ui.components.JBScrollPane
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<id>br.com.devsrsouza.kotlinbukkitapi.tooling</id>
|
<id>tech.carcadex.kotlinbukkitkit.tooling</id>
|
||||||
<name>KotlinBukkitAPI Tooling</name>
|
<name>KotlinBukkitKit Tooling</name>
|
||||||
<vendor>DevSrSouza</vendor>
|
<vendor>Denis Istratov</vendor>
|
||||||
|
|
||||||
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
|
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
|
||||||
on how to target different products -->
|
on how to target different products -->
|
||||||
@@ -11,28 +11,16 @@
|
|||||||
<depends>com.intellij.modules.externalSystem</depends>
|
<depends>com.intellij.modules.externalSystem</depends>
|
||||||
<depends>com.intellij.modules.java</depends>
|
<depends>com.intellij.modules.java</depends>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<!-- Add your extensions here -->
|
<moduleBuilder
|
||||||
<fileEditorProvider implementation="br.com.devsrsouza.kotlinbukkitapi.tooling.menu.MenuPreviewFileEditorProvider"/>
|
builderClass="tech.carcadex.kotlinbukkitkit.tooling.wizard.KBAPIModuleBuilder"
|
||||||
|
id="KBK_STEP"
|
||||||
|
order="first"/>
|
||||||
|
|
||||||
<fileType language="kotlin" extensions="bk.kts" name="Bukkript File" fieldName="INSTANCE"
|
|
||||||
implementationClass="br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptFileType" />
|
|
||||||
<internalFileTemplate name="Bukkript Script" />
|
|
||||||
<iconProvider implementation="br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptIconProvider" order="first"/>
|
|
||||||
|
|
||||||
<moduleBuilder builderClass="br.com.devsrsouza.kotlinbukkitapi.tooling.wizard.KBAPIModuleBuilder" />
|
|
||||||
|
|
||||||
<projectViewNodeDecorator implementation="br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptViewNodeDecorator" />
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
<extensions defaultExtensionNs="org.jetbrains.kotlin">
|
|
||||||
<scriptDefinitionsProvider implementation="br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptScriptDefinitionProvider" />
|
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<actions>
|
<actions>
|
||||||
<!-- Add your actions here -->
|
|
||||||
<action id="Bukkript.NewScript" class="br.com.devsrsouza.kotlinbukkitapi.tooling.bukkript.BukkriptCreateNewFileAction">
|
|
||||||
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewFromTemplate"/>
|
|
||||||
</action>
|
|
||||||
</actions>
|
</actions>
|
||||||
</idea-plugin>
|
</idea-plugin>
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
||||||
sodipodi:docname="folder.svg"
|
|
||||||
id="svg3167"
|
|
||||||
version="1.1"
|
|
||||||
viewBox="0 0 16 16"
|
|
||||||
height="16"
|
|
||||||
width="16">
|
|
||||||
<metadata
|
|
||||||
id="metadata3173">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<defs
|
|
||||||
id="defs3171" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
inkscape:current-layer="svg3167"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:window-y="50"
|
|
||||||
inkscape:window-x="50"
|
|
||||||
inkscape:cy="8"
|
|
||||||
inkscape:cx="8"
|
|
||||||
inkscape:zoom="52.4375"
|
|
||||||
showgrid="false"
|
|
||||||
id="namedview3169"
|
|
||||||
inkscape:window-height="1030"
|
|
||||||
inkscape:window-width="1870"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
guidetolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
objecttolerance="10"
|
|
||||||
borderopacity="1"
|
|
||||||
bordercolor="#666666"
|
|
||||||
pagecolor="#ffffff" />
|
|
||||||
<path
|
|
||||||
style="fill:#c4a000"
|
|
||||||
id="path3165"
|
|
||||||
d="M1,13 L15,13 L15,4 L7.98457,4 L6.69633,2.71149 C6.22161957,2.28559443 5.61570121,2.03457993 4.97888,2 L1.05128,2 C1.02295884,2 1,2.02295884 1,2.05128 L1,13 Z"
|
|
||||||
fill-rule="evenodd"
|
|
||||||
fill-opacity=".8"
|
|
||||||
fill="#9AA7B0" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 0 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
||||||
<path fill="#40B6E0" fill-opacity=".6" fill-rule="evenodd" d="M1,13 L15,13 L15,4 L7.98457,4 L6.69633,2.71149 C6.22161957,2.28559443 5.63665337,2.03457993 4.99983215,2 L1,2 L1,13 Z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 80 B |
|
Before Width: | Height: | Size: 454 B |
|
Before Width: | Height: | Size: 1009 B |
|
Before Width: | Height: | Size: 943 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 908 B |
|
Before Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 586 B |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 482 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 558 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 937 B |
|
Before Width: | Height: | Size: 918 B |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 548 B |
|
Before Width: | Height: | Size: 563 B |
|
Before Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 997 B |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |