GrzybcioRynek

Add a category

How to add a new market category — requires changing the MarketCategory enum and rebuilding the JAR.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

Warning

This is a developer task. Adding an entry in gui.yml alone does not create a category. An admin who only wants to change the name / icon of an existing category edits messages.gui.category.* and browse.categories — without a new enum constant.

The source of truth is the Java enum. YAML and messages must use the same key (configKey() = lowercase enum name).

Farming already exists

Do not add a “Farming” category from scratch — that is FARMING:

java
public enum MarketCategory {
    ALL,
    TOOLS,
    WEAPONS,
    ARMOR,
    BLOCKS,
    FOOD,
    FARMING,
    REDSTONE,
    DECORATIONS,
    POTIONS,
    ENCHANTED_BOOKS,
    OTHER;
}

configKey()farming. messageKey()gui.category.farming.

In gui.yml:

yaml
browse:
  categories:
    farming:
      slot: 16
      material: WHEAT

In config.yml:

yaml
messages:
  gui:
    category:
      farming: "&cFarming"

New category — three places + rebuild

1. Enum MarketCategory.java

Add a constant, a rule in matches(), and an exclusion in the OTHER branch.

java
public enum MarketCategory {
    ALL,
    TOOLS,
    // ...
    OTHER,
    MUSIC; // example — requires matches() logic
}

Without matches(), the filter shows nothing (default: return false).

2. gui.ymlbrowse.categories

yaml
browse:
  categories:
    music:
      slot: 24
      material: JUKEBOX

Avoid slot collisions with the defaults (10–16, 19–23).

3. config.ymlmessages.gui.category.*

yaml
messages:
  gui:
    category:
      music: "&cMusic"

Existing keys

all, tools, weapons, armor, blocks, food, farming, redstone, decorations, potions, enchanted_books, other.

Danger

A YAML key like rolnictwo: will not work. The enum has no ROLNICTWO.

After changing Java

Build a new JAR (Build), deploy to Paper 26.2, and restart the server — /market reload does not swap enum classes.