Development Assistance Asking if player wants texturepack + checking if player has it

Discussion in 'Plugin Help/Development/Requests' started by sgavster, Mar 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    sgavster

    Hello! I was wondering if I could ask the player if they want a texturepack (I know I can, I'm just not sure if there is a specific link I need to use for my texture pack.., because I sadly know I can not force it..) and I also want to know if I can check if the player has the texture pack.. Thanks for any help!

    EDIT:
    Here is a video:



    I want to know if I can make it so I can 1: Make it so that button always says allow or whatever:

    When it says disabled, through a plugin, make it say prompt (or allow)

    But I can not figure it out.. Here is my current code.


    PHP:
        public boolean onCommand(CommandSender senderCommand cmdString label,
                
    String[] args) {
            if (
    cmd.getName().equalsIgnoreCase("rp")) {
                if (
    args.length == 0) {
                    
    sender.sendMessage("§4That's not how you would use that command.");
                    
    sender.sendMessage("§b/rp yes");
                } else if(
    sender instanceof Player) {
                    if(
    args[0].equalsIgnoreCase("yes")) {
                        ((
    Playersender).setResourcePack("");//I know this isn't a link! This works.. It's a string. I'm testing haha!
                    
    }
                }
            }
            return 
    false;
        }
    I also have in my server.properties a random link so it asks when you log in.
     
    Last edited: Mar 20, 2015
    ProMCKingz likes this.
  2. @sgavster Pretty sure it's a client-based type of thing. I know it's possible to ask a player if they want to download and add a texture pack (but forgot how to, sorry. I'll look into it a bit more.) :)
     
  3. Offline

    Konato_K

    @sgavster In your server.properties set the link in the resource-pack option
     
  4. Offline

    sgavster

    @Konato_K I'd like to do it when the player logs in and also before I start an 'event' on my server. Can I do that?
     
  5. Offline

    Konato_K

    @sgavster That will prompt the message to the player when they login (unless they have server textures off), I don't know if you can do it after they already logged in, but if it's possible it would be with packets probably.
     
  6. Offline

    sgavster

    @Konato_K I found p.setTexturePack(String); but it is depricated and I have no idea if it works.. I really would love to know if this works haha. It'd be awesome. I have music files on my texturepack that are something custom so if the player didn't have the texture pack it would ruin it.
     
  7. Offline

    BrickBoy55

  8. Offline

    Konato_K

  9. Offline

    sgavster

    @BrickBoy55 That's awesome.. Thanks.


    @Konato_K I used that, but when I deny it once (testing..) and I use p.setResourcePack("test.link"); it just says I declined it.. Can I do anything about this?

    EDIT: By it comes back as denied, I mean it doesn't give me the prompt.
     
    Last edited: Mar 20, 2015
  10. Offline

    Konato_K

  11. Offline

    sgavster

    @Konato_K Hmm.. Really? That stinks.. It's not stored anywhere? I really think they need to work on this xD
     
  12. Offline

    BrickBoy55

    No problem
     
  13. Offline

    sgavster

  14. Offline

    BrickBoy55

  15. Offline

    sgavster

    @BrickBoy55 Oh, thanks.

    BUMP * Sorta.. I updated the OP, it now has a vid, and code, and a description of what I want.
     
  16. Online

    timtower Moderator Moderator

    Moved to Bukkit alternatives
     
  17. Offline

    sgavster

    @timtower Thanks. Sorry about that.

    I know this bump is a couple hours early but I really need this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  18. Offline

    nverdier

    Bumps within about 20 hours are fine.
     
    sgavster likes this.
  19. Offline

    sgavster

    @nverdier Oh, I always thought it was 24 hours. good to know! thanks!
     
  20. Offline

    nverdier

    @sgavster It is technically 24 hours, but the mods and admins are a bit lenient on the actual time, so 20 hours is fine usually.
     
  21. Offline

    bwfcwalshy Retired Staff

    sgavster likes this.
  22. Offline

    sgavster

  23. Offline

    sgavster

    bump! I would also like suggestions of otherways to do this, if anyone has any.
     
  24. Offline

    sgavster

  25. Offline

    sgavster

  26. Offline

    sgavster

Thread Status:
Not open for further replies.

Share This Page