Fabric Resource Pack Refresher is a mod for Minecraft that allows server administrators to refresh the resource pack on a client's game without the need for the client to relog. This can be particularly useful for servers that frequently update their resource packs.
- Minecraft version 1.20.1 or higher
- Fabric Loader version 0.11.3 or higher
- Fabric API (compatible version with the Minecraft version being used)
The mod provides a command to refresh the resource pack for all players or specific players. The commands can be executed from the server console or by players with the appropriate permissions.
- To refresh the resource pack for all players:
/rpr <packname>
- To refresh the resource pack for a specific player:
/rpr <packname> <player>
For building, running, and other operations, refer to the Makefile
commands:
make build
to build the project.make run
to run the project.make clean
to clean the build artifacts.make test
to run the tests.make package
to package the mod.
The mod's configuration can be found in src/main/java/codes/atomys/resourcepackrefresher/ResourcePackConfig.java
. It allows for specifying multiple resource packs with options such as:
packname
: The name of the resource pack.url
: The URL where the resource pack can be downloaded.required
: Whether the resource pack is required.hasPrompt
: Whether the player should be prompted to download the resource pack.message
: The message to display in the prompt.
Example configuration:
{
// Should all criteria be automatically revoked next time the command is executed.
"autoRevoke": true,
// List of all the resourcepacks configurations to use
"packs": [
{
"packname": "atomys",
"url": "https://example.com/resource_pack.zip",
"required": true,
"hasPrompt": true,
"message": "You need to download the resource pack to play on this server !"
}
]
}
This project supports development with a DevContainer to provide a consistent development environment. To get started:
- Ensure you have Docker installed and running on your system.
- Install the Visual Studio Code and the Remote - Containers extension.
- Open the project folder in Visual Studio Code, and when prompted, click on "Reopen in Container". Alternatively, you can open the Command Palette (
Ctrl+Shift+P
) and select "Remote-Containers: Open Folder in Container...".
The DevContainer configuration is located in .devcontainer/devcontainer.json
.
- Go to https://fabricmc.net/develop/
- Take the new values for
gradle.properties
- Test build locally with
make build
- Push the changes
This project is licensed under the MIT License - see the LICENSE
file for details.