Skip to content

Commit

Permalink
update pack hash; send resource pack as required
Browse files Browse the repository at this point in the history
  • Loading branch information
TehBrian committed Feb 15, 2024
1 parent 6f44ddd commit 39bf2ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 39bf2ea

Please sign in to comment.