From 8ac5a9093e813e683354f4286e7fbf0b7e8a1dfa Mon Sep 17 00:00:00 2001 From: itsthomthomob Date: Sat, 21 Feb 2026 00:21:15 -0600 Subject: [PATCH 1/2] DC-MF fixed minor extra space indents and created a simple readme file --- README.md | 74 +++++++++++++++++++ .../chestshopdatabase/ShopReplacements.java | 1 - .../model/ChestshopItem.java | 3 +- .../chestshopdatabase/task/TaskProgress.java | 1 - 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a739568 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +# ChestShop Database + +A Paper plugin for Minecraft 1.21.8 that persists [ChestShop](https://www.spigotmc.org/resources/chestshop.51856/) data to a MariaDB database, enabling server-wide shop search, price browsing, and hologram previews. + +Built for [DemocracyCraft](https://democracycraft.net/). + +## Features + +- **Shop tracking** — Automatically records shops as they are created, destroyed, and restocked in real time. +- **Search GUI** — `/csdb find` Opens a paginated chest GUI; filter by shop type (buy/sell), hide empty or full shops, and sort by price, stock, quantity, or distance. +- **Hologram previews** — Floating item displays above each shop sign, loaded per-chunk; togglable per player. +- **WorldEdit / FAWE integration** — Shops removed by a WorldEdit operation are automatically cleaned up from the database. +- **WorldGuard integration** — Exposes a `%region-name%` placeholder usable in shop display templates. + +## Requirements + +| Dependency | Required | +|---|---| +| Paper 1.21.8 | Yes | +| ChestShop | Yes | +| MariaDB | Yes | +| WorldEdit or FAWE | No | +| WorldGuard | No | + +## Installation + +1. Drop the plugin JAR into your `plugins/` folder. +2. Start the server once to generate config files, then stop it. +3. Edit `plugins/ChestShopDatabase/database-settings.yml` with your MariaDB connection details. +4. Run the SQL schema in `sql/create_tables_maria.sql` against your database. +5. Start the server. + +## Commands + +| Command | Permission | Description | +|---|---|---| +| `/csdb find` | `csdb.find` | Open the shop search GUI | +| `/csdb find toggle preview ` | `csdb.preview.toggle` | Toggle hologram previews for yourself | +| `/csdb find toggle visibility ` | `csdb.visibility.toggle` | Show or hide a shop in search results | +| `/csdb resync ` | `csdb.resync` | Full database resync by scanning all loaded chunks | +| `/csdb reload` | op | Reload config, messages, and item code groupings | + +**Note:** In DemocracyCraft server, these commands are just "/find" or "/find toggle preview", with no "csdb" required. + +## Configuration + +| File | Purpose | +|---|---| +| `database-settings.yml` | MariaDB URL, username, password | +| `settings.yml` | Shop icon templates, lore, click command, preview scale | +| `item-code-groupings.yml` | Item code aliases mapped to canonical item codes | +| `messages.yml` | Player-facing messages | + +## Building + +```bash +./gradlew build +``` + +Output JARs are placed in each module's `build/libs/` directory. + +## Project Structure + +``` +chestshop-database/ +├── core/ # Shared models, DB interfaces, utilities +├── chestshop-database-bukkit/ # Main plugin (commands, GUI, listeners) +├── adapters/ +│ ├── worldedit/ # WorldEdit integration +│ ├── fawe/ # FastAsyncWorldEdit integration +│ └── worldguard/ # WorldGuard region placeholder +└── sql/ + └── create_tables_maria.sql +``` diff --git a/core/src/main/java/io/github/md5sha256/chestshopdatabase/ShopReplacements.java b/core/src/main/java/io/github/md5sha256/chestshopdatabase/ShopReplacements.java index a478345..b1c26cf 100644 --- a/core/src/main/java/io/github/md5sha256/chestshopdatabase/ShopReplacements.java +++ b/core/src/main/java/io/github/md5sha256/chestshopdatabase/ShopReplacements.java @@ -29,7 +29,6 @@ private static Component ownerName(@Nonnull Shop shop) { return Component.text(shop.ownerName()); } - private static Component buyPrice(@Nonnull Shop shop) { return Component.text(priceToString(shop.buyPrice())); } diff --git a/core/src/main/java/io/github/md5sha256/chestshopdatabase/model/ChestshopItem.java b/core/src/main/java/io/github/md5sha256/chestshopdatabase/model/ChestshopItem.java index 4aa6fb9..7bdedb8 100644 --- a/core/src/main/java/io/github/md5sha256/chestshopdatabase/model/ChestshopItem.java +++ b/core/src/main/java/io/github/md5sha256/chestshopdatabase/model/ChestshopItem.java @@ -16,5 +16,4 @@ public ChestshopItem(@NotNull ChestshopItem other) { public ItemStack itemStack() { return this.itemStack.clone(); } - -} +} \ No newline at end of file diff --git a/core/src/main/java/io/github/md5sha256/chestshopdatabase/task/TaskProgress.java b/core/src/main/java/io/github/md5sha256/chestshopdatabase/task/TaskProgress.java index 4257a2b..a4bea98 100644 --- a/core/src/main/java/io/github/md5sha256/chestshopdatabase/task/TaskProgress.java +++ b/core/src/main/java/io/github/md5sha256/chestshopdatabase/task/TaskProgress.java @@ -65,5 +65,4 @@ public void triggerCompleted() { runnable.run(); } } - } From 95e9454ec716b55ce3978376db863cb1ba73631b Mon Sep 17 00:00:00 2001 From: Technofied <40795318+Technofied@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:09:12 +0800 Subject: [PATCH 2/2] Expand FAWE acronym, add StateCraft --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a739568..1218083 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ A Paper plugin for Minecraft 1.21.8 that persists [ChestShop](https://www.spigotmc.org/resources/chestshop.51856/) data to a MariaDB database, enabling server-wide shop search, price browsing, and hologram previews. -Built for [DemocracyCraft](https://democracycraft.net/). +Built for [DemocracyCraft](https://www.democracycraft.net/) and [StateCraft](https://www.mcstatecraft.com). ## Features - **Shop tracking** — Automatically records shops as they are created, destroyed, and restocked in real time. - **Search GUI** — `/csdb find` Opens a paginated chest GUI; filter by shop type (buy/sell), hide empty or full shops, and sort by price, stock, quantity, or distance. - **Hologram previews** — Floating item displays above each shop sign, loaded per-chunk; togglable per player. -- **WorldEdit / FAWE integration** — Shops removed by a WorldEdit operation are automatically cleaned up from the database. +- **WorldEdit / FastAsyncWorldEdit (FAWE) integration** — Shops removed by a WorldEdit operation are automatically cleaned up from the database. - **WorldGuard integration** — Exposes a `%region-name%` placeholder usable in shop display templates. ## Requirements @@ -19,7 +19,7 @@ Built for [DemocracyCraft](https://democracycraft.net/). | Paper 1.21.8 | Yes | | ChestShop | Yes | | MariaDB | Yes | -| WorldEdit or FAWE | No | +| WorldEdit or FastAsyncWorldEdit (FAWE) | No | | WorldGuard | No | ## Installation