Skip to content

Commit

Permalink
Resolve merge conflicts hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-MX committed Jun 28, 2024
2 parents 3578a8a + fc76019 commit dfd9341
Show file tree
Hide file tree
Showing 77 changed files with 1,942 additions and 444 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/modules/plugin/ktgui.plugin.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/.gradle/caches/paperweight/taskCache/reobfJar.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Command: C:\Users\Mangr\.gradle\jdks\adoptium-21-x64-hotspot-windows\bin\java.exe -Xmx1G -classpath C:\Users\Mangr\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.10.1\c293b2384ae12af74f407fa3aaa553bba4ac6763\tiny-remapper-0.10.1-fat.jar net.fabricmc.tinyremapper.Main D:\PC\Projects\KtBukkitGui\api\build\libs\ktgui-2.4.0-dev-all.jar D:\PC\Projects\KtBukkitGui\api\build\libs\api-2.4.0.jar C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\extractDevBundle.dir\data\mojang+yarn-spigot-reobf.tiny mojang+yarn spigot C:\Users\Mangr\.gradle\caches\paperweight-userdev\ff775525efc29c3503a07d1006e63e5695a742b7505cf63e157d49d32419c69f\module\io.papermc.paper\dev-bundle\1.20.4-R0.1-SNAPSHOT\paperweight\setupCache\applyMojangMappedPaperclipPatch.jar --threads=1
Finished after 2887.82 ms.
26 changes: 26 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@ plugins {
`maven-publish`
}

<<<<<<< HEAD
dependencies {
compileOnly(libs.paper.api)
compileOnly(libs.placeholder.api)
implementation(libs.kotlin.reflect)
compileOnly(libs.kotlin.stdlib)
=======
val paper_version: String by rootProject

repositories {
mavenCentral()
}

dependencies {
// compileOnly(kotlin("reflect"))
shadow(implementation(kotlin("reflect"))!!)
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10")

paperweight.paperDevBundle(paper_version)
>>>>>>> fc760191aa5090e9dac6c3014739a12dc7fc5dfb
}

tasks.test {
Expand All @@ -19,8 +34,13 @@ version = rootProject.version

sourceSets["main"].resources.srcDir("src/resources/")

<<<<<<< HEAD
kotlin {
jvmToolchain(JavaVersion.VERSION_17.ordinal)
=======
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "21"
>>>>>>> fc760191aa5090e9dac6c3014739a12dc7fc5dfb
}

tasks {
Expand All @@ -29,12 +49,18 @@ tasks {
}
shadowJar {
mergeServiceFiles()
<<<<<<< HEAD
// exclude {
//// it.path.startsWith("kotlin") && !it.path.contains("reactive")
// it.name.startsWith("kotlin")
// }
archiveBaseName.set("ktgui")
mergeServiceFiles()
=======
}
assemble {
dependsOn(reobfJar)
>>>>>>> fc760191aa5090e9dac6c3014739a12dc7fc5dfb
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
package com.mattmx.ktgui.commands.declarative

import com.mattmx.ktgui.commands.declarative.arg.Argument
import com.mattmx.ktgui.commands.declarative.arg.impl.MultiArgument
import com.mattmx.ktgui.commands.declarative.invocation.RunnableCommandContext
import com.mattmx.ktgui.utils.JavaCompatibility
import org.bukkit.block.data.type.Chain
import org.bukkit.command.CommandSender

class ChainCommandBuilder(val name: String) {
val arguments = arrayListOf<Argument<*>>()
val subcommands = arrayListOf<DeclarativeCommandBuilder<*>>()
val subcommands = arrayListOf<DeclarativeCommandBuilder>()

@JavaCompatibility
fun argument(argument: Argument<*>) = apply {
arguments.add(argument)
}

@JavaCompatibility
fun subcommand(vararg command: DeclarativeCommandBuilder<*>) = apply {
fun subcommand(vararg command: DeclarativeCommandBuilder) = apply {
subcommands.addAll(command)
}

inline fun <reified T : CommandSender> build() = DeclarativeCommandBuilder(name, T::class.java).apply {
inline infix fun <reified S : CommandSender> runs(noinline block: RunnableCommandContext<S>.() -> Unit) = build().runs(block)

fun build() = build(DeclarativeCommandBuilder(name))

fun <T : DeclarativeCommandBuilder> build(existing: T) = existing.apply {
this.expectedArguments += arguments
this.subcommands += this@ChainCommandBuilder.subcommands
}
}

inline operator fun <reified T : CommandSender> ChainCommandBuilder.invoke(block: DeclarativeCommandBuilder<T>.() -> Unit) =
build<T>().apply(block)
inline operator fun ChainCommandBuilder.invoke(block: DeclarativeCommandBuilder.() -> Unit) =
build().apply(block)

val ChainCommandBuilder.command
get() = build()

operator fun String.div(argument: Argument<*>) = ChainCommandBuilder(this).apply {
arguments.add(argument)
}

@JvmName("div1")
operator fun String.div(argument: List<Argument<*>>) = ChainCommandBuilder(this).apply {
arguments.addAll(argument)
arguments.add(MultiArgument("multi-argument", *argument.toTypedArray()))
}

operator fun String.div(s: String) = ChainCommandBuilder(this).apply {
subcommands.add(DeclarativeCommandBuilder(s))
}

operator fun String.div(subs: List<DeclarativeCommandBuilder<*>>) = ChainCommandBuilder(this).apply {
operator fun String.div(subs: List<DeclarativeCommandBuilder>) = ChainCommandBuilder(this).apply {
subcommands.addAll(subs)
}

operator fun DeclarativeCommandBuilder<*>.plus(other: DeclarativeCommandBuilder<*>) = listOf(this, other)
operator fun DeclarativeCommandBuilder.plus(other: DeclarativeCommandBuilder) = listOf(this, other)

operator fun ChainCommandBuilder.div(argument: Argument<*>) = this.apply {
arguments.add(argument)
Expand Down
Loading

0 comments on commit dfd9341

Please sign in to comment.