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
2 changes: 2 additions & 0 deletions .github/mc-version-range.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
26.1
26.3
8 changes: 5 additions & 3 deletions .github/scripts/gen-uninstall-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
if os.path.relpath(path, folder).replace(os.sep, "/") == "uninstall.mcfunction":
uninstall_text += text + "\n"
continue
objectives.update(re.findall(r"scoreboard objectives add (\S+)", text))
# a name that is a macro argument ($(obj)) is only known at runtime: the axes, they have their own check in the test
objectives.update(n for n in re.findall(r"scoreboard objectives add (\S+)", text) if "$(" not in n)
schedules.update(re.findall(r"schedule function (timber:[\w/]+)", text))
# storage timber:settings dialog.inputs[0].initial -> (timber:settings, dialog), the top level key is what gets removed
storage_keys.update(re.findall(r"storage (timber:\w+) (\w+)", text))
Expand All @@ -54,9 +55,10 @@ def write(name, lines):
# --- before the uninstall: something in every storage key
# The first line of both functions sets a marker that the test checks: PackTest doesn't complain about a function that doesn't
# exist, without the marker a missing or broken generation step would leave a test that checks nothing and passes.
write("uninstall_prepare.mcfunction", [HEADER, "#> Puts a value into every storage key the datapack writes to.",
write("uninstall_prepare.mcfunction", [HEADER, "#> Puts a value into every storage key the datapack writes to and that is empty.",
"scoreboard objectives add timber_test dummy", "scoreboard players set #uninstall_prepare_ran timber_test 1"]
+ [f"data modify storage {sid} {key} set value 1" for sid, key in sorted(storage_keys)])
# only where there is nothing yet: a key that holds real data (the list of axes) must stay usable for the uninstall
+ [f"execute unless data storage {sid} {key} run data modify storage {sid} {key} set value 1" for sid, key in sorted(storage_keys)])

# --- after the uninstall
lines = [
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/publish-modrinth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish to Modrinth

# Runs whenever a GitHub Release is published and uploads that release as a new Modrinth version.
# .github/mc-version-range.txt holds the two Minecraft versions (lowest, highest) this build supports; update it
# in the same commit where pack.mcmeta's max_format (or min_format) changes.
on:
release:
types: [published]

permissions:
contents: read

jobs:
publish:
name: Publish to Modrinth
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build the datapack zip
run: git archive --format=zip -o "Timber-${{ github.event.release.tag_name }}.zip" HEAD -- data 121 pack.mcmeta pack.png LICENSE README.md

- name: Read the supported Minecraft version range
id: versions
run: |
MIN=$(sed -n '1p' .github/mc-version-range.txt)
MAX=$(sed -n '2p' .github/mc-version-range.txt)
echo "range=[$MIN,$MAX]" >> "$GITHUB_OUTPUT"

- uses: Kira-NT/mc-publish@v3
with:
modrinth-id: gy7p6YNM
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
files: Timber-${{ github.event.release.tag_name }}.zip
name: ${{ github.event.release.name }}
version: ${{ github.event.release.tag_name }}
version-type: release
changelog: ${{ github.event.release.body }}
loaders: datapack
game-versions: ${{ steps.versions.outputs.range }}
222 changes: 0 additions & 222 deletions 121/data/timber/item_modifier/wear_out.json

This file was deleted.

2 changes: 1 addition & 1 deletion 121/data/timber/predicate/block/leaf.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"type": "minecraft:entity_scores",
"entity": "this",
"scores": {
"timber_prsistent": {
"timber_persistent": {
"min": 1
}
}
Expand Down
68 changes: 0 additions & 68 deletions 121/data/timber/predicate/used_axe.json

This file was deleted.

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

Version numbers are `MAJOR.MINOR.PATCH`:

- **MAJOR**: breaking change (incompatible behavior, dropping an old MC version via `min_format`, or a broken API)
- **MINOR**: new feature, or support for a new MC version via `max_format` (even a pack.mcmeta-only bump)
- **PATCH**: bug fix

Release notes live on the [GitHub Releases page](https://github.com/Moggla/Timber-Datapack/releases), not here. New tags use lowercase `v` (e.g. `v7.3.0`); releases before this file are tagged `V0.0.1` to `V7.2.0`.

## Releasing

1. If the supported MC versions changed: bump `pack.mcmeta` (`min_format`/`max_format`) and match `.github/mc-version-range.txt` to it. [Pack format](https://minecraft.wiki/w/Pack_format) lists which MC version has which format number.
2. Update the version string in `data/timber/dialog/help.json`.
3. Tag the commit `vX.Y.Z` and publish it as a GitHub Release, using "Generate release notes" for the body; that triggers the Modrinth upload automatically.
Loading
Loading