mc-datapacks / review-tracker

Datapack Review tracker
6 stars 1 forks source link

Harvestable hoe by boon4681 #46

Closed boon4681 closed 3 years ago

boon4681 commented 3 years ago

Project Page: https://github.com/boon4681/Harvestable-hoe (testing upload will available on "planet minecraft" later)

This hoe can harvesting crops by it self but it have cooldown when out of valid

EstEarth202 commented 3 years ago

This is a datapack from a Thai branch. The author states that this is still an incomplete version and is ready to revise until it is complete with writing to complete.

Datapack Advancement ✔️

Datapack Uninstallation ✔️+🔆

อันที่จริงไม่แนะนำให้ datapack disable มันส่งผลให้เกิดการ reload อัตโนมัติส่งผลให้แพ็คอื่นถูกรีการทำงานใหม่ไปด้วย

Reloading Message ❌

data\boon4681.auto.hoe\functions\init.mcfunction มี tellraw @a ["",{"text":"Harvestable hoe"

Common Trait Convention 🔆

แนะนำว่าถ้าใช้ ctc ก็ดีนะ จัดการได้ตามสะดวก อันนี้เป็นตัวอย่างคร่าวๆ give @s diamond_hoe{tag:{ctc:{id: 'auto_hoe',from: 'boon4681:auto_hoe',traits: {'tool/tilling': 1b, 'gem/diamond': 1b}}}}

Custom Model ID ☑️

Global ignoring tag ❌

data\boon4681.auto.hoe\functions\run\run.mcfunction -> execute as @a[tag=!global.ignore.gui]

Global Durability ☑️ (ขอใช้ใน namespace)

Namespace Convention ❌

อยากจะบอกว่า namespace objectives เนี่ยต้องเป็นอย่างใดอย่างนึงนะ ส่วนใหญ่แล้วเขาจะใช้ชื่อย่อกันเช่นชื่อพี่ EstEarth -> ee. เพราะว่ามันจำกัดแค่ 16 ตัวอักษร

scoreboard objectives add boon4681.active dummy

scoreboard objectives add du.has dummy
scoreboard objectives add du.max dummy
scoreboard objectives add du.cooldown dummy
scoreboard objectives add boon4681.calc_s0 dummy
scoreboard objectives add boon4681.item.id dummy
scoreboard objectives add iscrop dummy

Shulker Box Loot Table ❌

data\minecraft\loot_tables\blocks\shulker_box.json ใช้ไม่ตรงกับที่เขียนไว้นะ ↳ https://mc-datapacks.github.io/th/conventions/shulker_box_loot_table.html

setblock 29999977 0 29999977 shulker_box คำสั่ง setblock ต้องเป็น yellow_shulker_box ตามหัวข้อนี้ ↳ https://mc-datapacks.github.io/th/tips/shulker_box_inventory_manipulation.html

data\boon4681.auto.hoe\functions\durability\save.mcfunction
data\boon4681.auto.hoe\functions\durability\savecool.mcfunction

Tecnical advice 🔆

เราสามารถลดความยาวของคำสั่งลงได้ จากการนำเงื่อนไขบางอย่างไปใส่ใน @s ถ้าทำได้ ไฟล์อื่นๆใน datapack ของน้องก็ทำได้ซึ่งมีอีก

execute unless score @s[scores={du.cooldown=0,du.has=..0}] boon4681.item.id matches 0 run function boon4681.auto.hoe:durability/setsave_s0
execute unless score @s[scores={du.cooldown=1}] boon4681.item.id matches 0 run function boon4681.auto.hoe:run/calc_check
execute unless score @s[nbt={ActiveEffects:[{Id:32b}]},scores={du.cooldown=0}] boon4681.item.id matches 0 run function boon4681.auto.hoe:durability/setsave_s2
scoreboard players set @s[scores={du.has=..0}] boon4681.item.id 0

execute at @s[scores={boon4681.item.id=1}] positioned ~ ~ ~ run function boon4681.auto.hoe:break/breaking_1
execute at @s[scores={boon4681.item.id=1}] positioned ~ ~0.0625 ~ run function boon4681.auto.hoe:break/breaking_1
execute at @s[scores={boon4681.item.id=2}] positioned ~ ~ ~ run function boon4681.auto.hoe:break/breaking_2
execute at @s[scores={boon4681.item.id=2}] positioned ~ ~0.0625 ~ run function boon4681.auto.hoe:break/breaking_2
execute at @s[scores={boon4681.item.id=3}] positioned ~ ~ ~ run function boon4681.auto.hoe:break/breaking_3
execute at @s[scores={boon4681.item.id=3}] positioned ~ ~0.0625 ~ run function boon4681.auto.hoe:break/breaking_3

รู้หรือไม่: fake_player ไม่ต้องใช้ namespace เพราะมันอยู่ในภาย objective namespace. "auto.hoe.activate" boon4681.active

แนะนำว่าการ loop อ่ะควรใช้แบบนี้แทนนะ

ย้าย "boon4681.auto.hoe:loop" ไปใส่ใน load.json แล้วลบไฟล์ tick.json ออกเพราะไม่ใช้แล้ว

{
    "values":[
      "boon4681.auto.hoe:init",
      "boon4681.auto.hoe:loop"
    ]
}

ในข้อเท็จจริงมันมีอยู่ว่า ไฟล์ tick.json มันจะรันก่อนไฟล์ load เสมอ ไม่ค่อยดีเท่าก่อนที่จะให้มันทำงานโดยที่ยังไม่มีการเซ็ต score และอื่นๆให้เรียบร้อย

ต่อไปในไฟล์ "boon4681.auto.hoe:loop"

ให้เพิ่ม schedule function boon4681.auto.hoe:loop 1t เท่านี้ก็ได้ loop 1 tick แล้ว

ในส่วนของ uninstall ให้ใช้ schedule clear boon4681.auto.hoe:loop แทนที่ datapack disable เมื่อทำแบบนี้แล้ว pack ก็จะไม่ทำงานใดๆต่อโดยไม่ต้อง datapack disable แต่ถ้าใช้ tick.json ต่อให้ลบทุกอย่างออก มันก็ยังคงทำงานตราบใดที่ไม่ datapack disable พี่เลยแนะนำให้เราทำแบบนี้จะดีกว่า

Note

✔️ = Followed 🔆 = Advised to use ❌ = Doesn't follow ☑️ = Not required/Skip

ทั้งหมดคิดว่ามีเท่านี้ เอาแค่นี้ก่อน แล้วลองใช้ ฟีเจอร์ branching ใน github ดูเพื่อส่งตัวแก้มาให้พี่ในนี้ ตามที่อาจารย์แนะนำได้

msedge_a8llsdDStF

boon4681 commented 3 years ago

fixed! https://github.com/boon4681/Harvestable-hoe

EstEarth202 commented 3 years ago

Datapack Uninstallation ❓

มีแต่ schedule clear ไม่ลบ scoreboard ด้วยล่ะ

Shulker Box Loot Table ❌

minecraft\loot_tables\blocks\yellow_shulker_box.json ตรง "name": "minecraft:shulker_box" ยังไม่แก้

Something missing ❓

ไม่ forceload add 29999977 29999977 เดี๋ยว setblock ไม่ติดนะ

Tecnical advice 🔆

boon4681\advancements\boon4681.auto.hoe.json เอาคำว่า boon4681. ออกได้เลย

minecraft:stick{drop_contents:true} ใช้เป็น air{drop_contents:1b} แทนก็ได้ สั่นลงหน่อย ถ้าใช้ 1b ให้เปลี่ยนที่ loot_tables ด้วย

boon4681 commented 3 years ago

fix again! https://github.com/boon4681/Harvestable-hoe commit changed https://github.com/boon4681/Harvestable-hoe/commit/d3b8e9db9fc80000121e99c1c1d5e150c64e725f

EstEarth202 commented 3 years ago

forceload เอาไปใส่ในไฟล์ init นะ เอาไว้ที่ tick แบบนั้นทำงานตลอดเวลาสิแหม จะโพสต์ขึ้นเว็บไหม?

boon4681 commented 3 years ago

ลงคับ and fixed https://github.com/boon4681/Harvestable-hoe/commit/215924617632b25328f8a5abaca28793a3f96a8d https://github.com/boon4681/Harvestable-hoe/commit/28f004dcfe5399f1aad79e9c5c48f36e70f82b37

EstEarth202 commented 3 years ago

Certified Compatibility ✔️

Style Guideline Followed 💕

Final comment: สะดวกดีมีประโยชน์สำหรับคุณภาพชีวิต LMAO Datapack reviewer @EstEarth202. :thumbsup:

น้องสามารถใช้ป้ายที่มีอยู่ในหน้า certified banner บนหน้า github ได้เลย