daredevil19

Develop an in-game file editor plugin featuring a user-friendly INVENTORY GUI that allows players to view, edit, and save text files directly from Minecraft. Include permissions for file access control, support for multiple file types, and real-time updates to ensure changes are immediately reflected in the game world.

Kodari AI
KodariDec 30 at 4:13 am 15,988 (v2)

I’ll create an in-game file editor plugin with a comprehensive inventory GUI system for managing text files directly from Minecraft.

FileEditorPlugin
An interactive file editor plugin that allows players to view, edit, and save text files through an intuitive inventory GUI interface. Features include permission-based access control, support for multiple file formats (txt, yml, json, properties), real-time file updates, and collaborative editing capabilities. Players can browse files, edit content line-by-line, and save changes directly from in-game menus.

Plan

  • Core inventory GUI framework (manager, listener, handlers, buttons)

  • File management system with permission checks

  • Multiple GUI implementations (file browser, content viewer, line editor)

  • Chat-based text input system for editing

  • Commands and permissions structure

  • Configuration for file access rules


Plugin Created Successfully!

Features implemented:

  • GUI-based file browser with directory navigation and pagination

  • File viewer for read-only content inspection

  • File editor with line-by-line editing via chat input

  • Permission system for controlling access (browse, view, edit, delete, create, admin)

  • Real-time file updates with automatic backup creation

  • Multi-format support (txt, yml, json, properties, log, conf, cfg)

  • Safety features (file size limits, extension whitelist, path restrictions)

  • Intuitive controls (left-click to view, right-click to edit/delete)

Usage:

  • /fileeditor - Opens default file browser

  • /fileeditor browse <path> - Browse specific directory

  • /fileeditor view <file> - View file contents

  • /fileeditor edit <file> - Edit file (line by line)

Permissions:

  • fileeditor.use - Basic command access

  • fileeditor.browse - Browse directories

  • fileeditor.view - View files

  • fileeditor.edit - Edit files

  • fileeditor.admin - Access files outside plugin directory

The plugin uses an event-driven GUI framework with lazy initialization, chat-based text input for editing, and automatic file backups to prevent data loss!

daredevil19

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 1 error(s):

ERROR in src/main/java/com/fileitor/inventory/impl/FileEditorGUI.java at line 102: incompatible types: int is not a functional interface
            addButton(slot -> {
            ^


=== COMPILATION ERROR ANALYSIS ===

TYPE MISMATCHES:
  - incompatible types: int is not a functional interface
ACTION: Fix variable types or casting

FILES TO INVESTIGATE:
  - src/main/java/com/fileitor/inventory/impl/FileEditorGUI.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariDec 30 at 4:14 am 8,728 (v2)

I need to read the FileEditorGUI.java file to see the exact error and fix it.

Analysis

The error is on line 102 in FileEditorGUI.java. The issue is that addButton is being called with a lambda expression as the first parameter (slot -> {...}), but addButton expects an int as the first parameter, not a functional interface.

Looking at line 102:

Java
addButton(slot -> {

This should be:

Java
addButton(53, new InventoryButton()

The slot number should be 53 (which is used later in the code).

Fixed the compilation error. The issue was on line 102 where addButton(slot -> { was incorrectly using a lambda as the first parameter instead of an integer slot number. Changed it to addButton(53, new InventoryButton() for the “Next Page” button, and moved the “Close” button to slot 52 to avoid conflicts.

daredevil19

Enhance the INVENTORY GUI further, make improvements, and add a help command listing all available commands.

Kodari AI
KodariDec 30 at 4:35 am 24,318 (v2)

I’ll read the current implementation to understand what enhancements can be made and then add a help command.

Plan

  • Enhance GUI system with search/filter functionality

  • Add confirmation dialogs for destructive actions

  • Improve visual feedback with animations and sounds

  • Add help command with detailed command listing

  • Create a settings GUI for runtime configuration changes

Enhancements Complete

GUI System Improvements:

  • Added confirmation dialogs for destructive actions (delete lines)

  • Integrated XSound for audio feedback on all interactions

  • Enhanced GUIManager with player session tracking

  • Added visual consistency with glass pane borders

New Features:

  • HelpGUI: Comprehensive in-game help system with all commands, permissions, features, and tips

  • SettingsGUI: Runtime configuration viewer showing current settings

  • ConfirmationGUI: Reusable confirmation dialog for dangerous operations

Enhanced User Experience:

  • Sound effects for button clicks, page turns, saves, and errors

  • Better visual feedback with status indicators

  • Improved navigation with help button in file browser

  • Page numbers displayed in all paginated GUIs

  • File info displays now show current page

New Commands:

  • /fileeditor help - Opens interactive help GUI

  • /fileeditor settings - Opens settings viewer (admin only)

  • /fileeditor reload - Reloads configuration (admin only)

All GUIs now provide consistent audio-visual feedback and improved navigation flow.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
21 1,978
src/main/java/com/fileitor/FileEditorPlugin.java
package com.fileitor;

import com.fileitor.command.FileEditorCommand;
import com.fileitor.inventory.gui.GUIListener;
import com.fileitor.inventory.gui.GUIManager;
import com.fileitor.listener.ChatInputListener;
import com.fileitor.manager.FileManager;
import com.fileitor.manager.ConfigManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class FileEditorPlugin extends JavaPlugin {
    
    private GUIManager guiManager;
    private FileManager fileManager;
    private ConfigManager configManager;
    private ChatInputListener chatInputListener;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.guiManager = new GUIManager();
        this.fileManager = new FileManager(this);
        this.chatInputListener = new ChatInputListener(this);
        
        registerListeners();
        registerCommands();
        
        getLogger().info("FileEditorPlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (chatInputListener != null) {
            chatInputListener.cancelAllEdits();
        }
        
        getLogger().info("FileEditorPlugin has been disabled!");
    }
    
    private void registerListeners() {
        GUIListener guiListener = new GUIListener(guiManager);
        Bukkit.getPluginManager().registerEvents(guiListener, this);
        Bukkit.getPluginManager().registerEvents(chatInputListener, this);
    }
    
    private void registerCommands() {
        FileEditorCommand fileEditorCommand = new FileEditorCommand(this);
        getCommand("fileeditor").setExecutor(fileEditorCommand);
        getCommand("fileeditor").setTabCompleter(fileEditorCommand);
    }
}