diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d9de414..bf72c10 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -71,17 +71,17 @@ jobs: uses: montudor/action-zip@v1 if: steps.check_datapack_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGELOG.md ".*" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGES.md ".*" - name: Create mod jar file uses: montudor/action-zip@v1 if: steps.check_mod_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* CHANGELOG.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" - name: Create asset pack zip file uses: montudor/action-zip@v1 if: steps.check_assets_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGELOG.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" # Upload - name: Upload data pack version to Modrinth @@ -95,7 +95,7 @@ jobs: name: "[DP] Release v${{ github.event.inputs.tag }}" version: ${{ github.event.inputs.tag }} - changelog-file: CHANGELOG.* + changelog-file: CHANGES.* loaders: | datapack @@ -113,7 +113,7 @@ jobs: name: "[Mod] Release v${{ github.event.inputs.tag }}" version: ${{ github.event.inputs.tag }}+mod - changelog-file: CHANGELOG.* + changelog-file: CHANGES.* dependencies: | fabric-api(optional){modrinth:P7dR8mSH} @@ -138,7 +138,7 @@ jobs: name: "Release v${{ github.event.inputs.tag }}" version: ${{ github.event.inputs.tag }} - changelog-file: CHANGELOG.* + changelog-file: CHANGES.* loaders: | datapack @@ -156,7 +156,7 @@ jobs: name: "Release v${{ github.event.inputs.tag }}" version: ${{ github.event.inputs.tag }}+mod - changelog-file: CHANGELOG.* + changelog-file: CHANGES.* dependencies: | catalogue(optional){curseforge:459701} @@ -173,7 +173,7 @@ jobs: ./${{ github.event.repository.name }}-*-mod.jar - name: Add changelog header for GitHub release - run: sed -i '1i_Changelog:_' CHANGELOG.md + run: sed -i '1i_Changelog:_' CHANGES.md - name: Upload outputs to GitHub releases uses: Kir-Antipov/mc-publish@v3.3 with: @@ -183,7 +183,7 @@ jobs: name: Release v${{ github.event.inputs.tag }} version: v${{ github.event.inputs.tag }} - changelog-file: CHANGELOG.md + changelog-file: CHANGES.md files: | ./${{ github.event.repository.name }}-*.@(zip|jar) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 4d7c87f..c6eeb3c 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -71,17 +71,17 @@ jobs: uses: montudor/action-zip@v1 if: steps.check_datapack_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGELOG.md ".*" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGES.md ".*" - name: Create mod jar file uses: montudor/action-zip@v1 if: steps.check_mod_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* CHANGELOG.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" - name: Create asset pack zip file uses: montudor/action-zip@v1 if: steps.check_assets_folder.outputs.files_exists == 'true' with: - args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGELOG.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" # Upload - name: Capture datapack build artifact diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fb9bba1..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -- **Update to Minecraft 1.21** -- Fixed performance overlay for Minecraft 1.20.2+ not having an effect diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..d232dad --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,6 @@ +- **Support for Minecraft 1.21** ⚔️ (closes [#29](https://github.com/Tschipcraft/dynamiclights/issues/29), [#41](https://github.com/Tschipcraft/dynamiclights/issues/41), [#42](https://github.com/Tschipcraft/dynamiclights/issues/42), [#44](https://github.com/Tschipcraft/dynamiclights/issues/44)) + - Copied the contents of the legacy folders to their new names and removed unused code + - Used new enchantment check format in predicates + - Updated menu trigger to use advancements instead and added menu message header +- Fixed performance overlay for Minecraft 1.20.2+ not having an effect +- Updated LICENSE diff --git a/LICENSE b/LICENSE index 8b577cd..4bb973e 100644 --- a/LICENSE +++ b/LICENSE @@ -13,9 +13,9 @@ This license shall be included in all copies or substantial portions of this pro Permitted Uses: -1. You are PERMITTED to freely use this project on singleplayer worlds and multiplayer worlds/servers in your Minecraft game. +1. You are PERMITTED to freely use this project on singleplayer worlds and private multiplayer worlds/servers in your Minecraft game. -2. You are PERMITTED to modify this project's code for personal use or on your own private servers. +2. You are PERMITTED to modify this project's code for personal use and/or for contribution to this project. 3. You are PERMITTED to view this project's code, take reference, and learn from it. @@ -23,7 +23,7 @@ Permitted Uses: 5. You are PERMITTED to include this project in your modpack, IF you link back to at least one of the official download locations ([GitHub](https://github.com/Tschipcraft/dynamiclights), [CurseForge](https://www.curseforge.com/minecraft/texture-packs/tschipcrafts-dynamic-lights), [Modrinth](https://modrinth.com/datapack/dynamic-lights)), or by simply adding this project in the embedded or included mods sections directly on Modrinth and/or CurseForge. -6. You are PERMITTED to use parts or the whole project in your own project (Mod, Data Pack, Resource Pack, Map, Server, etc.), IF you obtain explicit permission from the creator (Tschipcraft) first. To request permission, please contact me via email at tschipcraft@gmail.com or message me directly on Planet Minecraft (https://www.planetminecraft.com/account/pms/new/tschipo), CurseForge (https://legacy.curseforge.com/private-messages/send?recipient=tschipcraft), or Discord (@tschipo) and include detailed information about your intentions. +6. You are PERMITTED to use parts or the whole project in your own project (Mod, Data Pack, Resource Pack, Map, Public Server, etc.), IF you obtain explicit permission from the creator (Tschipcraft) first. To request permission, please contact me via email at tschipcraft@gmail.com or message me directly on Planet Minecraft (https://www.planetminecraft.com/account/pms/new/tschipo), CurseForge (https://legacy.curseforge.com/private-messages/send?recipient=tschipcraft), or Discord (@tschipo) and include detailed information about your intentions. Prohibited Uses: diff --git a/README.md b/README.md index 40563b5..21422e6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ GitHub Downloads

-> A server-side data pack/mod for Minecraft 1.17x-1.20x +> A server-side data pack/mod for Minecraft 1.17x-1.21x
YouTube showcase @@ -22,16 +22,12 @@ Supported entities and items such as torches or lanterns will emit light by using the light block added in 21w13a. Because of this, the dynamic lights are limited to the block grid. (see [#9](https://github.com/Tschipcraft/dynamiclights/issues/9) for more information) -**Supported Items:** Torches, Lanterns, Campfires, Glowstone, Glowstone Dust, Blaze Rods, Blaze Powder, Spectral Arrows, Lava Buckets, Sea Lanterns, Prismarine Crystals, Froglights, Glow Ink Sacs, Glow Berries, Glow Item Frames, Glow Lichen, Jack o'Lanterns, Shroomlights, End Rods, End Crystals, Fire Charge, Amethyst Shards, Nether Stars, Ender Chests and Beacons +Some items are water sensitive and only turn off or on inside water. Additionally, all enchanted items will emit light level 6 while some enchants under certain conditions emit light level 9. +For a detailed overview of all supported items and entities, take a look at the wiki pages linked below. -Additionally, all enchanted items will emit light level 6 while Fire Aspect, Riptide or Channeling enchanted items emit light level 9. +Since this project is completely server-side, players joining a server with Dynamic Lights installed will not need to install anything on their end for it to work! However, you can still use the mod version on the client for single-player worlds only. Joining a server that does not have Dynamic Lights installed will have no effect. -**Supported Entities:** Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Shulker Bullets, Firework Rockets and Flying Wither Skulls - -Since this project is completely server-side, players joining a server with Dynamic Lights installed do not have to install anything on their end for it to work! Nontheless, you can still use the mod on -the client for singleplayer worlds only. Joining a server that has not installed Dynamic Lights will have no effect. - -[➜ For available settings and planned features, take a look at the wiki](https://github.com/Tschipcraft/dynamiclights/wiki) +[➜ For a detailed overview and available settings, take a look at the wiki](https://github.com/Tschipcraft/dynamiclights/wiki) ## Installation @@ -46,7 +42,7 @@ Also available on Modrinth and CurseForge! - Download on Modrinth + Download on Modrinth diff --git a/data/dynamiclights/function/install.mcfunction b/data/dynamiclights/function/install.mcfunction index dc437f7..1b13d40 100644 --- a/data/dynamiclights/function/install.mcfunction +++ b/data/dynamiclights/function/install.mcfunction @@ -10,20 +10,20 @@ scoreboard objectives add ts.dl.shulker dummy # Item score specification # Type: -# 1: Light level 3 (unused) +# 1: Light level 3 # 2: Light level 6 # 3: Light level 9 -# 4: Light level 12 (unused) +# 4: Light level 12 # 5: Light level 15 -# 6: Light level 3 (unused) outside water +# 6: Light level 3 outside water # 7: Light level 6 outside water # 8: Light level 9 outside water -# 9: Light level 12 (unused) outside water +# 9: Light level 12 outside water # 10: Light level 15 outside water -# 11: Light level 3 (unused) inside water +# 11: Light level 3 inside water # 12: Light level 6 inside water # 13: Light level 9 inside water -# 14: Light level 12 (unused) inside water +# 14: Light level 12 inside water # 15: Light level 15 inside water scoreboard objectives add ts.dl.i.type dummy @@ -39,7 +39,6 @@ scoreboard objectives add ts.dl.l.level dummy # Scoreboard for any temporary values scoreboard objectives add ts.dl.temp dummy -scoreboard objectives add ts.dl.mess.welc dummy scoreboard objectives add ts.dl.settings dummy # defaults @@ -64,15 +63,11 @@ scoreboard objectives add tschipcraft.menu trigger scoreboard objectives add tvc_ignore dummy ## Set load status -# 17 for v1.7 -scoreboard players set dynamiclights load.status 17 +# 18 for v1.8 +scoreboard players set dynamiclights load.status 18 # Reset advancement -advancement revoke @a only dynamiclights:interacted_with_item_frame +advancement revoke @a only tschipcraft:menu -## Schedule functions +## Schedule main function schedule function dynamiclights:internal/main 5t -schedule function dynamiclights:internal/loop 4t - -# Break for any version below Minecraft 1.17 -execute if entity @e[type=minecraft:marker,limit=1] diff --git a/data/dynamiclights/function/internal/item_frame/interacted.mcfunction b/data/dynamiclights/function/internal/item_frame/interacted.mcfunction deleted file mode 100644 index d2262c9..0000000 --- a/data/dynamiclights/function/internal/item_frame/interacted.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -##by Tschipcraft -# This function triggers whenever a player interacts with an item frame. It schedules a reparse of all near item frames for changed items. - -scoreboard players reset @e[type=#dynamiclights:reparse_interactible,distance=..7] ts.dl.i.type - -advancement revoke @s only dynamiclights:interacted_with_item_frame diff --git a/data/dynamiclights/function/internal/loop.mcfunction b/data/dynamiclights/function/internal/loop.mcfunction deleted file mode 100644 index 16c886e..0000000 --- a/data/dynamiclights/function/internal/loop.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -##by Tschipcraft -# Resets dynamic item holders such as item frames - -scoreboard players reset @e[type=#dynamiclights:reparse] ts.dl.i.type - -schedule function dynamiclights:internal/loop 4s diff --git a/data/dynamiclights/function/internal/main.mcfunction b/data/dynamiclights/function/internal/main.mcfunction index 0cbdf1e..e176127 100644 --- a/data/dynamiclights/function/internal/main.mcfunction +++ b/data/dynamiclights/function/internal/main.mcfunction @@ -12,8 +12,5 @@ execute unless score $global ts.dl.tnt.fuse matches 1 as @e[type=!#dynamiclights # Clear old lights execute as @e[type=minecraft:marker,tag=ts.dl.remove] at @s run function dynamiclights:internal/remove_light -# Menu -function dynamiclights:internal/menu - # Repeat schedule function dynamiclights:internal/main 1t diff --git a/data/dynamiclights/function/internal/menu.mcfunction b/data/dynamiclights/function/internal/menu.mcfunction deleted file mode 100644 index a59b9a8..0000000 --- a/data/dynamiclights/function/internal/menu.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -##by Tschipcraft - -## Menu message -scoreboard players enable @a tschipcraft.menu -#scoreboard players add @a ts.dl.mess.welcome 0 - don't show menu on first boot -execute as @a[scores={tschipcraft.menu=1..}] run scoreboard players set @s ts.dl.mess.welc 0 -execute as @a[scores={ts.dl.mess.welc=0}] run function dynamiclights:internal/messages/welcome - -execute as @a[scores={tschipcraft.menu=1..}] run schedule function dynamiclights:internal/menu_reset 1t diff --git a/data/dynamiclights/function/internal/menu_reset.mcfunction b/data/dynamiclights/function/internal/menu_reset.mcfunction deleted file mode 100644 index e6f0627..0000000 --- a/data/dynamiclights/function/internal/menu_reset.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -##by Tschipcraft - -scoreboard players reset @a[scores={tschipcraft.menu=1..}] ts.dl.mess.welc -scoreboard players reset @a[scores={tschipcraft.menu=1..}] tschipcraft.menu diff --git a/data/dynamiclights/function/internal/messages/welcome.mcfunction b/data/dynamiclights/function/internal/messages/welcome.mcfunction index 143922f..eaf824e 100644 --- a/data/dynamiclights/function/internal/messages/welcome.mcfunction +++ b/data/dynamiclights/function/internal/messages/welcome.mcfunction @@ -1,4 +1,3 @@ ## by Tschipcraft -tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu."}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack/mod.","color":"white"}]}},{"text":" "},{"text":"[Uninstall]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function dynamiclights:uninstall"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏻ Uninstall the data pack/mod.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues/new/choose"},"hoverEvent":{"action":"show_text","contents":"✉ Report an issue on GitHub."}},{"text":" "},{"text":"[Check for updates]","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=${version}"},"hoverEvent":{"action":"show_text","contents":"🔔 Check for updates on my website."}}] -scoreboard players set @s ts.dl.mess.welc 1 +tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu."}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack/mod.","color":"white"}]}},{"text":" "},{"text":"[Uninstall]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function dynamiclights:uninstall"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏻ Uninstall the data pack/mod.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues"},"hoverEvent":{"action":"show_text","contents":"✉ Report an issue on GitHub."}},{"text":" "},{"text":"[Check for updates]","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=${version}"},"hoverEvent":{"action":"show_text","contents":"🔔 Check for updates on my website."}}] diff --git a/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction b/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction deleted file mode 100644 index f7ff6ca..0000000 --- a/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -##by Tschipcraft - -execute as @s[type=minecraft:item_display] run data modify entity c295ddee-4c15-4e5b-83ba-2fbce873a1d5 HandItems[0] set from entity @s item -execute as @s[type=minecraft:block_display] run data modify entity c295ddee-4c15-4e5b-83ba-2fbce873a1d5 HandItems[0].id set from entity @s block_state.Name diff --git a/data/dynamiclights/function/internal/version_checker/start.mcfunction b/data/dynamiclights/function/internal/version_checker/start.mcfunction index 711278a..b533ba6 100644 --- a/data/dynamiclights/function/internal/version_checker/start.mcfunction +++ b/data/dynamiclights/function/internal/version_checker/start.mcfunction @@ -2,14 +2,6 @@ scoreboard objectives add ts.dl.version dummy execute store result score $global ts.dl.version run data get entity @r DataVersion -#execute if score $global ts.dl.version matches 3900.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.21 or above","color":"red","bold":true},{"text":" detected! This version of the data pack does not work in 1.21+! Please use a newer version.","color":"red"}] -#execute unless score $global tvc_ignore matches 1 if score $global ts.dl.version matches 3900.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Minecraft version 1.20.6 or above detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}] -#execute if score $global ts.dl.version matches 2976..3106 run say 1.19 detected! -#execute if score $global ts.dl.version matches 2731..2975 run say 1.18 detected! -#execute if score $global ts.dl.version matches 2587..2730 run say 1.17 detected! -execute if score $global ts.dl.version matches 2231..2586 run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.16","color":"red","bold":true},{"text":" detected! This data pack does not work in 1.16! Please use ","color":"red"},{"text": "1.17 or above", "color":"red","underlined":true},{"text":"!","color":"red"}] -execute if score $global ts.dl.version matches 1977..2230 run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.15","color":"red","bold": true},{"text":" detected! This data pack does not work in 1.15! Please use ","color":"red"},{"text": "1.17 or above", "color":"red","underlined":true},{"text":"!","color":"red"}] -execute if score $global ts.dl.version matches 1632..1976 run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.14","color":"red","bold": true},{"text":" detected! This data pack does not work in 1.14! Please use ","color":"red"},{"text": "1.17 or above", "color":"red","underlined":true},{"text":"!","color":"red"}] -execute if score $global ts.dl.version matches 1343..1631 run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.13","color":"red","bold": true},{"text":" detected! This data pack does not work in 1.13! Please use ","color":"red"},{"text": "1.17 or above", "color":"red","underlined":true},{"text":"!","color":"red"}] +execute unless score $global tvc_ignore matches 1 if score $global ts.dl.version matches 4000.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Future unknown Minecraft version above 1.21 detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}] execute unless score $global ts.dl.version matches 1.. run function dynamiclights:internal/version_checker/retry diff --git a/data/dynamiclights/function/reset.mcfunction b/data/dynamiclights/function/reset.mcfunction index e30ed81..86bdb4b 100644 --- a/data/dynamiclights/function/reset.mcfunction +++ b/data/dynamiclights/function/reset.mcfunction @@ -9,10 +9,9 @@ kill @e[type=minecraft:armor_stand,tag=ts.dl.i.parser] function dynamiclights:internal/explosion_detection/reset # Reset advancement -advancement revoke @a only dynamiclights:interacted_with_item_frame +advancement revoke @a only tschipcraft:menu -# Reschedule functions +# Reschedule main function schedule function dynamiclights:internal/main 5t -schedule function dynamiclights:internal/loop 4t say ⏏ Successfully resetted Dynamic lights! diff --git a/data/dynamiclights/function/settings/hide_feedback/main.mcfunction b/data/dynamiclights/function/settings/hide_feedback/main.mcfunction index 4058135..5793ea9 100644 --- a/data/dynamiclights/function/settings/hide_feedback/main.mcfunction +++ b/data/dynamiclights/function/settings/hide_feedback/main.mcfunction @@ -1,4 +1,5 @@ ##by Tschipcraft +# This doesn't seem to work anymore :( execute store result score $gamerule.send_feedback ts.dl.settings run gamerule sendCommandFeedback diff --git a/data/dynamiclights/function/uninstall.mcfunction b/data/dynamiclights/function/uninstall.mcfunction index 4ba8aa2..1ba6b27 100644 --- a/data/dynamiclights/function/uninstall.mcfunction +++ b/data/dynamiclights/function/uninstall.mcfunction @@ -32,7 +32,6 @@ scoreboard objectives remove tvc_ignore # Clear schedules schedule clear dynamiclights:internal/main -schedule clear dynamiclights:internal/loop # Disable data pack datapack disable "file/dynamiclights" diff --git a/data/dynamiclights/functions/install.mcfunction b/data/dynamiclights/functions/install.mcfunction index dc437f7..b8e6a77 100644 --- a/data/dynamiclights/functions/install.mcfunction +++ b/data/dynamiclights/functions/install.mcfunction @@ -10,20 +10,20 @@ scoreboard objectives add ts.dl.shulker dummy # Item score specification # Type: -# 1: Light level 3 (unused) +# 1: Light level 3 # 2: Light level 6 # 3: Light level 9 -# 4: Light level 12 (unused) +# 4: Light level 12 # 5: Light level 15 -# 6: Light level 3 (unused) outside water +# 6: Light level 3 outside water # 7: Light level 6 outside water # 8: Light level 9 outside water -# 9: Light level 12 (unused) outside water +# 9: Light level 12 outside water # 10: Light level 15 outside water -# 11: Light level 3 (unused) inside water +# 11: Light level 3 inside water # 12: Light level 6 inside water # 13: Light level 9 inside water -# 14: Light level 12 (unused) inside water +# 14: Light level 12 inside water # 15: Light level 15 inside water scoreboard objectives add ts.dl.i.type dummy @@ -64,8 +64,8 @@ scoreboard objectives add tschipcraft.menu trigger scoreboard objectives add tvc_ignore dummy ## Set load status -# 17 for v1.7 -scoreboard players set dynamiclights load.status 17 +# 18 for v1.8 +scoreboard players set dynamiclights load.status 18 # Reset advancement advancement revoke @a only dynamiclights:interacted_with_item_frame diff --git a/data/dynamiclights/functions/internal/messages/welcome.mcfunction b/data/dynamiclights/functions/internal/messages/welcome.mcfunction index 143922f..e550e30 100644 --- a/data/dynamiclights/functions/internal/messages/welcome.mcfunction +++ b/data/dynamiclights/functions/internal/messages/welcome.mcfunction @@ -1,4 +1,4 @@ ## by Tschipcraft -tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu."}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack/mod.","color":"white"}]}},{"text":" "},{"text":"[Uninstall]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function dynamiclights:uninstall"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏻ Uninstall the data pack/mod.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues/new/choose"},"hoverEvent":{"action":"show_text","contents":"✉ Report an issue on GitHub."}},{"text":" "},{"text":"[Check for updates]","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=${version}"},"hoverEvent":{"action":"show_text","contents":"🔔 Check for updates on my website."}}] +tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu."}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack/mod.","color":"white"}]}},{"text":" "},{"text":"[Uninstall]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function dynamiclights:uninstall"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏻ Uninstall the data pack/mod.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues"},"hoverEvent":{"action":"show_text","contents":"✉ Report an issue on GitHub."}},{"text":" "},{"text":"[Check for updates]","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=${version}"},"hoverEvent":{"action":"show_text","contents":"🔔 Check for updates on my website."}}] scoreboard players set @s ts.dl.mess.welc 1 diff --git a/data/dynamiclights/functions/internal/version_checker/start.mcfunction b/data/dynamiclights/functions/internal/version_checker/start.mcfunction index 711278a..597c579 100644 --- a/data/dynamiclights/functions/internal/version_checker/start.mcfunction +++ b/data/dynamiclights/functions/internal/version_checker/start.mcfunction @@ -2,8 +2,6 @@ scoreboard objectives add ts.dl.version dummy execute store result score $global ts.dl.version run data get entity @r DataVersion -#execute if score $global ts.dl.version matches 3900.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"\u26a0 Minecraft version ","color":"red"},{"text":"1.21 or above","color":"red","bold":true},{"text":" detected! This version of the data pack does not work in 1.21+! Please use a newer version.","color":"red"}] -#execute unless score $global tvc_ignore matches 1 if score $global ts.dl.version matches 3900.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Minecraft version 1.20.6 or above detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}] #execute if score $global ts.dl.version matches 2976..3106 run say 1.19 detected! #execute if score $global ts.dl.version matches 2731..2975 run say 1.18 detected! #execute if score $global ts.dl.version matches 2587..2730 run say 1.17 detected! diff --git a/data/dynamiclights/tags/entity_type/reparse.json b/data/dynamiclights/tags/entity_type/reparse.json deleted file mode 100644 index 31d7875..0000000 --- a/data/dynamiclights/tags/entity_type/reparse.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "//comment": "These entities need special parsing and are dynamic item holders, meaning that they may change their item over time. They will get reparsed every 4 seconds by default.", - "//version_notice": "Only needed until 24w11a.", - "replace": false, - "values": [ - "#dynamiclights:reparse_interactible", - {"id": "minecraft:item_display", "required": false} - ] -} diff --git a/data/dynamiclights/tags/entity_type/reparse_interactible.json b/data/dynamiclights/tags/entity_type/reparse_interactible.json deleted file mode 100644 index a924ec3..0000000 --- a/data/dynamiclights/tags/entity_type/reparse_interactible.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "//comment": "These entities need special parsing and are dynamic item holders, meaning that they may change their item over time. They are interactible by players and should listen to player interact events.", - "//version_notice": "Only needed until 24w11a.", - "replace": false, - "values": [ - "minecraft:item_frame", - "minecraft:glow_item_frame" - ] -} diff --git a/data/tschipcraft/advancement/menu.json b/data/tschipcraft/advancement/menu.json new file mode 100644 index 0000000..22a20a3 --- /dev/null +++ b/data/tschipcraft/advancement/menu.json @@ -0,0 +1,23 @@ +{ + "criteria": { + "trigger_menu": { + "trigger": "minecraft:tick", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "tschipcraft.menu": { + "min": 1 + } + } + } + ] + } + } + }, + "rewards": { + "function": "tschipcraft:menu" + } +} diff --git a/data/tschipcraft/function/menu.mcfunction b/data/tschipcraft/function/menu.mcfunction index 77fc074..a03030d 100644 --- a/data/tschipcraft/function/menu.mcfunction +++ b/data/tschipcraft/function/menu.mcfunction @@ -1,4 +1,8 @@ ##by Tschipcraft -scoreboard players set @s tschipcraft.menu 1 -function dynamiclights:settings/hide_feedback/main +scoreboard players reset @s tschipcraft.menu +scoreboard players enable @a tschipcraft.menu +advancement revoke @s only tschipcraft:menu + +# Call menu hook +function #tschipcraft:menu diff --git a/data/tschipcraft/function/menu_header.mcfunction b/data/tschipcraft/function/menu_header.mcfunction new file mode 100644 index 0000000..6e37692 --- /dev/null +++ b/data/tschipcraft/function/menu_header.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +tellraw @s {"text":"The following packs are installed:","color":"gold"} +function dynamiclights:settings/hide_feedback/main diff --git a/data/tschipcraft/tags/function/menu.json b/data/tschipcraft/tags/function/menu.json index 84e3739..b644b4b 100644 --- a/data/tschipcraft/tags/function/menu.json +++ b/data/tschipcraft/tags/function/menu.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ - "tschipcraft:menu" + "tschipcraft:menu_header", + "dynamiclights:internal/messages/welcome" ] }