Solved Ideas on how to get skull textures from a database

Discussion in 'Spigot Plugin Development' started by RockyHawk, Oct 7, 2019.

  1. Hello,
    I wanted to ask anyone how they would go about collecting a bunch of textures from custom skulls (either a 3D preview photo or a 2D flat image).
    I have made this plugin so far and I want to see if there is a way I can collect skulls and if they click the skull it will output the skull texture value. (example value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWRlNDQ4NDM0NWQzNDE1MjQzNDY3NzE0ZTY4YTYxYzlmZGNiYmY2ZTMzNGFmOTA5ZWNjOWQ1ZjRiZDI5MTMxMCJ9fX0= )

    You can find the values of skulls from this website https://minecraft-heads.com/custom-heads and there is a section called "value" near the bottom when you click on a skull.


    This is my program I want to do this for: https://www.spigotmc.org/resources/command-panels-editor-custom-guis.71184/

    I don't need a step by step guide, although it would help if it is complex ;) but just ideas on what you would do is fine, I have the bukkit API imported so I can use it in the code.

    Would you guys collect textures from each skull from some website or would you just have a link for the users to click and browse skulls on the website, then copy-paste the value??
    (maybe a copy-paste function and then a preview of that specific skull in the program thing.)
     
  2. You can import by owner id, owner name, texture id or by texture (base64 encoded). Its your choice how you retrieve them - copying them as base64 from a webpage seems to be usefull.

    There are by the way cool methods available to create guis with maps (e.g. by using BKCommonLib):

    Skip to 1:55
     
  3. I think it might be good to just get people to paste in the base64 value because that way they can use any website. Also because I would have to collect all the links from the website leading to all the heads, collect all the images from the heads and all the base64's which I am still unsure how to grab things from the website directly.

    It would be nice to have the image of the item so maybe when they paste in the base64 I can grab the image from the decoded texture link, although it would be blurry.
     
  4. Why would it be blurry? You are using the same texture as the minecraft client does
     
  5. Not in-game but just in the program itself.
     
  6. Yeah, I got that - you can still paint it in your program without it being blurry. Just use proper resizing functions (duplicate pixels, dont mix them). You could use GL_TEXTURE_MAG_FILTER in combination with GL_NEAREST to achieve this.
     
  7. I suggest using a scraper to just scrape all the values out, get all relevant information including texture urls, or player names, categories, name of the head etc, and storing it all in a text file. You can scrape websites like this with libraries such as JSoup which are built for java and allow the use of things such as CSS Selectors which will make your life much much easier.