最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

【網(wǎng)易基巖版】全自動(dòng)創(chuàng)建二維地皮教程

2023-01-28 18:31 作者:AS3B6K  | 我要投稿

大家看到這個(gè)專(zhuān)欄應(yīng)該已經(jīng)知道全自動(dòng)地皮是什么概念了吧 那么我們直接切入正題 一維地皮與二維的區(qū)別在于 前者是一條射線不斷延伸 后者以某種規(guī)律將地皮以平面的方式分布 那么說(shuō)到平面,我們要先了解分布的規(guī)律

以這張圖片為例開(kāi)講 圖中紅色小框表示每一塊地皮 橫軸表示橫坐標(biāo) 縱軸表示縱坐標(biāo) 藍(lán)色數(shù)字表示生成順序

觀察生成順序,可以看出我的思路為從左下樣板地皮開(kāi)始一層層向外包裹 觀察橫縱坐標(biāo)的變化,我們可以得出三種情況 ①縱坐標(biāo)為0,橫縱坐標(biāo)交換,縱坐標(biāo)加1 ②縱坐標(biāo)大于橫坐標(biāo),橫坐標(biāo)加1 ③縱坐標(biāo)小于等于橫坐標(biāo),縱坐標(biāo)減1直到減為0,再次進(jìn)行①的計(jì)算

這三種情況在我的世界中可以用計(jì)分板的operation子命令實(shí)現(xiàn),初始坐標(biāo)為(0,0),添加標(biāo)簽開(kāi)始計(jì)算 在計(jì)算完成之后用二分法傳送玩家到指定位置生成地皮,橫縱坐標(biāo)各二分一輪,傳送的距離取決于地皮的大小,例如我的樣板地皮為33x33,那么傳送距離就是33格 傳送的起始點(diǎn)均為樣板地皮的中心點(diǎn) 傳送完畢清除標(biāo)簽

下面為指令部分

