Resource Pack Priority

Discussion in 'Spigot Plugin Development' started by worthless_hobo, May 16, 2016.

  1. So as many of you are aware, since 1.7.2, players have been able to select multiple resource packs and set a priority for each of them.
    To prioritize them players would move them on their list of active resource packs. (Default is always last priority)
    An example would be:
    1. Faithful
    2. FireWolf
    3. Default
    So first Faithful would be loaded, but for any textures that it doesn't have the client would try to load them from the next resource pack. Faithful does not have textures for the hotbar, however FireWolf does. Normally it would use the hotbar from FireWolf and the other textures from Faithful.

    However, if a plugin sets the player's resource pack using setResourcePack(url) then it simply overrights the previously downloaded resource pack from the server without using priorities.
    I was wondering if anyone had any idea if it is even possible to set prioritized resource packs that were downloaded from the server?

    Me and my colleague discussed if it would be feasible to "generate" a new resource pack from multiple resource packs and then send it to a player, but it would be much easier if there were some other way to do this.

    I welcome any thoughts on the topic as long as they are constructive...
     
  2. saphiria

    Artist

    So, first off, the resource pack on the server always takes priority. Second, it is very possible to combine two or more packs into one and just upload that to the server. Let me know if you have any more questions.
     
  3. That's not at all what I meant...
    If the player downloads multiple resource packs from a server, the most recent resource pack is kept but the old one is not.
    My question is, can more then one resource pack be kept from a server. What I am trying to do is combine a few different resource packs but only the ones that the player chooses. Is this possible without generating a new custom resource pack every time to send to the player?
     
  4. Iirc, resource packs don't really have "priority" per se. Its more of a stacking then priority. When applying a pack on top of another pack, any missing details will bleed through so the lower packs work still. This is how one of my plugins works. It adds icons in the form of replacing unused font characters with images. Since my packs don't replace any blocks/items the default (or whatever was set prior) will still work fine. I haven't really tested server side stacking, but I believe it's the same way. It shouldn't matter where the pack comes from, but what matters the stacking order (order of application).

    ;)
     
  5. I tried setting multiple packs with player.setResourcePack(url), one after the other, but only the second one stays. I know that the second resource pack does not have a hotbar texture, but when it sets the pack it just uses the one from the default pack instead of the one from the first resource pack I set.
     
  6. After checking in the server-resource-pack folder in .minecraft. I noticed this:
    [​IMG]
    The first one I sent has barely any data after receiving the second.