Skip to content

Commit

Permalink
feat: add commands.json changes for 1.21.2 and 1.21.4 (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
misode authored Dec 12, 2024
1 parent 65d4fd8 commit d06e814
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 30 deletions.
137 changes: 124 additions & 13 deletions mecha/resources/1_21.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -40,7 +43,10 @@
}
},
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -50,7 +56,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -60,7 +69,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
}
Expand Down Expand Up @@ -89,7 +101,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -109,7 +124,10 @@
}
},
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -119,7 +137,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
},
Expand All @@ -129,7 +150,10 @@
"advancement": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:advancement"
}
}
}
}
Expand Down Expand Up @@ -167,6 +191,10 @@
},
"executable": true
},
"reset": {
"type": "literal",
"executable": true
},
"set": {
"type": "literal",
"children": {
Expand Down Expand Up @@ -5696,7 +5724,7 @@
"add": {
"type": "literal",
"children": {
"targets": {
"target": {
"type": "argument",
"children": {
"amount": {
Expand Down Expand Up @@ -5726,7 +5754,7 @@
"query": {
"type": "literal",
"children": {
"targets": {
"target": {
"type": "argument",
"children": {
"levels": {
Expand All @@ -5749,7 +5777,7 @@
"set": {
"type": "literal",
"children": {
"targets": {
"target": {
"type": "argument",
"children": {
"amount": {
Expand Down Expand Up @@ -6082,6 +6110,17 @@
},
"executable": true
},
"disablePlayerMovementCheck": {
"type": "literal",
"children": {
"value": {
"type": "argument",
"executable": true,
"parser": "brigadier:bool"
}
},
"executable": true
},
"disableRaids": {
"type": "literal",
"children": {
Expand Down Expand Up @@ -6390,6 +6429,21 @@
},
"executable": true
},
"minecartMaxSpeed": {
"type": "literal",
"children": {
"value": {
"type": "argument",
"executable": true,
"parser": "brigadier:integer",
"properties": {
"max": 1000,
"min": 1
}
}
},
"executable": true
},
"mobExplosionDropDecay": {
"type": "literal",
"children": {
Expand Down Expand Up @@ -8629,7 +8683,10 @@
"recipe": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:recipe"
}
}
},
"parser": "minecraft:entity",
Expand All @@ -8653,7 +8710,10 @@
"recipe": {
"type": "argument",
"executable": true,
"parser": "minecraft:resource_location"
"parser": "minecraft:resource_key",
"properties": {
"registry": "minecraft:recipe"
}
}
},
"parser": "minecraft:entity",
Expand Down Expand Up @@ -8720,6 +8780,57 @@
}
}
},
"rotate": {
"type": "literal",
"children": {
"target": {
"type": "argument",
"children": {
"facing": {
"type": "literal",
"children": {
"entity": {
"type": "literal",
"children": {
"facingEntity": {
"type": "argument",
"children": {
"facingAnchor": {
"type": "argument",
"executable": true,
"parser": "minecraft:entity_anchor"
}
},
"executable": true,
"parser": "minecraft:entity",
"properties": {
"type": "entities",
"amount": "single"
}
}
}
},
"facingLocation": {
"type": "argument",
"executable": true,
"parser": "minecraft:vec3"
}
}
},
"rotation": {
"type": "argument",
"executable": true,
"parser": "minecraft:rotation"
}
},
"parser": "minecraft:entity",
"properties": {
"type": "entities",
"amount": "single"
}
}
}
},
"save-all": {
"type": "literal",
"children": {
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/parse__command_examples__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2930,7 +2930,7 @@
<class 'mecha.ast.AstCommand'>
location: SourceLocation(pos=3022, lineno=64, colno=1)
end_location: SourceLocation(pos=3051, lineno=64, colno=30)
identifier: 'experience:query:targets:levels'
identifier: 'experience:query:target:levels'
arguments:
<class 'mecha.ast.AstPlayerName'>
location: SourceLocation(pos=3039, lineno=64, colno=18)
Expand Down
41 changes: 25 additions & 16 deletions tests/snapshots/spec__prototypes__0.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"advancement:revoke:targets:until:advancement",
"attribute:target:attribute:base:get",
"attribute:target:attribute:base:get:scale",
"attribute:target:attribute:base:reset",
"attribute:target:attribute:base:set:value",
"attribute:target:attribute:get",
"attribute:target:attribute:get:scale",
Expand Down Expand Up @@ -589,14 +590,14 @@
"execute:unless:score:target:targetObjective:>=:source:sourceObjective:subcommand",
"execute:unless:score:target:targetObjective:matches:range",
"execute:unless:score:target:targetObjective:matches:range:subcommand",
"experience:add:targets:amount",
"experience:add:targets:amount:levels",
"experience:add:targets:amount:points",
"experience:query:targets:levels",
"experience:query:targets:points",
"experience:set:targets:amount",
"experience:set:targets:amount:levels",
"experience:set:targets:amount:points",
"experience:add:target:amount",
"experience:add:target:amount:levels",
"experience:add:target:amount:points",
"experience:query:target:levels",
"experience:query:target:points",
"experience:set:target:amount",
"experience:set:target:amount:levels",
"experience:set:target:amount:points",
"fill:from:to:block",
"fill:from:to:block:destroy",
"fill:from:to:block:hollow",
Expand Down Expand Up @@ -633,6 +634,8 @@
"gamerule:commandModificationBlockLimit:value",
"gamerule:disableElytraMovementCheck",
"gamerule:disableElytraMovementCheck:value",
"gamerule:disablePlayerMovementCheck",
"gamerule:disablePlayerMovementCheck:value",
"gamerule:disableRaids",
"gamerule:disableRaids:value",
"gamerule:doDaylightCycle",
Expand Down Expand Up @@ -689,6 +692,8 @@
"gamerule:maxCommandForkCount:value",
"gamerule:maxEntityCramming",
"gamerule:maxEntityCramming:value",
"gamerule:minecartMaxSpeed",
"gamerule:minecartMaxSpeed:value",
"gamerule:mobExplosionDropDecay",
"gamerule:mobExplosionDropDecay:value",
"gamerule:mobGriefing",
Expand Down Expand Up @@ -937,6 +942,10 @@
"return:value",
"ride:target:dismount",
"ride:target:mount:vehicle",
"rotate:target:facing:entity:facingEntity",
"rotate:target:facing:entity:facingEntity:facingAnchor",
"rotate:target:facing:facingLocation",
"rotate:target:rotation",
"save-all",
"save-all:flush",
"save-off",
Expand Down Expand Up @@ -1123,12 +1132,12 @@
"worldborder:set:distance:time",
"worldborder:warning:distance:distance",
"worldborder:warning:time:time",
"xp:add:targets:amount",
"xp:add:targets:amount:levels",
"xp:add:targets:amount:points",
"xp:query:targets:levels",
"xp:query:targets:points",
"xp:set:targets:amount",
"xp:set:targets:amount:levels",
"xp:set:targets:amount:points"
"xp:add:target:amount",
"xp:add:target:amount:levels",
"xp:add:target:amount:points",
"xp:query:target:levels",
"xp:query:target:points",
"xp:set:target:amount",
"xp:set:target:amount:levels",
"xp:set:target:amount:points"
]

0 comments on commit d06e814

Please sign in to comment.