Support for adding multiple resource packs#2791
Support for adding multiple resource packs#2791davight wants to merge 7 commits intoDenizenScript:devfrom
Conversation
|
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); |
There was a problem hiding this comment.
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"); |
| 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); |
There was a problem hiding this comment.
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
|
should be better now, also moved hash parsing into a separate method for the sake of readability |
|
tbf I have no idea how to implement the 1.17 check, since papermodule is automatically loaded on paper softwares not based on version (if im correct ofc) |
This is continued work of #2712
Additions:
addinresourcepackcommand to send player additional resourcepacks.PlayerTag.remove_resource_packto remove resourcepack by ID from playerPlayerTag.remove_resource_packsto remove all resourcepacks from player