This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed
src/main/kotlin/io/github/dockyardmc/scroll/providers/default Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 11.gradle
22build /
3- ! gradle /wrapper /gradle-wrapper.jar
43! ** /src /main /** /build /
54! ** /src /test /** /build /
65
4241.DS_Store
4342gradlew.bat
4443gradlew
45- .idea
46- gradle /wrapper
44+ .idea
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ plugins {
1111}
1212
1313group = " io.github.dockyardmc"
14- version = " 2.7 "
14+ version = " 2.8 "
1515
1616repositories {
1717 mavenCentral()
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-7.6.1 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.5 -bin.zip
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -3,16 +3,20 @@ package io.github.dockyardmc.scroll.providers.default
33import io.github.dockyardmc.scroll.ClickAction
44import io.github.dockyardmc.scroll.ClickEvent
55import io.github.dockyardmc.scroll.Component
6+ import io.github.dockyardmc.scroll.providers.ClosingNamedFormatProvider
67import io.github.dockyardmc.scroll.providers.FormatProviderContext
7- import io.github.dockyardmc.scroll.providers.NamedFormatProvider
88
9- class ClickEventProvider : NamedFormatProvider (" click" ) {
9+ class ClickEventProvider : ClosingNamedFormatProvider (" click" , listOf() ) {
1010
11- override fun format (context : FormatProviderContext , component : Component ) {
11+ override fun formatNormal (context : FormatProviderContext , component : Component ) {
1212 val action = ClickAction .valueOf(context.getArgument(0 ).uppercase())
1313 val value = context.getArgument(1 )
1414 val clickEvent = ClickEvent (action, value)
1515
1616 component.clickEvent = clickEvent
1717 }
18+
19+ override fun formatClosing (context : FormatProviderContext , component : Component ) {
20+ component.clickEvent = null
21+ }
1822}
Original file line number Diff line number Diff line change @@ -4,16 +4,20 @@ import io.github.dockyardmc.scroll.Component
44import io.github.dockyardmc.scroll.HoverAction
55import io.github.dockyardmc.scroll.HoverEvent
66import io.github.dockyardmc.scroll.Scroll
7+ import io.github.dockyardmc.scroll.providers.ClosingNamedFormatProvider
78import io.github.dockyardmc.scroll.providers.FormatProviderContext
8- import io.github.dockyardmc.scroll.providers.NamedFormatProvider
99
10- class HoverEventProvider : NamedFormatProvider (" hover" ) {
10+ class HoverEventProvider : ClosingNamedFormatProvider (" hover" , listOf() ) {
1111
12- override fun format (context : FormatProviderContext , component : Component ) {
12+ override fun formatNormal (context : FormatProviderContext , component : Component ) {
1313 val action = HoverAction .valueOf(context.getArgument(0 ).uppercase())
1414 val value = Scroll .parse(context.getArgument(1 ))
1515 val hoverEvent = HoverEvent (action, value)
1616
1717 component.hoverEvent = hoverEvent
1818 }
19+
20+ override fun formatClosing (context : FormatProviderContext , component : Component ) {
21+ component.hoverEvent = null
22+ }
1923}
You can’t perform that action at this time.
0 commit comments