Skip to content

Commit 835aaaf

Browse files
committed
First public commit
0 parents  commit 835aaaf

304 files changed

Lines changed: 30259 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
release:
9+
types:
10+
- published
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: temurin
25+
java-version: '17'
26+
cache: maven
27+
28+
- name: Run Spotless lint
29+
run: mvn -B -ntp spotless:check
30+
31+
module-build:
32+
name: Build ${{ matrix.module }}
33+
runs-on: ubuntu-latest
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
module:
38+
- ezrtp-common
39+
- ezrtp-bukkit
40+
- ezrtp-paper
41+
- ezrtp-spigot
42+
- ezrtp-purpur
43+
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Set up JDK 17
49+
uses: actions/setup-java@v4
50+
with:
51+
distribution: temurin
52+
java-version: '17'
53+
cache: maven
54+
55+
- name: Build module
56+
run: mvn -B -ntp -pl ${{ matrix.module }} -am -DskipTests -Dspotless.check.skip=true package
57+
58+
unit-tests:
59+
name: Unit Tests
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
66+
- name: Set up JDK 17
67+
uses: actions/setup-java@v4
68+
with:
69+
distribution: temurin
70+
java-version: '17'
71+
cache: maven
72+
73+
- name: Run unit tests
74+
run: mvn -B -ntp -pl ezrtp-bukkit,ezrtp-paper -am -Dspotless.check.skip=true test
75+
76+
feature-tests:
77+
name: Feature Tests
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
84+
- name: Set up JDK 17
85+
uses: actions/setup-java@v4
86+
with:
87+
distribution: temurin
88+
java-version: '17'
89+
cache: maven
90+
91+
- name: Run feature tests
92+
run: mvn -B -ntp -pl ezrtp-bukkit -am -Pmessage-tests -Dspotless.check.skip=true test
93+
94+
publish-github-packages:
95+
name: Publish to GitHub Packages
96+
if: github.event_name == 'release'
97+
runs-on: ubuntu-latest
98+
permissions:
99+
contents: read
100+
packages: write
101+
102+
steps:
103+
- name: Checkout
104+
uses: actions/checkout@v4
105+
106+
- name: Set up JDK 17
107+
uses: actions/setup-java@v4
108+
with:
109+
distribution: temurin
110+
java-version: '17'
111+
cache: maven
112+
server-id: github
113+
server-username: GITHUB_ACTOR
114+
server-password: GITHUB_TOKEN
115+
116+
- name: Publish Maven artifacts
117+
run: mvn -B -ntp -DskipTests -Dspotless.check.skip=true deploy -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/${{ github.repository }}
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Search Pattern Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- '.github/workflows/search-pattern-benchmarks.yml'
8+
- 'ezrtp-common/src/main/java/com/skyblockexp/ezrtp/config/SearchPattern.java'
9+
- 'ezrtp-common/src/main/java/com/skyblockexp/ezrtp/teleport/search/**'
10+
- 'ezrtp-common/src/test/java/com/skyblockexp/ezrtp/tools/SearchPatternBenchmarkRunner.java'
11+
schedule:
12+
- cron: '0 6 * * 1'
13+
14+
jobs:
15+
benchmark:
16+
name: ${{ matrix.software }} / ${{ matrix.pattern }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
software: [bukkit, paper, spigot, purpur]
22+
pattern: [random, circle, triangle, diamond, square]
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up JDK 17
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: temurin
32+
java-version: '17'
33+
cache: maven
34+
35+
- name: Compile benchmark classpath
36+
run: mvn -B -ntp -pl ezrtp-${{ matrix.software }},ezrtp-common -am -DskipTests -Dspotless.check.skip=true test-compile
37+
38+
- name: Run search-pattern benchmark
39+
run: |
40+
mkdir -p benchmark-results
41+
mvn -B -ntp -pl ezrtp-common -DskipTests -Dspotless.check.skip=true \
42+
org.codehaus.mojo:exec-maven-plugin:3.5.0:java \
43+
-Dexec.classpathScope=test \
44+
-Dexec.mainClass=com.skyblockexp.ezrtp.tools.SearchPatternBenchmarkRunner \
45+
-Dexec.args="${{ matrix.software }} ${{ matrix.pattern }} 250000 2000000" \
46+
| tee benchmark-results/${{ matrix.software }}-${{ matrix.pattern }}.log
47+
48+
- name: Upload benchmark artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: benchmark-${{ matrix.software }}-${{ matrix.pattern }}
52+
path: benchmark-results/${{ matrix.software }}-${{ matrix.pattern }}.log
53+
54+
summarize:
55+
name: Summarize benchmark report
56+
runs-on: ubuntu-latest
57+
needs: benchmark
58+
59+
steps:
60+
- name: Download benchmark artifacts
61+
uses: actions/download-artifact@v4
62+
with:
63+
path: benchmark-artifacts
64+
65+
- name: Build markdown summary
66+
run: |
67+
{
68+
echo "# Search Pattern Benchmark Summary"
69+
echo
70+
echo "| Server software | Pattern | Avg ns/op | Ops/sec |"
71+
echo "|---|---:|---:|---:|"
72+
find benchmark-artifacts -name '*.log' | sort | while read -r log_file; do
73+
data_line="$(grep -E 'software=.*pattern=.*avg_ns=.*ops_per_sec=' "$log_file" | tail -n 1 || true)"
74+
if [ -z "$data_line" ]; then
75+
continue
76+
fi
77+
software="$(echo "$data_line" | sed -n 's/.*software=\([^ ]*\).*/\1/p')"
78+
pattern="$(echo "$data_line" | sed -n 's/.*pattern=\([^ ]*\).*/\1/p')"
79+
avg_ns="$(echo "$data_line" | sed -n 's/.*avg_ns=\([^ ]*\).*/\1/p')"
80+
ops_per_sec="$(echo "$data_line" | sed -n 's/.*ops_per_sec=\([^ ]*\).*/\1/p')"
81+
echo "| ${software} | ${pattern} | ${avg_ns} | ${ops_per_sec} |"
82+
done
83+
} > benchmark-summary.md
84+
85+
cat benchmark-summary.md >> "$GITHUB_STEP_SUMMARY"
86+
87+
- name: Upload summary artifact
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: benchmark-summary
91+
path: benchmark-summary.md

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Compiled class files
2+
*.class
3+
4+
# Log files
5+
*.log
6+
7+
# Package files
8+
*.jar
9+
*.war
10+
*.ear
11+
12+
# Maven
13+
**/target/
14+
/target/
15+
pom.xml.tag
16+
pom.xml.releaseBackup
17+
pom.xml.versionsBackup
18+
release.properties
19+
dependency-reduced-pom.xml
20+
buildNumber.properties
21+
22+
# Gradle
23+
.gradle
24+
build/
25+
26+
# IntelliJ
27+
*.iml
28+
.idea/
29+
out/
30+
31+
# Eclipse
32+
.project
33+
.classpath
34+
.settings/
35+
.recommenders
36+
37+
# VS Code
38+
.vscode/
39+
40+
# Generated sources
41+
/generated-sources/
42+
/generated-test-sources/
43+
44+
# Maven wrapper
45+
/.mvn/wrapper/maven-wrapper.jar
46+
47+
# OS files
48+
.DS_Store
49+
50+
# Temp files
51+
*.tmp
52+
*.swp
53+
*~

AGENTS.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# AGENTS.md — EzRTP Development Guide
2+
3+
This document defines repository-wide guidance for contributors and coding agents working in `EzRTP`.
4+
5+
## Scope
6+
- Applies to the entire repository rooted at this file.
7+
8+
## Goals
9+
- Keep behavior stable for server owners across Bukkit/Paper/Spigot/Purpur.
10+
- Prefer compatibility and safe fallbacks over platform-specific assumptions.
11+
- Make changes easy to review, test, and reason about.
12+
13+
## Repository layout
14+
- `src/main/java/...`: primary plugin implementation and shared runtime wiring.
15+
- `src/test/java/...`: unit/integration-style tests (including compatibility shims/mocks).
16+
- `ezrtp-common/`: platform abstraction interfaces and shared adapters.
17+
- `ezrtp-bukkit/`, `ezrtp-paper/`, `ezrtp-spigot/`, `ezrtp-purpur/`: platform provider modules.
18+
- `src/main/resources/*.yml`: default config and user-visible messages.
19+
20+
## Build & test expectations
21+
- Java version: **17**.
22+
- Preferred verification flow before submitting:
23+
1. `mvn -q -DskipTests compile`
24+
2. `mvn -q test`
25+
- If a full test run is too expensive, run targeted tests for touched areas and explicitly note what was skipped.
26+
27+
## Code quality standards
28+
- Keep classes focused; favor small methods with clear names.
29+
- Avoid silent behavior changes in teleport safety, cooldowns, and economy checks.
30+
- Do not introduce blocking operations on the main server thread.
31+
- Preserve cross-platform abstractions:
32+
- Add platform-specific behavior in platform modules.
33+
- Keep shared logic in common/core modules.
34+
- Prefer configuration-driven behavior over hardcoded values.
35+
- Add/adjust tests for bug fixes or non-trivial logic changes.
36+
37+
## Configuration & messages changes
38+
- When changing defaults in `config.yml`, `messages/*.yml`, `gui.yml`, `queue.yml`, or `network.yml`:
39+
- Keep backward compatibility in mind.
40+
- Document migration impacts in PR notes.
41+
- Ensure placeholder keys and message keys remain consistent.
42+
43+
## Performance & safety
44+
- Avoid repeated expensive world/biome lookups when cacheable.
45+
- Guard async/sync boundaries carefully when interacting with Bukkit/Paper APIs.
46+
- Treat teleport destination validation as safety-critical; prefer conservative fallbacks.
47+
48+
## PR readiness checklist
49+
- Code compiles.
50+
- Relevant tests pass (or justified exceptions documented).
51+
- New/changed behavior is covered by tests when practical.
52+
- User-facing config/message changes are clearly described.
53+
- No unrelated refactors mixed into focused fixes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Gyvex (63536625)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)