Skip to content

Commit 4e26709

Browse files
misoderuncows
andauthored
Update to 1.21.11 (#1226)
* Add 1.21.11 to test matrix * Update packtest version to fix crash * Rename gamerules * Exclude enchantable/sword in custom crafter item tags * Update pack format * Add `on_pass` item modifier for lightning in a bottle * Update AngryAt and AngerTime bee fields * Add new entities to reeling interactions (#1227) * Don't include minor pack format in pack.mcmeta * Update biome-extensions library for cooler caves * Remove unused poetry.lock file * Fix invalid llama Items NBT and HandItems * Update entity type tags with new mobs * Add spears to disassemblers * Clear disassemblers armor stand mainhand after process * Add nautlius and zombie nautilus to reeling leashable (#1229) * 1.21.11 Lunge Enchantment Compat (#1230) * Bookshelf Inspectors * Enchantment Extractors * Book Binders --------- Co-authored-by: runcows <[email protected]>
1 parent ef8a755 commit 4e26709

File tree

203 files changed

+10386
-2134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+10386
-2134
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ jobs:
101101
fabric_server_url: https://meta.fabricmc.net/v2/versions/loader/1.21.10/0.18.1/1.1.0/server/jar
102102
fabric_api_url: https://cdn.modrinth.com/data/P7dR8mSH/versions/dQ3p80zK/fabric-api-0.138.3%2B1.21.10.jar
103103
packtest_url: https://cdn.modrinth.com/data/XsKUhp45/versions/11yGLsYO/packtest-2.3-beta1-mc1.21.10.jar
104+
- version: '1.21.11'
105+
fabric_server_url: https://meta.fabricmc.net/v2/versions/loader/1.21.11-rc2/0.18.1/1.1.0/server/jar
106+
fabric_api_url: https://cdn.modrinth.com/data/P7dR8mSH/versions/RDb9rvBm/fabric-api-0.139.4%2B1.21.11.jar
107+
packtest_url: https://cdn.modrinth.com/data/XsKUhp45/versions/GN6fvTsW/packtest-2.4-beta2-mc1.21.11.jar
104108
name: 'test-${{ matrix.version }}'
105109
runs-on: ubuntu-24.04
106110
steps:

base/data/gm4/tags/entity_type/hostile.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"minecraft:hoglin",
1414
"minecraft:husk",
1515
"minecraft:magma_cube",
16+
{"id": "minecraft:parched", "required": false},
1617
"minecraft:phantom",
1718
"minecraft:piglin_brute",
1819
"minecraft:pillager",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"values": [
3+
{"id": "minecraft:camel_husk", "required": false},
34
"minecraft:cave_spider",
45
"minecraft:creaking",
56
"minecraft:drowned",
67
"minecraft:enderman",
78
"minecraft:piglin",
89
"minecraft:spider",
10+
{"id": "minecraft:zombie_nautilus", "required": false},
911
"minecraft:zombified_piglin"
1012
]
1113
}

base/data/gm4/tags/entity_type/passive.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"minecraft:horse",
1818
"minecraft:mooshroom",
1919
"minecraft:mule",
20+
{"id": "minecraft:nautilus", "required": false},
2021
"minecraft:ocelot",
2122
"minecraft:parrot",
2223
"minecraft:pig",

gm4/plugins/backwards.py

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
2+
import re
23
from typing import Any, Tuple, Callable
3-
from beet import Context, Pack, NamespaceFile, ItemModel
4+
from beet import Context, Pack, NamespaceFile, ItemModel, Function
45

56
logger = logging.getLogger("gm4.backwards")
67

@@ -11,38 +12,65 @@ def beet_default(ctx: Context):
1112
# edited item model definition - replaced head with player_head
1213
backport(ctx.assets, 63, playerhead_models_1_21_5)
1314

15+
# renamed gamerules
16+
backport(ctx.data, 92, rename_gamerules)
17+
1418

1519
def playerhead_models_1_21_5(id: str, resource: NamespaceFile):
1620
if not isinstance(resource, ItemModel):
1721
return None
22+
if id != "minecraft:player_head":
23+
return None
24+
25+
def recursive_replace(compound: dict[str,Any]):
26+
for key, val in compound.items():
27+
# recurse down the tree
28+
if isinstance(val, list):
29+
for subval in val: # type: ignore
30+
if isinstance(subval, dict):
31+
recursive_replace(subval) # type: ignore
32+
elif isinstance(val, dict):
33+
recursive_replace(val) # type: ignore
34+
# then replace matching compounds
35+
match val:
36+
case {
37+
"type": "minecraft:special",
38+
"model": {
39+
"type": "minecraft:player_head"
40+
}
41+
}:
42+
compound[key]["model"]["type"] = "minecraft:head"
43+
compound[key]["model"]["kind"] = "player"
44+
case _: # type: ignore
45+
pass
46+
47+
overlay = resource.copy()
48+
recursive_replace(overlay.data)
49+
return overlay
50+
51+
52+
# Only gamerules that are actually used are replaced
53+
GAMERULES_RENAMES = {
54+
"command_block_output": "commandBlockOutput",
55+
"spawn_phantoms": "doInsomnia",
56+
"natural_health_regeneration": "naturalRegeneration",
57+
"random_tick_speed": "randomTickSpeed",
58+
"send_command_feedback": "sendCommandFeedback",
59+
"show_death_messages": "showDeathMessages",
60+
}
61+
62+
63+
def rename_gamerules(id: str, resource: NamespaceFile):
64+
if not isinstance(resource, Function):
65+
return None
66+
text = resource.text
67+
for new_gamerule, old_gamerule in GAMERULES_RENAMES.items():
68+
text = re.sub(f"gamerule (minecraft:)?{new_gamerule}\\b", f"gamerule {old_gamerule}", text)
69+
if text == resource.text:
70+
return None
1871
overlay = resource.copy()
19-
json = overlay.data
20-
if id=="minecraft:player_head":
21-
def recursive_replace(compound: dict[str,Any]):
22-
for key, val in compound.items():
23-
# recurse down the tree
24-
if isinstance(val, list):
25-
for subval in val: # type: ignore
26-
if isinstance(subval, dict):
27-
recursive_replace(subval) # type: ignore
28-
elif isinstance(val, dict):
29-
recursive_replace(val) # type: ignore
30-
# then replace matching compounds
31-
match val:
32-
case {
33-
"type": "minecraft:special",
34-
"model": {
35-
"type": "minecraft:player_head"
36-
}
37-
}:
38-
compound[key]["model"]["type"] = "minecraft:head"
39-
compound[key]["model"]["kind"] = "player"
40-
case _: # type: ignore
41-
pass
42-
43-
recursive_replace(json)
44-
return overlay
45-
return None
72+
overlay.text = text
73+
return overlay
4674

4775

4876
def backport(pack: Pack[Any], format: int, run: Callable[[str, NamespaceFile], NamespaceFile | None]):

gm4/plugins/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

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

24-
SUPPORTED_GAME_VERSIONS = ["1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10"]
24+
SUPPORTED_GAME_VERSIONS = ["1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10", "1.21.11"]
2525

2626
# config models for beet.yaml metas
2727
CreditsModel = dict[str, list[str]]

gm4/plugins/write_mcmeta.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ def beet_default(ctx: Context):
1010
manifest_entry = {v.id:v for v in (manifest.modules|manifest.libraries).values()}.get(ctx.project_id, NoneAttribute())
1111

1212
ctx.data.pack_format = 71
13-
ctx.data.supported_formats = {"min_inclusive": 71, "max_inclusive": 88}
13+
ctx.data.supported_formats = {"min_inclusive": 71, "max_inclusive": 94}
1414
ctx.data.min_format = 71
15-
ctx.data.max_format = (88, 0)
15+
ctx.data.max_format = 94
1616

1717
ctx.assets.pack_format = 55
18-
ctx.assets.supported_formats = {"min_inclusive": 55, "max_inclusive": 69}
18+
ctx.assets.supported_formats = {"min_inclusive": 55, "max_inclusive": 75}
1919
ctx.assets.min_format = 55
20-
ctx.assets.max_format = (69, 0)
20+
ctx.assets.max_format = 75
2121

2222
for pack in ctx.packs:
2323
pack.description = [
2424
ctx.project_name,
2525
"\n",
2626
{
27-
"text": f"Gamemode 4 (1.21.5 - 1.21.9)",
27+
"text": f"Gamemode 4 (1.21.5+)",
2828
"color": "#4AA0C7"
2929
}
3030
]

gm4_apple_trees/data/gm4_apple_trees/function/wandering_trader/register_trade.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# run from gm4_fruiting_trees:wandering_trader/add_trade
55

66
# apple sapling
7-
execute if predicate gm4_apple_trees:overworld run summon trader_llama ~ 0 ~ {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option","gm4_new_trade_option"],Items:[{},{id:"minecraft:emerald",count:5,Slot:1b},{}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:8,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
7+
execute if predicate gm4_apple_trees:overworld run summon trader_llama ~ 0 ~ {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option","gm4_new_trade_option"],Items:[{id:"minecraft:emerald",count:5,Slot:1b}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:8,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
88
loot replace entity @e[type=trader_llama,limit=1,tag=gm4_new_trade_option] horse.0 loot gm4_apple_trees:items/apple_tree_sapling
99
tag @e[type=trader_llama] remove gm4_new_trade_option

gm4_balloon_animals/data/gm4_balloon_animals/function/wandering_trader/trade/add_bee_nest.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
tp @s ~ 0 ~
66

7-
data merge entity @s {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option"],Items:[{},{id:"minecraft:emerald",count:8,Slot:1b},{}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:1,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
7+
data merge entity @s {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option"],Items:[{id:"minecraft:emerald",count:8,Slot:1b}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:1,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
88

99
loot replace entity @s horse.0 loot gm4_balloon_animals:bee_nest

gm4_balloon_animals/data/gm4_balloon_animals/function/wandering_trader/trade/add_chicken_egg.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
tp @s ~ 0 ~
66

7-
data merge entity @s {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option"],Items:[{},{id:"minecraft:emerald",count:2,Slot:1b},{}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1b,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:4,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
7+
data merge entity @s {Silent:1b,NoGravity:1b,Invulnerable:1b,ChestedHorse:1b,Variant:0,Strength:1,DespawnDelay:1,Tags:["gm4_trade_option"],Items:[{id:"minecraft:emerald",count:2,Slot:1b}],equipment:{body:{id:"minecraft:light_blue_carpet",count:1b,components:{"minecraft:custom_data":{gm4_trades:{options:{maxUses:4,rewardXp:1b,xp:1,priceMultiplier:0.05f}}}}}}}
88

99

1010
execute store result score $variant_id gm4_balloon_animals_data run random value 0..2

0 commit comments

Comments
 (0)