From 39bf2ead3b30200efe41149b57af1906f8bb601f Mon Sep 17 00:00:00 2001 From: TehBrian Date: Wed, 14 Feb 2024 22:10:36 -0500 Subject: [PATCH] update pack hash; send resource pack as required --- .../floatyplugin/server/JoinQuitListener.java | 13 ++++++++++--- src/main/resources/config.conf | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java b/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java index 4cf3219..594d508 100644 --- a/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java +++ b/src/main/java/city/thefloating/floatyplugin/server/JoinQuitListener.java @@ -20,9 +20,13 @@ import org.bukkit.inventory.meta.FireworkMeta; import org.spongepowered.configurate.NodePath; +import java.net.URI; import java.time.Duration; import java.util.Calendar; +import static net.kyori.adventure.resource.ResourcePackInfo.resourcePackInfo; +import static net.kyori.adventure.resource.ResourcePackRequest.resourcePackRequest; + public final class JoinQuitListener implements Listener { private final FloatyPlugin plugin; @@ -56,9 +60,12 @@ public void onPack(final PlayerResourcePackStatusEvent event) { public void onJoin(final PlayerJoinEvent event) { final Player player = event.getPlayer(); - player.setResourcePack( - this.configConfig.data().resourcePackUrl(), - this.configConfig.data().resourcePackHash() + player.sendResourcePacks(resourcePackRequest() + .required(true) + .packs(resourcePackInfo() + .uri(URI.create(this.configConfig.data().resourcePackUrl())) + .hash(this.configConfig.data().resourcePackHash()) + ) ); player.sendMessage(this.langConfig.c(NodePath.path("banner"))); diff --git a/src/main/resources/config.conf b/src/main/resources/config.conf index ee40e1c..432c9e2 100644 --- a/src/main/resources/config.conf +++ b/src/main/resources/config.conf @@ -7,7 +7,7 @@ poke-force: { resource-pack-url: "https://raw.githubusercontent.com/thefloatingcity/pack/main/pack-archive.zip?raw=true" # https://emn178.github.io/online-tools/sha1_checksum.html -resource-pack-hash: "d0d0ced8dd2e5870c47b0a07b23611146ed06a8a" +resource-pack-hash: "8f4a4a762910f960f89d58e72be22e3210b21c6d" # if true, `/rules accept` will grant the "mad" rank, which cannot be # ascended from, and new players will be spawned into the madlands.