-
Notifications
You must be signed in to change notification settings - Fork 18
Home
Hamza Coşkun edited this page Dec 9, 2023
·
12 revisions
Welcome to the ObliviateInvs wiki!
Are you beginner in Java?
If you're new in Java, research what are buildtool softwares. We're mostly use Maven or Gradle to manage our libraries. These informations should be enough to research. After learned them, use appropriate code below.
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.hamza-cskn.obliviate-invs</groupId>
<artifactId>core</artifactId>
<version>INSERT_VERSION_HERE</version>
</dependency>
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.hamza-cskn.obliviate-invs:core:INSERT_VERSION_HERE'
//implementation 'com.github.hamza-cskn.obliviate-invs:configurablegui:INSERT_VERSION_HERE'
}
Initalize the inventory API.
public class Test extends JavaPlugin {
@Override
public void onEnable() {
new InventoryAPI(this).init();
}
}
Create your GUI class.
public class TestGui extends Gui {
public TestGui(Player player) {
super(player, "test-gui", "Test Title", 3);
//player, id, title, row
}
@Override
public void onOpen(InventoryOpenEvent event) {
addItem(0, new Icon(Material.STONE)));
//slot
}
}
Open your GUI to player.
new TestGui(player).open();
You've completed basic pieces! Visit other wiki pages.
https://github.com/Obliviated/ObliviateInvs/wiki/Icons
https://github.com/Obliviated/ObliviateInvs/wiki/Advanced-Slots