ObliviateInvs — Highly efficient modular GUI library icon

ObliviateInvs — Highly efficient modular GUI library -----

Highly efficient modular inventory library. Powerful as you need and small as you need.



[​IMG]
ObliviateInvs is stable. Feel free to contact us about it via GitHub issues.
11 Nov 2023

1000+ downloads per month

IF YOU LIKED THE LIBRARY PLEASE GIVE A STAR TO THE GITHUB REPOSITORY

Introduction

ObliviateInvs offers efficient and fast GUI development. Tested to handle even the most demanding GUI tasks.

Features
  • Create, listen, manage GUIs in only one class.
  • Create advanced slots to make completely interactive slots. (see wiki)
  • Add pagination support to your GUIs easily.
  • Create automatic repeat task for GUI. The task will be stopped when GUI closed.
  • Fully, modular design.
  • Make configurable your GUIs easily.
  • Automatically caches configuration items. Doesn't deserializes over and over.
  • Don't work hard work smart. These methods will handle your boring works: fillColumn(), fillRow(), fillGui(), sendTitleUpdate(), sendSizeUpdate()
  • Allows players clicking their own inventory during they using a GUI.
  • Feel safe. obliviate-invs tested in live. It is stable.
Modules
Core: The core module. Provides GUI classes.
Pagination: Provides pagination support for GUIs.
ConfigurableGUI: Provides Configurable GUI classes to serializing GUIs to human-readable configurations.
AdvancedSlot: Provides advanced slots to GUIs. (remember, custom GUIs of anvils, enchantment tables, brewing stands in Hypixel Skyblock)

Maven & Gradle
Maven
Code (XML):
<repository>
    <id>jitpack.io </id>
    <url>https://jitpack.io </url>
</repository>

<dependency>
    <groupId>com.github.hamza-cskn.obliviate-invs </groupId>
    <artifactId>core </artifactId>
    <version>4.3.0 </version>
</dependency>

<!-->
<dependency>
   <groupId>com.github.hamza-cskn.obliviate-invs</groupId>
   <artifactId>{MODULE}</artifactId>
   <version>4.3.0</version>
</dependency>
<-->

 
Gradle
Code (Groovy):
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.hamza-cskn.obliviate-invs:core:4.3.0'
    //implementation 'com.github.hamza-cskn.obliviate-invs:{MODULE}:4.3.0'
}

Core
Code (Java):
public class ExampleGui extends Gui {

    public ExampleGui (Player player ) {
        super (player, "example-gui", "Title", 6 ) ;
    }

    @Override
    public void onOpen (InventoryOpenEvent event ) {
        addItem ( 0, Material. STONE ) ;
      }
}
 
Configurable GUI module
Code
Code (Java):
@Override
    public void onOpen (InventoryOpenEvent event ) {
                # puts all dysfunctional icons
        putDysfunctionalIcons ( ) ;

                # puts a functional icon which is named "functional-test-icon"
        putIcon ( "functional-test-icon", e -> {
            player. sendMessage ( "You clicked" ) ;
        } ) ;
    }
 
Config
Code (YAML):
example-configurable-gui:
  title
: 'Custom Title'
  row
: 5
  icons
:
    filler-item
:
      material
: BLACK_STAINED_GLASS_PANE
      display-name
: '&a'
      slot
: 0-8
    functional-test-icon
:
      material
: DIAMOND_BOOTS
      display-name
: '&aGem'
      slot
: 4
      enchantments
:
       - 'DEPTH_STRIDER:1'
      item-flags
:
        #- 'HIDE_ENCHANTS'
        - '*'
 

[​IMG]
Pagination module
Code (Java):
paginationManager. registerSlotsBetween ( 10, 15 ) ;

for (Material material : Material. values ( ) ) {
    paginationManager. addItem ( new Icon (material ) ) ;
}
paginationManager. update ( ) ;



[​IMG]
Advanced Slot module
Code (Java):
public class TestGUI extends GUI {

    public TestGUI (Player player ) {
        super (player, "test-gui", "Test Title", 6 ) ;
    }


    @Override
    public void onOpen (InventoryOpenEvent event ) {
        fillGui ( new ItemStack (Material. BLACK_STAINED_GLASS_PANE ) ) ;

        // FIRST ADVANCED SLOT

        AdvancedSlot advancedSlot2 = addAdvancedIcon ( 12, new Icon (Material. BARRIER ) ) ;

        advancedSlot2. onPut (e -> {
            enchantItem ( ) ;
        } ) ;

        // SECOND ADVANCED SLOT

        AdvancedSlot advancedSlot1 = addAdvancedIcon ( 14, new Icon (Material. BARRIER ) ) ;

        advancedSlot1. onPreClick ( (e, item ) -> {
            if ( !item. getType ( ). equals (Material. LAPIS_LAZULI ) ) {
                player. sendMessage ( "You cannot put items here except lapis lazuli." ) ;
                return true ;
            }
            return false ;
        } ). onPut (e -> {
            enchantItem ( ) ;
        } ) ;


    }

    /**
     * Purpose of this method,
     * remove one lapis from the 2. slot -if exist-
     * enchant item on 1. slot
     */

    private void enchantItem ( ) {
        final Inventory inventory = getInventory ( ) ;

        //get item on lapis lazuli slot
        ItemStack itemOnSlot14 = inventory. getItem ( 14 ) ;
        if ( !itemOnSlot14. getType ( ). equals (Material. LAPIS_LAZULI ) ) return ;

        //remove 1 lapis lazuli
        itemOnSlot14. setAmount (itemOnSlot14. getAmount ( ) - 1 ) ;
        getInventory ( ). setItem ( 14, itemOnSlot14 ) ; // Modifies the item with Bukkit's code.

        //enchant item
        ItemStack itemOnSlot12 = inventory. getItem ( 12 ) ;
        itemOnSlot12. addEnchantment (Enchantment. DURABILITY, 3 ) ;

        getInventory ( ). setItem ( 12, itemOnSlot12 ) ; // Modifies the item with Bukkit's code.

    }
}
[​IMG]
[​IMG]

Other useful codes for GUI development
Resource Information
Author:
----------
Total Downloads: 1,294
First Release: Jul 21, 2022
Last Update: Nov 11, 2023
Category: ---------------
All-Time Rating:
16 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings