Skip to content

Commit

Permalink
Merge branch 'master' into dev/ella_immovable_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
EllaCoat committed Sep 16, 2024
2 parents 276bd16 + 8e8ae15 commit 23861f3
Show file tree
Hide file tree
Showing 14 changed files with 514 additions and 117 deletions.
258 changes: 258 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,264 @@
}
]
},
{
"label": "Object/登録処理",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/register.mcfunction",
"content": [
"#> asset:object/%namespace%/register",
"#",
"# Objectのデータを指定",
"#",
"# @within function asset:object/alias/%id%/register",
"",
"# 他のモブに継承されることを許可するか (boolean) (オプション)",
" # data modify storage asset:object ExtendsSafe set value ",
"# 継承されることを前提とした、抽象的なオブジェクトであるかどうか(boolean)",
" data modify storage asset:object IsAbstract set value false",
"# ID (int)",
" data modify storage asset:object ID set value %id%",
"# フィールド",
" # data modify storage asset:object Field.myValue set value "
]
},
{
"type": "file",
"rel": "data/asset/functions/object/alias/%id%/register.mcfunction",
"content": [
"#> asset:object/alias/%id%/register",
"#",
"# Objectのデータ指定処理のエイリアス",
"#",
"# @within asset_manager:object/summon/summon.m",
"",
"# 元の登録処理を呼び出す",
" function asset:object/%namespace%/register"
]
},
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/summon/debug.mcfunction",
"content": [
"#> asset:mob/%namespace%/summon/debug",
"#",
"# 動作チェック用の召喚処理 使い終わったら消してもいいかも",
"#",
"# @user",
"# @private",
"",
"# 召喚",
" data modify storage api: Argument.ID set value %id%",
" function api:object/summon"
]
}
],
"customQuestion": [
{
"name": "id",
"question": "ObjectのID",
"pattern": "[1-9][0-9]*",
"patternErrorMessage": "数値のみが許されるよ"
}
]
},
{
"label": "Object/ 召喚処理",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/summon/.mcfunction",
"content": [
"#> asset:object/%namespace%/summon/",
"#",
"# Object召喚処理の呼び出し時に実行されるfunction",
"#",
"# @within asset:object/alias/%id%/summon",
"",
"# 元となるEntityを召喚する",
" summon %entity% ~ ~ ~ {Tags:[\"ObjectInit\"]}",
"",
"# 実装フラグを立てる",
"data modify storage asset:object Implement set value true"
]
},
{
"type": "file",
"rel": "data/asset/functions/object/alias/%id%/summon.mcfunction",
"content": [
"#> asset:object/alias/%id%/summon",
"#",
"# Object召喚処理のエイリアス",
"#",
"# @within asset_manager:object/summon/summon.m",
"",
"# 元の召喚処理を呼び出す",
" function asset:object/%namespace%/summon/"
]
}
],
"customQuestion": [
{
"name": "id",
"question": "ObjectのID",
"pattern": "[1-9][0-9]*",
"patternErrorMessage": "数値のみが許されるよ"
},
{
"name": "entity",
"question": "元となるentity",
"pattern": "area_effect_cloud|armor_stand|arrow|axolotl|bat|bee|blaze|boat|cat|cave_spider|chest_minecart|chicken|cod|command_block_minecart|cow|creeper|dolphin|donkey|dragon_fireball|drowned|egg|elder_guardian|end_crystal|ender_dragon|ender_pearl|enderman|endermite|evoker|evoker_fangs|experience_bottle|experience_orb|eye_of_ender|falling_block|fireball|firework_rocket|fox|furnace_minecart|ghast|giant|glow_item_frame|glow_squid|goat|guardian|hoglin|hopper_minecart|horse|husk|illusioner|iron_golem|item|item_frame|leash_knot|lightning_bolt|llama|llama_spit|magma_cube|marker|minecart|mooshroom|mule|ocelot|painting|panda|parrot|phantom|pig|piglin|piglin_brute|pillager|polar_bear|potion|pufferfish|rabbit|ravager|salmon|sheep|shulker|shulker_bullet|silverfish|skeleton|skeleton_horse|slime|small_fireball|snow_golem|snowball|spawner_minecart|spectral_arrow|spider|squid|stray|strider|tnt|tnt_minecart|trader_llama|trident|tropical_fish|turtle|vex|villager|vindicator|wandering_trader|witch|wither|wither_skeleton|wither_skull|wolf|zoglin|zombie|zombie_horse|zombie_villager|zombified_piglin",
"patternErrorMessage": "Entityの名前のみが許されるよ"
}
]
},
{
"label": "Object/トリガー: tick",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/tick/.mcfunction",
"content": [
"#> asset:object/%namespace%/tick/",
"#",
"# Objectのtick時の処理",
"#",
"# @within asset:object/alias/%id%/tick",
"",
"# Tick加算",
" scoreboard players add @s General.Object.Tick 1",
"",
"# 消滅処理",
" kill @s[scores={General.Object.Tick=1000..}]",
"",
"# 実装フラグを立てる",
"data modify storage asset:object Implement set value true"
]
},
{
"type": "file",
"rel": "data/asset/functions/object/alias/%id%/tick.mcfunction",
"content": [
"#> asset:object/alias/%id%/tick",
"#",
"# Tick時処理のエイリアス",
"#",
"# @within asset_manager:object/tick/tick.m",
"",
"# 元のTick処理を呼び出す",
" function asset:object/%namespace%/tick/"
]
}
],
"customQuestion": [
{
"name": "id",
"question": "ObjectのID",
"pattern": "[1-9][0-9]*",
"patternErrorMessage": "数値のみが許されるよ"
}
]
},
{
"label": "Object/テンプレート: 初期化処理",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/load.mcfunction",
"content": [
"#> asset:object/%namespace%/load",
"#",
"# Objectに利用するスコアボード等の初期化処理",
"#",
"# @within tag/function asset:object/load",
"",
"#> 定義類はここに",
"# @within function asset:object/%namespace%/**",
" scoreboard objectives add "
]
},
{
"type": "file",
"rel": "data/asset/tags/functions/object/load.json",
"content": {
"values": [
"asset:object/%namespace%/load"
]
},
"append": {
"addFirst": true,
"key": "values",
"elem": "asset:object/%namespace%/load"
}
}
]
},
{
"label": "Object/テンプレート: _index.d ",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/_index.d.mcfunction",
"content": [
"#> asset:object/%namespace%/_index.d",
"# @private",
"",
"#> tag",
"# @within function asset:object/%namespace%/**",
" #declare"
]
}
]
},
{
"label": "Object/メソッド",
"generates": [
{
"type": "file",
"rel": "data/asset/functions/object/%namespace%/%method_name%/.mcfunction",
"content": [
"#> asset:object/%namespace%/%method_name%/",
"#",
"# 継承先などから実行される処理",
"#",
"# @within asset:object/alias/%id%/%method_name%",
"",
"# 実装フラグを立てる",
" data modify storage asset:object Implement set value true"
]
},
{
"type": "file",
"rel": "data/asset/functions/object/alias/%id%/%method_name%.mcfunction",
"content": [
"#> asset:object/alias/%id%/%method_name%",
"#",
"# メソッド処理のエイリアス",
"#",
"# @within asset_manager:object/tick/tick.m",
"",
"# 元のメソッド処理を呼び出す",
" function asset:object/%namespace%/%method_name%/"
]
}
],
"customQuestion": [
{
"name": "method_name",
"question": "メソッドの名前",
"pattern": "[a-z0-9./_-]*",
"patternErrorMessage": "使用できない文字が入っているようです"
},
{
"name": "id",
"question": "ObjectのID",
"pattern": "[1-9][0-9]*",
"patternErrorMessage": "数値のみが許されるよ"
}
]
},
],
"mcdutil.createDatapackTemplate.defaultFolder": false,
"mcdutil.createDatapackTemplate.defaultLoadAndTick": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0124.darkness/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

