Skip to content

Conversation

@davight
Copy link
Contributor

@davight davight commented Nov 13, 2025

This is continued work of #2712

Additions:

  • New argument add in resourcepack command to send player additional resourcepacks.
  • New mechanism PlayerTag.remove_resource_pack to remove resourcepack by ID from player
  • New mechanism PlayerTag.remove_resource_packs to remove all resourcepacks from player

@davight
Copy link
Contributor Author

davight commented Dec 24, 2025

ive moved remove function to the command itself as requested

player.setResourcePack(url, CoreUtilities.toLowerCase(hash), forced, PaperModule.parseFormattedText(prompt, ChatColor.WHITE));
}
else {
player.setResourcePack(ResourcePackCommand.parseUUID(id), url, CoreUtilities.toLowerCase(hash), PaperModule.parseFormattedText(prompt, ChatColor.WHITE), forced);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You parse id into a UUID multiple times across the code, I'd just do it once before the whole switch and then pass it here as a UUID already.


public static boolean checkOnline(PlayerTag player) {
if (!player.isOnline()) {
Debug.echoError("Invalid player '" + player.getName() + "' specified: must be online");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

UUID packUUID = id == null ? UUID.nameUUIDFromBytes(url.getBytes(StandardCharsets.UTF_8)) : parseUUID(id);
for (PlayerTag player : targets) {
if (checkOnline(player)) {
player.getPlayerEntity().addResourcePack(packUUID, url, hashData, prompt, forced);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a paper impl as well, otherwise some parts of the command support advanced text and some wont which might be a bit confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants