Skip to content

Commit

Permalink
Rebase on upstream master
Browse files Browse the repository at this point in the history
  • Loading branch information
theogiraudet committed Jun 12, 2024
2 parents 0439f53 + 0e2906e commit 7db779d
Show file tree
Hide file tree
Showing 1,168 changed files with 27,503 additions and 3,087 deletions.
8 changes: 7 additions & 1 deletion .env.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
mc_version: "1.20.6"
assets_path: "./assets"
generated_path: "./generated"
build_path: "./build"
datapacks_path: "./datapacks"
world_path: "."
bookshelf_libs:
- "Bookshelf"
- "Bookshelf Dev"
metadata_folder: "metadata"
doc_url: "https://bookshelf.docs.gunivers.net/"
feature_tag_namespace: "__bookshelf__"
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "🐛 Bug report"
about: Report a reproducible bug.
labels: '🐛 Bug'

---

<!--
Please provide a clear and concise description of what the bug is. Includes creenshots if needed.
Please test using the latest Bookshelf version to make sure your issue has not already been fixed.
-->

Bookshelf version:
Feature path:

## Steps To Reproduce

1.
2.

<!--
It is much easier for us to understand and fix a bug if we have a way to reproduce it.
If the bug is cause by the succession of several features call, please indicate the different steps.
-->

Code example:

<!--
Please provide a minimal example to reproduce the bug.
-->

## The current behavior


