Bump DesertWell to use v2.0.2 (#371)

This commit is contained in:
William authored and GitHub committed 2023-04-26 19:10:53 +01:00
1 parent 4ad24cfd54
commit ebfe84cf14
9 files changed
+57 -47

No files matched your search

+2 -1
View File
@@ -10,7 +10,7 @@ dependencies {
compileOnly 'org.jetbrains:annotations:24.0.1' compileOnly 'org.jetbrains:annotations:24.0.1'
compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT' compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
compileOnly 'net.william278:Annotaml:2.0.1' compileOnly 'net.william278:Annotaml:2.0.1'
compileOnly 'net.william278:DesertWell:1.1.1' compileOnly 'net.william278:DesertWell:2.0.2'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:4.0-SNAPSHOT' compileOnly 'com.github.Emibergo02:RedisEconomy:4.0-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.3' compileOnly 'me.clip:placeholderapi:2.11.3'
@@ -39,6 +39,7 @@ shadowJar {
relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml' relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml'
relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown' relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown'
relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell' relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell'
relocate 'org.json', 'net.william278.huskhomes.libraries.json'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml' relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml'
relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml' relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml'
relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson' relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson'
@@ -21,7 +21,7 @@ package net.william278.huskhomes;
import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.william278.annotaml.Annotaml; import net.william278.annotaml.Annotaml;
import net.william278.desertwell.Version; import net.william278.desertwell.util.Version;
import net.william278.huskhomes.command.BukkitCommand; import net.william278.huskhomes.command.BukkitCommand;
import net.william278.huskhomes.command.Command; import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.command.DisabledCommand; import net.william278.huskhomes.command.DisabledCommand;
+1 -1
View File
@@ -13,7 +13,7 @@ dependencies {
api 'com.google.code.gson:gson:2.10.1' api 'com.google.code.gson:gson:2.10.1'
api 'net.william278:Annotaml:2.0.1' api 'net.william278:Annotaml:2.0.1'
api 'net.william278:PagineDown:1.1' api 'net.william278:PagineDown:1.1'
api 'net.william278:DesertWell:1.1.1' api 'net.william278:DesertWell:2.0.2'
api 'dev.dejvokep:boosted-yaml:1.3.1' api 'dev.dejvokep:boosted-yaml:1.3.1'
api 'net.kyori:adventure-api:4.13.1' api 'net.kyori:adventure-api:4.13.1'
api('com.zaxxer:HikariCP:5.0.1') { api('com.zaxxer:HikariCP:5.0.1') {
@@ -23,8 +23,8 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.william278.annotaml.Annotaml; import net.william278.annotaml.Annotaml;
import net.william278.desertwell.UpdateChecker; import net.william278.desertwell.util.UpdateChecker;
import net.william278.desertwell.Version; import net.william278.desertwell.util.Version;
import net.william278.huskhomes.command.Command; import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.config.Locales; import net.william278.huskhomes.config.Locales;
import net.william278.huskhomes.config.Server; import net.william278.huskhomes.config.Server;
@@ -181,7 +181,7 @@ public interface HuskHomes extends TaskRunner, EventDispatcher, SafetyResolver {
UnsafeBlocks getUnsafeBlocks(); UnsafeBlocks getUnsafeBlocks();
/** /**
* The {@link Database} that stores persistent plugin data * The {@link Database} that store persistent plugin data
* *
* @return the {@link Database} implementation for accessing data * @return the {@link Database} implementation for accessing data
*/ */
@@ -189,7 +189,7 @@ public interface HuskHomes extends TaskRunner, EventDispatcher, SafetyResolver {
Database getDatabase(); Database getDatabase();
/** /**
* The {@link Validator} for validating thome names and descriptions * The {@link Validator} for validating home names and descriptions
* *
* @return the {@link Validator} instance * @return the {@link Validator} instance
*/ */
@@ -448,15 +448,19 @@ public interface HuskHomes extends TaskRunner, EventDispatcher, SafetyResolver {
@NotNull @NotNull
default UpdateChecker getUpdateChecker() { default UpdateChecker getUpdateChecker() {
return UpdateChecker.create(getVersion(), SPIGOT_RESOURCE_ID); return UpdateChecker.builder()
.currentVersion(getVersion())
.endpoint(UpdateChecker.Endpoint.SPIGOT)
.resource(Integer.toString(SPIGOT_RESOURCE_ID))
.build();
} }
default void checkForUpdates() { default void checkForUpdates() {
if (getSettings().doCheckForUpdates()) { if (getSettings().doCheckForUpdates()) {
getUpdateChecker().isUpToDate().thenAccept(updated -> { getUpdateChecker().check().thenAccept(checked -> {
if (!updated) { if (!checked.isUpToDate()) {
getUpdateChecker().getLatestVersion().thenAccept(latest -> log(Level.WARNING, log(Level.WARNING, "A new version of HuskTowns is available: v"
"A new version of HuskTowns is available: v" + latest + " (running v" + getVersion() + ")")); + checked.getLatestVersion() + " (running v" + getVersion() + ")");
} }
}); });
} }
@@ -20,8 +20,10 @@
package net.william278.huskhomes.command; package net.william278.huskhomes.command;
import de.themoep.minedown.adventure.MineDown; import de.themoep.minedown.adventure.MineDown;
import net.william278.desertwell.AboutMenu; import net.kyori.adventure.text.Component;
import net.william278.desertwell.UpdateChecker; import net.kyori.adventure.text.format.TextColor;
import net.william278.desertwell.about.AboutMenu;
import net.william278.desertwell.util.UpdateChecker;
import net.william278.huskhomes.HuskHomes; import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.config.Locales; import net.william278.huskhomes.config.Locales;
import net.william278.huskhomes.user.CommandUser; import net.william278.huskhomes.user.CommandUser;
@@ -49,30 +51,32 @@ public class HuskHomesCommand extends Command implements TabProvider {
addAdditionalPermissions(SUB_COMMANDS); addAdditionalPermissions(SUB_COMMANDS);
this.updateChecker = plugin.getUpdateChecker(); this.updateChecker = plugin.getUpdateChecker();
this.aboutMenu = AboutMenu.create("HuskHomes") this.aboutMenu = AboutMenu.builder()
.withDescription("A powerful, intuitive and flexible teleportation suite") .title(Component.text("HuskHomes"))
.withVersion(plugin.getVersion()) .description(Component.text("A powerful, intuitive and flexible teleportation suite"))
.addAttribution("Author", .version(plugin.getVersion())
AboutMenu.Credit.of("William278").withDescription("Click to visit website").withUrl("https://william278.net")) .credits("Author",
.addAttribution("Contributors", AboutMenu.Credit.of("William278").description("Click to visit website").url("https://william278.net"))
AboutMenu.Credit.of("imDaniX").withDescription("Code, refactoring"), .credits("Contributors",
AboutMenu.Credit.of("Log1x").withDescription("Code")) AboutMenu.Credit.of("imDaniX").description("Code, refactoring"),
.addAttribution("Translators", AboutMenu.Credit.of("Log1x").description("Code"))
AboutMenu.Credit.of("SnivyJ").withDescription("Simplified Chinese (zh-cn)"), .credits("Translators",
AboutMenu.Credit.of("ApliNi").withDescription("Simplified Chinese (zh-cn)"), AboutMenu.Credit.of("SnivyJ").description("Simplified Chinese (zh-cn)"),
AboutMenu.Credit.of("Wtq_").withDescription("Simplified Chinese (zh-cn)"), AboutMenu.Credit.of("ApliNi").description("Simplified Chinese (zh-cn)"),
AboutMenu.Credit.of("TonyPak").withDescription("Traditional Chinese (zh-tw)"), AboutMenu.Credit.of("Wtq_").description("Simplified Chinese (zh-cn)"),
AboutMenu.Credit.of("davgo0103").withDescription("Traditional Chinese (zh-tw)"), AboutMenu.Credit.of("TonyPak").description("Traditional Chinese (zh-tw)"),
AboutMenu.Credit.of("Villag3r_").withDescription("Italian (it-it)"), AboutMenu.Credit.of("davgo0103").description("Traditional Chinese (zh-tw)"),
AboutMenu.Credit.of("ReferTV").withDescription("Polish (pl)"), AboutMenu.Credit.of("Villag3r_").description("Italian (it-it)"),
AboutMenu.Credit.of("anchelthe").withDescription("Spanish (es-es)"), AboutMenu.Credit.of("ReferTV").description("Polish (pl)"),
AboutMenu.Credit.of("Chiquis2005").withDescription("Spanish (es-es)"), AboutMenu.Credit.of("anchelthe").description("Spanish (es-es)"),
AboutMenu.Credit.of("Ceddix").withDescription("German, (de-de)"), AboutMenu.Credit.of("Chiquis2005").description("Spanish (es-es)"),
AboutMenu.Credit.of("Pukejoy_1").withDescription("Bulgarian (bg-bg)")) AboutMenu.Credit.of("Ceddix").description("German, (de-de)"),
.addButtons( AboutMenu.Credit.of("Pukejoy_1").description("Bulgarian (bg-bg)"))
AboutMenu.Link.of("https://william278.net/docs/huskhomes").withText("Documentation").withIcon("⛏"), .buttons(
AboutMenu.Link.of("https://github.com/WiIIiam278/HuskHomes2/issues").withText("Issues").withIcon("❌").withColor("#ff9f0f"), AboutMenu.Link.of("https://william278.net/docs/huskhomes").text("Documentation").icon("⛏"),
AboutMenu.Link.of("https://discord.gg/tVYhJfyDWG").withText("Discord").withIcon("⭐").withColor("#6773f5")); AboutMenu.Link.of("https://github.com/WiIIiam278/HuskHomes2/issues").text("Issues").icon("❌").color(TextColor.color(0xff9f0f)),
AboutMenu.Link.of("https://discord.gg/tVYhJfyDWG").text("Discord").icon("⭐").color(TextColor.color(0x6773f5)))
.build();
} }
@Override @Override
@@ -85,7 +89,7 @@ public class HuskHomesCommand extends Command implements TabProvider {
} }
switch (action.toLowerCase()) { switch (action.toLowerCase()) {
case "about" -> executor.sendMessage(aboutMenu.toMineDown()); case "about" -> executor.sendMessage(aboutMenu.toComponent());
case "help" -> executor.sendMessage(getCommandList(executor) case "help" -> executor.sendMessage(getCommandList(executor)
.getNearestValidPage(parseIntArg(args, 1).orElse(1))); .getNearestValidPage(parseIntArg(args, 1).orElse(1)));
case "reload" -> { case "reload" -> {
@@ -95,15 +99,14 @@ public class HuskHomesCommand extends Command implements TabProvider {
} }
executor.sendMessage(new MineDown("[HuskHomes](#00fb9a bold) &#00fb9a&| Reloaded config & message files.")); executor.sendMessage(new MineDown("[HuskHomes](#00fb9a bold) &#00fb9a&| Reloaded config & message files."));
} }
case "update" -> updateChecker.isUpToDate().thenAccept(upToDate -> { case "update" -> updateChecker.check().thenAccept(checked -> {
if (upToDate) { if (checked.isUpToDate()) {
plugin.getLocales().getLocale("up_to_date", plugin.getVersion().toString()) plugin.getLocales().getLocale("up_to_date", plugin.getVersion().toString())
.ifPresent(executor::sendMessage); .ifPresent(executor::sendMessage);
return; return;
} }
updateChecker.getLatestVersion().thenAccept(latest -> plugin.getLocales() plugin.getLocales().getLocale("update_available", checked.getLatestVersion().toString(),
.getLocale("update_available", latest.toString(), plugin.getVersion().toString()) plugin.getVersion().toString()).ifPresent(executor::sendMessage);
.ifPresent(executor::sendMessage));
}); });
default -> plugin.getLocales().getLocale("error_invalid_syntax", getUsage()) default -> plugin.getLocales().getLocale("error_invalid_syntax", getUsage())
.ifPresent(executor::sendMessage); .ifPresent(executor::sendMessage);
@@ -34,7 +34,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.william278.annotaml.Annotaml; import net.william278.annotaml.Annotaml;
import net.william278.desertwell.Version; import net.william278.desertwell.util.Version;
import net.william278.huskhomes.command.Command; import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.command.FabricCommand; import net.william278.huskhomes.command.FabricCommand;
import net.william278.huskhomes.config.Locales; import net.william278.huskhomes.config.Locales;
+2 -1
View File
@@ -13,7 +13,7 @@ dependencies {
compileOnly 'org.jetbrains:annotations:24.0.1' compileOnly 'org.jetbrains:annotations:24.0.1'
compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT' compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
compileOnly 'net.william278:Annotaml:2.0.1' compileOnly 'net.william278:Annotaml:2.0.1'
compileOnly 'net.william278:DesertWell:1.1.1' compileOnly 'net.william278:DesertWell:2.0.2'
compileOnly 'me.lucko:commodore:2.2' compileOnly 'me.lucko:commodore:2.2'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1' compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'com.github.Emibergo02:RedisEconomy:9f4f9c86f4' compileOnly 'com.github.Emibergo02:RedisEconomy:9f4f9c86f4'
@@ -35,6 +35,7 @@ shadowJar {
relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml' relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml'
relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown' relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown'
relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell' relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell'
relocate 'org.json', 'net.william278.huskhomes.libraries.json'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml' relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml'
relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml' relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml'
relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson' relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson'
+1
View File
@@ -67,6 +67,7 @@ shadowJar {
relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml' relocate 'net.william278.annotaml', 'net.william278.huskhomes.libraries.annotaml'
relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown' relocate 'net.william278.paginedown', 'net.william278.huskhomes.libraries.paginedown'
relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell' relocate 'net.william278.desertwell', 'net.william278.huskhomes.libraries.desertwell'
relocate 'org.json', 'net.william278.huskhomes.libraries.json'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml' relocate 'dev.dejvokep.boostedyaml', 'net.william278.huskhomes.libraries.boostedyaml'
relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml' relocate 'org.yaml.snakeyaml', 'net.william278.huskhomes.libraries.snakeyaml'
relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson' relocate 'com.google.gson', 'net.william278.huskhomes.libraries.gson'
@@ -21,7 +21,7 @@ package net.william278.huskhomes;
import com.google.inject.Inject; import com.google.inject.Inject;
import net.william278.annotaml.Annotaml; import net.william278.annotaml.Annotaml;
import net.william278.desertwell.Version; import net.william278.desertwell.util.Version;
import net.william278.huskhomes.command.Command; import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.command.SpongeCommand; import net.william278.huskhomes.command.SpongeCommand;
import net.william278.huskhomes.config.Locales; import net.william278.huskhomes.config.Locales;