Skip to content
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

Add ability to use texture url in /skull #5120

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Add ability to use texture url in /skull #5120

merged 5 commits into from
Aug 8, 2023

Conversation

TheLukeGuy
Copy link
Contributor

@TheLukeGuy TheLukeGuy commented Oct 2, 2022

Information

This PR closes #3804.

Details

Proposed feature:

This lets users provide custom skins when using the /skull command by specifying a skin identifier instead of a username. This feature is only available on specific versions of Spigot 1.18.1 and above because it uses the new player profile API. On older versions, only a username can be used.

The /skull command now supports the following values in the first argument:

  • A username, like before
  • The 64-character-long identifier of a custom skin (the last part of the skin URL)
  • The 180-character-long base64 value of a custom skin

The first 7 characters of the skin identifier will be used for the skull's display name and the success message. An error message will be sent if a base64 value isn't a valid skin object.

Environments tested:

OS: Windows 11

Java version: openjdk version "17.0.1" 2021-10-19

  • Most recent Paper version (1.19.2, git-Paper-189)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

I used this head as an example. The screenshot below was taken immediately after running the following commands (and switching my hotbar slot in between):

/skull 1c1df3b095e6a774e26852901db234003979c7a75ce35d8d269bb3651e09cfa2
/skull eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWMxZGYzYjA5NWU2YTc3NGUyNjg1MjkwMWRiMjM0MDAzOTc5YzdhNzVjZTM1ZDhkMjY5YmIzNjUxZTA5Y2ZhMiJ9fX0=

Demonstration

Copy link
Member

@mdcfe mdcfe left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Overall this looks good, but it would be great if you could add an additional command usage message to indicate that texture URL hashes are accepted.

@TheLukeGuy
Copy link
Contributor Author

Sounds good! Does this look alright? I'm not sure I like the wording of it too much, but I can't think of any better way to describe it.

/skull help message

mdcfe
mdcfe previously approved these changes Feb 13, 2023
Copy link
Member

@mdcfe mdcfe left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in re-reviewing this! The new usage message looks good.

This PR will need updating and conflicts resolving before it can be merged. If you get a chance to do this, it would be great, but if not we can resolve this before we merge it.

@TheLukeGuy
Copy link
Contributor Author

All good, sure! I'll get the conflicts resolved as soon as possible.

@pop4959 pop4959 added type: enhancement Features and feature requests. module: main Issues or PRs for the main Essentials module and removed hacktoberfest-accepted labels May 5, 2023
@JRoy JRoy changed the title Add custom skins to /skull Add ability to use texture url in /skull Aug 8, 2023
@JRoy JRoy merged commit 0a4cf27 into EssentialsX:2.x Aug 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: main Issues or PRs for the main Essentials module type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/skull with custom skin
4 participants