Skip to content

Commit f1381cd

Browse files
authored
Improve agent instructions (#69)
1 parent 5c22820 commit f1381cd

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/copilot-instructions.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Generated data ends up under `mc/<version>/run/server/minecraft-data` in the rep
1313
- versions.json — canonical JSON array of versions that are supported (i.e. there are folders in mc/ for it)
1414
- mc-source/<version> — (External) minecraft java edition code for relevant version with Mojang mappings that you can reference for changes.
1515
* we store the last 2 most recent versions in the folder to save space, but if you need more versions you can do `cd mc-source && git ls-remote 'https://github.com/extremeheat/extracted_minecraft_data' && git clone 'https://github.com/extremeheat/extracted_minecraft_data' --depth 1 -b client1.20.3 1.20.3 && cd 1.20.3`
16-
* there is a .diff file in mc-source/ like `1.21.7_to_1.21.8.diff` that contains result of `git diff --no-index old new` that you can reference for changes (note it's typically large)
16+
* there is a .diff file in mc-source/ like `1.21.7_to_1.21.8.diff` that contains result of `git diff --no-index -M50% -l2000 old new` that you can reference for changes (note it's typically large)
1717
* Since our generator is using Mojang mappings, the API naming is the same.
1818
- README.md — info how to set up
1919

@@ -30,9 +30,17 @@ and figure out how to replicate, debug and fix the logical issues in data genera
3030

3131
## Troubleshooting
3232

33-
Simply iterating over errors one by one is a good way to fix most issues. Inside mc-source/ you are provided the latest
34-
code for the latest minecraft versions you can reference to investigate any code changes that we may need to accomodate in our
35-
generator code.
33+
Simply iterating over errors one by one is a good way to fix most issues. The `mc-source/` directory contains the two
34+
most recent Minecraft versions (e.g. `mc-source/1.21.10/` and `mc-source/1.21.11/`) plus a diff file between them.
35+
When searching for code, always target a specific version directory (e.g. search in `mc-source/1.21.11/` not `mc-source/`)
36+
to avoid clutter and confusion.
37+
38+
Importantly, before assuming a class/method was removed, check the diff file for renames first. Renames/moves appear as:
39+
```
40+
rename from net/minecraft/world/entity/animal/WaterAnimal.java
41+
rename to net/minecraft/world/entity/animal/fish/WaterAnimal.java
42+
```
43+
If not found in the diff (rename detection has a 2000 file limit), search the specific version directory to locate the class.
3644

3745
Sometimes, some APIs might change inside the mc code and make the data that the current code extracts no longer
3846
valid. In these cases, do your best to conform the new data to the old structure even if it feels wrong. If you
@@ -44,8 +52,8 @@ You can propose a new schema to the user (so that the relevant changes can be ma
4452
- Reproduce the problem locally inside the container and run the generator task.
4553
- Example run command: `./gradlew :mc:1.21.6:runServer --stacktrace`
4654
- See if the problem exists on an older version -- if so inform the user, otherwise compare logs and code
47-
- Inspect diffs in `mc-source/` to correlate Mojang API changes.
48-
- See mc-source/
55+
- Inspect diffs in `mc-source/` for API changes, renames, and moves
56+
- Search the specific version directory (e.g. `mc-source/1.21.11/`) to locate moved/renamed classes
4957
- Validate generated output at `mc/<version>/run/server/minecraft-data` to make sure all files are there
5058

5159
---

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ jobs:
7171

7272
- name: Write diff
7373
# NOTE: this returns exit code 1 if there are differences
74-
run: git diff --no-index ${{ steps.sb.outputs.second_latest_version }} ${{ steps.sb.outputs.latest_version }} > ${{ steps.sb.outputs.second_latest_version }}_to_${{ steps.sb.outputs.latest_version }}.diff
74+
run: git diff --no-index -M50% -l2000 ${{ steps.sb.outputs.second_latest_version }} ${{ steps.sb.outputs.latest_version }} > ${{ steps.sb.outputs.second_latest_version }}_to_${{ steps.sb.outputs.latest_version }}.diff
7575
working-directory: mc-source
7676
continue-on-error: true

0 commit comments

Comments
 (0)