Skip to content

Commit

Permalink
feat: Backport suppress_power test files to match 1.21 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shap-po committed Oct 2, 2024
1 parent a7a01f3 commit 5cd9260
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,28 @@
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"power": "*:*_power_hit",
"power": "*:*_power_active1",
"powers": [
"*:*_power_active1"
"*:*_power_hit"
],
"duration": 40,
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Suppressed"
"command": "say Suppressed powers by references: '*:*_power_active1', '*:*_power_hit'"
}
}
}
}
},

"power_hit": {
"type": "apoli:action_on_hit",
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Hit"
}
}
},

"power_active1": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 1"
"command": "say Suppress by reference: Active; Should be suppressed"
}
},

Expand All @@ -49,7 +38,18 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 2"
"command": "say Suppress by reference: Active; Should not be suppressed"
}
},

"power_hit": {
"type": "apoli:action_on_hit",
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Suppress by reference: Hit; Should be suppressed"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Suppress by source: Active; Should not be suppressed"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Suppress by source: Active"
"command": "say Suppress by source: Active; Should be suppressed"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Suppressed"
"command": "say Suppressed powers by source: 'apoli:command'"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"type": "shappoli:suppress_power",
"power_type": "apoli:active_self",
"power_types": [
"shappoli:action_on_trinket_update",
"test:nonexistent_power"
"shappoli:action_on_trinket_change"
],
"ignored_powers": [
"*:*_power_active2"
Expand All @@ -21,7 +20,7 @@
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Suppressed"
"command": "say Suppressed powers by types: 'apoli:active_self', 'shappoli:action_on_trinket_update'; Ignored power: '*:*_power_active2'"
}
}
}
Expand All @@ -33,7 +32,7 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 1"
"command": "say Suppress by type: Active; Should be suppressed"
}
},

Expand All @@ -42,15 +41,15 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 2"
"command": "say Suppress by type: Active; Should not be suppressed (ignored)"
}
},

"power_trinket": {
"type": "shappoli:action_on_trinket_update",
"type": "shappoli:action_on_trinket_change",
"entity_action_on_equip": {
"type": "apoli:execute_command",
"command": "say Equipped"
"command": "say Suppress by type: Trinket; Should be suppressed"
},
"item_condition": {
"type": "apoli:empty",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"type": "apoli:multiple",

"action_no_fields": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:selector_action",
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"duration": 40
}
}
},

"action_nonexisting_power": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:selector_action",
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"duration": 40,
"power": "test:nonexisting_power"
}
}
},

"action_nonexisting_power_type": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:selector_action",
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"duration": 40,
"power_type": "test:nonexisting_power_type"
}
}
},

"power_no_fields": {
"type": "shappoli:suppress_power"
},

"no_condition_suppressor": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:selector_action",
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"duration": 40,
"power": "*:*_no_condition_suppressed",
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Warning check: No condition"
}
}
}
}
},

"no_condition_suppressed": {
"type": "apoli:attribute",
"modifier": {
"id": "shappoli:suppress_power/multiple/suppressed/attribute/health",
"attribute": "minecraft:generic.max_health",
"operation": "addition",
"value": 1
},
"update_health": true
},

"multiple_suppressor": {
"type": "apoli:action_on_block_place",
"entity_action": {
"type": "apoli:selector_action",
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"duration": 40,
"power": "*:*",
"powers": [
"*:*_power_hit"
],
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Warning check: Suppressed multiple powers"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Hit"
"command": "say Suppress multiple powers: Hit; Should be suppressed"
}
}
},

"power_active": {
"power_active1": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active"
"command": "say Suppress multiple powers: Active; Should be suppressed"
}
},

"attribute": {
"type": "apoli:attribute",
"modifier": {
"attribute": "minecraft:generic.max_health",
"operation": "addition",
"value": 4
},
"update_health": true
"power_active2": {
"type": "apoli:active_self",
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Suppress multiple powers: Active; Should not be suppressed"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"selector": "@s",
"bientity_action": {
"type": "shappoli:suppress_power",
"power": "*:suppress_multiple/suppressed",
"power": "*:suppress_power/multiple/suppressed",
"ignored_power": "*:suppress_power/multiple/suppressed_power_active2",
"duration": 40,
"bientity_action": {
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Suppressed"
"command": "say Suppressed multiple powers from power 'shappoli:suppress_power/multiple/suppressed'"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
"*:suppress_power_multiple_suppressed"
],
"condition": {
"type": "apoli:on_block",
"block_condition": {
"type": "apoli:block",
"block": "minecraft:stone"
}
"type": "apoli:sneaking"
}
},

Expand All @@ -23,7 +19,7 @@
"type": "apoli:actor_action",
"action": {
"type": "apoli:execute_command",
"command": "say Hit"
"command": "say Suppress by suppressor power: Hit; Should be suppressed"
}
}
},
Expand All @@ -33,7 +29,7 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 1"
"command": "say Suppress by suppressor power: Active; Should be suppressed"
}
},

Expand All @@ -42,7 +38,7 @@
"key": "key.attack",
"entity_action": {
"type": "apoli:execute_command",
"command": "say Active 2"
"command": "say Suppress by suppressor power: Active; Should not be suppressed"
}
}
}

0 comments on commit 5cd9260

Please sign in to comment.