-
-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Misat11 edited this page May 29, 2020
·
29 revisions
SimpleInventories is library for generating gui menu in spigot plugin, example for shops, but it could be used for anything!
- absolute
- animation
- clone
- clone-method
- column
- conditions
- define
- disabled
- execute
- id
- include
- insert
- items
- linebreak
- pagebreak
- price
- price-type
- properties
- row
- skip
- times
- times-methods
- stack
- visible
- write
- All items are in sidebar menu --->
- BedWars - since 0.1.0
- ZombieApocalypse - since 2.0.4 (now have deprecated version)
- SimpleInventories of course
-
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 it
... InventoryListener.init(this); // for all guis ... Options options = new Options(this); options.setPrefix("My gui"); options.setBackItem(backItem); options.setPageBackItem(pageBackItem); options.setForwardItem(pageForwardItem); options.setCosmeticItem(cosmeticItem); // and more and more options you can set here SimpleInventories format = new SimpleInventories(options); // create new format with options format.loadFromDataFolder(plugin.getDataFolder(), "gui.yml"); // load yml/groovy file // here you can modify Bukkit.getServer().getPluginManager().registerEvents(new MyGuiListener(format), plugin); // create your listener for one inventory or for more inventories, it depends on you format.generateData(); // generate data after all listeners are registered and format is completely set // here you cannot modify format ... // somewhere in code you will need a way how to open it format.openForPlayer(player); ...
-
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>
-
Build your plugin and enjoy it
mvn install
Can't find what are you looking for on this wiki? Maybe our automatically generated javadoc could help you https://docs.screamingsandals.org/simpleinventories/simpleinventories-core/
- Welcome on this wiki
- Formats:
- Variables:
- Callbacks: (Groovy only)
-
Examples:
- Making shop (Groovy only)
- Making vault shop (Groovy only)