## The expected behavior
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Question
url: https://github.com/Gunivers/Bookshelf/discussions
about: Please ask questions here.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: ✨ Feature request
about: Suggest a new feature and/or a new module.
---
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Describe the feature you'd like. -->
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: 📝 Other
about: For other suggestions such as asking to add new related tools into the documentation, etc.
---
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Describe the feature you'd like. -->
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Tasks to do before merging
- [ ] I accept to publish my contribution under [MPL v2](http://mozilla.org/MPL/2.0/) License
- [ ] My pull request is linked to an existing issue
- [ ] I have added my contribution to the [changelog](https://github.com/Gunivers/Bookshelf/blob/master/docs/CHANGELOG.md)
- If my pull request is a new or modify an existing feature:
- [ ] I have documented my contribution (`/docs`)
- [ ] I added or updated the [header](https://bookshelf.docs.gunivers.net/en/latest/contribute/file-format.html) of the features' root function I contribute
- [ ] I [tested](https://bookshelf.docs.gunivers.net/en/latest/contribute/debug.html#unit-tests) my contribution
- [ ] I have added or updated the [header](https://bookshelf.docs.gunivers.net/en/latest/contribute/file-format.html) of the features' root function I contribute
- [ ] I have [tested](https://bookshelf.docs.gunivers.net/en/latest/contribute/debug.html#unit-tests) my contribution
50 changes: 50 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 🔍 Pull Request Checks

on:
pull_request:
paths:
- "datapacks/**"
types:
[
opened,
synchronize,
reopened,
labeled,
unlabeled
]

env:
GITHUB_EVENT: ${{ toJSON(github.event) }}

jobs:
review-metadata:
name: 🔍 Metadata Review
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: pip install -e ./scripts

- name: Check installation
run: python -m pip list

- name: Check function headers
run: python scripts/ci/check_function_headers_wf.py

- name: Check feature tag metadata
run: python scripts/ci/check_feature_tag_metadata_wf.py

- name: Check generated metadata
run: python scripts/ci/check_generated_metadata_wf.py

- name: Check module metadata files
run: python scripts/ci/check_metadata_files_wf.py
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup environment variables
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: pip install -e ./scripts

- name: Set environment variables
run: |
pip install -r scripts/requirements.txt
python3 scripts/definitions.py
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
echo "MC_VERSION=$(python -c 'import definitions; print(definitions.MC_VERSION)')" >> $GITHUB_ENV
echo "BUILD_PATH=$(python -c 'import definitions; print(definitions.BUILD_PATH)')" >> $GITHUB_ENV
- name: Package datapacks
run: python3 scripts/distribute.py -v ${{ env.MC_VERSION }}-${{ env.VERSION }} -w 0
run: python scripts/ci/distribute_release_wf.py -v ${{ env.MC_VERSION }}-${{ env.VERSION }} -w 0

- name: Package world
uses: aksiome/minecraft-package@master
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup environement variables
run: |
pip install -r scripts/requirements.txt
python3 scripts/definitions.py
- name: Download and prepare files
run: |
curl -o server.jar ${{ env.TEST_FABRIC_SERVER }}
mkdir mods
curl -o mods/fabric-api.jar ${{ env.TEST_FABRIC_API }}
curl -o mods/packtest.jar ${{ env.TEST_PACKTEST }}
mkdir -p world
cp -r ${{ env.DATAPACKS_PATH }} world/datapacks

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: pip install -e ./scripts

- name: Check installation
run: python -m pip list

- name: Run tests
run: |
java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui
run: python scripts/ci/run_packtest_wf.py
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/DIM-1/
/DIM1/
/entities/
/generated/
/playerdata/
/poi/
/region/
Expand All @@ -15,5 +14,6 @@
/session.lock
/uid.dat
/venv/
/scripts/src/bookshelf_scripts.egg-info/

/.vscode/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
&nbsp;&nbsp;
<a href="https://bookshelf.docs.gunivers.net/"><img src="./docs/_imgs/documentation.svg?v=2" alt="Documentation" style="height:3rem"></a>
&nbsp;&nbsp;
<a href="https://discord.gg/E8qq6tN"><img src="./docs/_imgs/discord.svg?v=2" alt="Discord" style="height:3rem"></a>
<a href="https://discord.gg/MkXytNjmBt"><img src="./docs/_imgs/discord.svg?v=2" alt="Discord" style="height:3rem"></a>
</div>
</h2>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"name": "help",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html",
"authors": [
"Aksiome"
],
"created": {
"date": "2024/03/05",
"version": "1.20.4"
},
"updated": {
"date": "2024/03/05",
"version": "1.20.4"
}
},
{
"name": "load",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html",
"authors": [
"Aksiome"
],
"created": {
"date": "2024/03/05",
"version": "1.20.4"
},
"updated": {
"date": "2024/03/05",
"version": "1.20.4"
}
},
{
"name": "unload",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html",
"authors": [
"Aksiome"
],
"created": {
"date": "2024/03/05",
"version": "1.20.4"
},
"updated": {
"date": "2024/03/05",
"version": "1.20.4"
}
},
{
"name": "var",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html#dump-var",
"authors": [
"Aksiome"
],
"created": {
"date": "2024/03/02",
"version": "1.20.4"
},
"updated": {
"date": "2024/03/02",
"version": "1.20.4"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "bs.dump",
"display_name": "Dump",
"description": "Dump the content of given variables to the chat.",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html",
"authors": [
"Aksiome"
],
"features": [
"bs.dump:help",
"bs.dump:load",
"bs.dump:unload",
"bs.dump:var"
]
}
6 changes: 6 additions & 0 deletions datapacks/Bookshelf Dev/data/bs.dump/.metadata/module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "bs.dump",
"display_name": "Dump",
"description": "Dump the content of given variables to the chat.",
"documentation": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html"
}
20 changes: 16 additions & 4 deletions datapacks/Bookshelf Dev/data/bs.dump/function/__help__.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# INFO ------------------------------------------------------------------------
# Copyright © 2024 Gunivers Community.

# CODE ------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Copyright (c) 2024 Gunivers
#
# This file is part of the Bookshelf project (https://github.com/Gunivers/Bookshelf).
#
# This source code is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Conditions:
# - You may use this file in compliance with the MPL v2.0
# - Any modifications must be documented and disclosed under the same license
#
# For more details, refer to the MPL v2.0.
#
# Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html
# ------------------------------------------------------------------------------------------------------------

tellraw @s [{"text": "[bs.dump documentation]", "color": "dark_aqua", "clickEvent": {"action": "open_url", "value": "https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html"}, "hoverEvent": {"action": "show_text", "contents": "Click to open URL"}}]
20 changes: 16 additions & 4 deletions datapacks/Bookshelf Dev/data/bs.dump/function/__load__.mcfunction
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# INFO ------------------------------------------------------------------------
# Copyright © 2024 Gunivers Community.

# CODE ------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Copyright (c) 2024 Gunivers
#
# This file is part of the Bookshelf project (https://github.com/Gunivers/Bookshelf).
#
# This source code is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Conditions:
# - You may use this file in compliance with the MPL v2.0
# - Any modifications must be documented and disclosed under the same license
#
# For more details, refer to the MPL v2.0.
#
# Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html
# ------------------------------------------------------------------------------------------------------------

forceload add -30000000 1600
execute unless entity B5-0-0-0-2 run summon minecraft:text_display -30000000 0 1600 {UUID:[I;181,0,0,2],Tags:["bs.entity","bs.persistent"],view_range:0f}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# INFO ------------------------------------------------------------------------
# Copyright © 2024 Gunivers Community.

# CODE ------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Copyright (c) 2024 Gunivers
#
# This file is part of the Bookshelf project (https://github.com/Gunivers/Bookshelf).
#
# This source code is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Conditions:
# - You may use this file in compliance with the MPL v2.0
# - Any modifications must be documented and disclosed under the same license
#
# For more details, refer to the MPL v2.0.
#
# Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/dump.html
# ------------------------------------------------------------------------------------------------------------

kill B5-0-0-0-2
forceload remove -30000000 1600
Expand Down
15 changes: 15 additions & 0 deletions datapacks/Bookshelf Dev/data/bs.dump/function/expand.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# ------------------------------------------------------------------------------------------------------------
# Copyright (c) 2024 Gunivers
#
# This file is part of the Bookshelf project (https://github.com/Gunivers/Bookshelf).
#
# This source code is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Conditions:
# - You may use this file in compliance with the MPL v2.0
# - Any modifications must be documented and disclosed under the same license
#
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

data modify storage bs:out dump set value ['{"text":"","color":"#cccccc"}']
$data modify storage bs:data dump set value [{var:$(var),indent:'"\\u2000"',expand:1}]
function bs.dump:format/any
Expand Down
Loading

0 comments on commit 7db779d

Please sign in to comment.