[EPIC] Runtime Texture Pack Change

Discussion in 'Plugin Development' started by Icyene, Aug 22, 2012.

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

    Icyene

    Its a replacement for Spout for custom textures of already-existing blocks. Given that the server forces texture packs :). I'm going to start writing a TextureAPI, which will allow things like:

    What I've just shown
    Changing player skins
    Changing blocks
    Items
    etc.

    Basically a program to generate texture packs on the fly. I have some code from a while ago for image processing, so I could get terrain.png done reasonably quickly. If only this was Python, it would have been done by now :p
     
    kroltan likes this.
  2. Offline

    Firefly

    This makes me want to cry with how beautiful it is. :)
     
  3. Offline

    Icyene

    Correct :). Even if you delete it from %appdata%/.minecraft/texturepacks-mp-cache, it still won't ask the player again. . Even changing the file in the link won't. Not sure if changing link will, but if it does its easy to make it not: always use same file name.

    If only it didn't force revert to default texture :'(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    Firefly

    Well, that just has to do with the new texture you're feeding them.
     
  5. Offline

    Icyene

    Me, fooling around with my hail rain.

    [​IMG]

    Yep. Limits users a bit, but the possibilities are endless. Imagine: a plugin called TextureWorld. Hooks into Multiverse and changes texture packs on world basis. You can have the nether look demonic, and the aether look angelic. ENDLESS!

    If there was a way to detect what texture pack a player was using, you could search the interwebs for it and modify it based on the file you get. but if this were possible, XRay wouldn't be a problem. Maybe with 1.4. Maybe.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  6. Offline

    WarmakerT

    Wait wait, you can change the skin of a single player? :O

    Do you know what this means? Custom nametags :3
    Edit.: *nameplates
    Edit 2.: Well actually, nevermind, it only changes the skin for yourself and no others xD

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  7. Offline

    Icyene

    Drawing words on the player?
     
  8. Offline

    WarmakerT

    Only that player would see them though. Other people would still see your normal skin.
     
  9. Offline

    Firefly

    It also means a sort of basic GUI, since you showed you could display text in the top left corner of the client.

    What if you send a packet to the other people too? (If such a packet exists)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  10. Offline

    Icyene

    The texture changes (including skin changes) get applied to them too. Just send the packet to every player in world.getOnlinePlayers, and do something like:

    Code:
    for(Player p : Bukkit.getServer().getOnlinePlayers()) {
    ((CraftPlayer)p).getHandle().netServerHandler.sendPacket(new Packet250CustomPayload("MC|TPack", ("https://dl.dropbox.com/u/67341745/Bukkit/Acid_Rain.zip"+"\0"+16).getBytes()));
    }
    
     
  11. sooo,

    If i change the Skin of my player, will it be displayed to the others or not?
    But when i am sending the Skin to all other Players, their SKin will change or not?
     
  12. You can't change the skin of a player. the method a in EntityPlayer is used to send a texture pack to the client, not to change the texture of the player.
     
  13. Maybe i am just to dumb, but this didnt work^^

    Code:java
    1.  
    2. package me.Johnny.TestChannel;
    3.  
    4. import org.bukkit.command.Command;
    5. import org.bukkit.command.CommandSender;
    6. import org.bukkit.entity.Player;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9.  
    10.  
    11. public class TestChannel extends JavaPlugin{
    12.  
    13. @Override
    14. public void onEnable() {
    15. getServer().getMessenger().registerOutgoingPluginChannel(this, "ForumDemo");
    16. System.out.println("ENABLE");
    17. }
    18. @Override
    19. public void onDisable() {
    20.  
    21. }
    22.  
    23.  
    24. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    25.  
    26. Player player = (Player)sender;
    27.  
    28. if(cmd.getName().equalsIgnoreCase("test"))
    29. {
    30. String message = "Plugin channels are cool but confusing! I also do not see how to use them for texture packs!";
    31.  
    32.  
    33. player.sendPluginMessage(this, "ForumDemo", message.getBytes(java.nio.charset.Charset.forName("UTF-8")));
    34. player.sendMessage("test");
    35. }
    36. return true;
    37.  
    38. }
    39.  
    40. }
    41.  
     
  14. Offline

    Firefly

    Well, if you change the nameplate, you skin gets reverted to default. So if you then send a new texture pack that changes the default skin, you could get around that ;)
     
    kroltan likes this.
  15. Offline

    Hopper

    Only your skin will be changed, and yes, the others will see it. Changing your skin does not automatically change anyone else's. If you send it to them, they have the option to change.
     
  16. Offline

    Icyene

    ONLY the first time. After you say 'yes' the first time you do not have a say in what texture comes your way.
    Take a look at feilmaster's SimpleNotice, its where I got it from. It appears you might need a different version if your client has modloader installed.

    *automagically

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  17. Offline

    chaseoes

    What works without any client mods? Have you tested it?
     
  18. Offline

    Jnorr44

    Yes, I tested it with him, without any client mods at all.
     
  19. Offline

    Icyene

    Yes. That is Bukkit code. Take a look at feilmaster's SimpleNotice plugin; I got that from the how-to page.

    CorrieKay Could I perhaps have the link to the image file you used to test? I tried using it on

    [​IMG]

    Which was on dropbox, but it did nothing. Didn't even give an error. However, it didn't say "Downloading Textures" as it does normally, so I am hanging on to the hope that it does work, and I just did something wrong.
     
  20. Offline

    Postkutsche

    Sending message in plugin channels, is just sending the client some information. You need a client mod to tell it what it has to do with it.

    SimpleNotice IS a client mod, it tells the client to show all send Strings in PluginChannel "SimpleNotice" in the top left corner for some Ticks.
     
  21. Offline

    Icyene

    Thanks for clearing that up :}
     
  22. But that will change the skins of all players using the default skin, not just a specific one. :/
    You can't send the player a png as a texture pack:
     
  23. Offline

    Icyene

    Now that its bold it makes more sense :)
     
  24. Offline

    creepycrafter4

    so this shows a message to the player like you see the text from F3?
     
  25. Offline

    Icyene

    If you have the client mod installed.
     
  26. Offline

    WarmakerT

    Just ruined it :(
     
  27. Offline

    Postkutsche

    For me this solution is way better than any similar I could invent, I don't really want my client to be manipulated without my approval.
     
  28. Offline

    macwinexpert

    Wow! Thank you so much, you are awesome :)
     
  29. Offline

    Postkutsche

    We just found out that you need a client mod for almost everything (except proposing a texture pack).
     
  30. Offline

    Icyene

    Which in itself is an alternative for Spout for servers using Spout for custom textures. Given that the server already imposes a texture pack.
     
Thread Status:
Not open for further replies.

Share This Page