execute if data storage asset:context {id:124} run function asset:effect/0124.darkness/end/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0124.darkness/_/register
#
#
#
# @within tag/function asset:effect/register

execute if data storage asset:context {id:124} run function asset:effect/0124.darkness/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0124.darkness/_/remove
#
# Effectが神器や牛乳によって削除された時に実行されるfunction
#
# @within tag/function asset:effect/remove

execute if data storage asset:context {id:124} run function asset:effect/0124.darkness/remove/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0124.darkness/_/tick
#
# Effectが発動している間毎tick実行されるfunction
#
# @within tag/function asset:effect/tick

execute if data storage asset:context {id:124} run function asset:effect/0124.darkness/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0124.darkness/end/
#
# Effectの効果が切れた時の処理
#
# @within function asset:effect/0124.darkness/_/end

# 暗闇を削除
effect clear @s darkness
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:effect/0124.darkness/register
#
# Effectのデータを指定
#
# @within function asset:effect/0124.darkness/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 124
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"暗闇"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value '{"text":"プレイヤーの視界を暗くする"}'
# 効果時間 (int) (default = API || error)
# data modify storage asset:effect Duration set value
# スタック (int) (default = API || 1)
# data modify storage asset:effect Stack set value
# 効果時間の操作方法 (default = API || "replace")
data modify storage asset:effect DurationOperation set value "forceReplace"
# スタックの操作方法 (default = API || "replace")
data modify storage asset:effect StackOperation set value "forceReplace"
# 最大効果時間 (int) (default = 2147483647)
# data modify storage asset:effect MaxDuration set value
# 最大スタック (int) (default = 2147483647)
data modify storage asset:effect MaxStack set value 1
# 悪い効果か否か (boolean)
data modify storage asset:effect IsBadEffect set value true
# 死亡時のエフェクトの処理 (default = "remove")
# data modify storage asset:effect ProcessOnDied set value
# 消すのに必要なレベル (int) (default = 1)
data modify storage asset:effect RequireClearLv set value 3

# フィールド
# data modify storage asset:effect Field set value {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0124.darkness/remove/
#
# Effectが削除された時の処理
#
# @within function asset:effect/0124.darkness/_/remove

# 暗闇を削除
effect clear @s darkness
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0124.darkness/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0124.darkness/_/tick

# 暗闇を付与
effect give @s darkness infinite 0 true
5 changes: 3 additions & 2 deletions Asset/data/asset/tags/functions/effect/end.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"asset:effect/0607.sedation/_/end",
"asset:effect/0608.sinking/_/end",
"asset:effect/0612.infringement/_/end",
"asset:effect/0613.white_curse/_/end"
"asset:effect/0613.white_curse/_/end",
"asset:effect/0124.darkness/_/end"
]
}
}
5 changes: 3 additions & 2 deletions Asset/data/asset/tags/functions/effect/register.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"asset:effect/0607.sedation/_/register",
"asset:effect/0608.sinking/_/register",
"asset:effect/0612.infringement/_/register",
"asset:effect/0613.white_curse/_/register"
"asset:effect/0613.white_curse/_/register",
"asset:effect/0124.darkness/_/register"
]
}
}
5 changes: 3 additions & 2 deletions Asset/data/asset/tags/functions/effect/remove.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"asset:effect/0607.sedation/_/remove",
"asset:effect/0608.sinking/_/remove",
"asset:effect/0612.infringement/_/remove",
"asset:effect/0613.white_curse/_/remove"
"asset:effect/0613.white_curse/_/remove",
"asset:effect/0124.darkness/_/remove"
]
}
}
Loading

0 comments on commit 23861f3

Please sign in to comment.