Skip to content

Commit

Permalink
chore: Update geary, idofront, publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Mar 16, 2024
1 parent 9516e4d commit 7c24e3d
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 60 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: MineInAbyss/publish-action@master
- uses: MineInAbyss/publish-action@develop
with:
maven-metadata-url: https://repo.mineinabyss.com/releases/com/mineinabyss/emojy/maven-metadata.xml
pages-path: build/dokka/htmlMultiModule/
dokka: dokkaHtmlMultiModule
maven-snapshot-metadata-url: https://repo.mineinabyss.com/snapshots/com/mineinabyss/emojy/maven-metadata.xml
maven-username: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
maven-password: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
release-files: |
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ allprojects {

dependencies {
// MineInAbyss platform
compileOnly(libs.bundles.idofront.core)
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.bundles.idofront.core)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") //NMS
Expand Down
16 changes: 8 additions & 8 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("com.mineinabyss.conventions.kotlin.jvm")
id("com.mineinabyss.conventions.papermc")
id("com.mineinabyss.conventions.autoversion")
alias(libs.plugins.kotlinx.serialization)
alias(idofrontLibs.plugins.kotlinx.serialization)
}

repositories {
Expand All @@ -15,14 +15,14 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.bundles.idofront.core)
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.bundles.idofront.core)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

compileOnly(libs.creative.api)
compileOnly(libs.creative.serializer.minecraft)
compileOnly(idofrontLibs.creative.api)
compileOnly(idofrontLibs.creative.serializer.minecraft)

// Shaded
implementation("com.aaaaahhhhh.bananapuncher714:GifConverter:1.0")
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/kotlin/com/mineinabyss/emojy/EmojyContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.mineinabyss.emojy.nms.EmojyNMSHandlers
import com.mineinabyss.emojy.nms.IEmojyNMSHandler
import com.mineinabyss.emojy.translator.EmojyLanguage
import com.mineinabyss.idofront.di.DI
import com.mineinabyss.idofront.messaging.ComponentLogger

val emojy by DI.observe<EmojyContext>()
val emojyConfig by DI.observe<EmojyConfig>()
Expand All @@ -18,4 +19,5 @@ interface EmojyContext {
val gifs: Set<Gifs.Gif>
val languages: Set<EmojyLanguage>
val handler: IEmojyNMSHandler
val logger: ComponentLogger
}
6 changes: 3 additions & 3 deletions core/src/main/kotlin/com/mineinabyss/emojy/EmojyGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ object EmojyGenerator {
resourcePack.font(font.toBuilder().addProvider(FontProvider.space().advance("\uE101", -1).build()).build())
// If the font has already added an entry for the emote, skip it
font.providers().any { it is BitMapFontProvider && it.file() == emote.texture } ->
return@forEach if (emojyConfig.debug) logWarn("Skipping ${emote.id}-font because it is a bitmap and already added") else {}
return@forEach emojy.logger.d("Skipping ${emote.id}-font because it is a bitmap and already added")
}

resourcePack.font(emote.appendFont(resourcePack))
emotesFolder.listFiles()?.find { f -> f.nameWithoutExtension == emote.texture.value().substringAfterLast("/").removeSuffix(".png") }?.let {
resourcePack.texture(Texture.texture(emote.texture, Writable.file(it)))
} ?: if (emojyConfig.debug) logWarn("Could not find texture for ${emote.id}") else {}
} ?: emojy.logger.d("Could not find texture for ${emote.id}")
}
emojy.gifs.forEach {
it.generateSplitGif(resourcePack)
Expand All @@ -58,7 +58,7 @@ object EmojyGenerator {
Texture.texture(Key.key("${framePath.asString()}${it.name}"), Writable.file(it))
}?.forEach(resourcePack::texture)
}.onFailure {
if (emojyConfig.debug) logError("Could not generate split gif for ${id}.gif: ${it.message}")
emojy.logger.d("Could not generate split gif for ${id}.gif: ${it.message}")
}
}
}
17 changes: 12 additions & 5 deletions core/src/main/kotlin/com/mineinabyss/emojy/EmojyPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import com.mineinabyss.emojy.translator.EmojyLanguage
import com.mineinabyss.emojy.translator.EmojyTranslator
import com.mineinabyss.idofront.config.config
import com.mineinabyss.idofront.di.DI
import com.mineinabyss.idofront.messaging.ComponentLogger
import com.mineinabyss.idofront.messaging.injectLogger
import com.mineinabyss.idofront.messaging.observeLogger
import com.mineinabyss.idofront.plugin.dataPath
import com.mineinabyss.idofront.plugin.listeners
import net.kyori.adventure.key.Key
import net.kyori.adventure.translation.GlobalTranslator
Expand Down Expand Up @@ -49,20 +53,23 @@ class EmojyPlugin : JavaPlugin() {

fun createEmojyContext() {
DI.remove<EmojyConfig>()
DI.add(config<EmojyConfig>("config", dataFolder.toPath(), EmojyConfig()).getOrLoad())
DI.add(config<EmojyConfig>("config", dataPath, EmojyConfig(), onLoad = {
this@EmojyPlugin.injectLogger(ComponentLogger.forPlugin(this@EmojyPlugin, it.logLevel))
}).getOrLoad())

DI.remove<EmojyTemplates>()
DI.add(config<EmojyTemplates>("templates", dataFolder.toPath(), EmojyTemplates()).getOrLoad())
DI.add(config<EmojyTemplates>("templates", dataPath, EmojyTemplates()).getOrLoad())

DI.remove<EmojyContext>()
DI.add<EmojyContext>(object : EmojyContext {
override val plugin: EmojyPlugin = this@EmojyPlugin
override val emotes: Set<Emotes.Emote> = config("emotes", dataFolder.toPath(), Emotes()).getOrLoad().emotes
override val gifs: Set<Gifs.Gif> = config("gifs", dataFolder.toPath(), Gifs()).getOrLoad().gifs
override val emotes: Set<Emotes.Emote> = config("emotes", dataPath, Emotes()).getOrLoad().emotes
override val gifs: Set<Gifs.Gif> = config("gifs", dataPath, Gifs()).getOrLoad().gifs
override val languages: Set<EmojyLanguage> = emojyConfig.supportedLanguages.map {
EmojyLanguage(it.split("_").let { l -> Locale(l.first(), l.last().uppercase()) },
config<Map<String, String>>(it, dataFolder.toPath() / "languages", mapOf()).getOrLoad())
config<Map<String, String>>(it, dataPath / "languages", mapOf()).getOrLoad())
}.toSet()
override val logger by plugin.observeLogger()
override val handler: IEmojyNMSHandler = EmojyNMSHandlers.setup()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.mineinabyss.emojy.config

import co.touchlab.kermit.Severity
import com.mineinabyss.emojy.*
import com.mineinabyss.idofront.messaging.*
import com.mineinabyss.idofront.serialization.KeySerializer
Expand Down Expand Up @@ -39,7 +40,7 @@ data class EmojyConfig(

val requirePermissions: Boolean = true,
val supportForceUnicode: Boolean = true,
val debug: Boolean = true,
val logLevel: Severity = Severity.Debug,
val emojyList: EmojyList = EmojyList(),
val supportedLanguages: Set<String> = mutableSetOf("en_us"),
) {
Expand Down Expand Up @@ -206,7 +207,7 @@ data class Gifs(val gifs: Set<Gif> = mutableSetOf()) {
aspectRatio = reader.getAspectRatio(0)
reader.getNumImages(true)
}.onFailure {
if (emojyConfig.debug) logError("Could not get frame count for ${id}.gif")
emojy.logger.d("Could not get frame count for ${id}.gif")
}.getOrNull() ?: run {
aspectRatio = 1f
0
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.mineinabyss
version=0.8
idofrontVersion=0.21.2
idofrontVersion=0.23.0
File renamed without changes.
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ dependencyResolutionManagement {
}

versionCatalogs {
create("libs"){
create("idofrontLibs"){
from("com.mineinabyss:catalog:$idofrontVersion")
}
create("emojyLibs").from(files("gradle/emojyLibs.toml"))
}
}

Expand Down
10 changes: 5 additions & 5 deletions v1_19_R1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.19.2-R0.1-SNAPSHOT") //NMS
}
Expand Down
10 changes: 5 additions & 5 deletions v1_19_R2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.19.3-R0.1-SNAPSHOT") //NMS
}
Expand Down
10 changes: 5 additions & 5 deletions v1_19_R3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT") //NMS
}
Expand Down
10 changes: 5 additions & 5 deletions v1_20_R1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT") //NMS
}
Expand Down
10 changes: 5 additions & 5 deletions v1_20_R2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT") //NMS
}
Expand Down
10 changes: 5 additions & 5 deletions v1_20_R3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {

dependencies {
// MineInAbyss platform
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.kotlinx.coroutines)
compileOnly(libs.minecraft.mccoroutine)
compileOnly(idofrontLibs.kotlinx.serialization.json)
compileOnly(idofrontLibs.kotlinx.serialization.kaml)
compileOnly(idofrontLibs.kotlinx.coroutines)
compileOnly(idofrontLibs.minecraft.mccoroutine)

// Shaded
implementation(libs.bundles.idofront.core)
implementation(idofrontLibs.bundles.idofront.core)
implementation(project(":core"))
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") //NMS
}
Expand Down

0 comments on commit 7c24e3d

Please sign in to comment.