創(chuàng)建積分項(xiàng)x,x1,x2,z,z1,z2 x2,z2用于計(jì)算,x1,z1用于情況討論,x,z用于儲(chǔ)存 生成盔甲架命名為dp 情況1部分: execute @a[tag=ks] ~~~ scoreboard players operation @e[name=dp,scores={z=0}] x >< @e[name=dp,scores={z=0}] z execute @a[tag=ks] ~~~ scoreboard players add @e[name=dp] z 1 execute @e[name=dp] ~~~ tellraw @a {"rawtext":[{"text":"目前坐標(biāo)"},{"score":{"objective":"x","name":"@s"}},{"text":","},{"score":{"objective":"z","name":"@s"}}]} execute @a[tag=ks] ~~~ scoreboard players operation @a[tag=ks] x = @e[name=dp] x execute @a[tag=ks] ~~~ scoreboard players operation @a[tag=ks] z = @e[name=dp] z execute @a[tag=ks] ~~~ tag @s add ks1 execute @a[tag=ks] ~~~ tag @s remove ks 情況2和情況3部分: execute @a[tag=ks] ~~~ scoreboard players operation @e[name=dp,scores={z=!0}] z1 = @e[name=dp,scores={z=!0}] z execute @a[tag=ks] ~~~ scoreboard players operation @e[name=dp,scores={z=!0}] x1 = @e[name=dp,scores={z=!0}] x execute @a[tag=ks] ~~~ scoreboard players operation @e[name=dp,scores={z=!0}] z1 -= @e[name=dp,scores={z=!0}] x1 execute @a[tag=ks] ~~~ scoreboard players add @e[name=dp,scores={z1=..0}] z -1 execute @e[name=dp] ~~~ tellraw @a {"rawtext":[{"text":"目前坐標(biāo)"},{"score":{"objective":"x","name":"@s"}},{"text":","},{"score":{"objective":"z","name":"@s"}}]} execute @a[tag=ks] ~~~ scoreboard players add @e[name=dp,scores={z1=1..}] x 1 execute @e[name=dp] ~~~ tellraw @a {"rawtext":[{"text":"目前坐標(biāo)"},{"score":{"objective":"x","name":"@s"}},{"text":","},{"score":{"objective":"z","name":"@s"}}]} execute @a[tag=ks] ~~~ scoreboard players operation @a[tag=ks] x = @e[name=dp] x execute @a[tag=ks] ~~~ scoreboard players operation @a[tag=ks] z = @e[name=dp] z execute @a[tag=ks] ~~~ tag @s add ks1 execute @a[tag=ks] ~~~ tag @s remove ks 二分計(jì)算部分 先將x,z分?jǐn)?shù)賦值為x2,z2。以x2,z2的分?jǐn)?shù)用來(lái)計(jì)算。tp到樣板地皮中心(每個(gè)人都不同,勿照抄,后面二分傳送距離為分?jǐn)?shù)乘邊長(zhǎng),例如我的地皮邊長(zhǎng)為33,256x33=8448): execute @a[tag=ks1] ~~~ tp @a[tag=ks1] -30 1 30 x軸: execute @a[tag=ks1,scores={x2=256..}] ~~~ tp @a[tag=ks1,scores={x2=256..}] ~8448~~ execute @a[tag=ks1,scores={x2=256..}] ~~~ scoreboard players remove @a[tag=ks1,scores={x2=256..}] x2 256 execute @a[tag=ks1,scores={x2=128..}] ~~~ tp @a[tag=ks1,scores={x2=128..}] ~4224~~ execute @a[tag=ks1,scores={x2=128..}] ~~~ scoreboard players remove @a[tag=ks1,scores={x2=128..}] x2 128 ……(依次為x=128-63-32-16-8-4-2-1) execute @a[tag=ks1,scores={x2=1..}] ~~~ tp @a[tag=ks1,scores={x2=1..}] ~33~~ execute @a[tag=ks1,scores={x2=1..}] ~~~ scoreboard players remove @a[tag=ks1,scores={x=1..}] x2 1 z軸同理 創(chuàng)建地皮部分(按照地皮大小調(diào)整): execute @a[tag=ks1] ~~~ structure load dp ~-16 ~-5 ~-16 execute @a[tag=ks1] ~~~ playsound random.levelup @s execute @a[tag=ks1] ~~~ title @s title §a§l計(jì)算完成! execute @a[tag=ks1] ~~~ fill ~-25 ~ ~-25 ~25 ~ ~25 air 0 replace structure_block execute @a[tag=ks1] ~~~ tag @s remove ks1

至此指令完成。 補(bǔ)充1: 重置指令: execute @e[name=dp] ~~~ scoreboard players set @s x 0 execute @e[name=dp] ~~~ scoreboard players set @s z 0 execute @e[name=dp] ~~~ scoreboard players set @s x1 0 execute @e[name=dp] ~~~ scoreboard players set @s z1 0 開(kāi)始計(jì)算: tag @a[目標(biāo)選擇器] add ks 補(bǔ)充2: 二分法在游戲里的意思即為將一個(gè)數(shù)字分為2^n之和,用于坐標(biāo)和距離互相轉(zhuǎn)化等應(yīng)用 站內(nèi)有關(guān)于二分的詳細(xì)教程,講的都比我好

謝謝各位的觀看!看完不要忘記給個(gè)三連哦,這對(duì)我非常重要!(σ≧?▽?≦?)σ。

【網(wǎng)易基巖版】全自動(dòng)創(chuàng)建二維地皮教程的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
吴川市| 连南| 凤冈县| 正宁县| 慈利县| 久治县| 涞水县| 前郭尔| 马龙县| 洛南县| 山阳县| 治县。| 巨鹿县| 象山县| 临颍县| 乡城县| 六盘水市| 青田县| 石棉县| 昌江| 甘孜| 巢湖市| 嵩明县| 霍林郭勒市| 天全县| 祁连县| 金门县| 林甸县| 马边| 西昌市| 昌黎县| 勐海县| 宜章县| 嘉鱼县| 崇礼县| 琼结县| 道孚县| 蓬莱市| 阿拉善左旗| 岐山县| 平度市|