Skip to content

Commit

Permalink
fix: 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
RitikShah committed Aug 18, 2024
1 parent 8ea95e9 commit 90b667a
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 227 deletions.
16 changes: 7 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version "1.7-SNAPSHOT"
id 'maven-publish'
id "org.jetbrains.kotlin.jvm"
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.10'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -27,12 +27,10 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:${project.kotlinx_serialization_json_version}"

// jgit
// implementation "org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}

processResources {
Expand All @@ -50,14 +48,14 @@ tasks.withType(JavaCompile) {
options.encoding = "UTF-8"

// Minecraft 1.18.1 upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
// classifier = "sources"
from sourceSets.main.allSource
}

Expand Down Expand Up @@ -94,4 +92,4 @@ publishing {
}
}

compileKotlin.kotlinOptions.jvmTarget = "17"
compileKotlin.kotlinOptions.jvmTarget = "21"
32 changes: 13 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
kotlin.code.style=official
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# Check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.8
loader_version=0.14.9
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.2

#Fabric api
fabric_version=0.60.0+1.19.2
loom_version=1.0-SNAPSHOT
# Fabric API
fabric_version=0.102.1+1.21.1
loom_version=1.7-SNAPSHOT

# Mod Properties
mod_version = 0.5
mod_version = 0.6
maven_group = net.rx.modules
archives_base_name = gitmod

# Kotlin
kotlin_version=1.7.10
fabric_kotlin_version=1.8.3+kotlin.1.7.10
kotlin_version=1.9.22
fabric_kotlin_version=1.10.17+kotlin.1.9.22

### Dependencies
## Aegis
colonel_version=0.2.1
aegis_version=3.2.5

## jgit
jgit_version=5.10.0.202012080955-r

## kotlin x
kotlinx_serialization_json_version=1.4.0
#### Dependencies
### jgit
#jgit_version=6.8.0.202311291450-r
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
Expand All @@ -13,5 +12,4 @@ pluginManagement {
id 'fabric-loom' version loom_version
id "org.jetbrains.kotlin.jvm" version kotlin_version
}

}
6 changes: 3 additions & 3 deletions src/main/kotlin/net/rx/modules/GitMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ object GitMod : ModInitializer {
ConfigManager.register(it)
}

ServerLifecycleEvents.SERVER_STOPPED.register {

}
// ServerLifecycleEvents.SERVER_STOPPED.register {
//
// }

CommandRegistrationCallback.EVENT.register(::registerCommands)
}
Expand Down
154 changes: 0 additions & 154 deletions src/main/kotlin/net/rx/modules/Text.kt

This file was deleted.

27 changes: 9 additions & 18 deletions src/main/kotlin/net/rx/modules/commands/GitAdminCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import net.minecraft.server.network.ServerPlayerEntity
import net.minecraft.text.ClickEvent
import net.minecraft.util.Formatting
import net.rx.modules.config.ConfigManager
import net.rx.modules.text

object GitAdminCommand : Command() {
override fun register(dispatcher: Dispatcher) {
Expand Down Expand Up @@ -67,47 +66,39 @@ object GitAdminCommand : Command() {

private fun reload(context: Context): Int {
ConfigManager.reloadData()
val test = text {
"hello world" styled Formatting.BOLD + Formatting.GREEN
NEW_LINE
"a more complex string" {

}
-"testing"
}
context.source.sendFeedback(
gray("Successfully reloaded configuration"), true)
context.source.sendFeedback(test, true)
{ gray("Successfully reloaded configuration") }, true)

return 1
}

private fun addOperator(context: Context, player: ServerPlayerEntity): Int {
val out = ConfigManager.addOperator(player.entityName, player.uuid.toString())
val out = ConfigManager.addOperator(player.name.string, player.uuid.toString())

if (out == 1) {
context.source.sendFeedback(
gray("Successfully added ${player.entityName} as an operator"), true
{ gray("Successfully added ${player.name} as an operator") }, true
)
context.source.player?.server?.playerManager?.sendCommandTree(context.source.player)
}
else
context.source.sendFeedback(
red("Could not added, ${player.entityName} is already an operator"), true)
{ red("Could not added, ${player.name} is already an operator") }, true)
return 1
}

private fun removeOperator(context: Context, player: ServerPlayerEntity): Int {
val out = ConfigManager.removeOperator(player.entityName, player.uuid.toString())
val out = ConfigManager.removeOperator(player.name.string, player.uuid.toString())

if (out == 1) {
context.source.sendFeedback(
gray("Successfully removed ${player.entityName} as an operator"), true
{ gray("Successfully removed ${player.name.string} as an operator") }, true
)
context.source.player?.server?.playerManager?.sendCommandTree(context.source.player)
}
else
context.source.sendFeedback(
red("Could not remove, ${player.entityName} is not an operator"), true)
{ red("Could not remove, ${player.name} is not an operator") }, true)

return out
}
Expand All @@ -130,7 +121,7 @@ object GitAdminCommand : Command() {

private fun listOperators(context: Context): Int {
context.source.sendFeedback(
gray("Operators: ${ConfigManager.getOperators().joinToString(",")}"), false)
{ gray("Operators: ${ConfigManager.getOperators().joinToString(",")}") }, false)
return 1
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/net/rx/modules/commands/RawGitCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object RawGitCommand : Command() {
print(args)
if (RawGitHandler.executing) {
val feedback = "${RawGitHandler.executor} is current running ${RawGitHandler.command}. Please wait.."
context.source.sendFeedback(red(feedback), true)
context.source.sendFeedback({ red(feedback) }, true)
return 0
}

Expand All @@ -49,7 +49,7 @@ object RawGitCommand : Command() {
RawGitHandler.runGit(path, args, context.source)
}

return 0
return 1
}

internal object GitSuggestionProvider : SuggestionProvider<Source> {
Expand Down
Loading

0 comments on commit 90b667a

Please sign in to comment.