SimpleInventories used is small library for making guis in minecraft! It's also available as plugin.
Look into our wiki: https://github.com/ScreamingSandals/SimpleInventories/wiki
- Import maven repository
<repository>
<id>screaming-repo</id>
<url>https://repo.screamingsandals.org/</url>
</repository>
- Include dependency
<dependency>
<groupId>org.screamingsandals.simpleinventories</groupId>
<artifactId>SimpleInventories-Core</artifactId>
<version>LATEST_VERSION_HERE</version>
<scope>compile</scope>
</dependency>
- Use in code
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Player;
import org.screamingsandals.simpleinventories.material.builder.ItemFactory;
import org.screamingsandals.simpleinventories.bukkit.SimpleInventoriesBukkit;
public class Sample extends JavaPlugin {
private InventorySet inventorySet;
public void onEnable() {
SimpleInventoriesBukkit.init(this);
inventorySet = SimpleInventoriesBukkit.builder()
.render(itemRenderEvent -> {
})
.preClick(preClickEvent -> {
})
.click(clickEvent -> {
})
.categoryOptions(options ->
options.backItem(ItemFactory.build(someItemStack1))
.pageBackItem(ItemFactory.build(someItemStack2))
.pageForwardItem(ItemFactory.build(someItemStack3))
.cosmeticItem(ItemFactory.build(someItemStack4))
)
.include("myAwesomeGui.yml")
.process();
}
public void show(Player player) {
SimpleInventoriesBukkit.wrapPlayer(player).openInventory(inventorySet);
}
}
- Relocate package
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.screamingsandals.simpleinventories</pattern>
<shadedPattern>${project.groupId}.si</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
- Now build your plugin and enjoy it!
mvn install