Skip to content

v1.1.0

Latest

Choose a tag to compare

@PincerPrithu PincerPrithu released this 23 Jun 21:41
· 4 commits to main since this release
c38a443

Version 1.1.0

New Features and Improvements:
  • Custom Item Serialization and Deserialization:

    • Implemented the CustomItem class to be fully ConfigurationSerializable with proper serialization and deserialization methods.
    • Registered CustomItem with Bukkit's ConfigurationSerialization system to ensure correct handling of custom items in configuration files.
  • Configuration Enhancements:

    • Added a comprehensive configuration file (config.yml) that includes settings for API credentials, GUI settings, and messages.
    • Defined a structured format for gui-icons in the configuration to allow for easy customization of GUI elements.
  • GUI Icon Loading:

    • Created a new method to read and deserialize all gui-icons from the configuration into a HashMap<String, ItemStack>.
    • Ensured that the method handles exceptions and logs errors gracefully if any issues occur during the loading process.
  • Refactored Main Menu Creation:

    • Improved the MainMenu class to use a for-each loop for adding category buttons, enhancing readability and maintainability.
    • Defined specific slots for category buttons and ensured the GUI layout remains clean and organized.
    • Added border buttons and a close button to enhance the user experience within the GUI.
  • Bug Fixes:

    • Resolved an issue where MemorySection could not be cast to CustomItem, ensuring proper deserialization of custom items from the configuration.
    • Fixed potential NPE (NullPointerException) cases by adding necessary null checks when accessing item metadata.
Detailed Changes:
  1. CustomItem Class:

    • Implemented ConfigurationSerializable interface.
    • Added proper serialization and deserialization methods.
    • Example usage and configuration added to config.yml.
  2. Configuration Setup:

    • Updated config.yml to include detailed sections for api-credentials, settings, gui-icons, and messages.
    • Added example entries for various GUI icons including border, back, close, category, and product items.
  3. GuiIconLoader Class:

    • New class GuiIconLoader to handle loading and deserialization of GUI icons from the configuration.
    • Method loadGuiIcons reads gui-icons from the config and populates a HashMap<String, ItemStack>.
  4. MainMenu Class:

    • Refactored to use a for-each loop for iterating over categories and setting up buttons in the GUI.
    • Improved logic for placing border and category buttons in the GUI layout.
    • Ensured proper handling of player interactions with the GUI, including opening category lists and closing the inventory.
  5. Exception Handling:

    • Added try-catch blocks to gracefully handle and log errors during the configuration reading and GUI setup processes.
How to Update:
  1. Pull the latest changes from the repository.
  2. Ensure your configuration file (config.yml) is updated with the new structure and settings.
  3. Restart your server to apply the changes and see the new features in action.

We hope these improvements enhance your experience with the NamelessMCStoreGUI plugin. If you encounter any issues or have suggestions for further improvements, please open an issue on GitHub. Thank you for using our plugin!