Skip to content

Commit 457e9d7

Browse files
committed
Update to MC 26.1.1
1 parent ea8ef91 commit 457e9d7

8 files changed

Lines changed: 323 additions & 79 deletions

File tree

‎.github/labeler.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ mc-1.20:
2323
- 'Minecraft: 1.20'
2424
mc-1.21:
2525
- 'Minecraft: 1.21'
26-
mc-1.22:
27-
- 'Minecraft: 1.22'
28-
mc-1.23:
29-
- 'Minecraft: 1.23'
30-
mc-1.24:
31-
- 'Minecraft: 1.24'
32-
mc-1.25:
33-
- 'Minecraft: 1.25'
26+
mc-26:
27+
- 'Minecraft: 26'
28+
mc-27:
29+
- 'Minecraft: 27'
30+
mc-28:
31+
- 'Minecraft: 28'
32+
mc-29:
33+
- 'Minecraft: 29'
34+
mc-30:
35+
- 'Minecraft: 30'

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/setup-java@v4
1919
with:
2020
distribution: 'microsoft'
21-
java-version: 21
21+
java-version: 25
2222
- name: 'Setup Gradle'
2323
uses: gradle/actions/setup-gradle@v4
2424
with:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
14+
copilot-setup-steps:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
19+
# Steps that will run before the agent starts
20+
steps:
21+
- name: 'Checkout'
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: true
25+
- name: Read Java version from gradle.properties
26+
id: java_version
27+
run: |
28+
if [ -f gradle.properties ] && grep -q '^java_version=' gradle.properties; then
29+
VERSION=$(grep '^java_version=' gradle.properties | cut -d'=' -f2)
30+
else
31+
VERSION=17
32+
fi
33+
echo "Using Java version: $VERSION"
34+
echo "version=$VERSION" >> $GITHUB_OUTPUT
35+
- name: 'Setup Java'
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: 'microsoft'
39+
java-version: ${{ steps.java_version.outputs.version }}
40+
- name: 'Setup Gradle'
41+
uses: gradle/actions/setup-gradle@v4
42+
with:
43+
gradle-version: wrapper
44+
cache-read-only: false
45+
- name: 'Build'
46+
run: ./gradlew build --no-daemon
47+
env:
48+
MAVEN_USERNAME: ${{ github.actor }}
49+
MAVEN_KEY: ${{ secrets.GITHUB_TOKEN }}
50+
GITHUB_USER: ${{ github.actor }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- name: 'Warmup for game test server'
53+
run: ./gradlew runGameTestServer --no-daemon

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ keystore.jks
2727
secrets.properties
2828
build_number.properties
2929
changelog.txt
30+
31+
.cache
32+
config

‎AGENTS.md‎

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# AGENTS.md - Developer and AI Agent Guide
2+
3+
This document provides essential information for developers and AI agents working on this Minecraft mod's codebase.
4+
5+
## Project Overview
6+
7+
This is a Minecraft mod. See README.md for a description of what this mod does. The project is written in Java and uses Gradle as its build system.
8+
9+
## Multi-Loader Architecture
10+
11+
**This repo only uses a multi-loader architecture if you can find a `loader-common` directory in the root of this repo!**
12+
13+
In Minecraft 1.21 and above, this repository uses a **multi-loader setup**, meaning the mod is available on multiple Minecraft mod loaders.
14+
The Minecraft version can be found in `gradle.properties`.
15+
Understanding this architecture is crucial when making changes:
16+
17+
### Directory Structure
18+
19+
- **`loader-common/`**: Contains source code that is common across all mod loaders. Most shared functionality should be implemented here.
20+
- **`loader-fabric/`**: Fabric-specific implementation and integration code.
21+
- **`loader-forge/`**: Forge-specific implementation and integration code (for older Minecraft versions).
22+
- **`loader-neoforge/`**: NeoForge-specific implementation and integration code (for newer Minecraft versions).
23+
24+
For NeoForge, relevant jars can for example be found in the following locations:
25+
26+
- Minecraft merged jar: `build/moddev/artifacts/minecraft-patched-26.1.1.1-beta-merged.jar`
27+
- NeoForge: `~/.gradle/caches/modules-2/files-2.1/net.neoforged/neoforge/26.1.1.1-beta/214ad5aa883deaf6d71298baf4232bb994305f36/neoforge-26.1.1.1-beta-universal.jar`
28+
- CyclopsCore source: `~/.m2/repository/org/cyclops/cyclopscore/cyclopscore-26.1.1-neoforge/1.25.5-DEV/cyclopscore-26.1.1-neoforge-1.25.5-DEV-sources.jar`
29+
30+
### Making Changes in Multi-loader Setups
31+
32+
When adding features or fixing bugs:
33+
1. Place shared logic in `loader-common/` whenever possible
34+
2. Only add loader-specific code to the respective `loader-*` directories when platform-specific APIs are required
35+
3. Ensure your changes work across all supported loaders
36+
37+
## Testing
38+
39+
This mod uses two types of tests:
40+
41+
### 1. Unit Tests
42+
43+
**Location**: `src/test/java/`
44+
45+
Traditional JUnit tests for testing isolated functionality without requiring a full Minecraft instance.
46+
47+
**Running unit tests**:
48+
```bash
49+
./gradlew test
50+
```
51+
52+
Unit tests are automatically executed when running the `build` command.
53+
54+
### 2. Game Tests
55+
56+
**Location**: Within normal sources, typically in the `org/cyclops/*/gametest` package (e.g., `loader-common/src/main/java/org/cyclops/cyclopscore/gametest/`)
57+
58+
Game tests run an actual Minecraft instance to test code with real game logic. These are essential for testing features that interact with Minecraft's gameplay systems.
59+
Game tests only exist in Minecraft 1.21 and higher.
60+
61+
**Running game tests**:
62+
```bash
63+
./gradlew runGameTestServer
64+
```
65+
66+
**Important**:
67+
- Game tests are **NOT** run automatically during the build process
68+
- For Minecraft 1.21 and above, game tests must be run manually before committing
69+
- Game tests must pass before finalizing your changes
70+
71+
### When to Add Tests
72+
73+
When adding new features or fixing bugs:
74+
- **Always** add unit tests when possible for isolated logic
75+
- **Always** add game tests when the feature interacts with Minecraft gameplay systems
76+
- Look at existing tests in the respective directories for examples of test patterns and conventions
77+
78+
### Testing advancements
79+
80+
When writing game tests for advancements, don't just call criterion triggers directly, but try to simulate actual game logic to invoke the criterion triggers indirectly.
81+
82+
### Test coverage
83+
84+
When adding new tests for the sake of increasing test coverage, you can measure coverage by running `./gradlew test runGameTestServer jacocoTestReport`, and checking the coverage output in `build/reports/jacoco/test/`.
85+
86+
## Building the Project
87+
88+
### Prerequisites
89+
90+
- Java version is specified in `gradle.properties` (otherwise, default to version 17)
91+
- Gradle (use the provided wrapper: `./gradlew`)
92+
93+
### Build Command
94+
95+
Before every commit, ensure the project builds successfully:
96+
97+
```bash
98+
./gradlew build
99+
```
100+
101+
This command will:
102+
- Compile all source code
103+
- Run unit tests automatically
104+
- Generate build artifacts
105+
106+
### Full Pre-Commit Validation
107+
108+
Run build:
109+
110+
```bash
111+
./gradlew build
112+
```
113+
114+
Only for Minecraft 1.21 and above, also run game tests:
115+
```bash
116+
./gradlew runGameTestServer
117+
```
118+
119+
Both must pass before committing changes.
120+
121+
## Code Formatting
122+
123+
This project uses Spotless for code formatting:
124+
125+
```bash
126+
./gradlew spotlessApply
127+
```
128+
129+
The pre-commit script in `scripts/pre-commit` automatically formats staged files. Consider setting it up as a Git hook:
130+
131+
```bash
132+
ln -s ../../scripts/pre-commit .git/hooks/pre-commit
133+
```
134+
135+
## Development Workflow
136+
137+
1. **Understand the change**: Read the issue/feature request thoroughly
138+
2. **Explore the codebase**: Use tools like `grep` to find relevant code
139+
3. **Make minimal changes**: Focus on the specific issue/feature
140+
4. **Add tests**: Write unit tests and/or game tests as appropriate
141+
5. **Build and test**:
142+
```bash
143+
./gradlew build
144+
./gradlew runGameTestServer # For MC 1.21+
145+
```
146+
6. **Format code**: `./gradlew spotlessApply`
147+
7. **Commit**: Use clear, descriptive commit messages
148+
149+
## Release Management
150+
151+
Version bumping and release management helper scripts are available in the [CyclopsMC/ReleaseHelpers](https://github.com/CyclopsMC/ReleaseHelpers) repository. These bash scripts assist with:
152+
- Version bumping across all loaders
153+
- Changelog management
154+
- Release preparation
155+
156+
## Gradle Tasks Reference
157+
158+
Common Gradle tasks for development:
159+
160+
| Task | Purpose |
161+
|------|---------|
162+
| `./gradlew build` | Build the project and run unit tests |
163+
| `./gradlew test` | Run unit tests only |
164+
| `./gradlew runGameTestServer` | Run game tests (manual, required for MC 1.21+) |
165+
| `./gradlew spotlessApply` | Format code according to project standards |
166+
| `./gradlew publishToMavenLocal` | Publish to local Maven for testing in other projects |
167+
168+
If for any reason gradle fails due to internet connection issues, try running offline instead by running the gradle command with the `--offline` flag.
169+
170+
## CI/CD
171+
172+
GitHub Actions automatically:
173+
- Builds the project on every push and pull request
174+
- Runs unit tests
175+
- Runs game tests (including `runGameTestServer`)
176+
- Generates coverage reports
177+
- Deploys to CurseForge, Modrinth, and Maven on appropriate branches/tags
178+
179+
See `.github/workflows/ci.yml` for the full CI configuration.
180+
181+
## Additional Resources
182+
183+
- **README.md**: Project overview and usage information
184+
- **CONTRIBUTING.md**: Contribution guidelines and issue reporting
185+
- **Build configuration**: `build.gradle` and loader-specific build files
186+
- **Project properties**: `gradle.properties` (Minecraft version, mod version, etc.)
187+
188+
## Key Principles
189+
190+
1. **Minimal changes**: Make the smallest possible changes to achieve your goal
191+
2. **Test coverage**: Always try to add tests for new features and bug fixes (may be difficult or impossible for things related to GUIs)
192+
3. **Multi-loader compatibility**: Ensure changes work across all supported loaders
193+
4. **Build validation**: Never commit without running `build` (and `runGameTestServer` for MC 1.21+)
194+
5. **Code quality**: Follow existing patterns and conventions in the codebase
195+
196+
## Code changes across Minecraft updates
197+
198+
When I ask you to things such as "fix upmerge issues" or "update to the next Minecraft version",
199+
this means that I want you to help resolve compilation errors
200+
that were introduced due to upmerging code from an older minecraft version to a newer minecraft version.
201+
The old minecraft version can be found in the `.upmerge-src-branch` file of the parent directory,
202+
and the new minecraft version can be found in `gradle.properties`.
203+
Changes may also include fixing merge conflicts.
204+
205+
IMPORTANT: Some changes may be non-trivial,
206+
for which you can find detail background information for each seperate Minecraft update within these primers: https://github.com/neoforged/.github/tree/main/primers
207+
The blogs of https://neoforged.net/ and https://fabricmc.net/blog/ may also contain useful porting help.
208+
209+
After making all necessary changes, make sure the code fully compiles and the (game) tests pass.

0 commit comments

Comments
 (0)