Local Resource Pack Hoster
- Tested Minecraft Versions:
- 1.7
- 1.8
- 1.9
- 1.10
- 1.11
- 1.12
- 1.13
- Contributors:
- BananaPuncher714
Are you tired of hosting your public resource packs on dropbox? Maybe you want your players to have multiple resource pack options? Or maybe you only want to allow certain people to use a super special custom pack? Well, look no further! This plugin is capable of that, and even more, especially for developers!
What is this?
Local Resource Pack Hoster allows your server to self-serve resource pack requests. An additional port is required for the mini http daemon used to handle client requests.
Cool, so how does this work?
LocalResourcePackHoster hosts a mini http daemon which listens for client requests. Once it recieves a request, it will check if the ip of the client requesting matches an online player's ip. If so, it will check if the player has permission to access the resource pack requested. If so, it will send it to the player.
How secure is it?
The mini http daemon only serves resource packs specified inside the config, and no more than that. Premium resource packs are safe and can only be accessed by people with the right permissions, since the ip of the request and player are checked so that it's not possible to request a resource pack from a computer that is not connected to the server.
Commands
/resourcepack <id> [player] - Lets players download resource packs they have access to, and allows server admins or the console to prompt the desired player with a custom resource pack.
Permissions
The Config
- localresourcepack.user - True by default; lets players change their own resource pack.
- localresourcepack.admin - OP by default; lets admins set players' resource packs. The desired player must have permission to use the resource pack specified.
- localresourcepack.pack.<id> - OP by default; lets players download the resource pack.
Requires a restart to update in-game.
For developersCode (YAML):# The port to use for the mini-http daemon
port: 40021
# Whether or not the console should print a message whenever a player attempts to fetch a resource pack
verbose: false
# Whether or not the server is localhost; Useful for testing situations if you're not able to open a port
localhost: false
# The packs are <id>: <path-to-resource-pack>
# The packs should be placed inside the '/plugins/LocalResourcePackHoster/resourcepacks/' folder
packs:
demo: "demopack.zip"
You can add/remove/view resource packs loaded by getting the LocaleResourcePackHoster instance like so:
Send a resource pack to a player like this:Code (Java):
Note that the resource pack id has to be a valid resource pack and the player must have permission to get it.Code (Java):
This plugin also provides a ResourcePackWrapper, and a SoundPackWrapper, which allows you to edit resource packs with ease!
Here is a quick demo on how to create and edit a SoundPackWrapper.
Code (Java):File iconImage, audioFile;
String description;
try {
// First create a new SoundPackWrapper from a file
SoundPackWrapper wrapper = new SoundPackWrapper( file );
// Next, we add the pack icon, and replace any existing ones.
wrapper.addElement( "pack.png", iconImage, StandardCopyOption.REPLACE_EXISTING );
// Then we can set the description.
wrapper.setDescription( description );
// Now we will add a sound to the pack.
wrapper.addSound( new SoundResource( "sound_id", audioFile, true ), "sound_path", false );
// Call the save method to save the description, but if you're not changing the description, call the ZipWrapper#close() method once you're done adding/remove files.
wrapper.save();
// We can also do wrapper.close();
} catch ( IOException e ) {
e.printStackTrace();
}

Local Resource Pack Hoster 1.1
Host your server resource packs with ease and security directly from your server!