Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ jobs:
with:
distribution: temurin
java-version: '25'
server-id: github-pinont # must match the <id> of the GH Packages repo in pom.xml
cache: maven
# Must match pom.xml <repository><id>github-pinont</id>
server-id: github-pinont
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
settings-path: ${{ github.workspace }}
# EXPERIMENT: resolves SingularityLib 2.0.0-SNAPSHOT from GitHub Packages using
# this repo's own GITHUB_TOKEN — tests whether cross-repo same-user reads are
# allowed by default without a manual package-access grant.
# Resolves io.github.pinont:singularitylib:2.0.0-SNAPSHOT from
# https://maven.pkg.github.com/Pinont/SingularityLib using this
# workflow's GITHUB_TOKEN (packages:read). setup-java writes
# settings.xml with <server><id>github-pinont</id> and
# ${env.GITHUB_TOKEN}; pass it with -s so Maven actually uses it.
- name: Build (full compile against lib snapshot)
run: mvn -B clean package
run: mvn -B -U clean package -s ${{ github.workspace }}/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# setup-java writes this into the workspace on CI (settings-path)
/settings.xml

target/

pom.xml.tag
Expand Down
17 changes: 8 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ The owner's plan says to "rework DevTool from Kotlin back to Java." **Fact-check
mvn clean package # shaded jar into target/ (JDK 25 required)
```
- Requires **JDK 25** (`java.version=25`), targets **Paper API `26.2.build.N-stable`**.
- Depends on `com.github.pinont:SingularityLib:2.0.0-SNAPSHOT` via the `${singularity.version}` property — pinned to the lib's v2 line.
- Resolves SingularityLib from the **public registry** (`https://raw.githubusercontent.com/Pinont/singularity-maven/gh-pages/`) — no auth required; Paper from `repo.papermc.io`. Source compiles against lib `2.0.0-SNAPSHOT` from this registry as of the v2 API migration (see below).
- **Bootstrap model:** SingularityLib is NOT bundled into this jar. Dependency scope is `provided`, and `maven-shade-plugin` `artifactSet` excludes `com.github.pinont:SingularityLib`. At runtime the lib ships as its own plugin on the server.
- Depends on `io.github.pinont:singularitylib:2.0.0-SNAPSHOT` via the `${singularity.version}` property — pinned to the lib's v2 line.
- Resolves SingularityLib from **GitHub Packages** (`https://maven.pkg.github.com/Pinont/SingularityLib`, repository id `github-pinont`). Auth is required even for the public package: CI uses `GITHUB_TOKEN` via `.github/workflows/build.yml` (`packages: read` + `mvn -s settings.xml`); locally put a PAT with `read:packages` in `~/.m2/settings.xml` under `<server><id>github-pinont</id>`. Paper API comes from `repo.papermc.io`. Do not resolve the lib from `maven.pinont.me` (stale Aug 28 SNAPSHOT).
- **Bootstrap model:** SingularityLib is NOT bundled into this jar. Dependency scope is `provided`, and `maven-shade-plugin` `artifactSet` excludes `io.github.pinont:singularitylib`. At runtime the lib ships as its own plugin on the server.

## Code layout
Root package: `com.github.pinont.devtool` (26 files)

- `DevTool.java` — entry point; extends `CorePlugin`, empty `onPluginStart/Stop` (everything registers via lib mechanisms)
- `api/CItemManager.java` — wrapper over lib's CustomItemManager used by menus
- `items/Tool.java` — the dev tool item players hold to open the tool
- `commands/` — `/devtool`, `/flyspeed`, `/vanish` (`SimpleCommand` style)
- `events/ChatEvent.java` — chat capture (used by world-name input flows)
- `methods/` — one-off helpers: `CreateWorld`, `ProperWorldName`, `SendChat`, `Blank`, world-creator UI builders, `WorldDeleteButton`
- `menu/DevToolMenu.java` + `menu/submenu/*` (11 menus) — the whole GUI surface: main menu, player management (server/specific player, kick/ban approvals), world management (server worlds, single world, creator, delete approval), custom items, other tools
- `commands/` — `/devtool`, `/flyspeed`, `/vanish` (`SimpleCommand` / `CommandGroup` style)
- `methods/` — one-off helpers: `CreateWorld`, `ProperWorldName`, `StartConversation`, `PromptWorldInput`, snippet export (`ItemSnippet`, `EntitySnippet`, `ExportSnippet`), world-creator UI builders, `WorldDeleteButton`
- `menu/DevToolMenu.java` + `menu/submenu/*` — the whole GUI surface: main menu, player management, world management, Item Studio / Entity Studio (snippet export), config editor, custom items, other tools

Resource: `src/main/resources/paper-plugin.yml` — declares `name: SingularityDevTool`, `main: com.github.pinont.devtool.DevTool`, `api-version: '26.2'`, and `folia-supported: true`.

