"Reassets" is a plugin for the Bukkit framework that collects images and 3D models from the folders of your plugins and creates a resource pack from them. It is capable of uploading the resource pack to a hosting service. With "Reassets," you no longer need to manually modify predicates and overrides or have knowledge of custom model IDs; Reassets takes care of all that for you.
After connecting the dependency to your plugin, you will be able to use the "resources" folder and its paths. With the help of relative paths you can get items and pictures.
On this GIF image, it demonstrates how quickly a new item is added to the game's resource pack.
On this video, I showcase the main functionality and configuration of the plugin
Installation
Download the latest release of the plugin and put it in the plugins folder. Start the server.
In the plugins\reassets folder, a resource pack folder will appear. You can replace its contents with your own resource pack.
Usage
If you have a plugin with its own folder, for example, plugins\example, you need to create a folder inside called plugins\reassets.
Then, put item images into it, such as:
plugins/reassets/items/test.png
plugins/reassets/items/other_item.png
plugins/reassets/items/other_item_eat.png
plugins/reassets/items/other_item_sword.png
On the server, enter the command:
/reassets generated
After that, the plugin will gather the resource pack from the images of your plugins and send it to the file storage if the option is enabled.
Usage in other plugins
Download this repository, open the project, and load the Maven of this project.
https://github.com/slavaWins/reassets
To add a dependency to your project, you need to modify the pom.xml file
<dependency>
<groupId>org.slavawins</groupId>
<artifactId>reassets</artifactId>
<version>v1.1v-1.20.1-SNAPSHOT</version>
</dependency>
depend:
- reassets
In your plugin, add a folder named 'resources' and within it create a folder called 'reassets/items'. Place the item image file inside this folder.
In onEnable, we add the unpacking of your images to your plugin's folder:
// from import org.slavawins.reassets.integration.ResourceExtractor;
@Override
public void onEnable() {
ResourceExtractor.extract(this, "reassets");
Start the server. You will see that your folder with the image has been moved to your plugin's folder on the server: \plugins\trashitem\xreassets
Next, enter the command to generate items:
/reassets generated
Then, display the list of items:
/reassets list
Next, navigate to the plugins\reassets folder and you will see the generated resource pack.
After this, you will be able to obtain an item based on your image using the ReassetsGet.item method.
ItemStack item = ReassetsGet.item("/reassets/items/button/plus.png");
The magic lies in the fact that the plugin indexes the neighboring folders and creates a resource pack, remembering the paths for future reference