[EPIC] Runtime Texture Pack Change

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

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


    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

    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


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


    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


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


    Me, fooling around with my hail rain.


    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


    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


    Drawing words on the player?
  8. Offline


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


    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


    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:

    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^^

    2. package me.Johnny.TestChannel;
    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;
    11. public class TestChannel extends JavaPlugin{
    13. @Override
    14. public void onEnable() {
    15. getServer().getMessenger().registerOutgoingPluginChannel(this, "ForumDemo");
    16. System.out.println("ENABLE");
    17. }
    18. @Override
    19. public void onDisable() {
    21. }
    24. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    26. Player player = (Player)sender;
    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!";
    33. player.sendPluginMessage(this, "ForumDemo", message.getBytes(java.nio.charset.Charset.forName("UTF-8")));
    34. player.sendMessage("test");
    35. }
    36. return true;
    38. }
    40. }
  14. Offline


    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


    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


    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.


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


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


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


    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


    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


    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


    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


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


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


    If you have the client mod installed.
  26. Offline


    Just ruined it :(
  27. Offline


    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


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


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


    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