Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 5a5bea6

Browse files
committed
v2.0.1: HuskHomes v3.0.4 and MineDown-adventure support
1 parent 57c4fab commit 5a5bea6

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'net.william278'
8-
version "2.0-${versionMetadata()}"
8+
version "2.0.1-${versionMetadata()}"
99

1010
repositories {
1111
mavenCentral()
@@ -17,19 +17,28 @@ repositories {
1717

1818
dependencies {
1919
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
20-
compileOnly 'net.william278:HuskHomes2:4db869abf1'
20+
compileOnly 'net.william278:HuskHomes2:06d73c23d1'
2121
compileOnly 'org.jetbrains:annotations:23.0.0'
2222

23-
implementation 'de.themoep:inventorygui:1.5.1-SNAPSHOT'
24-
implementation 'de.themoep:minedown:1.7.1-SNAPSHOT'
23+
implementation 'de.themoep:inventorygui:1.6-SNAPSHOT'
24+
implementation 'de.themoep:minedown-adventure:1.7.1-SNAPSHOT'
25+
implementation 'net.kyori:adventure-text-serializer-legacy:4.11.0'
26+
implementation 'net.kyori:adventure-platform-bukkit:4.1.2'
2527

26-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
27-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
28+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
29+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
30+
}
31+
32+
compileJava.options.encoding = 'UTF-8'
33+
34+
tasks.withType(JavaCompile) {
35+
options.encoding = 'UTF-8'
2836
}
2937

3038
shadowJar {
3139
relocate 'de.themoep.inventorygui', 'net.william278.huskhomes.gui.libraries.inventorygui'
3240
relocate 'de.themoep.minedown', 'net.william278.huskhomes.gui.libraries.minedown'
41+
relocate 'net.kyori.adventure', 'net.william278.huskhomes.gui.libraries.adventure'
3342
}
3443

3544
jar {

src/main/java/net/william278/huskhomes/gui/SavedPositionMenu.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package net.william278.huskhomes.gui;
22

3-
import de.themoep.inventorygui.*;
4-
import net.md_5.bungee.api.chat.BaseComponent;
3+
import de.themoep.inventorygui.GuiElementGroup;
4+
import de.themoep.inventorygui.GuiPageElement;
5+
import de.themoep.inventorygui.InventoryGui;
6+
import de.themoep.inventorygui.StaticGuiElement;
7+
import de.themoep.minedown.adventure.MineDown;
8+
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
59
import net.william278.huskhomes.api.HuskHomesAPI;
6-
import net.william278.huskhomes.libraries.minedown.MineDown;
710
import net.william278.huskhomes.player.OnlineUser;
811
import net.william278.huskhomes.position.*;
912
import net.william278.huskhomes.util.Permission;
@@ -194,11 +197,12 @@ private boolean canEditPosition(@NotNull SavedPosition position, @NotNull Player
194197
* @param replacements The replacements to use
195198
* @return The legacy text
196199
*/
200+
@SuppressWarnings("SameParameterValue")
197201
@NotNull
198202
private Optional<String> getLocale(@NotNull String localeKey, String... replacements) {
199203
return huskHomesAPI.getLocale(localeKey, replacements)
200-
.map(MineDown::toComponent)
201-
.map(BaseComponent::toLegacyText);
204+
.map(mineDown -> LegacyComponentSerializer.builder()
205+
.build().serialize(mineDown.toComponent()));
202206
}
203207

204208
/**
@@ -209,7 +213,8 @@ private Optional<String> getLocale(@NotNull String localeKey, String... replacem
209213
*/
210214
@NotNull
211215
private String getLegacyText(@NotNull String mineDown) {
212-
return BaseComponent.toLegacyText(new MineDown(mineDown).toComponent());
216+
return LegacyComponentSerializer.builder()
217+
.build().serialize(new MineDown(mineDown).toComponent());
213218
}
214219

215220
/**

0 commit comments

Comments
 (0)