IF - Inventory Framework 0.10.3

Create, alter and manage GUIs in an easy and maintainable manner

  1. Stef
    Tested Minecraft Versions:
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Source Code:
    https://github.com/stefvanschie/IF/
    Contributors:
    https://github.com/stefvanschie/IF/graphs/contributors
    This resource is for developers only, if you're a server owner then this isn't intended for you.
    Tested Minecraft Versions shows the supported Minecraft version(s). This resource may work on other versions, but this hasn't been tested and no guarantees will be made that these versions keep working in the future.

    IF

    IF - Inventory Framework is a lightweight, but powerful GUI framework, intended to help you create, alter and manage GUIs more easy. Here are a few things why I think IF stands out from other similar frameworks:


    Pane based: IF relies fully on the usage of panes which allow you to separate your GUI in smaller parts which can be changed individually, without altering any other parts of your GUI.

    XML reading: IF can read XML files and create entire GUIs from those. No more long methods creating your GUIs, just load them from an XML file. (Don't worry, XML is fully optional, just ignore it if you don't want to use it.)

    Extensible: You can create your own panes with their own features to behave exactly how you want them to, without having to redesign a new GUI framework yourself from the ground up.

    No more event handlers: No need to create listeners, listen to events and use a dozen if-statements to determine which item was clicked. IF will handle this all for you, so you can focus on creating your plugin.

    Rotations: Easily apply linear two dimensional rotations on your panes to rotate your panes in different ways.



    IF has an in-depth wiki detailing the workings of the framework and how to use it. You can find the wiki here.

    Usage

    IF works standalone. You have to shade it into your plugin, rather than add it to the server.

    If you're not using a build system, you can download the resource from the download link here and add it as a dependency in your IDE.

    If you're using Maven, add the following as dependency to your pom.xml:
    Code (XML):
    <dependency>
       <groupId>com.github.stefvanschie.inventoryframework</groupId>
       <artifactId>IF</artifactId>
       <version>0.10.3</version>
    </dependency>
    IF is in the Central Repository, so you don't have to specify a repository.

    Then add this to shade IF into your plugin:
    Code (XML):
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-shade-plugin</artifactId>
       <version>3.2.2</version>
       <configuration>
           <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
           <relocations>
               <relocation>
                   <pattern>com.github.stefvanschie.inventoryframework</pattern>
                   <shadedPattern>[YOUR PACKAGE].inventoryframework</shadedPattern>
               </relocation>
           </relocations>
       </configuration>
       <executions>
           <execution>
               <phase>package</phase>
               <goals>
                   <goal>shade</goal>
               </goals>
           </execution>
       </executions>
    </plugin>
    Replace [YOUR PACKAGE] with your main package.

    There are extensive tutorials and examples on the wiki, so I highly recommend checking it out to see how it works. If you're uncertain how XML works, there's also a small tutorial on that on the wiki as well.

    Here's a small snippet on how to create a base GUI with one item in it.

    Code (Java):
    //create a gui with 5 rows and the title My GUI
    ChestGui gui = new ChestGui(5, "My GUI");
    //create a new pane occupying the entire gui
    OutlinePane pane = new OutlinePane(0, 0, 9, 5);
    ItemStack item = new ItemStack(Material.ICE);
    //create an item which will send a message when clicked
    GuiItem guiItem = new GuiItem(item, event -> event.getWhoClicked().sendMessage("You clicked on ice!"));
    //add the item to the pane
    pane.addItem(guiItem);
    //add the pane to the gui
    gui.addPane(pane);
    Suggestions and feedback are highly appreciated!

    Links:

    AlexW, lokka30, Tigerkatze and 6 others like this.

Recent Updates

  1. V 0.10.3
  2. V 0.10.2
  3. V 0.10.1

Recent Reviews

  1. Keroberos0
    Keroberos0
    5/5,
    Version: 0.10.3
    Been looking for something like this for a while. Works very well and the xml support is amazing. So much customization options! 10/10
    1. Stef
      Author's Response
      Thank you, I'm happy to hear that you enjoy it.
  2. andric05
    andric05
    5/5,
    Version: 0.10.3
    The amount of simplicity of this API is insane, I could't get custom paginated menu to work for 2 weeks, this has helped a lot. Very easy to use for new programmers.
    1. Stef
      Author's Response
      Thanks, I'm glad this is useful for you.
  3. AlexW
    AlexW
    5/5,
    Version: 0.9.9
    Very Nice Framework, could you maybe add support for the adventure API / Components? Thanks ^^
    1. Stef
      Author's Response
      Thank you, Trigary has made a PR for this and I'm currently reviewing it, so hopefully this will be added soon.
  4. iCodeHaven
    iCodeHaven
    5/5,
    Version: 0.9.7
    Amazing framework, but should support 1.8 somewhat out of the box for stubborn 1.8 users like me.
    Love you Stef <3
  5. lokka30
    lokka30
    5/5,
    Version: 0.9.5
    Wow, what an amazing library! The documentation is extremely clear, and the XML capability is awesome. Thanks Stef!
    1. Stef
      Author's Response
      Thank you, I'm glad you enjoy it.
  6. Rosstail
    Rosstail
    5/5,
    Version: 0.9.2
    Excellent framework, I use it in one of my plugin project and it's really user friendly.
    1. Stef
      Author's Response
      Thank you, I appreciate the review
  7. violetwtf
    violetwtf
    5/5,
    Version: 0.9.1
    Great tool. Does everything it needs to, and has a nice API. Relatively easy documentation as well.
    1. Stef
      Author's Response
      Thank you for your review, I'm glad you like it.
  8. StealWonders
    StealWonders
    5/5,
    Version: 0.6.1
    Inventory Frameworks makes your development process just so easy. Features like the paginated inventory panes are fun & easy to use.
    Recommend 10/10 for anyone to try this framework out.
    1. Stef
      Author's Response
      Thanks a lot for your review
  9. 89apt89
    89apt89
    5/5,
    Version: 0.5.19
    Really awesome framework. Skips all the boring stuff and lets you get on with making your plugin. 10/10
    1. Stef
      Author's Response
      Thanks a lot!
  10. SamB440
    SamB440
    5/5,
    Version: 0.5.18
    This is an excellent API for creating inventories. Clean and easy to understand documentation. Takes a while to get used to, however once you work it out inventories become far easier to create. My only regret is that I didn't find it earlier!
    1. Stef
      Author's Response
      Thanks for the kind review!