Compare commits
2 commits
5ab4824a42
...
2b6bed8336
Author | SHA1 | Date | |
---|---|---|---|
2b6bed8336 | |||
7918072e1e |
6 changed files with 98 additions and 16 deletions
4
.idea/gradle.xml
generated
4
.idea/gradle.xml
generated
|
@ -6,13 +6,13 @@
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="distributionType" value="LOCAL" />
|
<option name="distributionType" value="LOCAL" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="/usr/share/java/gradle" />
|
<option name="gradleJvm" value="temurin-21" />
|
||||||
<option name="gradleJvm" value="graalvm-jdk-21" />
|
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="resolveExternalAnnotations" value="true" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.0.0" />
|
<option name="version" value="2.2.10" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,10 +1,12 @@
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.0.0"
|
kotlin("jvm") version "2.2.10"
|
||||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
id("com.gradleup.shadow") version "9.1.0"
|
||||||
id("io.papermc.paperweight.userdev") version "1.7.1"
|
id("io.papermc.paperweight.userdev") version "2.0.0-beta.18"
|
||||||
id("xyz.jpenilla.run-paper") version "2.3.0"
|
id("xyz.jpenilla.run-paper") version "2.3.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val kotlin_version = "2.2.10"
|
||||||
|
|
||||||
group = "xyz.ineanto.dragon"
|
group = "xyz.ineanto.dragon"
|
||||||
version = "1.1"
|
version = "1.1"
|
||||||
|
|
||||||
|
@ -17,22 +19,19 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Spigot
|
// Spigot
|
||||||
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
|
paperweight.paperDevBundle("1.21.8-R0.1-SNAPSHOT")
|
||||||
|
|
||||||
// Game Libraries
|
// Game Libraries
|
||||||
compileOnly("xyz.xenondevs.invui:invui:1.33")
|
compileOnly("xyz.xenondevs.invui:invui:1.46")
|
||||||
compileOnly("xyz.xenondevs.invui:invui-kotlin:1.33")
|
compileOnly("xyz.xenondevs.invui:invui-kotlin:1.46")
|
||||||
|
|
||||||
implementation("ru.brikster:glyphs-api:1.1.0")
|
implementation("ru.brikster:glyphs-api:1.1.0")
|
||||||
implementation("ru.brikster:glyphs-resources:1.1.0")
|
implementation("ru.brikster:glyphs-resources:1.1.0")
|
||||||
implementation("team.unnamed:creative-api:1.7.2")
|
|
||||||
// Serializer for Minecraft format (ZIP / Folder)
|
|
||||||
implementation("team.unnamed:creative-serializer-minecraft:1.7.2")
|
|
||||||
|
|
||||||
// Stdlib
|
// Stdlib
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
|
||||||
// Commons IO
|
// Commons IO
|
||||||
implementation("commons-io:commons-io:2.11.0")
|
implementation("commons-io:commons-io:2.14.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
|
@ -41,6 +40,6 @@ kotlin {
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
runServer {
|
runServer {
|
||||||
minecraftVersion("1.21")
|
minecraftVersion("1.21.8")
|
||||||
}
|
}
|
||||||
}
|
}
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -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-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
13
src/main/kotlin/xyz/ineanto/dragon/assets/Asset.kt
Normal file
13
src/main/kotlin/xyz/ineanto/dragon/assets/Asset.kt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package xyz.ineanto.dragon.assets
|
||||||
|
|
||||||
|
data class Asset(
|
||||||
|
private val qualifier: String,
|
||||||
|
val name: String,
|
||||||
|
var path: String = "assets/${qualifier}/${name}.png"
|
||||||
|
) {
|
||||||
|
class Icons {
|
||||||
|
companion object {
|
||||||
|
val DENY: Asset = Asset("icon", "deny")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package xyz.ineanto.dragon.inventory
|
||||||
|
|
||||||
|
import net.kyori.adventure.key.Key
|
||||||
|
import net.kyori.adventure.text.Component
|
||||||
|
import net.kyori.adventure.text.format.NamedTextColor
|
||||||
|
import net.kyori.adventure.text.format.TextDecoration
|
||||||
|
import ru.brikster.glyphs.compile.GlyphCompiler
|
||||||
|
import ru.brikster.glyphs.glyph.Glyph
|
||||||
|
import ru.brikster.glyphs.glyph.GlyphComponentBuilder
|
||||||
|
import ru.brikster.glyphs.glyph.GlyphComponentBuilder.PositionType
|
||||||
|
import ru.brikster.glyphs.glyph.image.ImageGlyph
|
||||||
|
import ru.brikster.glyphs.glyph.image.TextureProperties
|
||||||
|
import ru.brikster.glyphs.glyph.space.mojang.MojangSpacesGlyph
|
||||||
|
import ru.brikster.glyphs.resources.GlyphResources
|
||||||
|
import team.unnamed.creative.texture.Texture
|
||||||
|
|
||||||
|
class TeamSelectionScreen {
|
||||||
|
fun show() {
|
||||||
|
// Glyphs objects
|
||||||
|
var spaces = MojangSpacesGlyph.create()
|
||||||
|
|
||||||
|
var guiBackground = ImageGlyph.of(
|
||||||
|
Key.key(Glyph.DEFAULT_NAMESPACE, "gui/gui_background"),
|
||||||
|
Texture.of(
|
||||||
|
Key.key(Glyph.DEFAULT_NAMESPACE, "gui/gui_background"),
|
||||||
|
GlyphResources.resourceFromJar("gui_background.png")
|
||||||
|
),
|
||||||
|
TextureProperties(/* height */ 256, /* ascent */ 19)
|
||||||
|
)
|
||||||
|
|
||||||
|
var exampleButton = ImageGlyph.of(
|
||||||
|
Key.key(Glyph.DEFAULT_NAMESPACE, "gui/example_button"),
|
||||||
|
Texture.of(
|
||||||
|
Key.key(Glyph.DEFAULT_NAMESPACE, "gui/example_button"),
|
||||||
|
GlyphResources.resourceFromJar("example_button.png")
|
||||||
|
),
|
||||||
|
TextureProperties(/* height */ 22, /* ascent */ -56
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
var font = GlyphResources.minecraftFontGlyphCollection(
|
||||||
|
listOf(
|
||||||
|
TextureProperties(/* height */ 12, /* ascent */ -6),
|
||||||
|
TextureProperties(/* height */ 8, /* ascent */ -24
|
||||||
|
),
|
||||||
|
TextureProperties(/* height */ 8, /* ascent */-36)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
val resources = GlyphCompiler.instance()
|
||||||
|
.compile(spaces, guiBackground, exampleButton, font);
|
||||||
|
resources.addAll(GlyphResources.blankSlotResources());
|
||||||
|
|
||||||
|
//createResourcepack(resources)
|
||||||
|
|
||||||
|
val title = GlyphComponentBuilder.gui(spaces)
|
||||||
|
.append(guiBackground)
|
||||||
|
.append(/* position */ 131, exampleButton)
|
||||||
|
.append(/* position */ 16, font.translate(/* height */ 12, /* ascent */ -6, "Example text"))
|
||||||
|
.append(/* position */ 16, font.translate(/* height */ 8, /* ascent */ -24, "Hello "))
|
||||||
|
.append(PositionType.RELATIVE, font.translate(/* height */ 8, /* ascent */ -24, "world..."))
|
||||||
|
.append(
|
||||||
|
PositionType.ABSOLUTE, /* position */
|
||||||
|
16,
|
||||||
|
font.translate(/* height */ 8, /* ascent */ -36, "Hello world...", NamedTextColor.LIGHT_PURPLE)
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
.append(Component.text("Test menu with glyphs", NamedTextColor.DARK_GRAY, TextDecoration.UNDERLINED))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue