Skip to content

Commit

Permalink
Update to 1.21.2 (#1060)
Browse files Browse the repository at this point in the history
* Fix CustomNameVisible NBT

* Update version and pack format

* Split boat entity types

* Builtin empty loot table was removed

* Update packtest to 1.21.2-pre3

* Add overlay for biome_extensions

* Replace air items with count 0 items in loot tables

* Update auto crafting air loot entries

* Revert overlay direction

* Test both 1.21.1 and 1.21.2

* Remove generic. and player. attribute prefixes

* Use 1.21.2-pre3 vanilla files and update beet scripts

* Fix some random issues

* Rewrite attribute IDs for pack format 48

* Add overlay for soul glass recipe

* Disable luck attribute rewrite because it conflicts with the potion effect

* Disable new banner patterns in overlay

* Fix phantom scarecrows rocket aim due to tp command change

* Remove beehive inspector from 1.21.2

* Update test versions to 1.21.2
  • Loading branch information
misode authored Oct 22, 2024
1 parent 31484f1 commit e865ab4
Show file tree
Hide file tree
Showing 1,469 changed files with 19,252 additions and 1,788 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ on:
workflow_dispatch:

env:
VERSION: '1.21'
VERSION: '1.21.2'
COMMIT_MSG: ${{ github.event.head_commit.message }}
# https://fabricmc.net/use/server/
TEST_FABRIC_SERVER: https://meta.fabricmc.net/v2/versions/loader/1.21.1/0.16.5/1.0.1/server/jar
# https://modrinth.com/mod/fabric-api/versions
TEST_FABRIC_API: https://cdn.modrinth.com/data/P7dR8mSH/versions/WTaAx4ah/fabric-api-0.105.0%2B1.21.1.jar
# https://modrinth.com/mod/packtest/versions
TEST_PACKTEST: https://cdn.modrinth.com/data/XsKUhp45/versions/x9txtivi/packtest-1.8-mc1.21.1.jar

jobs:
build:
Expand Down Expand Up @@ -103,6 +97,22 @@ jobs:
branch: release

test:
strategy:
fail-fast: false
matrix:
include:
# https://fabricmc.net/use/server/
# https://modrinth.com/mod/fabric-api/versions
# https://modrinth.com/mod/packtest/versions
- version: '1.21.1'
fabric_server_url: https://meta.fabricmc.net/v2/versions/loader/1.21.1/0.16.5/1.0.1/server/jar
fabric_api_url: https://cdn.modrinth.com/data/P7dR8mSH/versions/WTaAx4ah/fabric-api-0.105.0%2B1.21.1.jar
packtest_url: https://cdn.modrinth.com/data/XsKUhp45/versions/x9txtivi/packtest-1.8-mc1.21.1.jar
- version: '1.21.2'
fabric_server_url: https://meta.fabricmc.net/v2/versions/loader/1.21.2/0.16.7/1.0.1/server/jar
fabric_api_url: https://cdn.modrinth.com/data/P7dR8mSH/versions/UEjZZNue/fabric-api-0.106.1%2B1.21.2.jar
packtest_url: https://cdn.modrinth.com/data/XsKUhp45/versions/wjOUK14F/packtest-1.9-mc1.21.2.jar
name: 'test-${{ matrix.version }}'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -131,6 +141,7 @@ jobs:
- name: Build all modules for tests
run: poetry run beet -p beet-test.yaml -l ${{ env.LOG_LEVEL }} build
env:
VERSION: ${{ matrix.version }}
LOG_LEVEL: ${{ runner.debug == 1 && 'DEBUG' || 'INFO'}}

- name: Setup Java
Expand All @@ -141,10 +152,10 @@ jobs:

- name: Download server files
run: |
curl -o server.jar $TEST_FABRIC_SERVER
curl -o server.jar ${{ matrix.fabric_server_url }}
mkdir mods
curl -o mods/fabric-api.jar $TEST_FABRIC_API
curl -o mods/packtest.jar $TEST_PACKTEST
curl -o mods/fabric-api.jar ${{ matrix.fabric_api_url }}
curl -o mods/packtest.jar ${{ matrix.packtest_url }}
- name: Copy packs to world
run: |
Expand All @@ -162,5 +173,5 @@ jobs:
if: ${{ failure() && steps.run-tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: 'Test world for ${{ github.sha }}'
name: 'Test world in ${{ matrix.version }} for ${{ github.sha }}'
path: ${{ github.workspace }}/world/
19 changes: 19 additions & 0 deletions base/data/gm4/loot_table/air.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:stick",
"functions": [
{
"function": "minecraft:set_count",
"count": 0
}
]
}
]
}
]
}
3 changes: 3 additions & 0 deletions base/data/gm4/loot_table/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pools": []
}
6 changes: 6 additions & 0 deletions base/data/gm4/tags/entity_type/boats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
{ "id": "minecraft:boat", "required": false },
{ "id": "#minecraft:boat", "required": false }
]
}
15 changes: 15 additions & 0 deletions base/data/gm4/tags/entity_type/chest_boats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"values": [
{ "id": "minecraft:chest_boat", "required": false },
{ "id": "minecraft:oak_chest_boat", "required": false },
{ "id": "minecraft:spruce_chest_boat", "required": false },
{ "id": "minecraft:birch_chest_boat", "required": false },
{ "id": "minecraft:jungle_chest_boat", "required": false },
{ "id": "minecraft:acacia_chest_boat", "required": false },
{ "id": "minecraft:cherry_chest_boat", "required": false },
{ "id": "minecraft:dark_oak_chest_boat", "required": false },
{ "id": "minecraft:mangrove_chest_boat", "required": false },
{ "id": "minecraft:bamboo_chest_raft", "required": false },
{ "id": "minecraft:pale_oak_chest_boat", "required": false }
]
}
4 changes: 2 additions & 2 deletions base/data/gm4/tags/entity_type/non_living.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"minecraft:area_effect_cloud",
"minecraft:arrow",
"minecraft:block_display",
"minecraft:boat",
"#gm4:boats",
"minecraft:breeze_wind_charge",
"minecraft:chest_boat",
"#gm4:chest_boats",
"minecraft:chest_minecart",
"minecraft:command_block_minecart",
"minecraft:dragon_fireball",
Expand Down
3 changes: 3 additions & 0 deletions base/data/minecraft/loot_table/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pools": []
}
5 changes: 1 addition & 4 deletions beet-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pipeline:
- gm4.plugins.output
- gm4.plugins.player_heads
- gm4.plugins.resource_pack
- gm4.plugins.attribute_rewrite
- beet.contrib.model_merging
- beet.contrib.optifine
- beet.contrib.babelbox
Expand All @@ -16,8 +17,6 @@ pipeline:
pipeline:
- gm4.plugins.write_mcmeta
meta:
vanilla:
version: 1.21.1
gm4_dev: True
mecha:
formatting:
Expand Down Expand Up @@ -46,8 +45,6 @@ pipeline:
meta:
autosave:
link: false
vanilla:
version: 1.21.1
gm4_dev: True

ignore:
Expand Down
9 changes: 1 addition & 8 deletions beet-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ pipeline:
- gm4.plugins.module.default_pack_icon
- gm4.plugins.readme_generator.libraries
meta:
vanilla:
version: 1.21.1
mecha:
formatting:
layout: preserve
Expand All @@ -41,6 +39,7 @@ pipeline:
- gm4.plugins.manifest.update_patch
- gm4.plugins.player_heads
- gm4.plugins.resource_pack
- gm4.plugins.attribute_rewrite
- beet.contrib.model_merging
- beet.contrib.optifine
- beet.contrib.babelbox
Expand All @@ -53,8 +52,6 @@ pipeline:
meta: {copy_files: {data_pack: {LICENSE.md: "../LICENSE.md"}}}
- gm4.plugins.readme_generator
meta:
vanilla:
version: 1.21.1
mecha:
formatting:
layout: preserve
Expand Down Expand Up @@ -87,14 +84,10 @@ pipeline:
- gm4.plugins.manifest.update_patch
- gm4.plugins.resource_pack.pad_model_overrides
meta:
vanilla:
version: 1.21.1
pack_scan: resource_pack

- gm4.plugins.manifest.write_meta

meta:
autosave:
link: false
vanilla:
version: 1.21.1
5 changes: 1 addition & 4 deletions beet-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ pipeline:
- gm4.plugins.output.test
- gm4.plugins.player_heads
- gm4.plugins.resource_pack
- gm4.plugins.attribute_rewrite
- gm4_guidebook.generate_guidebooks.load_page_data
- gm4_guidebook.generate_guidebooks.load_custom_recipes
- gm4.plugins.test.load_tests
- gm4.plugins.test.skip_mecha_lint
pipeline:
- gm4.plugins.write_mcmeta
meta:
vanilla:
version: 1.21.1
mecha:
formatting:
layout: preserve
Expand All @@ -26,5 +25,3 @@ pipeline:
meta:
autosave:
link: false
vanilla:
version: 1.21.1
53 changes: 53 additions & 0 deletions gm4/plugins/attribute_rewrite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from beet import Context, TextFileBase
import re

