-
-
Notifications
You must be signed in to change notification settings - Fork 112
Support for adding multiple resource packs #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
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.
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"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
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