Skip to content

Commit

Permalink
add some planes
Browse files Browse the repository at this point in the history
  • Loading branch information
uran247 committed Aug 8, 2023
1 parent d7773fc commit 77ff591
Show file tree
Hide file tree
Showing 49 changed files with 648 additions and 119 deletions.
5 changes: 5 additions & 0 deletions data/advancements/functions/give-plane.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ loot give @s[advancements={plane-data:crafting/plane/la5=true}] loot plane-data:
loot give @s[advancements={plane-data:crafting/plane/il2=true}] loot plane-data:il2
loot give @s[advancements={plane-data:crafting/plane/pe-2=true}] loot plane-data:pe-2
loot give @s[advancements={plane-data:crafting/plane/mig15bis=true}] loot plane-data:mig15bis
loot give @s[advancements={plane-data:crafting/plane/d520=true}] loot plane-data:d520
loot give @s[advancements={plane-data:crafting/plane/mc202=true}] loot plane-data:mc202
loot give @s[advancements={plane-data:crafting/plane/saab21=true}] loot plane-data:saab21
loot give @s[advancements={plane-data:crafting/plane/saab29f=true}] loot plane-data:saab29f
loot give @s[advancements={plane-data:crafting/plane/re2005=true}] loot plane-data:re2005
5 changes: 5 additions & 0 deletions data/advancements/functions/take-plane-recipe.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ recipe take @s[advancements={plane-data:crafting/plane/la5=true}] plane-data:pla
recipe take @s[advancements={plane-data:crafting/plane/il2=true}] plane-data:plane/il2-recipe
recipe take @s[advancements={plane-data:crafting/plane/pe-2=true}] plane-data:plane/pe-2-recipe
recipe take @s[advancements={plane-data:crafting/plane/mig15bis=true}] plane-data:plane/mig15bis-recipe
recipe take @s[advancements={plane-data:crafting/plane/d520=true}] plane-data:plane/d520-recipe
recipe take @s[advancements={plane-data:crafting/plane/mc202=true}] plane-data:plane/mc202-recipe
recipe take @s[advancements={plane-data:crafting/plane/saab21=true}] plane-data:plane/saab21-recipe
recipe take @s[advancements={plane-data:crafting/plane/saab29f=true}] plane-data:plane/saab29f-recipe
recipe take @s[advancements={plane-data:crafting/plane/re2005=true}] plane-data:plane/re2005-recipe
2 changes: 1 addition & 1 deletion data/constructor/functions/addstorage.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data merge storage minecraft:plane-datapack {temporary:{Pos:[0.0d,0.0d,0.0d]},It
data merge storage minecraft:plane-datapack-weapon {gun-data:[{plane-id:0,Pos:[0.0,0.0,0.0],speed:[0.0,0.0,0.0]}]}

#data version指定
execute store success score #is-different-data vp.reg1 run data modify storage minecraft:plane-datapack data-version set value "0.9.1.000000121"
execute store success score #is-different-data vp.reg1 run data modify storage minecraft:plane-datapack data-version set value "0.9.1.000000142"

#航空機個別ストレージ作成
execute if score #is-different-data vp.reg1 matches 1 run function #constructor:add-storage
Expand Down
5 changes: 5 additions & 0 deletions data/constructor/functions/take-plane-recipe-force.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ recipe take @a plane-data:plane/la5-recipe
recipe take @a plane-data:plane/il2-recipe
recipe take @a plane-data:plane/pe-2-recipe
recipe take @a plane-data:plane/mig15bis-recipe
recipe take @a plane-data:plane/d520-recipe
recipe take @a plane-data:plane/mc202-recipe
recipe take @a plane-data:plane/saab21-recipe
recipe take @a plane-data:plane/saab29f-recipe
recipe take @a plane-data:plane/re2005-recipe
3 changes: 2 additions & 1 deletion data/constructor/tags/functions/add-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"plane-data:saab21/saab21-storage",
"plane-data:mc202/mc202-storage",
"plane-data:d520/d520-storage",
"plane-data:me163b/me163b-storage"
"plane-data:me163b/me163b-storage",
"plane-data:re2005/re2005-storage"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ execute as @s[tag=saab21] at @s run function plane-data:saab21/saab21-2-item
execute as @s[tag=mc202] at @s run function plane-data:mc202/mc202-2-item
execute as @s[tag=d520] at @s run function plane-data:d520/d520-2-item
execute as @s[tag=me163b] at @s run function plane-data:me163b/me163b-2-item
execute as @s[tag=re2005] at @s run function plane-data:re2005/re2005-2-item
35 changes: 35 additions & 0 deletions data/plane-data/advancements/crafting/plane/d520.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "plane-data:crafting/root",
"display": {
"icon": {
"item": "minecraft:feather",
"nbt": "{}"
},
"title": {
"translate": "dummy"
},
"description": {
"translate": "dummy"
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": true
},
"criteria": {
"get_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "plane-data:plane/d520-recipe"
}
}
},
"requirements": [
[
"get_recipe"
]
],
"rewards": {
"function": "advancements:plane-recipie-manager"
}
}
35 changes: 35 additions & 0 deletions data/plane-data/advancements/crafting/plane/mc202.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "plane-data:crafting/root",
"display": {
"icon": {
"item": "minecraft:feather",
"nbt": "{}"
},
"title": {
"translate": "dummy"
},
"description": {
"translate": "dummy"
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": true
},
"criteria": {
"get_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "plane-data:plane/mc202-recipe"
}
}
},
"requirements": [
[
"get_recipe"
]
],
"rewards": {
"function": "advancements:plane-recipie-manager"
}
}
35 changes: 35 additions & 0 deletions data/plane-data/advancements/crafting/plane/re2005.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "plane-data:crafting/root",
"display": {
"icon": {
"item": "minecraft:feather",
"nbt": "{}"
},
"title": {
"translate": "dummy"
},
"description": {
"translate": "dummy"
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": true
},
"criteria": {
"get_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "plane-data:plane/re2005-recipe"
}
}
},
"requirements": [
[
"get_recipe"
]
],
"rewards": {
"function": "advancements:plane-recipie-manager"
}
}
35 changes: 35 additions & 0 deletions data/plane-data/advancements/crafting/plane/saab21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "plane-data:crafting/root",
"display": {
"icon": {
"item": "minecraft:feather",
"nbt": "{}"
},
"title": {
"translate": "dummy"
},
"description": {
"translate": "dummy"
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": true
},
"criteria": {
"get_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "plane-data:plane/saab21-recipe"
}
}
},
"requirements": [
[
"get_recipe"
]
],
"rewards": {
"function": "advancements:plane-recipie-manager"
}
}
35 changes: 35 additions & 0 deletions data/plane-data/advancements/crafting/plane/saab29f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "plane-data:crafting/root",
"display": {
"icon": {
"item": "minecraft:feather",
"nbt": "{}"
},
"title": {
"translate": "dummy"
},
"description": {
"translate": "dummy"
},
"frame": "task",
"show_toast": false,
"announce_to_chat": false,
"hidden": true
},
"criteria": {
"get_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "plane-data:plane/saab29f-recipe"
}
}
},
"requirements": [
[
"get_recipe"
]
],
"rewards": {
"function": "advancements:plane-recipie-manager"
}
}
4 changes: 2 additions & 2 deletions data/plane-data/functions/d520/d520-position.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# @within plane:position/position-individual

#seatの位置修正
execute at @s[tag=has-rider] run tp @e[tag=plane-seat,tag=target-parts,distance=..32] ^ ^ ^
execute at @s[tag=!has-rider] run tp @e[tag=plane-seat,tag=target-parts,distance=..32] ^ ^ ^
execute at @s[tag=has-rider] run tp @e[tag=plane-seat,tag=target-parts,distance=..32] ^ ^0.5 ^-4.5
execute at @s[tag=!has-rider] run tp @e[tag=plane-seat,tag=target-parts,distance=..32] ^ ^-0.3 ^-0.3
29 changes: 16 additions & 13 deletions data/plane-data/functions/d520/d520-storage.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ data modify storage voxel-planes:plane d520.plane-data.tier set value 2
data modify storage voxel-planes:plane d520.plane-data.flight-model.weight set value 2452
data modify storage voxel-planes:plane d520.plane-data.flight-model.speed set value {max-speed:529,cruise-speed:370,climb-rate:14.3,stall-speed:125}
data modify storage voxel-planes:plane d520.plane-data.flight-model.engine set value {type:recipro,horse-power:900,number:1}
#data modify storage voxel-planes:plane d520.plane-data.flight-model.turn-rate set value {pitch:36f,yaw:21.6f,roll:$ROLL_RATE_DEGREE}
#data modify storage voxel-planes:plane d520.plane-data.flight-model.energy-loss-rate set value 0.7
#data modify storage voxel-planes:plane d520.plane-data.model-data.body set value {parking-cmd:41,rolling-cmd:42,flying-cmd:43}
#data modify storage voxel-planes:plane d520.plane-data.model-data.landing-pitch set value $LANDING_PITCH_DEGREE
#data modify storage voxel-planes:plane d520.plane-data.hitbox set value {}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {engine:{max-hp:160d,offset:[$X,$Y,$Z]}}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {aileron-r:{max-hp:140d,offset:[$X,$Y,$Z]},aileron-l:{max-hp:140d,offset:[$X,$Y,$Z]}}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {elevator-r:{max-hp:110d,offset:[$X,$Y,$Z]},elevator-l:{max-hp:110d,offset:[$X,$Y,$Z]}}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {radder:{max-hp:120d,offset:[$X,$Y,$Z]}}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {cockpit:{offset:[$X,$Y,$Z]}}
#data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {body:{max-hp:170d,offset:[$X,$Y,$Z]}}
data modify storage voxel-planes:plane d520.plane-data.flight-model.turn-rate set value {pitch:36f,yaw:21.6f,roll:90f}
data modify storage voxel-planes:plane d520.plane-data.flight-model.energy-loss-rate set value 0.7
data modify storage voxel-planes:plane d520.plane-data.model-data.body set value {parking-cmd:41,rolling-cmd:42,flying-cmd:43}
data modify storage voxel-planes:plane d520.plane-data.model-data.landing-pitch set value -12
data modify storage voxel-planes:plane d520.plane-data.model-data.scale set value [1f,1f,1f]
data modify storage voxel-planes:plane d520.plane-data.model-data.translation set value [-0.3f,0f,0f]
data modify storage voxel-planes:plane d520.plane-data.model-data.central-axis-offset set value 1.375
data modify storage voxel-planes:plane d520.plane-data.hitbox set value {}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {engine:{max-hp:160d,offset:[0d,-0.2d,2.5d],width:1,height:1}}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {aileron-r:{max-hp:140d,offset:[-2.5d,-0.5d,1d],width:1.2,height:1.2},aileron-l:{max-hp:140d,offset:[2.5d,-0.5d,1d],width:1.2,height:1.2}}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {elevator-r:{max-hp:110d,offset:[-0.5d,0.2d,-3.5d],width:0.8,height:0.8},elevator-l:{max-hp:110d,offset:[0.5d,0.2d,-3.5d],width:0.8,height:0.8}}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {radder:{max-hp:120d,offset:[0d,0.9d,-3.9d],width:0.8,height:0.8}}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {cockpit:{offset:[0d,0.6d,-0.3d],width:0.5,height:0.5}}
data modify storage voxel-planes:plane d520.plane-data.hitbox merge value {body:{max-hp:170d,offset:[0d,-0.3d,0d],width:1,height:1}}

#デフォルト機銃データセット
data modify storage voxel-planes:weapon d520.base.20mm set value {data:{name:"20mm gun",type:gun,size:20mm,max-ammunition:60,current-ammunition:60,max-cooltime:2,current-cooltime:0,max-reload:280,current-reload:0,tracer:"lightgreen",damage:60,speed:11,bullets:[{offset:[0d,0d,4d]}]}}
data modify storage voxel-planes:weapon d520.base.7.5mm set value {data:{name:"7.5mm gun",type:gun,size:7p7mm,max-ammunition:675,current-ammunition:675,max-cooltime:1,current-cooltime:0,max-reload:140,current-reload:0,tracer:"lightgreen",damage:18,speed:10.5,bullets:[{offset:[0d,0d,0d]},{offset:[0d,0d,0d]},{offset:[0d,0d,0d]},{offset:[0d,0d,0d]}]}}
data modify storage voxel-planes:weapon d520.base.20mm set value {data:{name:"20mm gun",type:gun,size:20mm,max-ammunition:60,current-ammunition:60,max-cooltime:2,current-cooltime:0,max-reload:280,current-reload:0,tracer:"yellow",damage:60,speed:11,bullets:[{offset:[0d,0d,4d]}]}}
data modify storage voxel-planes:weapon d520.base.7p5mm set value {data:{name:"7.5mm gun",type:gun,size:7p7mm,max-ammunition:675,current-ammunition:675,max-cooltime:1,current-cooltime:0,max-reload:140,current-reload:0,tracer:"lightgreen",damage:18,speed:10.5,bullets:[{offset:[-1.9d,1.1d,2.1d]},{offset:[-1.7d,1.1d,2.1d]},{offset:[1.9d,1.1d,2.1d]},{offset:[1.7d,1.1d,2.1d]}]}}
12 changes: 3 additions & 9 deletions data/plane-data/functions/d520/d520.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#機体召喚
summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,NoGravity:0b,Tags:[d520,plane-init,plane-root,plane,entity-nohit,need-calc-offset,delay-rotation,tier1],DisabledSlots:256}
summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,NoGravity:0b,Tags:[d520,plane-init,plane,entity-nohit,plane-seat],Passengers:[{id:"donkey",Attributes:[{Name:"generic.max_health",Base:20d}],Invulnerable:1b,DeathLootTable:"minecraft:entities/bat",SaddleItem:{id:"minecraft:saddle",Count:1b},Tame:1b,NoAI:1b,Silent:1b,ChestedHorse:1b,ActiveEffects:[{Id:14b,Amplifier:0b,Duration:1000000,ShowParticles:0b}],Tags:[d520,plane-init,plane,plane-seat,entity-nohit]}],DisabledSlots:256}
summon armor_stand ~ ~ ~ {Tags:[plane-body,d520,plane-init,plane,has-model,model-changeable,entity-nohit],NoGravity:1b,Invisible:1b,HandItems:[{id:"minecraft:diamond_sword",Count:1b,tag:{CustomModelData:85,Unbreakable:1b}},{}],Pose:{LeftArm:[0f,0f,0f],RightArm:[-12f,0f,0f]},DisabledSlots:256}
summon item_display ~ ~ ~ {Tags:["plane-body","d520",plane-init,plane,has-model,model-changeable,entity-nohit],NoGravity:1b,item:{id:"minecraft:diamond_sword",Count:1b,tag:{CustomModelData:0,Unbreakable:1b}},interpolation_duration:0,view_range:4.0f,transformation:{right_rotation:{angle:0f,axis:[0f,1f,0f]},left_rotation:{angle:0f,axis:[0f,0f,1f]},scale:[1f,1f,1f],translation:[0f,1.5f,0f]},item_display:"thirdperson_righthand"}
ride @e[tag=plane-init,tag=plane-body,distance=..1,limit=1] mount @e[tag=plane-init,tag=plane-root,distance=..1,limit=1]

#ID付与
Expand All @@ -42,14 +42,8 @@ execute as @e[type=donkey,tag=plane-init,distance=..1] run function plane-data:u
#武器データセット
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon set value {current-weapon-index:0}
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list set value []
#data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list append from storage voxel-planes:weapon d520.base.$WEAPON_TYPE
#data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:$WEAPON_TYPE}}].data.$WEAPON_TYPEs append from storage voxel-planes:weapon d520.additional.$ADDITIONAL_WEAPOM[]

#爆弾ロケットの弾数変更(不要なら削除)
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.current-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.max-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:rocket}}].data.current-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:rocket}}].data.rockets
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:rocket}}].data.max-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:rocket}}].data.rockets
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list append from storage voxel-planes:weapon d520.base.20mm
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list append from storage voxel-planes:weapon d520.base.7p5mm

#プレイヤーと同じAngYにする
schedule function plane:summon/util/delay-rotation 2
Expand Down
10 changes: 4 additions & 6 deletions data/plane-data/functions/mc202/mc202-equip.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,23 @@

#> private
# @private
#declare score_holder #$ITEM_TYPE #$ITEM_TYPEを入力
#declare score_holder #60kg #60kgを入力

#装備品チェック
execute store success score #$ITEM_TYPE vp.reg1 if entity @e[type=minecraft:donkey,tag=target-parts,nbt={Items:[{tag:{item-type:60kg-bomb}}]},distance=..30]
execute store success score #60kg vp.reg1 if entity @e[type=minecraft:donkey,tag=target-parts,nbt={Items:[{tag:{item-type:60kg-bomb}}]},distance=..30]

#排他装備品判定

#ストレージリセット
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:rocket}}]

#weapon-listに武器データアペンド
execute if score #$ITEM_TYPE vp.reg1 matches 1.. unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list append from storage voxel-planes:weapon mc202.base.bomb
execute if score #$ITEM_TYPE vp.reg1 matches 1.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs append from storage voxel-planes:weapon mc202.additional.50kg[]
execute if score #60kg vp.reg1 matches 1.. unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list append from storage voxel-planes:weapon mc202.base.bomb
execute if score #60kg vp.reg1 matches 1.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs append from storage voxel-planes:weapon mc202.additional.50kg[]

#弾数変更
execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}] store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.current-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs
execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}] store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.max-ammunition int 1 run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].weapon.weapon-list[{data:{type:bomb}}].data.bombs

#不要装備削除
execute if entity @e[tag=target-parts,tag=plane-bomb,distance=..32] run kill @e[tag=target-parts,tag=plane-bomb]
execute if entity @e[tag=target-parts,tag=plane-rocket,distance=..32] run kill @e[tag=target-parts,tag=plane-rocket]
Loading

0 comments on commit 77ff591

Please sign in to comment.