ATTRIBUTES_RENAMES = {
"minecraft:armor": "minecraft:generic.armor",
"minecraft:armor_toughness": "minecraft:generic.armor_toughness",
"minecraft:attack_damage": "minecraft:generic.attack_damage",
"minecraft:attack_knockback": "minecraft:generic.attack_knockback",
"minecraft:attack_speed": "minecraft:generic.attack_speed",
"minecraft:block_break_speed": "minecraft:player.block_break_speed",
"minecraft:block_interaction_range": "minecraft:player.block_interaction_range",
"minecraft:burning_time": "minecraft:generic.burning_time",
"minecraft:explosion_knockback_resistance": "minecraft:generic.explosion_knockback_resistance",
"minecraft:entity_interaction_range": "minecraft:player.entity_interaction_range",
"minecraft:fall_damage_multiplier": "minecraft:generic.fall_damage_multiplier",
"minecraft:flying_speed": "minecraft:generic.flying_speed",
"minecraft:follow_range": "minecraft:generic.follow_range",
"minecraft:gravity": "minecraft:generic.gravity",
"minecraft:jump_strength": "minecraft:generic.jump_strength",
"minecraft:knockback_resistance": "minecraft:generic.knockback_resistance",
# We only use "minecraft:luck" as a potion/effect, never as attribute
# "minecraft:luck": "minecraft:generic.luck",
"minecraft:max_absorption": "minecraft:generic.max_absorption",
"minecraft:max_health": "minecraft:generic.max_health",
"minecraft:mining_efficiency": "minecraft:player.mining_efficiency",
"minecraft:movement_efficiency": "minecraft:generic.movement_efficiency",
"minecraft:movement_speed": "minecraft:generic.movement_speed",
"minecraft:oxygen_bonus": "minecraft:generic.oxygen_bonus",
"minecraft:safe_fall_distance": "minecraft:generic.safe_fall_distance",
"minecraft:scale": "minecraft:generic.scale",
"minecraft:sneaking_speed": "minecraft:player.sneaking_speed",
"minecraft:spawn_reinforcements": "minecraft:zombie.spawn_reinforcements",
"minecraft:step_height": "minecraft:generic.step_height",
"minecraft:submerged_mining_speed": "minecraft:player.submerged_mining_speed",
"minecraft:sweeping_damage_ratio": "minecraft:player.sweeping_damage_ratio",
"minecraft:water_movement_efficiency": "minecraft:generic.water_movement_efficiency",
}

def beet_default(ctx: Context):
yield

for id, resource in ctx.data.all():
if isinstance(resource, TextFileBase):
resource.source_stop
overlay_text = resource.text
for src_attribute, overlay_attribute in ATTRIBUTES_RENAMES.items():
overlay_text = re.sub("\\b" + src_attribute + "\\b", overlay_attribute, overlay_text)
if overlay_text != resource.text:
overlay_resource = resource.copy()
overlay_resource.text = overlay_text
overlay = ctx.data.overlays["overlay_48"]
overlay.supported_formats = { "min_inclusive": 48, "max_inclusive": 48 }
overlay[id] = overlay_resource
8 changes: 4 additions & 4 deletions gm4/plugins/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

parent_logger = logging.getLogger("gm4.manifest")

SUPPORTED_GAME_VERSIONS = ["1.21", "1.21.1"]
SUPPORTED_GAME_VERSIONS = ["1.21", "1.21.1", "1.21.2"]

