Skip to content

[Feature] Delete-all command and Backspace quick-delete for the block list #392

Description

@Asawars

changes.patch
src.zip

Hi! First of all, thanks for the mod.

I often end up with a huge auto-populated ore list and there is no quick way to
clean it up: entries can only be removed one by one via Shift+Click -> Delete,
and there is no "clear whole list" action.

I made two small changes and tested them on the v1.20.1-2.18.1 source. I am
attaching the patch (changes.patch) and a short description. Happy to open a
proper PR if that is preferred.

Changes:

  1. Backspace quick-delete - while hovering an entry in the XRay block list
    (GuiSelectionScreen), pressing Backspace removes that entry and persists the
    change. The hovered row is highlighted so it is clear what will be removed.
    Backspace is ignored while the search box is focused, so typing still works.
  2. /xray clear client command - clears the entire block list and writes an
    empty list to config/xray/block_store.json. The file is intentionally kept
    (not deleted), otherwise the mod's first-run logic re-populates the default
    ores on the next launch.
  3. Added two lang keys: xray.tooltips.delete, xray.message.list_cleared.

Files touched: GuiSelectionScreen.java, ClientController.java,
assets/xray/lang/en_us.json.

Tested: open the XRay menu, hover an entry, press Backspace -> entry disappears
and stays gone after reopening the menu / restarting. Run /xray clear -> whole
list emptied and stays empty after restart.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions