-
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Misat11 edited this page Dec 14, 2019
·
29 revisions
SimpleGuiFormat 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
- id
- include
- insert
- items
- linebreak
- pagebreak
- price
- price-type
- properties
- row
- skip
- stack
- visible
- write
- BedWars - since 0.1.0
- ZombieApocalypse - since 2.0.4 (now have deprecated version)
-
Import maven repository
<repository> <id>mtorus-repo</id> <url>https://jenkins.mtorus.cz/plugin/repository/everything/</url> </repository>
-
Include dependency
<dependency> <groupId>misat11.lib.sgui</groupId> <artifactId>SimpleGuiFormat</artifactId> <version>SELECTED_VERSION</version> <!-- current version is: 0.0.10-snap5 --> <scope>compile</scope> </dependency>
-
Use it
... Bukkit.getServer().getPluginManager().registerEvents(new InventoryListener(), plugin); // for all guis ... Options options = new Options(); 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 SimpleGuiFormat format = new SimpleGuiFormat(options); # create new format with options format.load(plugin.getDataFolder(), "gui.yml"); // load yml 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 ...
-
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>misat11.lib</pattern> <shadedPattern>${project.groupId}.lib</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)