# config models for beet.yaml metas
CreditsModel = dict[str, list[str]]
Expand Down Expand Up @@ -145,7 +145,7 @@ def create(ctx: Context):
ctx.cache["gm4_manifest"].json = manifest.dict()

# Read in the previous manifest, if found
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
release_dir = Path('release') / version
manifest_file = release_dir / "meta.json"

Expand All @@ -157,7 +157,7 @@ def create(ctx: Context):
logger.error("No existing meta.json manifest file was located. Build was cancelled to avoid faulty releases.")
sys.exit(1) # quit the build and mark the github action as failed
else:
logger.warn("No existing meta.json manifest file was located")
logger.warning("No existing meta.json manifest file was located")
ctx.cache["previous_manifest"].json = ManifestFileModel(last_commit="",modules=[],libraries={},contributors=[]).dict()


Expand Down Expand Up @@ -219,7 +219,7 @@ def update_patch(ctx: Context):

def write_meta(ctx: Context):
"""Write the updated meta.json file."""
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
release_dir = Path('release') / version
os.makedirs(release_dir, exist_ok=True)

Expand Down
12 changes: 6 additions & 6 deletions gm4/plugins/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def beet_default(ctx: Context):
"""Saves the datapack to the ./out folder in it's exit phase.
Should be first in pipeline to properly wrap all other plugins cleanup phases"""
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
out_dir = Path("out")

yield # wait for exit phase, after other plugins cleanup
Expand All @@ -33,7 +33,7 @@ def beet_default(ctx: Context):

def resource_pack(ctx: Context):
"""Saves the resourcepack to the ./out folder."""
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
out_dir = Path("out")

ctx.assets.save(
Expand All @@ -43,7 +43,7 @@ def resource_pack(ctx: Context):

def release_resource_pack(ctx: Context):
"""Saves the resourcepack to the ./out folder."""
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
release_dir = Path("release") / version

yield
Expand Down Expand Up @@ -82,7 +82,7 @@ def release(ctx: Context):
`BEET_SMITHED_TOKEN` environment variable is set, will try to publish a
new version to Smithed if it doesn't already exist.
"""
version_dir = os.getenv("VERSION", "1.21")
version_dir = os.getenv("VERSION", "1.21.2")
release_dir = Path("release") / version_dir

corrected_project_id = stem if (stem:=ctx.directory.stem).startswith("lib") else ctx.project_id
Expand Down Expand Up @@ -199,7 +199,7 @@ def publish_smithed(ctx: Context, config: ManifestConfig, file_name: str):
"""Attempts to publish pack to smithed"""
auth_token = os.getenv(SMITHED_AUTH_KEY, None)
logger = parent_logger.getChild(f"smithed.{ctx.project_id}")
mc_version_dir = os.getenv("VERSION", "1.21")
mc_version_dir = os.getenv("VERSION", "1.21.2")
manifest = ManifestCacheModel.parse_obj(ctx.cache["gm4_manifest"].json)
project_id = stem if (stem:=ctx.directory.stem).startswith("lib") else ctx.project_id

Expand Down Expand Up @@ -299,7 +299,7 @@ def clear_release(ctx: Context):
1. Deleted modules no longer stick around in the current version
2. Changes to the build system (such as renamed files/folders) are properly reflected
"""
version = os.getenv("VERSION", "1.21")
version = os.getenv("VERSION", "1.21.2")
release_dir = Path("release") / version
shutil.rmtree(release_dir, ignore_errors=True)
os.makedirs(release_dir, exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion gm4/plugins/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def versioned_namespace(ctx: Context, version: Version):
namespace = ctx.project_id if ctx.project_id != 'base' else 'gm4'
versioned_namespace = f"{namespace}-{version.major}.{version.minor}"
ctx.require(rename_files(data_pack={
"match":{"functions": "*", "advancements": "*", "loot_tables": "*", "predicates": "*"},
"match": {"functions": "*", "advancements": "*", "loot_tables": "*", "predicates": "*"} if namespace != 'gm4' else {"functions": "*", "advancements": "*"},
"find": f"{namespace}:([a-z_/]+)",
"replace": f"{versioned_namespace}:\\1"
}))
Expand Down
Loading

0 comments on commit e865ab4

Please sign in to comment.