Expand All @@ -53,9 +52,9 @@ Source migrated to the lib v2 signatures:
## Known issues / tech debt (observed)
1. ~~`paper-plugin.yml` name mismatch~~ — fixed on `rework/v2`: renamed to `SingularityDevTool`.
2. ~~Stale dependency version~~ — fixed on `rework/v2`: `${singularity.version}=2.0.0-SNAPSHOT` tracking the lib v2 line.
3. Chat-input flows (`ChatEvent` + `SendChat`) are fragile global state — replace with conversation API (Paper `ConversationFactory`) during rework.
3. ~~Chat-input flows (`ChatEvent` + `SendChat`) are fragile global state~~replaced with Paper `ConversationFactory` via `StartConversation` / `PromptWorldInput` (world name/border/seed and config-editor string keys). Type `cancel` to abort.
4. Menus rebuild state imperatively per open; no shared pagination abstraction yet (lib roadmap item).
5. No tests at all.
5. Test coverage: MockBukkit smoke + command-dispatch + registration tests exist under `src/test/java` (see `DevToolCommandTest`, `DevToolRegistrationTest`, `DevToolTest`). Snippet generation and conversation-start are covered without inventory-click simulation.

## Agent guidance
- New features in Java, wired through SingularityLib APIs (`CorePlugin`, `SimpleCommand`, `Menu`) rather than raw Bukkit where possible.
Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Singularity DevTool Plugin
[![](https://jitpack.io/v/Pinont/Singularity-DevTool.svg)](https://jitpack.io/#Pinont/Singularity-DevTool)
[![](https://img.shields.io/github/license/Pinont/Singularity-DevTool)](https://github.com/Pinont/Singularity-DevTool/blob/main/LICENSE)

A Minecraft plugin that introduces a better way to debug your plugins.

## Requirements
- **Paper 26.2+** or **Folia 26.x** (JDK 25)
- **SingularityLib** installed as a server plugin (bootstrap model — see below)

## Build
```bash
mvn clean package # requires JDK 25
```
Place the jar from `target/` into your server's `plugins/` folder.

## Dependencies
Built on **SingularityLib** via the bootstrap plugin model — the lib runs as its own
plugin; DevTool compiles against it with `provided` scope (never bundled):

```xml
<dependency>
<groupId>io.github.pinont</groupId>
<artifactId>singularitylib</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
```

```yaml
# paper-plugin.yml
dependencies:
server:
SingularityLib:
load: BEFORE
required: true
join-classpath: true
```

Get the latest lib release from
[central.sonatype.com/artifact/io.github.pinont/singularitylib](https://central.sonatype.com/artifact/io.github.pinont/singularitylib),
or dev snapshots from GitHub Packages
(`https://maven.pkg.github.com/Pinont/SingularityLib`, repo id `github-pinont`).

## Development roadmap (v2)
DevTool v2 becomes an in-server IDE for Singularity plugins: auto-discovers all loaded
Singularity plugins, bridges their commands under `/devtool <plugin> <cmd>`, GUI config
editing with live reload, item/entity inspectors, builders that export code snippets,
and Paper conversations for world-name / config-string prompts (no global chat listener).
See the repo's AGENTS.md for the current state.
50 changes: 30 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
<name>SingularityPlugin</name>

<properties>
<!-- v2 line: tracks SingularityLib rework/v2 branch. NOT published yet,
so resolution fails until the lib publishes 2.0.0-SNAPSHOT to
GitHub Packages. Accepted for this pass. -->
<!-- v2 line: io.github.pinont:singularitylib from GitHub Packages
(repository id github-pinont). -->
<singularity.version>2.0.0-SNAPSHOT</singularity.version>
<java.version>25</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -32,6 +31,11 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -68,28 +72,21 @@
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<!-- GitHub Packages: primary home for SingularityLib artifacts.
Concrete repo path required (GitHub Packages has no wildcard
group URLs); matches SingularityLib distributionManagement. -->
<!-- Public token-free registry (GitHub Pages via raw.githubusercontent).
See Pinont/singularity-maven. -->
<!-- GitHub Packages: snapshots for io.github.pinont:singularitylib.
id must match setup-java server-id / settings.xml <server><id>.
Auth required (even for public packages): GITHUB_TOKEN in CI,
or a PAT with read:packages in ~/.m2/settings.xml locally. -->
<repository>
<id>singularity</id>
<url>https://maven.pinont.me/</url>
<id>github-pinont</id>
<url>https://maven.pkg.github.com/Pinont/SingularityLib</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<!-- JitPack TEMPORARILY DISABLED: lib v2 publishes to GitHub Packages
only (locked decision). Re-enable only if pulling legacy <=1.3.x
lib artifacts. NOTE: resolution of singularity.version=2.0.0-SNAPSHOT
FAILS until the lib publishes to GitHub Packages — expected. Auth
(user + PAT with read:packages) goes in settings.xml when needed.
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
-->
</repositories>

<dependencies>
Expand All @@ -107,5 +104,18 @@
classpath; never bundled (see shade excludes above). -->
<scope>provided</scope>
</dependency>
<!-- Test dependencies (MockBukkit matching Paper 26.2) -->
<dependency>
<groupId>org.mockbukkit.mockbukkit</groupId>
<artifactId>mockbukkit-v26.2</artifactId>
<version>4.116.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
5 changes: 4 additions & 1 deletion src/main/java/com/github/pinont/devtool/DevTool.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.github.pinont.devtool;

import com.github.pinont.devtool.commands.DevToolCommand;
import com.github.pinont.singularitylib.plugin.CorePlugin;

public final class DevTool extends CorePlugin {
public class DevTool extends CorePlugin {

@Override
public void onPluginStart() {
// Explicit registration (v2 DSL) — no @AutoRegister classpath scanning.
registerComponents(new DevToolCommand());
}

@Override
Expand Down
93 changes: 0 additions & 93 deletions src/main/java/com/github/pinont/devtool/commands/DevTool.java

This file was deleted.

Loading
Loading