GUI Api
Simple Api That have own events inside, simple methods to create ItemStack or fast checker.
1. Put my Api in plugins folder inside your minecraft server.
2. If you're using Eclipse, right click on you project --> Properties. On the left bar select Java Build Path. On right side click Add External JARs... And click my Api.
3. Main class must implement Listener class. Don't forget to put register Events method in onEnable! :)
4. To create empty GUI use:
GUI gui = new GUI(String title, int size, int yourOwnId);
Or
GUI gui = new GUI(String title, InventoryType type, int yourOwnId);
5. Adding items to GUI
You can add head item or normal item.
Head :
gui.setHead(String nick, int index)
Or
gui.setHead(String nick, int index, List<String> lore)
Items :
setItem(int index, Material m, short bit)
Or
setItem(int index, Material m, short bit, String title)
Or
setItem(iint index, Material m, short bit, String title, List<String> lore)
Bit is data.
6. Opening and closing GUI:
gui.setTo(Player player)
It will call onGuiOpenEvent.
To close use simply Inventory method:
event.getPlayer().getInventory().close();
Attention ! When closing Inventory make sure you wait 1 tick before you close it! When you don't wait 1 tick, and Player Shift clicked an item from GUI, he will be given with this item!
7. Events
- onGuiChangeEvent - Called when player has opened gui and it changed.
- onGuiClose - Called when player close gui.
- onGuiItemClickEvent - Called when player click item in gui, not in his inventory.
- onGuiOpenEvent - Called when player open gui from gui.setTo(Player p)
- onGuiShiftClickFromBottomInventoryEvent - Called when player shift click an item from his inventory to gui.
8. Classes
Main - call Events
GUI - Object with methods inself
GPlayers - List of Players who's are having opened gui.
Check - Class with two methods.
9. Check class
In check class are two methods.
twoItems which return boolean if two items are same
twoItems(ItemStack one, ItemStack two)
Or
twoItemsNoLore(ItemStack one, ItemStack two)
And fastItem
fastItem(Material m, int size, short bit, String Display, List<String> lore)
Or
fastItem(Material m, int size, short bit, String Display)
And that's it!
Hope you liked it.
If there's a bug let me know and I will fix it!
Soon!
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta