Skip to content

Commit

Permalink
stable release 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
creamIcec committed Aug 6, 2021
1 parent a4c0414 commit eafb51d
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
4 changes: 1 addition & 3 deletions load_maps/data/imgloader/functions/gen.mcfunction
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
tellraw @p "§3当前运行:默认地图起始编号为零模式"
scoreboard players add @e[tag=creator] line 0
scoreboard players add @e[tag=creator] row 0
scoreboard objectives add tptimes dummy "tptimes"
scoreboard players set @e[tag=creator] tptimes 0
execute unless score @e[tag=creator,limit=1] row matches 0..100 run tellraw @p "§4当前要创建的行数不是正数,请重新放入一定数量的物品或执行imgloader:getarg。"
execute unless score @e[tag=creator,limit=1] row matches 0..100 run tellraw @p "§4当前要创建的行数不是正数,请重新放入一定数量的物品或执行/function imgloader:getarg。"
execute at @e[tag=creator,limit=1] if entity @e[tag=creator,y_rotation=-45..45] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 0 0
execute at @e[tag=creator,limit=1] if entity @e[tag=creator,y_rotation=45..135] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 90 0
execute at @e[tag=creator,limit=1] if entity @e[tag=creator, y_rotation=135..180] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 180 0
Expand Down
5 changes: 3 additions & 2 deletions load_maps/data/imgloader/functions/gencreator.mcfunction
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kill @e[tag=creator,limit=1,sort=nearest]
kill @e[tag=helper,limit=1,sort=nearest]
kill @e[tag=helper2,limit=1,sort=nearest]
summon armor_stand ~ ~ ~ {Tags:["creator"],NoGravity:true}
summon armor_stand ~ ~ ~ {Tags:["creator"],NoGravity:true,CustomName:'{"text":"地图创建者"}',CustomNameVisible:true}
summon armor_stand ~ ~ ~ {Tags:["helper"],NoGravity:true}
summon armor_stand ~ ~ ~ {Tags:["helper2"],NoGravity:true}
tp @e[tag=creator] ~ ~ ~ ~ ~
Expand All @@ -24,5 +24,6 @@ execute at @e[tag=helper2,limit=1] if entity @e[tag=helper2,y_rotation=-179.9..-
execute at @e[tag=helper2,limit=1] if entity @e[tag=helper2,y_rotation=-135..-45] align xz run tp @e[tag=helper2] ~0.5 ~ ~0.5 -90 0
execute at @e[tag=creator] run setblock ^ ^ ^ stone keep
execute at @e[tag=creator] run setblock ^ ^ ^1 grass_block keep
tellraw @p {"translate":"现在,在另一个位置运行函数%s在那里生成一个用于设置地图长宽的箱子(已放置则可忽略)","with":[{"text": "/function imgloader:genargctr","color": "#FF5C38"}],"insertion":"/function imgloader:genargctr"}
tellraw @p {"translate":"现在,在另一个位置运行函数%s在那里生成一个用于设置地图长宽的箱子","with":[{"text": "/function imgloader:genargctr","color": "#FF5C38"},{"text":"/function imgloader:getarg","color": "#FF5C38"}],"insertion":"/function imgloader:genargctr"}
tellraw @p {"translate": "(已运行过并成功放置则可直接站在箱子上运行%s)","with":[{"text":"/function imgloader:getarg","color":"#FF5C38"}],"insertion":"/function imgloader:getarg"}
tellraw @p "§2同时请将盔甲架脚部面朝方向前那一个草方块替换为作为背景墙的方块。"
11 changes: 6 additions & 5 deletions load_maps/data/imgloader/functions/gennotwith0.mcfunction
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tellraw @p "§3当前运行:手动设置地图起始编号模式"
tellraw @p "§2请输入/scoreboard players set @e[tag=creator] tptimes <要放置的地图起始编号>再运行此函数。"
tellraw @p "§3如已执行上述命令,可忽略绿色字体信息"
tellraw @p {"translate":"§2请输入%s再运行此函数。","with":[{"text":"/trigger initial set <要放置的地图起始编号>","color":"#FF5C38"}],"insertion": "/trigger initial set <要放置的地图起始编号>"}
tellraw @p "§3如已执行上述命令,可忽略上述信息"
scoreboard players add @e[tag=creator] line 0
scoreboard players add @e[tag=creator] row 0
scoreboard objectives add checkif0 dummy "checkif0"
scoreboard players set @e[tag=creator] checkif0 0
execute unless score @e[tag=creator,limit=1] row matches 0..100 run tellraw @p "§4当前要创建的行数不是正数,请重新放入一定数量的物品或执行imgloader:getarg"
execute unless score @e[tag=creator,limit=1] row matches 0..100 run tellraw @p {"translate":"§4当前要创建的行数不是正数,请重新放入一定数量的物品或执行%s","with":[{"text":"/function imgloader:getarg"}],"insertion": "/function imgloader:getarg"}
execute at @e[tag=creator,limit=1] if entity @e[tag=creator,y_rotation=-45..45] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 0 0
execute at @e[tag=creator,limit=1] if entity @e[tag=creator,y_rotation=45..135] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 90 0
execute at @e[tag=creator,limit=1] if entity @e[tag=creator, y_rotation=135..180] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 180 0
Expand All @@ -14,5 +14,6 @@ execute at @e[tag=creator,limit=1] if entity @e[tag=creator, y_rotation=-135..-4
execute at @e[tag=creator,limit=1] run summon minecraft:armor_stand ^ ^ ^2 {Tags:[poser]}
execute at @e[tag=creator,limit=1] align xz run tp @e[tag=creator] ~0.5 ~ ~0.5 facing entity @e[type=armor_stand,tag=poser,limit=1]
kill @e[tag=poser]
execute if score @e[tag=creator,limit=1] tptimes matches 1..10000 run function imgloader:setwallline
execute if score @e[tag=creator,limit=1] tptimes matches 0..0 run tellraw @p "§4请将tptimes赋非0值后再运行。"
execute store result score @e[tag=creator,limit=1,sort=nearest] initial run scoreboard players get @p initial
execute if score @e[tag=creator,limit=1] initial matches 1..10000 run function imgloader:setwallline
execute if score @e[tag=creator,limit=1] initial matches 0..0 run tellraw @p "§4请将initial赋非0值后再运行。"
9 changes: 5 additions & 4 deletions load_maps/data/imgloader/functions/getarg.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ scoreboard objectives add row dummy "row"
scoreboard objectives add fixed_row dummy
scoreboard objectives add fixed_line dummy
scoreboard objectives add prerow dummy "prerow"
scoreboard objectives add tptimes trigger "tptimes"
scoreboard players set @e[tag=creator,limit=1] tptimes 0
scoreboard objectives add initial trigger "initial"
scoreboard players set @e[tag=creator,limit=1] initial 0
execute store result score @e[tag=creator] line run data get block ~ ~ ~ Items[0].Count
execute store result score @e[tag=creator] fixed_line run scoreboard players get @e[tag=creator,limit=1] line
execute store result score @e[tag=creator] prerow run data get block ~ ~ ~ Items[1].Count
execute store result score @e[tag=creator] row run data get block ~ ~ ~ Items[1].Count
execute store result score @e[tag=creator] fixed_row run data get block ~ ~ ~ Items[1].Count
#scoreboard objectives setdisplay sidebar line
tellraw @p "§3现在请输入/function gen默认以地图编号为0开始渲染,或输入/function gennotwith0自定义一个地图开始编号。"
tellraw @p "注意:在地图生成前,可随时运行/function imgloader:getarg来修改长和高,只要你站在箱子上即可。"
tellraw @p {"translate":"§3现在请输入%s默认以地图编号为0开始渲染。","with":[{"text":"/function imgloader:gen","color":"#FF5C38"}],"insertion":"/function imgloader:gen"}
tellraw @p {"translate":"或输入%s自定义一个地图开始编号。","with":[{"text": "/function imgloader:gennotwith0","color":"#FF5C38"}],"insertion":"/function imgloader:gennotwith0"}
tellraw @p {"translate":"注意:在生成创建者之后,可随时运行%s,只要站在箱子上即可。","with":[{"text":"/function imgloader:getarg","color":"#FF5C38"}],"insertion":"/function imgloader:getarg"}
4 changes: 2 additions & 2 deletions load_maps/data/imgloader/functions/help.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tellraw @p "欢迎使用地图画自动加载器数据包!"
tellraw @p {"translate": "要开始加载地图画,请先将地图文件置于%s文件夹中","with":[{"text":".minecraft/saves/<你的存档名>/data","color": "#FF5C38"}]}
tellraw @p {"translate":"然后运行函数%s在你所在位置生成一个地图创建者(按住shift+点击此消息可自动填充指令)","with":[{"text": "/function imgloader:gencreator","color": "#FF5C38","underlined": true}],"insertion":"/function imgloader:gencreator"}
tellraw @p {"translate":"然后运行函数%s在你所在位置生成一个地图创建者","with":[{"text": "/function imgloader:gencreator","color": "#FF5C38","underlined": true}],"insertion":"/function imgloader:gencreator"}
#tellraw @p "输入/trigger ifshowhelp set 0以不再自动显示教程,/trigger ifshowhelp set 1重新激活教程。"
12 changes: 12 additions & 0 deletions load_maps/data/imgloader/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
scoreboard objectives add ifshowhelp trigger
scoreboard objectives add ifshowhelper dummy
scoreboard objectives add initial trigger "initial"
scoreboard players set @e[tag=creator] initial 0
scoreboard players enable @p initial
tellraw @p {"text": "欢迎使用自动地图画加载器数据包!"}
tellraw @p {"translate":"现在输入%s以显示教程(提示:所有指令可通过shift+左键点击以自动填充)","with":[{"text":"/function imgloader:help","color":"#FF5C38"}],"insertion": "/function imgloader:help"}
tellraw @p {"translate":"或输入%s以显示指令参考手册","with":[{"text":"/function imgloader:reference","color":"#FF5C38"}],"insertion": "/function imgloader:reference"}
#tellraw @p {"translate":"%s以重新激活教程。","with":[{"text":"/trigger ifshowhelp set 0","color":"#FF5C38"}]}
#execute store success score @e[tag=creator,limit=1] ifshowhelp run scoreboard players get @e[tag=creator,limit=1] ifshowhelper
#scoreboard players enable @p ifshowhelp
execute if score @p ifshowhelper matches 0..0 run function imgloader:help
9 changes: 9 additions & 0 deletions load_maps/data/imgloader/functions/reference.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tellraw @p "**********************指令参考手册***********************"
tellraw @p {"translate":"%s 显示分步教程。","with":[{"text":"/function imgloader:help","color":"#FF5C38"}],"insertion": "/function imgloader:help"}
tellraw @p {"translate":"%s 在你所处位置按照你面朝方向生成一个地图创建者。","with":[{"text":"/function imgloader:gencreator","color":"#FF5C38"}],"insertion": "/function gencreator"}
tellraw @p {"translate":"%s 在你所处位置生成一个用于设置参数的箱子。","with":[{"text":"/function imgloader:genargctr","color":"#FF5C38"}],"insertion": "/function imgloader:genargctr"}
tellraw @p {"translate":"%s 开始渲染(从编号为0的地图开始)。","with":[{"text":"/function imgloader:gen","color":"#FF5C38"}],"insertion": "/function imgloader:gen"}
tellraw @p {"translate":"%s 开始渲染(从自定义编号的地图开始)。","with":[{"text":"/function imgloader:gennotwith0","color":"#FF5C38"}],"insertion": "/function imgloader:gennotwith0"}
tellraw @p {"translate":"%s 指定地图起始编号。","with":[{"text":"/trigger initial <起始编号>","color":"#FF5C38"}],"insertion": "/trigger initial <起始编号>"}
tellraw @p {"translate":"%s 重新加载数据包。","with":[{"text":"/reload","color":"#FF5C38"}],"insertion": "/reload"}
tellraw @p "**********************************************************"
4 changes: 2 additions & 2 deletions load_maps/data/imgloader/functions/refreshing.mcfunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
execute at @e[tag=creator,limit=1] store result entity @e[type=item_frame,limit=1,sort=nearest] Item.tag.map int 1 run scoreboard players get @e[tag=creator,limit=1] tptimes
execute at @e[tag=creator,limit=1] store result entity @e[type=item_frame,limit=1,sort=nearest] Item.tag.map int 1 run scoreboard players get @e[tag=creator,limit=1] initial
execute at @e[tag=creator,limit=1] run tp @e[tag=creator] ^-1 ^ ^
execute as @e[tag=creator,limit=1] at @e[tag=creator,limit=1] run scoreboard players add @e[tag=creator,limit=1] tptimes 1
execute as @e[tag=creator,limit=1] at @e[tag=creator,limit=1] run scoreboard players add @e[tag=creator,limit=1] initial 1
execute if score @e[tag=creator,limit=1] line matches 2..100 run function imgloader:refreshlineremove
execute if score @e[tag=creator,limit=1] line matches 1..1 run function imgloader:refreshrowremove
2 changes: 1 addition & 1 deletion load_maps/data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"replace": false,
"values":[
"imgloader:help"
"imgloader:load"
]
}

0 comments on commit eafb51d

Please sign in to comment.