From 2ea659d1ca2cd70eb016cf91dd77fd9cbc17a72d Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Thu, 4 Jul 2024 20:57:52 +0200 Subject: [PATCH 1/4] Support for Snapshot 24w18a - Updated to work with Snapshot 24w18a using adjusted overlays - Fixed performance overlay for Minecraft 1.20.2+ not having an effect - Updated GitHub workflow to exclude rather than include folders --- .github/workflows/cd.yml | 6 ++-- .github/workflows/test_workflow.yml | 8 ++--- .gitignore | 1 + CHANGELOG.md | 35 ++----------------- .../internal/version_checker/start.mcfunction | 2 +- .../place_light/12/summon_exec.mcfunction | 2 +- .../place_light/12/summon_new.mcfunction | 0 .../place_light/15/summon_exec.mcfunction | 0 .../place_light/15/summon_new.mcfunction | 0 .../place_light/3/summon_exec.mcfunction | 0 .../place_light/3/summon_new.mcfunction | 0 .../place_light/6/summon_exec.mcfunction | 0 .../place_light/6/summon_new.mcfunction | 0 .../place_light/9/summon_exec.mcfunction | 2 +- .../place_light/9/summon_new.mcfunction | 0 .../channeling_trident.json | 4 +++ .../fire_aspect_items.json | 4 +++ .../riptide_trident.json | 4 +++ pack.mcmeta | 8 ++--- 19 files changed, 29 insertions(+), 47 deletions(-) create mode 100644 .gitignore rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/12/summon_exec.mcfunction (83%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/12/summon_new.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/15/summon_exec.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/15/summon_new.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/3/summon_exec.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/3/summon_new.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/6/summon_exec.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/6/summon_new.mcfunction (100%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/9/summon_exec.mcfunction (83%) rename overlay_16/data/dynamiclights/functions/{ => internal}/place_light/9/summon_new.mcfunction (100%) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 07803aa..3394df0 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 data overlay_16 overlay_33 overlay_35 overlay_disable_trim pack.mcmeta pack.png LICENSE README.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 src META-INF fabric.mod.json unused wiki CHANGELOG.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 data overlay_16 overlay_33 overlay_35 overlay_disable_trim assets META-INF net fabric.mod.json pack.mcmeta pack.png LICENSE README.md + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused wiki CHANGELOG.md ".*" - 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 assets overlay_16 overlay_33 overlay_35 overlay_disable_trim pack.mcmeta pack.png LICENSE README.md + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x net src META-INF fabric.mod.json unused wiki CHANGELOG.md ".*" # Upload - name: Upload data pack version to Modrinth diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 139d51c..05157d5 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -1,4 +1,4 @@ -name: Continuous Deployment (Test) +name: Continuous Deployment (Build) on: workflow_dispatch: inputs: @@ -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 data overlay_16 overlay_33 overlay_35 overlay_disable_trim pack.mcmeta pack.png LICENSE README.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 src META-INF fabric.mod.json unused wiki CHANGELOG.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 data overlay_16 overlay_33 overlay_35 overlay_disable_trim assets META-INF net fabric.mod.json pack.mcmeta pack.png LICENSE README.md + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused wiki CHANGELOG.md ".*" - 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 assets overlay_16 overlay_33 overlay_35 overlay_disable_trim pack.mcmeta pack.png LICENSE README.md + args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x net src META-INF fabric.mod.json unused wiki CHANGELOG.md ".*" # Upload - name: Capture datapack build artifact diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..515e491 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/unused \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index de29d99..fb9bba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,2 @@ -Hotfix for v1.8 - the data pack now actually includes the overlays for compatibility with 1.20.6 (closes [#34](https://github.com/Tschipcraft/dynamiclights/issues/34)) - -- **Update to Minecraft 1.20.6 šŗ** - These changes utilize overlays to maintain backwards compatibility - - Switched to testing components rather than NBT in predicates - - Added support for the newly added contents slot in predicates -- **Added intermediate light levels 3 and 12** ([#14](https://github.com/Tschipcraft/dynamiclights/issues/14)) - - Magma cubes, magma blocks, magma cream, all remaining amethyst buds, heart of the sea and totem of undying (closes [#23](https://github.com/Tschipcraft/dynamiclights/issues/23)) now emit light level 3 - - Dragon fireballs now emit light level 12 instead of 15 -- **Implemented a new system for finding valid locations for dynamic lights.** -Checks now actively avoid blocking paths of fluids and pistons (closes [#15](https://github.com/Tschipcraft/dynamiclights/issues/15)), interfering with other redstone components and triggering certain block updates (closes [#12](https://github.com/Tschipcraft/dynamiclights/issues/12)) -- **Added support for parsing item displays, block displays and falling blocks** -- **Added support for parsing tridents, arrows and ominous item spawners in versions 1.20.5 and up** -- Simplified light block placement and removal -- Fixed shulkers teleporting away when shooting (closes [#20](https://github.com/Tschipcraft/dynamiclights/issues/20)) -- Eventified item frame reparsing in versions before 1.20.5 - Item frame reparsing is now triggered when a player right-clicks on an item frame or when an item drops nearby in versions prior to 24w11a - This should improve performance in regions with a high number of item frames while also improving responsiveness (first steps for [#13](https://github.com/Tschipcraft/dynamiclights/issues/13)) -- Improved dynamic light explosion avoidance performance by checking a global score instead of scanning for nearby area effect clouds -- Fixed dynamic lights overwriting cave_air with air -- Fixed dynamic light position offset for item entities -- Added separate mod support tag lists for modded items -- Added additional overlay that should slightly improve performance when placing dynamic lights in 1.20.2 and above -- Gave dynamic light marker entities a custom name ([#19](https://github.com/Tschipcraft/dynamiclights/issues/19)) -- Some light level changes - - Added conduit to light level 15 items - - Moved glowstone dust from light level 15 to light level 9 - - Added crying obsidian to light level 9 items - - Added small_fireball to light level 9 entities - - Moved allay from 9 to light level 6 entities - - Added enchanted golden apple, enchanting table, enchanted book, sculk catalyst and the upcoming vault to light level 6 items -- Added paintings to the ignore tag list -- Added tnt minecarts to the may_block_explosion_damage tag list +- **Update to Minecraft 1.21** +- Fixed performance overlay for Minecraft 1.20.2+ not having an effect diff --git a/data/dynamiclights/functions/internal/version_checker/start.mcfunction b/data/dynamiclights/functions/internal/version_checker/start.mcfunction index 184b695..711278a 100644 --- a/data/dynamiclights/functions/internal/version_checker/start.mcfunction +++ b/data/dynamiclights/functions/internal/version_checker/start.mcfunction @@ -2,7 +2,7 @@ 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 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! diff --git a/overlay_16/data/dynamiclights/functions/place_light/12/summon_exec.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/12/summon_exec.mcfunction similarity index 83% rename from overlay_16/data/dynamiclights/functions/place_light/12/summon_exec.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/12/summon_exec.mcfunction index 3eab96d..c05c84c 100644 --- a/overlay_16/data/dynamiclights/functions/place_light/12/summon_exec.mcfunction +++ b/overlay_16/data/dynamiclights/functions/internal/place_light/12/summon_exec.mcfunction @@ -3,4 +3,4 @@ data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [12]"}'} -function dynamiclights:internal/place_light/6/update +function dynamiclights:internal/place_light/12/update diff --git a/overlay_16/data/dynamiclights/functions/place_light/12/summon_new.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/12/summon_new.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/12/summon_new.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/12/summon_new.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/15/summon_exec.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/15/summon_exec.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/15/summon_exec.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/15/summon_exec.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/15/summon_new.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/15/summon_new.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/15/summon_new.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/15/summon_new.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/3/summon_exec.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/3/summon_exec.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/3/summon_exec.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/3/summon_exec.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/3/summon_new.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/3/summon_new.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/3/summon_new.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/3/summon_new.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/6/summon_exec.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/6/summon_exec.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/6/summon_exec.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/6/summon_exec.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/6/summon_new.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/6/summon_new.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/6/summon_new.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/6/summon_new.mcfunction diff --git a/overlay_16/data/dynamiclights/functions/place_light/9/summon_exec.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/9/summon_exec.mcfunction similarity index 83% rename from overlay_16/data/dynamiclights/functions/place_light/9/summon_exec.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/9/summon_exec.mcfunction index 4c4677b..f209162 100644 --- a/overlay_16/data/dynamiclights/functions/place_light/9/summon_exec.mcfunction +++ b/overlay_16/data/dynamiclights/functions/internal/place_light/9/summon_exec.mcfunction @@ -3,4 +3,4 @@ data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [9]"}'} -function dynamiclights:internal/place_light/6/update +function dynamiclights:internal/place_light/9/update diff --git a/overlay_16/data/dynamiclights/functions/place_light/9/summon_new.mcfunction b/overlay_16/data/dynamiclights/functions/internal/place_light/9/summon_new.mcfunction similarity index 100% rename from overlay_16/data/dynamiclights/functions/place_light/9/summon_new.mcfunction rename to overlay_16/data/dynamiclights/functions/internal/place_light/9/summon_new.mcfunction diff --git a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/channeling_trident.json b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/channeling_trident.json index bbfb734..2c3e866 100644 --- a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/channeling_trident.json +++ b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/channeling_trident.json @@ -1,6 +1,7 @@ [ { "//comment": "This predicate returns false, if the tested entity is holding a with channeling enchanted trident", + "//version": "enchantments alongside enchantment is included for 24w18a-24w21a", "condition": "minecraft:inverted", "term": { "condition": "minecraft:entity_properties", @@ -18,6 +19,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:channeling", + "enchantments": "minecraft:channeling", "levels": { "min": 1 } @@ -47,6 +49,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:channeling", + "enchantments": "minecraft:channeling", "levels": { "min": 1 } @@ -77,6 +80,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:channeling", + "enchantments": "minecraft:channeling", "levels": { "min": 1 } diff --git a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/fire_aspect_items.json b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/fire_aspect_items.json index 72039a2..b1044d2 100644 --- a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/fire_aspect_items.json +++ b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/fire_aspect_items.json @@ -1,6 +1,7 @@ [ { "//comment": "This predicate returns false, if the tested entity is holding any fire aspect enchanted items", + "//version": "enchantments alongside enchantment is included for 24w18a-24w21a", "condition": "minecraft:inverted", "term": { "condition": "minecraft:entity_properties", @@ -15,6 +16,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:fire_aspect", + "enchantments": "minecraft:fire_aspect", "levels": { "min": 1 } @@ -41,6 +43,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:fire_aspect", + "enchantments": "minecraft:fire_aspect", "levels": { "min": 1 } @@ -68,6 +71,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:fire_aspect", + "enchantments": "minecraft:fire_aspect", "levels": { "min": 1 } diff --git a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/riptide_trident.json b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/riptide_trident.json index 628dc22..6020545 100644 --- a/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/riptide_trident.json +++ b/overlay_35/data/dynamiclights/predicates/entity/additional_item_tests/riptide_trident.json @@ -1,6 +1,7 @@ [ { "//comment": "This predicate returns false, if the tested entity is holding a with riptide enchanted trident", + "//version": "enchantments alongside enchantment is included for 24w18a-24w21a", "condition": "minecraft:inverted", "term": { "condition": "minecraft:entity_properties", @@ -18,6 +19,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:riptide", + "enchantments": "minecraft:riptide", "levels": { "min": 1 } @@ -47,6 +49,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:riptide", + "enchantments": "minecraft:riptide", "levels": { "min": 1 } @@ -77,6 +80,7 @@ "minecraft:enchantments": [ { "enchantment": "minecraft:riptide", + "enchantments": "minecraft:riptide", "levels": { "min": 1 } diff --git a/pack.mcmeta b/pack.mcmeta index b53e2a4..e760bdd 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -2,21 +2,21 @@ "id": "dynamiclights", "pack": { "pack_format": 15, - "supported_formats": [7,41], + "supported_formats": [7,45], "description": "Tschipcraft's Dynamic Lights \nā v${version} ā mc${mc_version}" }, "overlays": { "entries": [ { - "formats": [16,99], + "formats": [16,44], "directory": "overlay_16" }, { - "formats": [33,99], + "formats": [33,44], "directory": "overlay_33" }, { - "formats": [35,99], + "formats": [35,44], "directory": "overlay_35" }, { From 6a600f98b38154bcff38f0902899e048817f37c5 Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:44:04 +0200 Subject: [PATCH 2/4] Support for Snapshot 24w21a - Updated to work with Snapshot 24w21a (#29) - Copied the contents of the legacy folders to their new names - Updated GitHub workflow to properly exclude folders --- .github/workflows/cd.yml | 6 +- .github/workflows/test_workflow.yml | 6 +- .../function/api/place_light/12.mcfunction | 7 + .../function/api/place_light/15.mcfunction | 7 + .../function/api/place_light/3.mcfunction | 7 + .../function/api/place_light/6.mcfunction | 7 + .../function/api/place_light/9.mcfunction | 7 + .../dynamiclights/function/install.mcfunction | 78 +++++++++++ .../function/install_trigger.mcfunction | 4 + .../activate/channeling.mcfunction | 4 + .../enchantments/activate/riptide.mcfunction | 4 + .../deactivate/channeling.mcfunction | 4 + .../deactivate/riptide.mcfunction | 4 + .../explosion_detection/reset.mcfunction | 4 + .../explosion_detection/setup/tnt.mcfunction | 7 + .../explosion_detection/tnt.mcfunction | 10 ++ .../function/internal/ghast.mcfunction | 6 + .../internal/item_frame/interacted.mcfunction | 6 + .../function/internal/kill_marker.mcfunction | 5 + .../function/internal/loop.mcfunction | 6 + .../function/internal/main.mcfunction | 19 +++ .../function/internal/main_exec.mcfunction | 12 ++ .../internal/main_exec_pass.mcfunction | 29 ++++ .../function/internal/menu.mcfunction | 9 ++ .../function/internal/menu_reset.mcfunction | 4 + .../internal/messages/welcome.mcfunction | 4 + .../internal/place_light/12/exec.mcfunction | 11 ++ .../12/find_place/layer_1.mcfunction | 13 ++ .../12/find_place/layer_2.mcfunction | 17 +++ .../place_light/12/place_block.mcfunction | 6 + .../place_light/12/prev_it/check.mcfunction | 8 ++ .../place_light/12/prev_it/update.mcfunction | 5 + .../internal/place_light/12/summon.mcfunction | 11 ++ .../place_light/12/summon_exec.mcfunction | 6 + .../place_light/12/summon_new.mcfunction | 5 + .../internal/place_light/12/update.mcfunction | 8 ++ .../internal/place_light/15/exec.mcfunction | 11 ++ .../15/find_place/layer_1.mcfunction | 13 ++ .../15/find_place/layer_2.mcfunction | 17 +++ .../place_light/15/place_block.mcfunction | 6 + .../place_light/15/prev_it/check.mcfunction | 7 + .../place_light/15/prev_it/update.mcfunction | 5 + .../internal/place_light/15/summon.mcfunction | 11 ++ .../place_light/15/summon_exec.mcfunction | 6 + .../place_light/15/summon_new.mcfunction | 5 + .../internal/place_light/15/update.mcfunction | 8 ++ .../internal/place_light/3/exec.mcfunction | 11 ++ .../3/find_place/layer_1.mcfunction | 13 ++ .../3/find_place/layer_2.mcfunction | 17 +++ .../place_light/3/place_block.mcfunction | 6 + .../place_light/3/prev_it/check.mcfunction | 8 ++ .../place_light/3/prev_it/update.mcfunction | 5 + .../internal/place_light/3/summon.mcfunction | 11 ++ .../place_light/3/summon_exec.mcfunction | 6 + .../place_light/3/summon_new.mcfunction | 5 + .../internal/place_light/3/update.mcfunction | 8 ++ .../internal/place_light/6/exec.mcfunction | 11 ++ .../6/find_place/layer_1.mcfunction | 13 ++ .../6/find_place/layer_2.mcfunction | 17 +++ .../place_light/6/place_block.mcfunction | 6 + .../place_light/6/prev_it/check.mcfunction | 8 ++ .../place_light/6/prev_it/update.mcfunction | 5 + .../internal/place_light/6/summon.mcfunction | 11 ++ .../place_light/6/summon_exec.mcfunction | 6 + .../place_light/6/summon_new.mcfunction | 5 + .../internal/place_light/6/update.mcfunction | 8 ++ .../internal/place_light/9/exec.mcfunction | 11 ++ .../9/find_place/layer_1.mcfunction | 13 ++ .../9/find_place/layer_2.mcfunction | 17 +++ .../place_light/9/place_block.mcfunction | 6 + .../place_light/9/prev_it/check.mcfunction | 8 ++ .../place_light/9/prev_it/update.mcfunction | 5 + .../internal/place_light/9/summon.mcfunction | 11 ++ .../place_light/9/summon_exec.mcfunction | 6 + .../place_light/9/summon_new.mcfunction | 5 + .../internal/place_light/9/update.mcfunction | 8 ++ .../function/internal/remove_light.mcfunction | 10 ++ .../function/internal/sources/core.mcfunction | 11 ++ .../internal/sources/entity.mcfunction | 10 ++ .../sources/parse/extension_1194.mcfunction | 4 + .../internal/sources/parse/main.mcfunction | 19 +++ .../sources/parse/main_exec.mcfunction | 30 ++++ .../internal/version_checker/retry.mcfunction | 3 + .../internal/version_checker/start.mcfunction | 15 ++ .../function/internal/water/enter.mcfunction | 8 ++ .../function/internal/water/exit.mcfunction | 8 ++ .../internal/water/rain_check_1194.mcfunction | 4 + data/dynamiclights/function/reset.mcfunction | 18 +++ .../function/settings.mcfunction | 3 + .../function/settings/core.mcfunction | 69 +++++++++ .../settings/hide_feedback/hide.mcfunction | 4 + .../settings/hide_feedback/main.mcfunction | 5 + .../settings/hide_feedback/unhide.mcfunction | 3 + .../toggle_amethyst_trimmed.mcfunction | 8 ++ .../settings/toggle_channeling.mcfunction | 8 ++ .../toggle_enchanted_items.mcfunction | 8 ++ .../settings/toggle_fire_aspect.mcfunction | 8 ++ .../function/settings/toggle_ghast.mcfunction | 8 ++ .../settings/toggle_glowing.mcfunction | 8 ++ .../settings/toggle_on_fire.mcfunction | 8 ++ .../toggle_rain_sensitivity.mcfunction | 8 ++ .../settings/toggle_riptide.mcfunction | 8 ++ .../function/settings/toggle_sound.mcfunction | 8 ++ .../toggle_water_sensitivity.mcfunction | 9 ++ .../function/summon_light.mcfunction | 4 + .../function/summon_redstone_light.mcfunction | 4 + .../function/summon_soul_light.mcfunction | 4 + .../function/uninstall.mcfunction | 43 ++++++ .../amethyst_trimmed_items.json | 80 +++++++++++ .../channeling_trident.json | 101 ++++++++++++++ .../enchanted_items.json | 89 ++++++++++++ .../fire_aspect_items.json | 92 ++++++++++++ .../riptide_trident.json | 101 ++++++++++++++ .../entity/has_amethyst_trimmed_items.json | 25 ++++ .../entity/has_channeling_trident.json | 29 ++++ .../predicate/entity/has_enchanted_items.json | 25 ++++ .../entity/has_fire_aspect_items.json | 25 ++++ .../predicate/entity/has_riptide_trident.json | 32 +++++ .../predicate/entity/is_glowing.json | 31 ++++ .../predicate/entity/is_in_water.json | 8 ++ .../predicate/entity/is_on_fire.json | 27 ++++ .../predicate/entity/light_level/12.json | 65 +++++++++ .../entity/light_level/12/contents.json | 32 +++++ .../light_level/12/has_mainhand_item.json | 17 +++ .../predicate/entity/light_level/12/head.json | 31 ++++ .../entity/light_level/12/mainhand.json | 31 ++++ .../entity/light_level/12/offhand.json | 31 ++++ .../predicate/entity/light_level/15.json | 72 ++++++++++ .../entity/light_level/15/contents.json | 55 ++++++++ .../light_level/15/has_mainhand_item.json | 40 ++++++ .../predicate/entity/light_level/15/head.json | 54 +++++++ .../entity/light_level/15/mainhand.json | 54 +++++++ .../entity/light_level/15/offhand.json | 54 +++++++ .../predicate/entity/light_level/3.json | 65 +++++++++ .../entity/light_level/3/contents.json | 32 +++++ .../light_level/3/has_mainhand_item.json | 17 +++ .../predicate/entity/light_level/3/head.json | 31 ++++ .../entity/light_level/3/mainhand.json | 31 ++++ .../entity/light_level/3/offhand.json | 31 ++++ .../predicate/entity/light_level/6.json | 79 +++++++++++ .../entity/light_level/6/contents.json | 32 +++++ .../light_level/6/has_mainhand_item.json | 17 +++ .../predicate/entity/light_level/6/head.json | 31 ++++ .../entity/light_level/6/mainhand.json | 31 ++++ .../entity/light_level/6/offhand.json | 31 ++++ .../predicate/entity/light_level/9.json | 93 ++++++++++++ .../entity/light_level/9/contents.json | 32 +++++ .../light_level/9/has_mainhand_item.json | 17 +++ .../predicate/entity/light_level/9/head.json | 31 ++++ .../entity/light_level/9/mainhand.json | 31 ++++ .../entity/light_level/9/offhand.json | 31 ++++ .../entity/should_emit_light_level/12.json | 10 ++ .../entity/should_emit_light_level/15.json | 10 ++ .../entity/should_emit_light_level/3.json | 10 ++ .../entity/should_emit_light_level/6.json | 10 ++ .../entity/should_emit_light_level/9.json | 10 ++ .../contents/water_immersion_extinguish.json | 25 ++++ .../contents/water_immersion_illuminate.json | 25 ++++ .../head/water_immersion_extinguish.json | 24 ++++ .../head/water_immersion_illuminate.json | 24 ++++ .../entity/water_check/is_outside_water.json | 20 +++ .../mainhand/water_immersion_extinguish.json | 24 ++++ .../mainhand/water_immersion_illuminate.json | 24 ++++ .../no_water_immersion_extinguish_items.json | 68 +++++++++ .../no_water_immersion_illuminate_items.json | 68 +++++++++ .../offhand/water_immersion_extinguish.json | 24 ++++ .../offhand/water_immersion_illuminate.json | 24 ++++ .../water_check/scores/12_turn_off.json | 17 +++ .../entity/water_check/scores/12_turn_on.json | 17 +++ .../water_check/scores/15_turn_off.json | 17 +++ .../entity/water_check/scores/15_turn_on.json | 17 +++ .../entity/water_check/scores/3_turn_off.json | 17 +++ .../entity/water_check/scores/3_turn_on.json | 17 +++ .../entity/water_check/scores/6_turn_off.json | 17 +++ .../entity/water_check/scores/6_turn_on.json | 17 +++ .../entity/water_check/scores/9_turn_off.json | 17 +++ .../entity/water_check/scores/9_turn_on.json | 17 +++ .../predicate/ghast_targeting.json | 26 ++++ data/dynamiclights/predicate/visible.json | 11 ++ .../predicate/world/in_water.json | 9 ++ .../predicate/world/is_raining.json | 4 + .../place_light/piston_deep_search/down.json | 17 +++ .../piston_deep_search/down/2.json | 27 ++++ .../piston_deep_search/down/3.json | 39 ++++++ .../place_light/piston_deep_search/east.json | 17 +++ .../piston_deep_search/east/2.json | 27 ++++ .../piston_deep_search/east/3.json | 39 ++++++ .../place_light/piston_deep_search/north.json | 17 +++ .../piston_deep_search/north/2.json | 27 ++++ .../piston_deep_search/north/3.json | 39 ++++++ .../place_light/piston_deep_search/south.json | 17 +++ .../piston_deep_search/south/2.json | 27 ++++ .../piston_deep_search/south/3.json | 39 ++++++ .../place_light/piston_deep_search/up.json | 17 +++ .../place_light/piston_deep_search/up/2.json | 27 ++++ .../place_light/piston_deep_search/up/3.json | 39 ++++++ .../place_light/piston_deep_search/west.json | 17 +++ .../piston_deep_search/west/2.json | 27 ++++ .../piston_deep_search/west/3.json | 39 ++++++ .../world/place_light/pos_blocked.json | 30 ++++ .../world/place_light/valid_pos.json | 132 ++++++++++++++++++ .../tags/block/affected_by_gravity.json | 10 ++ data/dynamiclights/tags/block/air.json | 8 ++ data/dynamiclights/tags/block/avoid.json | 26 ++++ .../tags/block/breaks_piston_push_chain.json | 25 ++++ data/dynamiclights/tags/block/piston.json | 8 ++ .../dynamiclights/tags/block/tnt_exclude.json | 9 ++ .../tags/entity_type/dyn_ignore.json | 13 ++ .../tags/entity_type/light_level/12.json | 7 + .../tags/entity_type/light_level/15.json | 9 ++ .../tags/entity_type/light_level/3.json | 7 + .../tags/entity_type/light_level/6.json | 9 ++ .../tags/entity_type/light_level/9.json | 13 ++ .../tags/entity_type/may_block_explosion.json | 10 ++ .../dynamiclights/tags/entity_type/parse.json | 9 ++ .../tags/entity_type/reparse.json | 9 ++ .../entity_type/reparse_interactible.json | 9 ++ .../entity_type/single_slot_entities.json | 13 ++ .../dynamiclights/tags/function/settings.json | 6 + .../tags/item/light_level/12.json | 7 + .../tags/item/light_level/15.json | 21 +++ .../tags/item/light_level/3.json | 14 ++ .../tags/item/light_level/6.json | 20 +++ .../tags/item/light_level/9.json | 20 +++ .../tags/item/mod_support/light_level/12.json | 6 + .../tags/item/mod_support/light_level/15.json | 8 ++ .../tags/item/mod_support/light_level/3.json | 9 ++ .../tags/item/mod_support/light_level/6.json | 9 ++ .../tags/item/mod_support/light_level/9.json | 9 ++ .../mod_support/water_sensitive/turn_off.json | 7 + .../mod_support/water_sensitive/turn_on.json | 6 + .../tags/item/trimmable_armor.json | 6 + .../tags/item/water_sensitive/turn_off.json | 14 ++ .../tags/item/water_sensitive/turn_on.json | 10 ++ data/minecraft/tags/function/load.json | 5 + data/tschipcraft/function/menu.mcfunction | 4 + data/tschipcraft/tags/function/menu.json | 6 + 237 files changed, 4602 insertions(+), 6 deletions(-) create mode 100644 data/dynamiclights/function/api/place_light/12.mcfunction create mode 100644 data/dynamiclights/function/api/place_light/15.mcfunction create mode 100644 data/dynamiclights/function/api/place_light/3.mcfunction create mode 100644 data/dynamiclights/function/api/place_light/6.mcfunction create mode 100644 data/dynamiclights/function/api/place_light/9.mcfunction create mode 100644 data/dynamiclights/function/install.mcfunction create mode 100644 data/dynamiclights/function/install_trigger.mcfunction create mode 100644 data/dynamiclights/function/internal/enchantments/activate/channeling.mcfunction create mode 100644 data/dynamiclights/function/internal/enchantments/activate/riptide.mcfunction create mode 100644 data/dynamiclights/function/internal/enchantments/deactivate/channeling.mcfunction create mode 100644 data/dynamiclights/function/internal/enchantments/deactivate/riptide.mcfunction create mode 100644 data/dynamiclights/function/internal/explosion_detection/reset.mcfunction create mode 100644 data/dynamiclights/function/internal/explosion_detection/setup/tnt.mcfunction create mode 100644 data/dynamiclights/function/internal/explosion_detection/tnt.mcfunction create mode 100644 data/dynamiclights/function/internal/ghast.mcfunction create mode 100644 data/dynamiclights/function/internal/item_frame/interacted.mcfunction create mode 100644 data/dynamiclights/function/internal/kill_marker.mcfunction create mode 100644 data/dynamiclights/function/internal/loop.mcfunction create mode 100644 data/dynamiclights/function/internal/main.mcfunction create mode 100644 data/dynamiclights/function/internal/main_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/main_exec_pass.mcfunction create mode 100644 data/dynamiclights/function/internal/menu.mcfunction create mode 100644 data/dynamiclights/function/internal/menu_reset.mcfunction create mode 100644 data/dynamiclights/function/internal/messages/welcome.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/find_place/layer_1.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/find_place/layer_2.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/place_block.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/prev_it/check.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/prev_it/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/summon.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/summon_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/summon_new.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/12/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/find_place/layer_1.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/find_place/layer_2.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/place_block.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/prev_it/check.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/prev_it/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/summon.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/summon_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/summon_new.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/15/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/find_place/layer_1.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/find_place/layer_2.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/place_block.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/prev_it/check.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/prev_it/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/summon.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/summon_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/summon_new.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/3/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/find_place/layer_1.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/find_place/layer_2.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/place_block.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/prev_it/check.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/prev_it/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/summon.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/summon_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/summon_new.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/6/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/find_place/layer_1.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/find_place/layer_2.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/place_block.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/prev_it/check.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/prev_it/update.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/summon.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/summon_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/summon_new.mcfunction create mode 100644 data/dynamiclights/function/internal/place_light/9/update.mcfunction create mode 100644 data/dynamiclights/function/internal/remove_light.mcfunction create mode 100644 data/dynamiclights/function/internal/sources/core.mcfunction create mode 100644 data/dynamiclights/function/internal/sources/entity.mcfunction create mode 100644 data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction create mode 100644 data/dynamiclights/function/internal/sources/parse/main.mcfunction create mode 100644 data/dynamiclights/function/internal/sources/parse/main_exec.mcfunction create mode 100644 data/dynamiclights/function/internal/version_checker/retry.mcfunction create mode 100644 data/dynamiclights/function/internal/version_checker/start.mcfunction create mode 100644 data/dynamiclights/function/internal/water/enter.mcfunction create mode 100644 data/dynamiclights/function/internal/water/exit.mcfunction create mode 100644 data/dynamiclights/function/internal/water/rain_check_1194.mcfunction create mode 100644 data/dynamiclights/function/reset.mcfunction create mode 100644 data/dynamiclights/function/settings.mcfunction create mode 100644 data/dynamiclights/function/settings/core.mcfunction create mode 100644 data/dynamiclights/function/settings/hide_feedback/hide.mcfunction create mode 100644 data/dynamiclights/function/settings/hide_feedback/main.mcfunction create mode 100644 data/dynamiclights/function/settings/hide_feedback/unhide.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_amethyst_trimmed.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_channeling.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_enchanted_items.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_fire_aspect.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_ghast.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_glowing.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_on_fire.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_rain_sensitivity.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_riptide.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_sound.mcfunction create mode 100644 data/dynamiclights/function/settings/toggle_water_sensitivity.mcfunction create mode 100644 data/dynamiclights/function/summon_light.mcfunction create mode 100644 data/dynamiclights/function/summon_redstone_light.mcfunction create mode 100644 data/dynamiclights/function/summon_soul_light.mcfunction create mode 100644 data/dynamiclights/function/uninstall.mcfunction create mode 100644 data/dynamiclights/predicate/entity/additional_item_tests/amethyst_trimmed_items.json create mode 100644 data/dynamiclights/predicate/entity/additional_item_tests/channeling_trident.json create mode 100644 data/dynamiclights/predicate/entity/additional_item_tests/enchanted_items.json create mode 100644 data/dynamiclights/predicate/entity/additional_item_tests/fire_aspect_items.json create mode 100644 data/dynamiclights/predicate/entity/additional_item_tests/riptide_trident.json create mode 100644 data/dynamiclights/predicate/entity/has_amethyst_trimmed_items.json create mode 100644 data/dynamiclights/predicate/entity/has_channeling_trident.json create mode 100644 data/dynamiclights/predicate/entity/has_enchanted_items.json create mode 100644 data/dynamiclights/predicate/entity/has_fire_aspect_items.json create mode 100644 data/dynamiclights/predicate/entity/has_riptide_trident.json create mode 100644 data/dynamiclights/predicate/entity/is_glowing.json create mode 100644 data/dynamiclights/predicate/entity/is_in_water.json create mode 100644 data/dynamiclights/predicate/entity/is_on_fire.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12/contents.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12/has_mainhand_item.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12/head.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12/mainhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/12/offhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15/contents.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15/has_mainhand_item.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15/head.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15/mainhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/15/offhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3/contents.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3/has_mainhand_item.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3/head.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3/mainhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/3/offhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6/contents.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6/has_mainhand_item.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6/head.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6/mainhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/6/offhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9/contents.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9/has_mainhand_item.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9/head.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9/mainhand.json create mode 100644 data/dynamiclights/predicate/entity/light_level/9/offhand.json create mode 100644 data/dynamiclights/predicate/entity/should_emit_light_level/12.json create mode 100644 data/dynamiclights/predicate/entity/should_emit_light_level/15.json create mode 100644 data/dynamiclights/predicate/entity/should_emit_light_level/3.json create mode 100644 data/dynamiclights/predicate/entity/should_emit_light_level/6.json create mode 100644 data/dynamiclights/predicate/entity/should_emit_light_level/9.json create mode 100644 data/dynamiclights/predicate/entity/water_check/contents/water_immersion_extinguish.json create mode 100644 data/dynamiclights/predicate/entity/water_check/contents/water_immersion_illuminate.json create mode 100644 data/dynamiclights/predicate/entity/water_check/head/water_immersion_extinguish.json create mode 100644 data/dynamiclights/predicate/entity/water_check/head/water_immersion_illuminate.json create mode 100644 data/dynamiclights/predicate/entity/water_check/is_outside_water.json create mode 100644 data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_extinguish.json create mode 100644 data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_illuminate.json create mode 100644 data/dynamiclights/predicate/entity/water_check/no_water_immersion_extinguish_items.json create mode 100644 data/dynamiclights/predicate/entity/water_check/no_water_immersion_illuminate_items.json create mode 100644 data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_extinguish.json create mode 100644 data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_illuminate.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/12_turn_off.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/12_turn_on.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/15_turn_off.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/15_turn_on.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/3_turn_off.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/3_turn_on.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/6_turn_off.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/6_turn_on.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/9_turn_off.json create mode 100644 data/dynamiclights/predicate/entity/water_check/scores/9_turn_on.json create mode 100644 data/dynamiclights/predicate/ghast_targeting.json create mode 100644 data/dynamiclights/predicate/visible.json create mode 100644 data/dynamiclights/predicate/world/in_water.json create mode 100644 data/dynamiclights/predicate/world/is_raining.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/down.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/down/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/down/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/east.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/east/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/east/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/north.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/north/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/north/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/south.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/south/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/south/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/up.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/up/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/up/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/west.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/west/2.json create mode 100644 data/dynamiclights/predicate/world/place_light/piston_deep_search/west/3.json create mode 100644 data/dynamiclights/predicate/world/place_light/pos_blocked.json create mode 100644 data/dynamiclights/predicate/world/place_light/valid_pos.json create mode 100644 data/dynamiclights/tags/block/affected_by_gravity.json create mode 100644 data/dynamiclights/tags/block/air.json create mode 100644 data/dynamiclights/tags/block/avoid.json create mode 100644 data/dynamiclights/tags/block/breaks_piston_push_chain.json create mode 100644 data/dynamiclights/tags/block/piston.json create mode 100644 data/dynamiclights/tags/block/tnt_exclude.json create mode 100644 data/dynamiclights/tags/entity_type/dyn_ignore.json create mode 100644 data/dynamiclights/tags/entity_type/light_level/12.json create mode 100644 data/dynamiclights/tags/entity_type/light_level/15.json create mode 100644 data/dynamiclights/tags/entity_type/light_level/3.json create mode 100644 data/dynamiclights/tags/entity_type/light_level/6.json create mode 100644 data/dynamiclights/tags/entity_type/light_level/9.json create mode 100644 data/dynamiclights/tags/entity_type/may_block_explosion.json create mode 100644 data/dynamiclights/tags/entity_type/parse.json create mode 100644 data/dynamiclights/tags/entity_type/reparse.json create mode 100644 data/dynamiclights/tags/entity_type/reparse_interactible.json create mode 100644 data/dynamiclights/tags/entity_type/single_slot_entities.json create mode 100644 data/dynamiclights/tags/function/settings.json create mode 100644 data/dynamiclights/tags/item/light_level/12.json create mode 100644 data/dynamiclights/tags/item/light_level/15.json create mode 100644 data/dynamiclights/tags/item/light_level/3.json create mode 100644 data/dynamiclights/tags/item/light_level/6.json create mode 100644 data/dynamiclights/tags/item/light_level/9.json create mode 100644 data/dynamiclights/tags/item/mod_support/light_level/12.json create mode 100644 data/dynamiclights/tags/item/mod_support/light_level/15.json create mode 100644 data/dynamiclights/tags/item/mod_support/light_level/3.json create mode 100644 data/dynamiclights/tags/item/mod_support/light_level/6.json create mode 100644 data/dynamiclights/tags/item/mod_support/light_level/9.json create mode 100644 data/dynamiclights/tags/item/mod_support/water_sensitive/turn_off.json create mode 100644 data/dynamiclights/tags/item/mod_support/water_sensitive/turn_on.json create mode 100644 data/dynamiclights/tags/item/trimmable_armor.json create mode 100644 data/dynamiclights/tags/item/water_sensitive/turn_off.json create mode 100644 data/dynamiclights/tags/item/water_sensitive/turn_on.json create mode 100644 data/minecraft/tags/function/load.json create mode 100644 data/tschipcraft/function/menu.mcfunction create mode 100644 data/tschipcraft/tags/function/menu.json diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3394df0..d9de414 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 src META-INF fabric.mod.json unused 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/* CHANGELOG.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 wiki CHANGELOG.md ".*" + 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" - 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 net src META-INF fabric.mod.json unused wiki CHANGELOG.md ".*" + 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" # Upload - name: Upload data pack version to Modrinth diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 05157d5..4d7c87f 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 src META-INF fabric.mod.json unused 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/* CHANGELOG.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 wiki CHANGELOG.md ".*" + 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" - 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 net src META-INF fabric.mod.json unused wiki CHANGELOG.md ".*" + 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" # Upload - name: Capture datapack build artifact diff --git a/data/dynamiclights/function/api/place_light/12.mcfunction b/data/dynamiclights/function/api/place_light/12.mcfunction new file mode 100644 index 0000000..09b8207 --- /dev/null +++ b/data/dynamiclights/function/api/place_light/12.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Places a dynamic light block with light level 12 near the provided location (~ ~ ~) that will disappear after 1 tick +# Additionally sets the score #check_passed ts.dl.temp to 1 + +scoreboard players set #check_passed ts.dl.temp 1 + +function dynamiclights:internal/place_light/12/exec diff --git a/data/dynamiclights/function/api/place_light/15.mcfunction b/data/dynamiclights/function/api/place_light/15.mcfunction new file mode 100644 index 0000000..ea04db5 --- /dev/null +++ b/data/dynamiclights/function/api/place_light/15.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Places a dynamic light block with light level 15 near the provided location (~ ~ ~) that will disappear after 1 tick +# Additionally sets the score #check_passed ts.dl.temp to 1 + +scoreboard players set #check_passed ts.dl.temp 1 + +function dynamiclights:internal/place_light/15/exec diff --git a/data/dynamiclights/function/api/place_light/3.mcfunction b/data/dynamiclights/function/api/place_light/3.mcfunction new file mode 100644 index 0000000..113dcdd --- /dev/null +++ b/data/dynamiclights/function/api/place_light/3.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Places a dynamic light block with light level 3 near the provided location (~ ~ ~) that will disappear after 1 tick +# Additionally sets the score #check_passed ts.dl.temp to 1 + +scoreboard players set #check_passed ts.dl.temp 1 + +function dynamiclights:internal/place_light/3/exec diff --git a/data/dynamiclights/function/api/place_light/6.mcfunction b/data/dynamiclights/function/api/place_light/6.mcfunction new file mode 100644 index 0000000..a3dc58a --- /dev/null +++ b/data/dynamiclights/function/api/place_light/6.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Places a dynamic light block with light level 6 near the provided location (~ ~ ~) that will disappear after 1 tick +# Additionally sets the score #check_passed ts.dl.temp to 1 + +scoreboard players set #check_passed ts.dl.temp 1 + +function dynamiclights:internal/place_light/6/exec diff --git a/data/dynamiclights/function/api/place_light/9.mcfunction b/data/dynamiclights/function/api/place_light/9.mcfunction new file mode 100644 index 0000000..eb949b6 --- /dev/null +++ b/data/dynamiclights/function/api/place_light/9.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Places a dynamic light block with light level 9 near the provided location (~ ~ ~) that will disappear after 1 tick +# Additionally sets the score #check_passed ts.dl.temp to 1 + +scoreboard players set #check_passed ts.dl.temp 1 + +function dynamiclights:internal/place_light/9/exec diff --git a/data/dynamiclights/function/install.mcfunction b/data/dynamiclights/function/install.mcfunction new file mode 100644 index 0000000..dc437f7 --- /dev/null +++ b/data/dynamiclights/function/install.mcfunction @@ -0,0 +1,78 @@ +##by Tschipcraft + +## Initalise scoreboards +scoreboard objectives add ts.dl.ghast_cool dummy +scoreboard objectives add ts.dl.in_water dummy +scoreboard objectives add ts.dl.in_rain dummy +scoreboard objectives add ts.dl.sound dummy +scoreboard objectives add ts.dl.tnt.fuse dummy +scoreboard objectives add ts.dl.shulker dummy + +# Item score specification +# Type: +# 1: Light level 3 (unused) +# 2: Light level 6 +# 3: Light level 9 +# 4: Light level 12 (unused) +# 5: Light level 15 +# 6: Light level 3 (unused) outside water +# 7: Light level 6 outside water +# 8: Light level 9 outside water +# 9: Light level 12 (unused) outside water +# 10: Light level 15 outside water +# 11: Light level 3 (unused) inside water +# 12: Light level 6 inside water +# 13: Light level 9 inside water +# 14: Light level 12 (unused) inside water +# 15: Light level 15 inside water +scoreboard objectives add ts.dl.i.type dummy + +scoreboard objectives add ts.dl.i.is_ench dummy +scoreboard objectives add ts.dl.i.is_ameth dummy +scoreboard objectives add ts.dl.i.is_firea dummy +scoreboard objectives add ts.dl.i.is_ript dummy +scoreboard objectives add ts.dl.i.is_chann dummy + +# Light level associated with marker entities +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 +execute unless score $enable_on_fire ts.dl.settings matches -1..2 run scoreboard players set $enable_on_fire ts.dl.settings 1 +execute unless score $enable_glowing ts.dl.settings matches -1..2 run scoreboard players set $enable_glowing ts.dl.settings 0 +execute unless score $fire_aspect ts.dl.settings matches -1..2 run scoreboard players set $fire_aspect ts.dl.settings 1 +execute unless score $riptide ts.dl.settings matches -1..2 run scoreboard players set $riptide ts.dl.settings 1 +execute unless score $channeling ts.dl.settings matches -1..2 run scoreboard players set $channeling ts.dl.settings 1 +execute unless score $enchanted_items ts.dl.settings matches -1..2 run scoreboard players set $enchanted_items ts.dl.settings 1 +execute unless score $amethyst_trimmed ts.dl.settings matches -1..2 run scoreboard players set $amethyst_trimmed ts.dl.settings 1 +execute unless score $enable_ghast ts.dl.settings matches -1..2 run scoreboard players set $enable_ghast ts.dl.settings 1 + +execute unless score $water_sensitive ts.dl.settings matches -1..2 run scoreboard players set $water_sensitive ts.dl.settings 1 +execute unless score $enable_sound ts.dl.settings matches -1..2 run scoreboard players set $enable_sound ts.dl.settings 1 +execute unless score $rain_sensitive ts.dl.settings matches -1..2 run scoreboard players set $rain_sensitive ts.dl.settings 1 + +# Hidden +execute unless score $unlimited ts.dl.settings matches -1..2 run scoreboard players set $unlimited ts.dl.settings 0 + +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 + +# Reset advancement +advancement revoke @a only dynamiclights:interacted_with_item_frame + +## Schedule functions +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/install_trigger.mcfunction b/data/dynamiclights/function/install_trigger.mcfunction new file mode 100644 index 0000000..8e1160c --- /dev/null +++ b/data/dynamiclights/function/install_trigger.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +function dynamiclights:internal/version_checker/start +function dynamiclights:install diff --git a/data/dynamiclights/function/internal/enchantments/activate/channeling.mcfunction b/data/dynamiclights/function/internal/enchantments/activate/channeling.mcfunction new file mode 100644 index 0000000..9eb67ac --- /dev/null +++ b/data/dynamiclights/function/internal/enchantments/activate/channeling.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +playsound minecraft:block.beacon.power_select player @a ~ ~ ~ 0.3 +scoreboard players set @s ts.dl.sound 2 diff --git a/data/dynamiclights/function/internal/enchantments/activate/riptide.mcfunction b/data/dynamiclights/function/internal/enchantments/activate/riptide.mcfunction new file mode 100644 index 0000000..d58533a --- /dev/null +++ b/data/dynamiclights/function/internal/enchantments/activate/riptide.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +playsound minecraft:block.conduit.activate player @a ~ ~ ~ 0.8 +scoreboard players set @s ts.dl.sound 1 diff --git a/data/dynamiclights/function/internal/enchantments/deactivate/channeling.mcfunction b/data/dynamiclights/function/internal/enchantments/deactivate/channeling.mcfunction new file mode 100644 index 0000000..27007c1 --- /dev/null +++ b/data/dynamiclights/function/internal/enchantments/deactivate/channeling.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +playsound minecraft:block.beacon.deactivate player @a ~ ~ ~ 0.3 +scoreboard players set @s ts.dl.sound 0 diff --git a/data/dynamiclights/function/internal/enchantments/deactivate/riptide.mcfunction b/data/dynamiclights/function/internal/enchantments/deactivate/riptide.mcfunction new file mode 100644 index 0000000..6c4ec2f --- /dev/null +++ b/data/dynamiclights/function/internal/enchantments/deactivate/riptide.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +playsound minecraft:block.conduit.deactivate player @a ~ ~ ~ 0.3 +scoreboard players set @s ts.dl.sound 0 diff --git a/data/dynamiclights/function/internal/explosion_detection/reset.mcfunction b/data/dynamiclights/function/internal/explosion_detection/reset.mcfunction new file mode 100644 index 0000000..4f55210 --- /dev/null +++ b/data/dynamiclights/function/internal/explosion_detection/reset.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft +# Resets the global explosion alarm + +scoreboard players reset $global ts.dl.tnt.fuse diff --git a/data/dynamiclights/function/internal/explosion_detection/setup/tnt.mcfunction b/data/dynamiclights/function/internal/explosion_detection/setup/tnt.mcfunction new file mode 100644 index 0000000..c79ffe6 --- /dev/null +++ b/data/dynamiclights/function/internal/explosion_detection/setup/tnt.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Gets initial fuse of tnt + +# Fuse NBT tag was renamed in 23w42a +execute if score $global ts.dl.version matches 3684.. store result score @s ts.dl.tnt.fuse run data get entity @s fuse +execute if score $global ts.dl.version matches ..3683 store result score @s ts.dl.tnt.fuse run data get entity @s Fuse +tag @s add ts.dl.tnt.setup diff --git a/data/dynamiclights/function/internal/explosion_detection/tnt.mcfunction b/data/dynamiclights/function/internal/explosion_detection/tnt.mcfunction new file mode 100644 index 0000000..2a6ba51 --- /dev/null +++ b/data/dynamiclights/function/internal/explosion_detection/tnt.mcfunction @@ -0,0 +1,10 @@ +##by Tschipcraft +# Commands run by tnt per tick + +# Set up score for fuse +execute as @s[tag=!ts.dl.tnt.setup] run function dynamiclights:internal/explosion_detection/setup/tnt + +# Decrement fuse and trigger if it hits 0 +scoreboard players remove @s ts.dl.tnt.fuse 1 +execute if score @s ts.dl.tnt.fuse matches ..1 run scoreboard players set $global ts.dl.tnt.fuse 1 +execute if score @s ts.dl.tnt.fuse matches ..1 run schedule function dynamiclights:internal/explosion_detection/reset 1t diff --git a/data/dynamiclights/function/internal/ghast.mcfunction b/data/dynamiclights/function/internal/ghast.mcfunction new file mode 100644 index 0000000..3dcafcc --- /dev/null +++ b/data/dynamiclights/function/internal/ghast.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft + +execute as @s[predicate=dynamiclights:ghast_targeting] run scoreboard players add @s ts.dl.ghast_cool 1 +execute as @s[predicate=!dynamiclights:ghast_targeting] run scoreboard players reset @s ts.dl.ghast_cool +execute as @s[scores={ts.dl.ghast_cool=10..20}] at @s run function dynamiclights:api/place_light/15 +execute as @s[scores={ts.dl.ghast_cool=60..}] run scoreboard players reset @s ts.dl.ghast_cool diff --git a/data/dynamiclights/function/internal/item_frame/interacted.mcfunction b/data/dynamiclights/function/internal/item_frame/interacted.mcfunction new file mode 100644 index 0000000..d2262c9 --- /dev/null +++ b/data/dynamiclights/function/internal/item_frame/interacted.mcfunction @@ -0,0 +1,6 @@ +##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/kill_marker.mcfunction b/data/dynamiclights/function/internal/kill_marker.mcfunction new file mode 100644 index 0000000..025d38d --- /dev/null +++ b/data/dynamiclights/function/internal/kill_marker.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +# Prevent vibrations +tp @s ~ 320 ~ +kill @s diff --git a/data/dynamiclights/function/internal/loop.mcfunction b/data/dynamiclights/function/internal/loop.mcfunction new file mode 100644 index 0000000..16c886e --- /dev/null +++ b/data/dynamiclights/function/internal/loop.mcfunction @@ -0,0 +1,6 @@ +##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 new file mode 100644 index 0000000..0cbdf1e --- /dev/null +++ b/data/dynamiclights/function/internal/main.mcfunction @@ -0,0 +1,19 @@ +## by Tschipcraft + +# Tag old lights +tag @e[type=minecraft:marker,tag=ts.dl.light] add ts.dl.remove + +# Detect explosions +execute as @e[type=minecraft:tnt] at @s run function dynamiclights:internal/explosion_detection/tnt + +# Core +execute unless score $global ts.dl.tnt.fuse matches 1 as @e[type=!#dynamiclights:dyn_ignore,tag=!smithed.strict,tag=!global.ignore,tag=!global.ignore.gui] unless entity @s[type=minecraft:player,gamemode=spectator] at @s run function dynamiclights:internal/main_exec + +# 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/main_exec.mcfunction b/data/dynamiclights/function/internal/main_exec.mcfunction new file mode 100644 index 0000000..7311574 --- /dev/null +++ b/data/dynamiclights/function/internal/main_exec.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft + +## Ghast +# Ghasts are excluded from the limited range, since shoot timer desynchronizes +execute if score $enable_ghast ts.dl.settings matches 1..2 if entity @s[type=minecraft:ghast] at @s run function dynamiclights:internal/ghast + +## Check to avoid placing inside shulkers (#20) +execute if entity @s[type=minecraft:shulker_bullet] align xyz positioned ~0.5 ~ ~0.5 store result score @s ts.dl.shulker if entity @e[type=minecraft:shulker,distance=..0.1] + +## Range limit +execute if score $unlimited ts.dl.settings matches 1..2 unless entity @s[type=minecraft:shulker_bullet,scores={ts.dl.shulker=1}] run function dynamiclights:internal/main_exec_pass +execute unless score $unlimited ts.dl.settings matches 1..2 unless entity @s[type=minecraft:shulker_bullet,scores={ts.dl.shulker=1}] if entity @p[gamemode=!spectator,distance=..65] run function dynamiclights:internal/main_exec_pass diff --git a/data/dynamiclights/function/internal/main_exec_pass.mcfunction b/data/dynamiclights/function/internal/main_exec_pass.mcfunction new file mode 100644 index 0000000..3f2a1ea --- /dev/null +++ b/data/dynamiclights/function/internal/main_exec_pass.mcfunction @@ -0,0 +1,29 @@ +##by Tschipcraft + +## In Rain? (exclusive 1.19.4+ feature) +scoreboard players reset @s ts.dl.in_rain +execute if score $global ts.dl.version matches 3337.. if score $rain_sensitive ts.dl.settings matches 1..2 if predicate dynamiclights:world/is_raining run function dynamiclights:internal/water/rain_check_1194 + +## In water? +scoreboard players add @s ts.dl.in_water 0 +execute if score $water_sensitive ts.dl.settings matches 1..2 as @s[scores={ts.dl.in_water=0}] anchored eyes positioned ^ ^ ^ if predicate dynamiclights:entity/is_in_water run function dynamiclights:internal/water/enter +execute as @s[type=!minecraft:item,scores={ts.dl.in_water=1}] anchored eyes positioned ^ ^ ^ unless predicate dynamiclights:entity/is_in_water run function dynamiclights:internal/water/exit +execute as @s[type=minecraft:item,scores={ts.dl.in_water=1}] anchored eyes positioned ^ ^ ^ positioned ~ ~-0.1 ~ unless predicate dynamiclights:entity/is_in_water run function dynamiclights:internal/water/exit + +## Sound cues for trident enchants +scoreboard players add @s ts.dl.sound 0 +execute if score $enable_sound ts.dl.settings matches 1..2 as @s[scores={ts.dl.sound=0},predicate=dynamiclights:entity/has_riptide_trident] run function dynamiclights:internal/enchantments/activate/riptide +execute if score $enable_sound ts.dl.settings matches 1..2 as @s[scores={ts.dl.sound=1},predicate=!dynamiclights:entity/has_riptide_trident] run function dynamiclights:internal/enchantments/deactivate/riptide + +execute if score $enable_sound ts.dl.settings matches 1..2 as @s[scores={ts.dl.sound=0},predicate=dynamiclights:entity/has_channeling_trident] run function dynamiclights:internal/enchantments/activate/channeling +execute if score $enable_sound ts.dl.settings matches 1..2 as @s[scores={ts.dl.sound=2},predicate=!dynamiclights:entity/has_channeling_trident] run function dynamiclights:internal/enchantments/deactivate/channeling + +## Dispatch light +function dynamiclights:internal/sources/core + +# Light block sadly blocks explosion damage +#execute as @s[type=minecraft:creeper,nbt={ignited:1b},tag=!global.ignore,tag=!smithed.strict] at @s run function dynamiclights:api/place_light/15 + +## Extension for More Mobs +execute as @s[type=minecraft:wither_skeleton,tag=ts.mm.magma_1] at @s run function dynamiclights:api/place_light/6 +execute as @s[type=minecraft:wither_skeleton,tag=ts.mm.magma_2] at @s run function dynamiclights:api/place_light/9 diff --git a/data/dynamiclights/function/internal/menu.mcfunction b/data/dynamiclights/function/internal/menu.mcfunction new file mode 100644 index 0000000..a59b9a8 --- /dev/null +++ b/data/dynamiclights/function/internal/menu.mcfunction @@ -0,0 +1,9 @@ +##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 new file mode 100644 index 0000000..e6f0627 --- /dev/null +++ b/data/dynamiclights/function/internal/menu_reset.mcfunction @@ -0,0 +1,4 @@ +##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 new file mode 100644 index 0000000..143922f --- /dev/null +++ b/data/dynamiclights/function/internal/messages/welcome.mcfunction @@ -0,0 +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."}}] +scoreboard players set @s ts.dl.mess.welc 1 diff --git a/data/dynamiclights/function/internal/place_light/12/exec.mcfunction b/data/dynamiclights/function/internal/place_light/12/exec.mcfunction new file mode 100644 index 0000000..79f8b65 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/exec.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Initiates finding a valid location to place the dynamic light + +# Reset check score +scoreboard players set #block_placed ts.dl.temp 0 + +# Try current location +execute if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +# If not valid, try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/12/find_place/layer_1 diff --git a/data/dynamiclights/function/internal/place_light/12/find_place/layer_1.mcfunction b/data/dynamiclights/function/internal/place_light/12/find_place/layer_1.mcfunction new file mode 100644 index 0000000..f57ed4b --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/find_place/layer_1.mcfunction @@ -0,0 +1,13 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +# Try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/12/find_place/layer_2 diff --git a/data/dynamiclights/function/internal/place_light/12/find_place/layer_2.mcfunction b/data/dynamiclights/function/internal/place_light/12/find_place/layer_2.mcfunction new file mode 100644 index 0000000..b42f748 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/find_place/layer_2.mcfunction @@ -0,0 +1,17 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~2 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/12/summon diff --git a/data/dynamiclights/function/internal/place_light/12/place_block.mcfunction b/data/dynamiclights/function/internal/place_light/12/place_block.mcfunction new file mode 100644 index 0000000..13f8d54 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/place_block.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Places the light block + +fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=12] replace minecraft:water[level=0] +execute if block ~ ~ ~ minecraft:cave_air run tag @s add ts.dl.cave_air +execute unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=12] replace #dynamiclights:air diff --git a/data/dynamiclights/function/internal/place_light/12/prev_it/check.mcfunction b/data/dynamiclights/function/internal/place_light/12/prev_it/check.mcfunction new file mode 100644 index 0000000..624fae0 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/prev_it/check.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Checks if the light level from the previous iteration marker is lower or higher and about to be removed +# Renews the previous iteration marker + +scoreboard players set #light_exists ts.dl.temp 1 +execute if score @s ts.dl.l.level matches ..11 run function dynamiclights:internal/place_light/12/update +execute if score @s[tag=ts.dl.remove] ts.dl.l.level matches 13.. run function dynamiclights:internal/place_light/12/update +tag @s remove ts.dl.remove diff --git a/data/dynamiclights/function/internal/place_light/12/prev_it/update.mcfunction b/data/dynamiclights/function/internal/place_light/12/prev_it/update.mcfunction new file mode 100644 index 0000000..916c12c --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/prev_it/update.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Gives an old light a new light level + +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=12,waterlogged=false] replace minecraft:light[waterlogged=false] +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=12,waterlogged=true] replace minecraft:light[waterlogged=true] diff --git a/data/dynamiclights/function/internal/place_light/12/summon.mcfunction b/data/dynamiclights/function/internal/place_light/12/summon.mcfunction new file mode 100644 index 0000000..4df18bc --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/summon.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Places a dynamic light block with light level 12 in the world + +# Check if a dynamic light already exists here +scoreboard players set #light_exists ts.dl.temp 0 +execute align xyz if block ~ ~ ~ minecraft:light as @e[type=minecraft:marker,tag=ts.dl.light,distance=..0.1,limit=1,sort=nearest] at @s run function dynamiclights:internal/place_light/12/prev_it/check + +# Summon a new dynamic light +execute if score #light_exists ts.dl.temp matches 0 unless block ~ ~ ~ minecraft:light run function dynamiclights:internal/place_light/12/summon_new + +scoreboard players set #block_placed ts.dl.temp 1 diff --git a/data/dynamiclights/function/internal/place_light/12/summon_exec.mcfunction b/data/dynamiclights/function/internal/place_light/12/summon_exec.mcfunction new file mode 100644 index 0000000..c05c84c --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/summon_exec.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Sets attributes to new dynamic light entity and places light block + +data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [12]"}'} + +function dynamiclights:internal/place_light/12/update diff --git a/data/dynamiclights/function/internal/place_light/12/summon_new.mcfunction b/data/dynamiclights/function/internal/place_light/12/summon_new.mcfunction new file mode 100644 index 0000000..79f9ea1 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/summon_new.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Summons a new dynamic light entity + +# This is faster compared to tag and target the newly created entity when execute summon did not exist +execute align xyz summon minecraft:marker run function dynamiclights:internal/place_light/12/summon_exec diff --git a/data/dynamiclights/function/internal/place_light/12/update.mcfunction b/data/dynamiclights/function/internal/place_light/12/update.mcfunction new file mode 100644 index 0000000..9168f29 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/12/update.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Sets the light level for a dynamic light entity and updates the block + +scoreboard players set @s ts.dl.l.level 12 +# Update existing dynamic light block +execute if score #light_exists ts.dl.temp matches 1 run function dynamiclights:internal/place_light/12/prev_it/update +# Place new light block (checking for player placed light blocks is done in summon.mcfunction) +execute if score #light_exists ts.dl.temp matches 0 run function dynamiclights:internal/place_light/12/place_block diff --git a/data/dynamiclights/function/internal/place_light/15/exec.mcfunction b/data/dynamiclights/function/internal/place_light/15/exec.mcfunction new file mode 100644 index 0000000..7d514d9 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/exec.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Initiates finding a valid location to place the dynamic light + +# Reset check score +scoreboard players set #block_placed ts.dl.temp 0 + +# Try current location +execute if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +# If not valid, try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/15/find_place/layer_1 diff --git a/data/dynamiclights/function/internal/place_light/15/find_place/layer_1.mcfunction b/data/dynamiclights/function/internal/place_light/15/find_place/layer_1.mcfunction new file mode 100644 index 0000000..e7ad5be --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/find_place/layer_1.mcfunction @@ -0,0 +1,13 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +# Try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/15/find_place/layer_2 diff --git a/data/dynamiclights/function/internal/place_light/15/find_place/layer_2.mcfunction b/data/dynamiclights/function/internal/place_light/15/find_place/layer_2.mcfunction new file mode 100644 index 0000000..271a95c --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/find_place/layer_2.mcfunction @@ -0,0 +1,17 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~2 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/15/summon diff --git a/data/dynamiclights/function/internal/place_light/15/place_block.mcfunction b/data/dynamiclights/function/internal/place_light/15/place_block.mcfunction new file mode 100644 index 0000000..6f4fc2a --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/place_block.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Places the light block + +fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=15] replace minecraft:water[level=0] +execute if block ~ ~ ~ minecraft:cave_air run tag @s add ts.dl.cave_air +execute unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=15] replace #dynamiclights:air diff --git a/data/dynamiclights/function/internal/place_light/15/prev_it/check.mcfunction b/data/dynamiclights/function/internal/place_light/15/prev_it/check.mcfunction new file mode 100644 index 0000000..5c1f95b --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/prev_it/check.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft +# Checks if the light level from the previous iteration marker is lower than 15 +# Renews the previous iteration marker + +scoreboard players set #light_exists ts.dl.temp 1 +execute if score @s ts.dl.l.level matches ..14 run function dynamiclights:internal/place_light/15/update +tag @s remove ts.dl.remove diff --git a/data/dynamiclights/function/internal/place_light/15/prev_it/update.mcfunction b/data/dynamiclights/function/internal/place_light/15/prev_it/update.mcfunction new file mode 100644 index 0000000..3fbad81 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/prev_it/update.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Gives an old light a new light level + +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=false] replace minecraft:light[waterlogged=false] +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=true] replace minecraft:light[waterlogged=true] diff --git a/data/dynamiclights/function/internal/place_light/15/summon.mcfunction b/data/dynamiclights/function/internal/place_light/15/summon.mcfunction new file mode 100644 index 0000000..ccba0a1 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/summon.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Places a dynamic light block with light level 15 in the world + +# Check if a dynamic light already exists here +scoreboard players set #light_exists ts.dl.temp 0 +execute align xyz if block ~ ~ ~ minecraft:light as @e[type=minecraft:marker,tag=ts.dl.light,distance=..0.1,limit=1,sort=nearest] at @s run function dynamiclights:internal/place_light/15/prev_it/check + +# Summon a new dynamic light +execute if score #light_exists ts.dl.temp matches 0 unless block ~ ~ ~ minecraft:light run function dynamiclights:internal/place_light/15/summon_new + +scoreboard players set #block_placed ts.dl.temp 1 diff --git a/data/dynamiclights/function/internal/place_light/15/summon_exec.mcfunction b/data/dynamiclights/function/internal/place_light/15/summon_exec.mcfunction new file mode 100644 index 0000000..f3f1e2d --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/summon_exec.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Sets attributes to new dynamic light entity and places light block + +data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [15]"}'} + +function dynamiclights:internal/place_light/15/update diff --git a/data/dynamiclights/function/internal/place_light/15/summon_new.mcfunction b/data/dynamiclights/function/internal/place_light/15/summon_new.mcfunction new file mode 100644 index 0000000..1b66bfa --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/summon_new.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Summons a new dynamic light entity + +# This is faster compared to tag and target the newly created entity when execute summon did not exist +execute align xyz summon minecraft:marker run function dynamiclights:internal/place_light/15/summon_exec diff --git a/data/dynamiclights/function/internal/place_light/15/update.mcfunction b/data/dynamiclights/function/internal/place_light/15/update.mcfunction new file mode 100644 index 0000000..0aa8550 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/15/update.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Sets the light level for a dynamic light entity and updates the block + +scoreboard players set @s ts.dl.l.level 15 +# Update existing dynamic light block +execute if score #light_exists ts.dl.temp matches 1 run function dynamiclights:internal/place_light/15/prev_it/update +# Place new light block (checking for player placed light blocks is done in summon.mcfunction) +execute if score #light_exists ts.dl.temp matches 0 run function dynamiclights:internal/place_light/15/place_block diff --git a/data/dynamiclights/function/internal/place_light/3/exec.mcfunction b/data/dynamiclights/function/internal/place_light/3/exec.mcfunction new file mode 100644 index 0000000..3714686 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/exec.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Initiates finding a valid location to place the dynamic light + +# Reset check score +scoreboard players set #block_placed ts.dl.temp 0 + +# Try current location +execute if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +# If not valid, try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/3/find_place/layer_1 diff --git a/data/dynamiclights/function/internal/place_light/3/find_place/layer_1.mcfunction b/data/dynamiclights/function/internal/place_light/3/find_place/layer_1.mcfunction new file mode 100644 index 0000000..28af4af --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/find_place/layer_1.mcfunction @@ -0,0 +1,13 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +# Try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/3/find_place/layer_2 diff --git a/data/dynamiclights/function/internal/place_light/3/find_place/layer_2.mcfunction b/data/dynamiclights/function/internal/place_light/3/find_place/layer_2.mcfunction new file mode 100644 index 0000000..3771727 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/find_place/layer_2.mcfunction @@ -0,0 +1,17 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~2 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/3/summon diff --git a/data/dynamiclights/function/internal/place_light/3/place_block.mcfunction b/data/dynamiclights/function/internal/place_light/3/place_block.mcfunction new file mode 100644 index 0000000..624db9f --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/place_block.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Places the light block + +fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=3] replace minecraft:water[level=0] +execute if block ~ ~ ~ minecraft:cave_air run tag @s add ts.dl.cave_air +execute unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=3] replace #dynamiclights:air diff --git a/data/dynamiclights/function/internal/place_light/3/prev_it/check.mcfunction b/data/dynamiclights/function/internal/place_light/3/prev_it/check.mcfunction new file mode 100644 index 0000000..07410f9 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/prev_it/check.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Checks if the light level from the previous iteration marker is lower or higher and about to be removed +# Renews the previous iteration marker + +scoreboard players set #light_exists ts.dl.temp 1 +execute if score @s ts.dl.l.level matches ..2 run function dynamiclights:internal/place_light/3/update +execute if score @s[tag=ts.dl.remove] ts.dl.l.level matches 4.. run function dynamiclights:internal/place_light/3/update +tag @s remove ts.dl.remove diff --git a/data/dynamiclights/function/internal/place_light/3/prev_it/update.mcfunction b/data/dynamiclights/function/internal/place_light/3/prev_it/update.mcfunction new file mode 100644 index 0000000..ef6b16e --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/prev_it/update.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Gives an old light a new light level + +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=3,waterlogged=false] replace minecraft:light[waterlogged=false] +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=3,waterlogged=true] replace minecraft:light[waterlogged=true] diff --git a/data/dynamiclights/function/internal/place_light/3/summon.mcfunction b/data/dynamiclights/function/internal/place_light/3/summon.mcfunction new file mode 100644 index 0000000..278fe16 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/summon.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Places a dynamic light block with light level 3 in the world + +# Check if a dynamic light already exists here +scoreboard players set #light_exists ts.dl.temp 0 +execute align xyz if block ~ ~ ~ minecraft:light as @e[type=minecraft:marker,tag=ts.dl.light,distance=..0.1,limit=1,sort=nearest] at @s run function dynamiclights:internal/place_light/3/prev_it/check + +# Summon a new dynamic light +execute if score #light_exists ts.dl.temp matches 0 unless block ~ ~ ~ minecraft:light run function dynamiclights:internal/place_light/3/summon_new + +scoreboard players set #block_placed ts.dl.temp 1 diff --git a/data/dynamiclights/function/internal/place_light/3/summon_exec.mcfunction b/data/dynamiclights/function/internal/place_light/3/summon_exec.mcfunction new file mode 100644 index 0000000..93a851d --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/summon_exec.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Sets attributes to new dynamic light entity and places light block + +data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [3]"}'} + +function dynamiclights:internal/place_light/3/update diff --git a/data/dynamiclights/function/internal/place_light/3/summon_new.mcfunction b/data/dynamiclights/function/internal/place_light/3/summon_new.mcfunction new file mode 100644 index 0000000..f123d8a --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/summon_new.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Summons a new dynamic light entity + +# This is faster compared to tag and target the newly created entity when execute summon did not exist +execute align xyz summon minecraft:marker run function dynamiclights:internal/place_light/3/summon_exec diff --git a/data/dynamiclights/function/internal/place_light/3/update.mcfunction b/data/dynamiclights/function/internal/place_light/3/update.mcfunction new file mode 100644 index 0000000..9438625 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/3/update.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Sets the light level for a dynamic light entity and updates the block + +scoreboard players set @s ts.dl.l.level 3 +# Update existing dynamic light block +execute if score #light_exists ts.dl.temp matches 1 run function dynamiclights:internal/place_light/3/prev_it/update +# Place new light block (checking for player placed light blocks is done in summon.mcfunction) +execute if score #light_exists ts.dl.temp matches 0 run function dynamiclights:internal/place_light/3/place_block diff --git a/data/dynamiclights/function/internal/place_light/6/exec.mcfunction b/data/dynamiclights/function/internal/place_light/6/exec.mcfunction new file mode 100644 index 0000000..7ab30b6 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/exec.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Initiates finding a valid location to place the dynamic light + +# Reset check score +scoreboard players set #block_placed ts.dl.temp 0 + +# Try current location +execute if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +# If not valid, try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/6/find_place/layer_1 diff --git a/data/dynamiclights/function/internal/place_light/6/find_place/layer_1.mcfunction b/data/dynamiclights/function/internal/place_light/6/find_place/layer_1.mcfunction new file mode 100644 index 0000000..0341161 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/find_place/layer_1.mcfunction @@ -0,0 +1,13 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +# Try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/6/find_place/layer_2 diff --git a/data/dynamiclights/function/internal/place_light/6/find_place/layer_2.mcfunction b/data/dynamiclights/function/internal/place_light/6/find_place/layer_2.mcfunction new file mode 100644 index 0000000..81b9ad5 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/find_place/layer_2.mcfunction @@ -0,0 +1,17 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~2 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/6/summon diff --git a/data/dynamiclights/function/internal/place_light/6/place_block.mcfunction b/data/dynamiclights/function/internal/place_light/6/place_block.mcfunction new file mode 100644 index 0000000..3154ab0 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/place_block.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Places the light block + +fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=6] replace minecraft:water[level=0] +execute if block ~ ~ ~ minecraft:cave_air run tag @s add ts.dl.cave_air +execute unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=6] replace #dynamiclights:air diff --git a/data/dynamiclights/function/internal/place_light/6/prev_it/check.mcfunction b/data/dynamiclights/function/internal/place_light/6/prev_it/check.mcfunction new file mode 100644 index 0000000..8580134 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/prev_it/check.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Checks if the light level from the previous iteration marker is lower or higher and about to be removed +# Renews the previous iteration marker + +scoreboard players set #light_exists ts.dl.temp 1 +execute if score @s ts.dl.l.level matches ..5 run function dynamiclights:internal/place_light/6/update +execute if score @s[tag=ts.dl.remove] ts.dl.l.level matches 7.. run function dynamiclights:internal/place_light/6/update +tag @s remove ts.dl.remove diff --git a/data/dynamiclights/function/internal/place_light/6/prev_it/update.mcfunction b/data/dynamiclights/function/internal/place_light/6/prev_it/update.mcfunction new file mode 100644 index 0000000..8ebee45 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/prev_it/update.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Gives an old light a new light level + +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=false] replace minecraft:light[waterlogged=false] +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=true] replace minecraft:light[waterlogged=true] diff --git a/data/dynamiclights/function/internal/place_light/6/summon.mcfunction b/data/dynamiclights/function/internal/place_light/6/summon.mcfunction new file mode 100644 index 0000000..bafd70e --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/summon.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Places a dynamic light block with light level 6 in the world + +# Check if a dynamic light already exists here +scoreboard players set #light_exists ts.dl.temp 0 +execute align xyz if block ~ ~ ~ minecraft:light as @e[type=minecraft:marker,tag=ts.dl.light,distance=..0.1,limit=1,sort=nearest] at @s run function dynamiclights:internal/place_light/6/prev_it/check + +# Summon a new dynamic light +execute if score #light_exists ts.dl.temp matches 0 unless block ~ ~ ~ minecraft:light run function dynamiclights:internal/place_light/6/summon_new + +scoreboard players set #block_placed ts.dl.temp 1 diff --git a/data/dynamiclights/function/internal/place_light/6/summon_exec.mcfunction b/data/dynamiclights/function/internal/place_light/6/summon_exec.mcfunction new file mode 100644 index 0000000..b9e1b78 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/summon_exec.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Sets attributes to new dynamic light entity and places light block + +data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [6]"}'} + +function dynamiclights:internal/place_light/6/update diff --git a/data/dynamiclights/function/internal/place_light/6/summon_new.mcfunction b/data/dynamiclights/function/internal/place_light/6/summon_new.mcfunction new file mode 100644 index 0000000..63676d1 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/summon_new.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Summons a new dynamic light entity + +# This is faster compared to tag and target the newly created entity when execute summon did not exist +execute align xyz summon minecraft:marker run function dynamiclights:internal/place_light/6/summon_exec diff --git a/data/dynamiclights/function/internal/place_light/6/update.mcfunction b/data/dynamiclights/function/internal/place_light/6/update.mcfunction new file mode 100644 index 0000000..f149a6d --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/6/update.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Sets the light level for a dynamic light entity and updates the block + +scoreboard players set @s ts.dl.l.level 6 +# Update existing dynamic light block +execute if score #light_exists ts.dl.temp matches 1 run function dynamiclights:internal/place_light/6/prev_it/update +# Place new light block (checking for player placed light blocks is done in summon.mcfunction) +execute if score #light_exists ts.dl.temp matches 0 run function dynamiclights:internal/place_light/6/place_block diff --git a/data/dynamiclights/function/internal/place_light/9/exec.mcfunction b/data/dynamiclights/function/internal/place_light/9/exec.mcfunction new file mode 100644 index 0000000..642c6da --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/exec.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Initiates finding a valid location to place the dynamic light + +# Reset check score +scoreboard players set #block_placed ts.dl.temp 0 + +# Try current location +execute if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +# If not valid, try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/9/find_place/layer_1 diff --git a/data/dynamiclights/function/internal/place_light/9/find_place/layer_1.mcfunction b/data/dynamiclights/function/internal/place_light/9/find_place/layer_1.mcfunction new file mode 100644 index 0000000..d666126 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/find_place/layer_1.mcfunction @@ -0,0 +1,13 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +# Try deeper layer +execute unless score #block_placed ts.dl.temp matches 1 run function dynamiclights:internal/place_light/9/find_place/layer_2 diff --git a/data/dynamiclights/function/internal/place_light/9/find_place/layer_2.mcfunction b/data/dynamiclights/function/internal/place_light/9/find_place/layer_2.mcfunction new file mode 100644 index 0000000..7366159 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/find_place/layer_2.mcfunction @@ -0,0 +1,17 @@ +##by Tschipcraft +# Finds a location to place a dynamic light + +execute positioned ~ ~2 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~ ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~-1 ~1 ~ if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon + +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon +execute unless score #block_placed ts.dl.temp matches 1 positioned ~ ~1 ~-1 if predicate dynamiclights:world/place_light/valid_pos run function dynamiclights:internal/place_light/9/summon diff --git a/data/dynamiclights/function/internal/place_light/9/place_block.mcfunction b/data/dynamiclights/function/internal/place_light/9/place_block.mcfunction new file mode 100644 index 0000000..0cd7322 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/place_block.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Places the light block + +fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=9] replace minecraft:water[level=0] +execute if block ~ ~ ~ minecraft:cave_air run tag @s add ts.dl.cave_air +execute unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=9] replace #dynamiclights:air diff --git a/data/dynamiclights/function/internal/place_light/9/prev_it/check.mcfunction b/data/dynamiclights/function/internal/place_light/9/prev_it/check.mcfunction new file mode 100644 index 0000000..4e0a11b --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/prev_it/check.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Checks if the light level from the previous iteration marker is lower or higher and about to be removed +# Renews the previous iteration marker + +scoreboard players set #light_exists ts.dl.temp 1 +execute if score @s ts.dl.l.level matches ..8 run function dynamiclights:internal/place_light/9/update +execute if score @s[tag=ts.dl.remove] ts.dl.l.level matches 10.. run function dynamiclights:internal/place_light/9/update +tag @s remove ts.dl.remove diff --git a/data/dynamiclights/function/internal/place_light/9/prev_it/update.mcfunction b/data/dynamiclights/function/internal/place_light/9/prev_it/update.mcfunction new file mode 100644 index 0000000..008b495 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/prev_it/update.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Gives an old light a new light level + +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=false] replace minecraft:light[waterlogged=false] +fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=true] replace minecraft:light[waterlogged=true] diff --git a/data/dynamiclights/function/internal/place_light/9/summon.mcfunction b/data/dynamiclights/function/internal/place_light/9/summon.mcfunction new file mode 100644 index 0000000..b34e83b --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/summon.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Places a dynamic light block with light level 9 in the world + +# Check if a dynamic light already exists here +scoreboard players set #light_exists ts.dl.temp 0 +execute align xyz if block ~ ~ ~ minecraft:light as @e[type=minecraft:marker,tag=ts.dl.light,distance=..0.1,limit=1,sort=nearest] at @s run function dynamiclights:internal/place_light/9/prev_it/check + +# Summon a new dynamic light +execute if score #light_exists ts.dl.temp matches 0 unless block ~ ~ ~ minecraft:light run function dynamiclights:internal/place_light/9/summon_new + +scoreboard players set #block_placed ts.dl.temp 1 diff --git a/data/dynamiclights/function/internal/place_light/9/summon_exec.mcfunction b/data/dynamiclights/function/internal/place_light/9/summon_exec.mcfunction new file mode 100644 index 0000000..f209162 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/summon_exec.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft +# Sets attributes to new dynamic light entity and places light block + +data merge entity @s {Tags:["ts.dl.light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [9]"}'} + +function dynamiclights:internal/place_light/9/update diff --git a/data/dynamiclights/function/internal/place_light/9/summon_new.mcfunction b/data/dynamiclights/function/internal/place_light/9/summon_new.mcfunction new file mode 100644 index 0000000..0f2feb5 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/summon_new.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Summons a new dynamic light entity + +# This is faster compared to tag and target the newly created entity when execute summon did not exist +execute align xyz summon minecraft:marker run function dynamiclights:internal/place_light/9/summon_exec diff --git a/data/dynamiclights/function/internal/place_light/9/update.mcfunction b/data/dynamiclights/function/internal/place_light/9/update.mcfunction new file mode 100644 index 0000000..4ac6583 --- /dev/null +++ b/data/dynamiclights/function/internal/place_light/9/update.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Sets the light level for a dynamic light entity and updates the block + +scoreboard players set @s ts.dl.l.level 9 +# Update existing dynamic light block +execute if score #light_exists ts.dl.temp matches 1 run function dynamiclights:internal/place_light/9/prev_it/update +# Place new light block (checking for player placed light blocks is done in summon.mcfunction) +execute if score #light_exists ts.dl.temp matches 0 run function dynamiclights:internal/place_light/9/place_block diff --git a/data/dynamiclights/function/internal/remove_light.mcfunction b/data/dynamiclights/function/internal/remove_light.mcfunction new file mode 100644 index 0000000..29759a7 --- /dev/null +++ b/data/dynamiclights/function/internal/remove_light.mcfunction @@ -0,0 +1,10 @@ +##by Tschipcraft + +# Set back water +fill ~ ~ ~ ~ ~ ~ minecraft:water replace minecraft:light[waterlogged=true] +# Set back cave_air +execute if entity @s[tag=ts.dl.cave_air] run fill ~ ~ ~ ~ ~ ~ minecraft:cave_air replace minecraft:light +# Set back air +fill ~ ~ ~ ~ ~ ~ minecraft:air replace minecraft:light + +execute if entity @s[type=minecraft:marker,tag=ts.dl.light] run function dynamiclights:internal/kill_marker diff --git a/data/dynamiclights/function/internal/sources/core.mcfunction b/data/dynamiclights/function/internal/sources/core.mcfunction new file mode 100644 index 0000000..636fc7b --- /dev/null +++ b/data/dynamiclights/function/internal/sources/core.mcfunction @@ -0,0 +1,11 @@ +##by Tschipcraft +# Dispatches dynamic light around the world +# @s - entity that may emit light + +# These entities use a different NBT tag for storing the item and need special parsing (since 24w11a these are only falling blocks and block displays) +execute as @s[type=#dynamiclights:parse] unless score @s ts.dl.i.type matches 0..15 run function dynamiclights:internal/sources/parse/main + +# Offsets for exploding entities +execute as @s[type=#dynamiclights:may_block_explosion] positioned ~ ~2 ~ run function dynamiclights:internal/sources/entity +execute as @s[type=minecraft:end_crystal] positioned ~ ~-0.32 ~ run function dynamiclights:internal/sources/entity +execute as @s[type=!#dynamiclights:may_block_explosion,type=!minecraft:end_crystal] anchored eyes positioned ^ ^ ^ run function dynamiclights:internal/sources/entity diff --git a/data/dynamiclights/function/internal/sources/entity.mcfunction b/data/dynamiclights/function/internal/sources/entity.mcfunction new file mode 100644 index 0000000..0024b70 --- /dev/null +++ b/data/dynamiclights/function/internal/sources/entity.mcfunction @@ -0,0 +1,10 @@ +##by Tschipcraft +# Places light, if the current entity matches any criteria for it + +scoreboard players set #check_passed ts.dl.temp 0 + +execute if predicate dynamiclights:entity/should_emit_light_level/15 align xyz run function dynamiclights:api/place_light/15 +execute unless score #check_passed ts.dl.temp matches 1 if predicate dynamiclights:entity/should_emit_light_level/12 align xyz run function dynamiclights:api/place_light/12 +execute unless score #check_passed ts.dl.temp matches 1 if predicate dynamiclights:entity/should_emit_light_level/9 align xyz run function dynamiclights:api/place_light/9 +execute unless score #check_passed ts.dl.temp matches 1 if predicate dynamiclights:entity/should_emit_light_level/6 align xyz run function dynamiclights:api/place_light/6 +execute unless score #check_passed ts.dl.temp matches 1 if predicate dynamiclights:entity/should_emit_light_level/3 align xyz run function dynamiclights:api/place_light/3 diff --git a/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction b/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction new file mode 100644 index 0000000..f7ff6ca --- /dev/null +++ b/data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction @@ -0,0 +1,4 @@ +##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/sources/parse/main.mcfunction b/data/dynamiclights/function/internal/sources/parse/main.mcfunction new file mode 100644 index 0000000..68b2454 --- /dev/null +++ b/data/dynamiclights/function/internal/sources/parse/main.mcfunction @@ -0,0 +1,19 @@ +##by Tschipcraft + +summon armor_stand ~ ~ ~ {UUID:[I;-1030365714,1276464731,-2084950084,-395075115],NoGravity:1b,Silent:1b,Invulnerable:1b,Small:1b,Marker:1b,Invisible:1b,NoBasePlate:1b,Tags:["ts.dl.i.parser"],HandItems:[{id:"minecraft:structure_void",Count:1b},{}],DisabledSlots:4144959} + +# Copy NBT data +execute as @s[type=minecraft:falling_block] run data modify entity c295ddee-4c15-4e5b-83ba-2fbce873a1d5 HandItems[0].id set from entity @s BlockState.Name +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 + +execute as c295ddee-4c15-4e5b-83ba-2fbce873a1d5 run function dynamiclights:internal/sources/parse/main_exec + +# Transfer scores +scoreboard players operation @s ts.dl.i.type = .global ts.dl.i.type +scoreboard players operation @s ts.dl.i.is_ench = .global ts.dl.i.is_ench +scoreboard players operation @s ts.dl.i.is_ameth = .global ts.dl.i.is_ameth +scoreboard players operation @s ts.dl.i.is_firea = .global ts.dl.i.is_firea +scoreboard players operation @s ts.dl.i.is_ript = .global ts.dl.i.is_ript +scoreboard players operation @s ts.dl.i.is_chann = .global ts.dl.i.is_chann + +# Item frame checking is not neccessary anymore diff --git a/data/dynamiclights/function/internal/sources/parse/main_exec.mcfunction b/data/dynamiclights/function/internal/sources/parse/main_exec.mcfunction new file mode 100644 index 0000000..d9e7cfa --- /dev/null +++ b/data/dynamiclights/function/internal/sources/parse/main_exec.mcfunction @@ -0,0 +1,30 @@ +##by Tschipcraft + +# Restore defaults +scoreboard players set .global ts.dl.i.type 0 +scoreboard players set .global ts.dl.i.is_ench 0 +scoreboard players set .global ts.dl.i.is_ameth 0 +scoreboard players set .global ts.dl.i.is_firea 0 +scoreboard players set .global ts.dl.i.is_ript 0 +scoreboard players set .global ts.dl.i.is_chann 0 + +# Light Level +execute if predicate dynamiclights:entity/light_level/3/has_mainhand_item run scoreboard players set .global ts.dl.i.type 1 +execute if predicate dynamiclights:entity/light_level/6/has_mainhand_item run scoreboard players set .global ts.dl.i.type 2 +execute if predicate dynamiclights:entity/light_level/9/has_mainhand_item run scoreboard players set .global ts.dl.i.type 3 +execute if predicate dynamiclights:entity/light_level/12/has_mainhand_item run scoreboard players set .global ts.dl.i.type 4 +execute if predicate dynamiclights:entity/light_level/15/has_mainhand_item run scoreboard players set .global ts.dl.i.type 5 + +# Water Check +execute unless score .global ts.dl.i.type matches 0 unless predicate dynamiclights:entity/water_check/no_water_immersion_extinguish_items run scoreboard players add .global ts.dl.i.type 5 +execute unless score .global ts.dl.i.type matches 0 unless predicate dynamiclights:entity/water_check/no_water_immersion_illuminate_items run scoreboard players add .global ts.dl.i.type 10 + +# Additional item glow sources +execute unless predicate dynamiclights:entity/additional_item_tests/enchanted_items run scoreboard players set .global ts.dl.i.is_ench 1 +execute unless predicate dynamiclights:entity/additional_item_tests/amethyst_trimmed_items run scoreboard players set .global ts.dl.i.is_ameth 1 +execute unless predicate dynamiclights:entity/additional_item_tests/fire_aspect_items run scoreboard players set .global ts.dl.i.is_firea 1 +execute unless predicate dynamiclights:entity/additional_item_tests/riptide_trident run scoreboard players set .global ts.dl.i.is_ript 1 +execute unless predicate dynamiclights:entity/additional_item_tests/channeling_trident run scoreboard players set .global ts.dl.i.is_chann 1 + +# Kill armor stand (@s) +function dynamiclights:internal/kill_marker diff --git a/data/dynamiclights/function/internal/version_checker/retry.mcfunction b/data/dynamiclights/function/internal/version_checker/retry.mcfunction new file mode 100644 index 0000000..bba8137 --- /dev/null +++ b/data/dynamiclights/function/internal/version_checker/retry.mcfunction @@ -0,0 +1,3 @@ +##by Tschipcraft + +schedule function dynamiclights:internal/version_checker/start 1s diff --git a/data/dynamiclights/function/internal/version_checker/start.mcfunction b/data/dynamiclights/function/internal/version_checker/start.mcfunction new file mode 100644 index 0000000..711278a --- /dev/null +++ b/data/dynamiclights/function/internal/version_checker/start.mcfunction @@ -0,0 +1,15 @@ +##by Tschipcraft + +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 ts.dl.version matches 1.. run function dynamiclights:internal/version_checker/retry diff --git a/data/dynamiclights/function/internal/water/enter.mcfunction b/data/dynamiclights/function/internal/water/enter.mcfunction new file mode 100644 index 0000000..332e016 --- /dev/null +++ b/data/dynamiclights/function/internal/water/enter.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Any entity that is in water will run this function + +# Test if a sound should be played +execute if score $enable_sound ts.dl.settings matches 1..2 unless predicate dynamiclights:entity/water_check/no_water_immersion_illuminate_items run playsound block.beacon.activate player @a ~ ~ ~ 0.3 +execute if score $enable_sound ts.dl.settings matches 1..2 unless predicate dynamiclights:entity/water_check/no_water_immersion_extinguish_items run playsound block.fire.extinguish player @a ~ ~ ~ 0.3 + +scoreboard players set @s ts.dl.in_water 1 diff --git a/data/dynamiclights/function/internal/water/exit.mcfunction b/data/dynamiclights/function/internal/water/exit.mcfunction new file mode 100644 index 0000000..6a61f16 --- /dev/null +++ b/data/dynamiclights/function/internal/water/exit.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft +# Any entity that is in water will run this function + +# Test if a sound should be played +execute if score $enable_sound ts.dl.settings matches 1..2 unless predicate dynamiclights:entity/water_check/no_water_immersion_extinguish_items run playsound item.flintandsteel.use player @a ~ ~ ~ 0.3 +execute if score $enable_sound ts.dl.settings matches 1..2 unless predicate dynamiclights:entity/water_check/no_water_immersion_illuminate_items run playsound block.beacon.deactivate player @a ~ ~ ~ 0.3 + +scoreboard players set @s ts.dl.in_water 0 diff --git a/data/dynamiclights/function/internal/water/rain_check_1194.mcfunction b/data/dynamiclights/function/internal/water/rain_check_1194.mcfunction new file mode 100644 index 0000000..15422ea --- /dev/null +++ b/data/dynamiclights/function/internal/water/rain_check_1194.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft +# Completes the rain check started in main_exec_pass.mcfunction (mc1.19.4+) + +execute if dimension minecraft:overworld unless biome ~ ~ ~ #minecraft:snow_golem_melts positioned over motion_blocking if entity @s[dy=999] run scoreboard players set @s ts.dl.in_rain 1 diff --git a/data/dynamiclights/function/reset.mcfunction b/data/dynamiclights/function/reset.mcfunction new file mode 100644 index 0000000..e30ed81 --- /dev/null +++ b/data/dynamiclights/function/reset.mcfunction @@ -0,0 +1,18 @@ +##by Tschipcraft + +# Remove existing lights +execute as @e[type=minecraft:marker,tag=ts.dl.light] at @s run function dynamiclights:internal/remove_light +# Kill parser armor stand +kill @e[type=minecraft:armor_stand,tag=ts.dl.i.parser] + +# Reset explosion alarm +function dynamiclights:internal/explosion_detection/reset + +# Reset advancement +advancement revoke @a only dynamiclights:interacted_with_item_frame + +# Reschedule functions +schedule function dynamiclights:internal/main 5t +schedule function dynamiclights:internal/loop 4t + +say ā Successfully resetted Dynamic lights! diff --git a/data/dynamiclights/function/settings.mcfunction b/data/dynamiclights/function/settings.mcfunction new file mode 100644 index 0000000..bd0246a --- /dev/null +++ b/data/dynamiclights/function/settings.mcfunction @@ -0,0 +1,3 @@ +##by Tschipcraft + +function dynamiclights:settings/core diff --git a/data/dynamiclights/function/settings/core.mcfunction b/data/dynamiclights/function/settings/core.mcfunction new file mode 100644 index 0000000..f3c7726 --- /dev/null +++ b/data/dynamiclights/function/settings/core.mcfunction @@ -0,0 +1,69 @@ +##by Tschipcraft + +tellraw @s {"text":"\n=-=Dynamic Lights Settings=-=","bold":true,"color":"dark_green"} + +tellraw @s {"text":"\nEnable light emitting from...","bold":true,"color":"white"} + +execute if score $enable_on_fire ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_on_fire"}},{"text":"Burning entities","color":"white"}] +execute if score $enable_on_fire ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color": "red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_on_fire"}},{"text":"Burning entities","color":"white"}] +execute if score $enable_on_fire ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Burning entities","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enable_on_fire ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Burning entities","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $enable_glowing ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_glowing"}},{"text":"Entities with the glowing potion effect","color":"white"}] +execute if score $enable_glowing ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_glowing"}},{"text":"Entities with the glowing potion effect","color":"white"}] +execute if score $enable_glowing ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Entities with the glowing potion effect","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enable_glowing ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Entities with the glowing potion effect","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $enable_ghast ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_ghast"}},{"text":"Ghasts about to shoot a fireball","color":"white"}] +execute if score $enable_ghast ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_ghast"}},{"text":"Ghasts about to shoot a fireball","color":"white"}] +execute if score $enable_ghast ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Ghasts about to shoot a fireball","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enable_ghast ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Ghasts about to shoot a fireball","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $enchanted_items ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."},{"text":"\nā Note: Having this option enabled may lead to decreased performance of some mob farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_enchanted_items"}},{"text":"Enchanted items","color":"white"}] +execute if score $enchanted_items ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_enchanted_items"}},{"text":"Enchanted items","color":"white"}] +execute if score $enchanted_items ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Enchanted items","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enchanted_items ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Enchanted items","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $global ts.dl.version matches 3400.. if score $amethyst_trimmed ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_amethyst_trimmed"}},{"text":"Armor trimmed with amethyst","color":"white"}] +execute if score $global ts.dl.version matches 3400.. if score $amethyst_trimmed ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_amethyst_trimmed"}},{"text":"Armor trimmed with amethyst","color":"white"}] +execute if score $global ts.dl.version matches 3400.. if score $amethyst_trimmed ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Armor trimmed with amethyst","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $global ts.dl.version matches 3400.. if score $amethyst_trimmed ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Armor trimmed with amethyst","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +tellraw @s {"text":"\nEnable additional light emitting from...","bold":true,"color":"white"} + +execute if score $fire_aspect ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."},{"text":"\nā Note: Having this option enabled may lead to decreased performance of some mob farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_fire_aspect"}},{"text":"Items enchanted with Fire Aspect","color":"white"}] +execute if score $fire_aspect ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_fire_aspect"}},{"text":"Items enchanted with Fire Aspect","color":"white"}] +execute if score $fire_aspect ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Items enchanted with Fire Aspect","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $fire_aspect ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Items enchanted with Fire Aspect","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $water_sensitive ts.dl.settings matches 1..2 if score $riptide ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_riptide"}},{"text":"Tridents enchanted with Riptide inside water","color":"white"}] +execute if score $water_sensitive ts.dl.settings matches 1..2 if score $riptide ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text": "on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_riptide"}},{"text":"Tridents enchanted with Riptide inside water","color":"white"}] +execute if score $water_sensitive ts.dl.settings matches 1..2 if score $riptide ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Tridents enchanted with Riptide inside water","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $water_sensitive ts.dl.settings matches 1..2 if score $riptide ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Tridents enchanted with Riptide inside water","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $water_sensitive ts.dl.settings matches -1..0 run tellraw @s [{"text":"[ā] ","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Please enable the water sensitvity check first."}]}},{"text":"Tridents enchanted with Riptide inside water","color":"gray"}] + +execute if score $channeling ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_channeling"}},{"text":"Tridents enchanted with Channeling during a thunderstorm","color":"white"}] +execute if score $channeling ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":"."}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_channeling"}},{"text":"Tridents enchanted with Channeling during a thunderstorm","color":"white"}] +execute if score $channeling ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Tridents enchanted with Channeling during a thunderstorm","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $channeling ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Tridents enchanted with Channeling during a thunderstorm","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +tellraw @s {"text":"","bold":true,"color":"white"} + +execute if score $water_sensitive ts.dl.settings matches 1 run tellraw @s [{"text":"[ā] ","bold":true,"color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":". \nIf enabled, water sensitive items such as torches will turn off inside water.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_water_sensitivity"}},{"text":"Water Sensitivity Check","color":"white"}] +execute if score $water_sensitive ts.dl.settings matches 0 run tellraw @s [{"text":"[ā] ","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":". \nIf enabled, water sensitive items such as torches will turn off inside water.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_water_sensitivity"}},{"text":"Water Sensitivity Check","color":"white"}] +execute if score $water_sensitive ts.dl.settings matches -1 run tellraw @s [{"text":"[ā] Water Sensitivity Check","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $water_sensitive ts.dl.settings matches 2 run tellraw @s [{"text":"[ā] Water Sensitivity Check","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $enable_sound ts.dl.settings matches 1 run tellraw @s [{"text": " ā","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":". \nIf enabled, sound cues play when a water sensitive item turns off or on. Also applies to Trident sounds.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_sound"}},{"text":"[ā] ","color":"green"},{"text":"Sound cues","color":"white"}] +execute if score $enable_sound ts.dl.settings matches 0 run tellraw @s [{"text": " ā","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":". \nIf enabled, sound cues play when a water sensitive item turns off or on. Also applies to Trident sounds.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_sound"}},{"text":"[ā] ","color":"red"},{"text":"Sound cues","color":"white"}] +execute if score $enable_sound ts.dl.settings matches -1 run tellraw @s [{"text":" ā[ā] Sound Cues","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enable_sound ts.dl.settings matches 2 run tellraw @s [{"text":" ā[ā] Sound Cues","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $global ts.dl.version matches 3337.. if score $water_sensitive ts.dl.settings matches 1..2 if score $rain_sensitive ts.dl.settings matches 1 run tellraw @s [{"text": " ā","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"off","color":"red"},{"text":". \nIf enabled, touching rain counts as being inside water.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_rain_sensitivity"}},{"text":"[ā] ","color":"green"},{"text":"Rain Check","color":"white"}] +execute if score $global ts.dl.version matches 3337.. if score $water_sensitive ts.dl.settings matches 1..2 if score $rain_sensitive ts.dl.settings matches 0 run tellraw @s [{"text": " ā","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Click here to toggle this feature "},{"text":"on","color":"green"},{"text":". \nIf enabled, touching rain counts as being inside water.","color":"white"}]},"clickEvent":{"action":"run_command","value":"/function dynamiclights:settings/toggle_rain_sensitivity"}},{"text":"[ā] ","color":"red"},{"text":"Rain Check","color":"white"}] +execute if score $global ts.dl.version matches 3337.. if score $water_sensitive ts.dl.settings matches 1..2 if score $rain_sensitive ts.dl.settings matches -1 run tellraw @s [{"text":" ā[ā] Rain Check","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $global ts.dl.version matches 3337.. if score $water_sensitive ts.dl.settings matches 1..2 if score $rain_sensitive ts.dl.settings matches 2 run tellraw @s [{"text":" ā[ā] Rain Check","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $global ts.dl.version matches 3337.. if score $water_sensitive ts.dl.settings matches -1..0 run tellraw @s [{"text":" ā[ā] Rain Check","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Please enable the water sensitvity check first."}]}}] + +function dynamiclights:settings/hide_feedback/main +playsound minecraft:block.dispenser.dispense master @s ~ ~ ~ 0.2 2 diff --git a/data/dynamiclights/function/settings/hide_feedback/hide.mcfunction b/data/dynamiclights/function/settings/hide_feedback/hide.mcfunction new file mode 100644 index 0000000..a45d564 --- /dev/null +++ b/data/dynamiclights/function/settings/hide_feedback/hide.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +gamerule sendCommandFeedback false +schedule function dynamiclights:settings/hide_feedback/unhide 1t diff --git a/data/dynamiclights/function/settings/hide_feedback/main.mcfunction b/data/dynamiclights/function/settings/hide_feedback/main.mcfunction new file mode 100644 index 0000000..4058135 --- /dev/null +++ b/data/dynamiclights/function/settings/hide_feedback/main.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +execute store result score $gamerule.send_feedback ts.dl.settings run gamerule sendCommandFeedback + +execute if score $gamerule.send_feedback ts.dl.settings matches 1 run function dynamiclights:settings/hide_feedback/hide diff --git a/data/dynamiclights/function/settings/hide_feedback/unhide.mcfunction b/data/dynamiclights/function/settings/hide_feedback/unhide.mcfunction new file mode 100644 index 0000000..5620e7c --- /dev/null +++ b/data/dynamiclights/function/settings/hide_feedback/unhide.mcfunction @@ -0,0 +1,3 @@ +##by Tschipcraft + +gamerule sendCommandFeedback true diff --git a/data/dynamiclights/function/settings/toggle_amethyst_trimmed.mcfunction b/data/dynamiclights/function/settings/toggle_amethyst_trimmed.mcfunction new file mode 100644 index 0000000..c66ad3c --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_amethyst_trimmed.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $amethyst_trimmed ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from armor trimmed with amethyst","color":"yellow"}] +execute if score $amethyst_trimmed ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from armor trimmed with amethyst","color":"yellow"}] + +scoreboard players add $amethyst_trimmed ts.dl.settings 1 +execute if score $amethyst_trimmed ts.dl.settings matches 2 run scoreboard players set $amethyst_trimmed ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_channeling.mcfunction b/data/dynamiclights/function/settings/toggle_channeling.mcfunction new file mode 100644 index 0000000..669e485 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_channeling.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $channeling ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from tridents enchanted with channeling during a thunderstorm","color":"yellow"}] +execute if score $channeling ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from tridents enchanted with channeling during a thunderstorm","color":"yellow"}] + +scoreboard players add $channeling ts.dl.settings 1 +execute if score $channeling ts.dl.settings matches 2 run scoreboard players set $channeling ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_enchanted_items.mcfunction b/data/dynamiclights/function/settings/toggle_enchanted_items.mcfunction new file mode 100644 index 0000000..186d0ed --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_enchanted_items.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $enchanted_items ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from enchanted items","color":"yellow"}] +execute if score $enchanted_items ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from enchanted items","color":"yellow"}] + +scoreboard players add $enchanted_items ts.dl.settings 1 +execute if score $enchanted_items ts.dl.settings matches 2 run scoreboard players set $enchanted_items ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_fire_aspect.mcfunction b/data/dynamiclights/function/settings/toggle_fire_aspect.mcfunction new file mode 100644 index 0000000..2cbd816 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_fire_aspect.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $fire_aspect ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from items enchanted with Fire Aspect","color":"yellow"}] +execute if score $fire_aspect ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from items enchanted with Fire Aspect","color":"yellow"}] + +scoreboard players add $fire_aspect ts.dl.settings 1 +execute if score $fire_aspect ts.dl.settings matches 2 run scoreboard players set $fire_aspect ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_ghast.mcfunction b/data/dynamiclights/function/settings/toggle_ghast.mcfunction new file mode 100644 index 0000000..3e544d5 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_ghast.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $enable_ghast ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from ghasts about to shoot a fireball","color":"yellow"}] +execute if score $enable_ghast ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from ghasts about to shoot a fireball","color":"yellow"}] + +scoreboard players add $enable_ghast ts.dl.settings 1 +execute if score $enable_ghast ts.dl.settings matches 2 run scoreboard players set $enable_ghast ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_glowing.mcfunction b/data/dynamiclights/function/settings/toggle_glowing.mcfunction new file mode 100644 index 0000000..3d4c1d9 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_glowing.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $enable_glowing ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from entities with the glowing effect","color":"yellow"}] +execute if score $enable_glowing ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from entities with the glowing effect","color":"yellow"}] + +scoreboard players add $enable_glowing ts.dl.settings 1 +execute if score $enable_glowing ts.dl.settings matches 2 run scoreboard players set $enable_glowing ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_on_fire.mcfunction b/data/dynamiclights/function/settings/toggle_on_fire.mcfunction new file mode 100644 index 0000000..0f94512 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_on_fire.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $enable_on_fire ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from entities on fire","color":"yellow"}] +execute if score $enable_on_fire ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from entities on fire","color":"yellow"}] + +scoreboard players add $enable_on_fire ts.dl.settings 1 +execute if score $enable_on_fire ts.dl.settings matches 2 run scoreboard players set $enable_on_fire ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_rain_sensitivity.mcfunction b/data/dynamiclights/function/settings/toggle_rain_sensitivity.mcfunction new file mode 100644 index 0000000..a21aaae --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_rain_sensitivity.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $rain_sensitive ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Rain counts as water","color":"yellow"}] +execute if score $rain_sensitive ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Rain counts as water","color":"yellow"}] + +scoreboard players add $rain_sensitive ts.dl.settings 1 +execute if score $rain_sensitive ts.dl.settings matches 2 run scoreboard players set $rain_sensitive ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_riptide.mcfunction b/data/dynamiclights/function/settings/toggle_riptide.mcfunction new file mode 100644 index 0000000..9bff869 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_riptide.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $riptide ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Light emitting from tridents enchanted with riptide underwater","color":"yellow"}] +execute if score $riptide ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Light emitting from tridents enchanted with riptide underwater","color":"yellow"}] + +scoreboard players add $riptide ts.dl.settings 1 +execute if score $riptide ts.dl.settings matches 2 run scoreboard players set $riptide ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_sound.mcfunction b/data/dynamiclights/function/settings/toggle_sound.mcfunction new file mode 100644 index 0000000..4d2eb43 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_sound.mcfunction @@ -0,0 +1,8 @@ +##by Tschipcraft + +execute if score $enable_sound ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Sound Cues","color":"yellow"}] +execute if score $enable_sound ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Sound Cues","color":"yellow"}] + +scoreboard players add $enable_sound ts.dl.settings 1 +execute if score $enable_sound ts.dl.settings matches 2 run scoreboard players set $enable_sound ts.dl.settings 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/settings/toggle_water_sensitivity.mcfunction b/data/dynamiclights/function/settings/toggle_water_sensitivity.mcfunction new file mode 100644 index 0000000..0b59619 --- /dev/null +++ b/data/dynamiclights/function/settings/toggle_water_sensitivity.mcfunction @@ -0,0 +1,9 @@ +##by Tschipcraft + +execute if score $water_sensitive ts.dl.settings matches 1 run tellraw @s ["",{"text":"\n-> Disabled "},{"text":"Water sensitive items","color":"yellow"}] +execute if score $water_sensitive ts.dl.settings matches 0 run tellraw @s ["",{"text":"\n-> Enabled "},{"text":"Water sensitive items","color":"yellow"}] + +scoreboard players add $water_sensitive ts.dl.settings 1 +execute if score $water_sensitive ts.dl.settings matches 2 run scoreboard players set $water_sensitive ts.dl.settings 0 +execute if score $water_sensitive ts.dl.settings matches 0 run scoreboard players set @e[type=!#dynamiclights:dyn_ignore,scores={ts.dl.in_water=1},tag=!smithed.strict,tag=!global.ignore,tag=!global.ignore.gui] ts.dl.in_water 0 +function dynamiclights:settings diff --git a/data/dynamiclights/function/summon_light.mcfunction b/data/dynamiclights/function/summon_light.mcfunction new file mode 100644 index 0000000..123a67e --- /dev/null +++ b/data/dynamiclights/function/summon_light.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft +# Deprecated + +function dynamiclights:api/place_light/15 diff --git a/data/dynamiclights/function/summon_redstone_light.mcfunction b/data/dynamiclights/function/summon_redstone_light.mcfunction new file mode 100644 index 0000000..be22734 --- /dev/null +++ b/data/dynamiclights/function/summon_redstone_light.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft +# Deprecated + +function dynamiclights:api/place_light/6 diff --git a/data/dynamiclights/function/summon_soul_light.mcfunction b/data/dynamiclights/function/summon_soul_light.mcfunction new file mode 100644 index 0000000..c0d43e9 --- /dev/null +++ b/data/dynamiclights/function/summon_soul_light.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft +# Deprecated + +function dynamiclights:api/place_light/9 diff --git a/data/dynamiclights/function/uninstall.mcfunction b/data/dynamiclights/function/uninstall.mcfunction new file mode 100644 index 0000000..4ba8aa2 --- /dev/null +++ b/data/dynamiclights/function/uninstall.mcfunction @@ -0,0 +1,43 @@ +##by Tschipcraft + +# Remove existing lights +execute as @e[type=minecraft:marker,tag=ts.dl.light] at @s run function dynamiclights:internal/remove_light +# Kill parser armor stand +kill @e[type=minecraft:armor_stand,tag=ts.dl.i.parser] + +# Remove scores +scoreboard objectives remove ts.dl.ghast_cool +scoreboard objectives remove ts.dl.in_water +scoreboard objectives remove ts.dl.in_rain +scoreboard objectives remove ts.dl.sound +scoreboard objectives remove ts.dl.tnt.fuse +scoreboard objectives remove ts.dl.shulker + +scoreboard objectives remove ts.dl.i.type +scoreboard objectives remove ts.dl.i.is_ench +scoreboard objectives remove ts.dl.i.is_ameth +scoreboard objectives remove ts.dl.i.is_firea +scoreboard objectives remove ts.dl.i.is_ript +scoreboard objectives remove ts.dl.i.is_chann +scoreboard objectives remove ts.dl.l.level + +scoreboard objectives remove ts.dl.temp + +scoreboard objectives remove ts.dl.mess.welc +scoreboard objectives remove ts.dl.settings +scoreboard objectives remove tschipcraft.menu + +scoreboard objectives remove ts.dl.version +scoreboard objectives remove tvc_ignore + +# Clear schedules +schedule clear dynamiclights:internal/main +schedule clear dynamiclights:internal/loop + +# Disable data pack +datapack disable "file/dynamiclights" +datapack disable "file/dynamiclights.zip" +datapack disable "mod:dynamiclights" +datapack disable "file/${file_name}" + +say ā» Dynamic Lights v${version} by Tschipcraft has been uninstalled by @s! It is safe to disable and remove the data pack/mod. diff --git a/data/dynamiclights/predicate/entity/additional_item_tests/amethyst_trimmed_items.json b/data/dynamiclights/predicate/entity/additional_item_tests/amethyst_trimmed_items.json new file mode 100644 index 0000000..a4a694e --- /dev/null +++ b/data/dynamiclights/predicate/entity/additional_item_tests/amethyst_trimmed_items.json @@ -0,0 +1,80 @@ +[ + { + "//comment": "This predicate returns false, if the tested entity is holding or wearing any amethyst trimmed items", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "items": "#minecraft:trimmable_armor", + "count": { + "min": 1 + }, + "predicates": { + "minecraft:trim": { + "material": "minecraft:amethyst" + } + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "items": "#minecraft:trimmable_armor", + "count": { + "min": 1 + }, + "predicates": { + "minecraft:trim": { + "material": "minecraft:amethyst" + } + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#minecraft:trimmable_armor", + "count": { + "min": 1 + }, + "predicates": { + "minecraft:trim": { + "material": "minecraft:amethyst" + } + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.is_ameth": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/additional_item_tests/channeling_trident.json b/data/dynamiclights/predicate/entity/additional_item_tests/channeling_trident.json new file mode 100644 index 0000000..18c529b --- /dev/null +++ b/data/dynamiclights/predicate/entity/additional_item_tests/channeling_trident.json @@ -0,0 +1,101 @@ +[ + { + "//comment": "This predicate returns false, if the tested entity is holding a with channeling enchanted trident", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:channeling", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:channeling", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:channeling", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.is_chann": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/additional_item_tests/enchanted_items.json b/data/dynamiclights/predicate/entity/additional_item_tests/enchanted_items.json new file mode 100644 index 0000000..5c8d4be --- /dev/null +++ b/data/dynamiclights/predicate/entity/additional_item_tests/enchanted_items.json @@ -0,0 +1,89 @@ +[ + { + "//comment": "This predicate returns false, if the tested entity is holding or wearing any enchanted items", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.is_ench": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/additional_item_tests/fire_aspect_items.json b/data/dynamiclights/predicate/entity/additional_item_tests/fire_aspect_items.json new file mode 100644 index 0000000..bc73eba --- /dev/null +++ b/data/dynamiclights/predicate/entity/additional_item_tests/fire_aspect_items.json @@ -0,0 +1,92 @@ +[ + { + "//comment": "This predicate returns false, if the tested entity is holding any fire aspect enchanted items", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:fire_aspect", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:fire_aspect", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:fire_aspect", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.is_firea": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/additional_item_tests/riptide_trident.json b/data/dynamiclights/predicate/entity/additional_item_tests/riptide_trident.json new file mode 100644 index 0000000..bf8b402 --- /dev/null +++ b/data/dynamiclights/predicate/entity/additional_item_tests/riptide_trident.json @@ -0,0 +1,101 @@ +[ + { + "//comment": "This predicate returns false, if the tested entity is holding a with riptide enchanted trident", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:riptide", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:riptide", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": [ + "minecraft:trident" + ], + "count": { + "min": 1 + }, + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:riptide", + "levels": { + "min": 1 + } + } + ] + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.is_ript": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/has_amethyst_trimmed_items.json b/data/dynamiclights/predicate/entity/has_amethyst_trimmed_items.json new file mode 100644 index 0000000..f0d1532 --- /dev/null +++ b/data/dynamiclights/predicate/entity/has_amethyst_trimmed_items.json @@ -0,0 +1,25 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is holding or wearing any amethyst trimmed items and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$amethyst_trimmed" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/additional_item_tests/amethyst_trimmed_items" + } + } +] diff --git a/data/dynamiclights/predicate/entity/has_channeling_trident.json b/data/dynamiclights/predicate/entity/has_channeling_trident.json new file mode 100644 index 0000000..5f6bc69 --- /dev/null +++ b/data/dynamiclights/predicate/entity/has_channeling_trident.json @@ -0,0 +1,29 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is holding a with riptide enchanted trident while in a thunderstorm and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$channeling" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:weather_check", + "thundering": true + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/additional_item_tests/channeling_trident" + } + } +] diff --git a/data/dynamiclights/predicate/entity/has_enchanted_items.json b/data/dynamiclights/predicate/entity/has_enchanted_items.json new file mode 100644 index 0000000..c2ea4ff --- /dev/null +++ b/data/dynamiclights/predicate/entity/has_enchanted_items.json @@ -0,0 +1,25 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is holding or wearing any enchanted items and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$enchanted_items" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/additional_item_tests/enchanted_items" + } + } +] diff --git a/data/dynamiclights/predicate/entity/has_fire_aspect_items.json b/data/dynamiclights/predicate/entity/has_fire_aspect_items.json new file mode 100644 index 0000000..5e164bf --- /dev/null +++ b/data/dynamiclights/predicate/entity/has_fire_aspect_items.json @@ -0,0 +1,25 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is holding any fire aspect enchanted items and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$fire_aspect" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/additional_item_tests/fire_aspect_items" + } + } +] diff --git a/data/dynamiclights/predicate/entity/has_riptide_trident.json b/data/dynamiclights/predicate/entity/has_riptide_trident.json new file mode 100644 index 0000000..f9a7778 --- /dev/null +++ b/data/dynamiclights/predicate/entity/has_riptide_trident.json @@ -0,0 +1,32 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is holding a with riptide enchanted trident underwater and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$riptide" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/additional_item_tests/riptide_trident" + } + } +] diff --git a/data/dynamiclights/predicate/entity/is_glowing.json b/data/dynamiclights/predicate/entity/is_glowing.json new file mode 100644 index 0000000..6e0db00 --- /dev/null +++ b/data/dynamiclights/predicate/entity/is_glowing.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is glowing and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$enable_glowing" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:glowing": { + "duration": { + "min": 1 + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/is_in_water.json b/data/dynamiclights/predicate/entity/is_in_water.json new file mode 100644 index 0000000..a8621ae --- /dev/null +++ b/data/dynamiclights/predicate/entity/is_in_water.json @@ -0,0 +1,8 @@ +{ + "//comment": "This predicate returns true if the tested entity is inside water", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/is_outside_water" + } +} diff --git a/data/dynamiclights/predicate/entity/is_on_fire.json b/data/dynamiclights/predicate/entity/is_on_fire.json new file mode 100644 index 0000000..6722276 --- /dev/null +++ b/data/dynamiclights/predicate/entity/is_on_fire.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true, if the tested entity is on fire and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$enable_on_fire" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_on_fire": true + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12.json b/data/dynamiclights/predicate/entity/light_level/12.json new file mode 100644 index 0000000..b15697c --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12.json @@ -0,0 +1,65 @@ +[ + { + "//comment": "This predicate returns false if the entity should emit light level 12", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/12/mainhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/12/offhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/12/head" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/12/contents" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:light_level/12" + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 4 + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/12_turn_off" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/12_turn_on" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12/contents.json b/data/dynamiclights/predicate/entity/light_level/12/contents.json new file mode 100644 index 0000000..e3507a7 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12/contents.json @@ -0,0 +1,32 @@ +[ + { + "//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities, item frames and other single slot entities since 24w11a.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:light_level/12", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12/has_mainhand_item.json b/data/dynamiclights/predicate/entity/light_level/12/has_mainhand_item.json new file mode 100644 index 0000000..283870b --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12/has_mainhand_item.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand is a light level 12 item (solely used by the item parser)", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/12", + "count": { + "min": 1 + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12/head.json b/data/dynamiclights/predicate/entity/light_level/12/head.json new file mode 100644 index 0000000..1ccf261 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12/head.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the head should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:light_level/12", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12/mainhand.json b/data/dynamiclights/predicate/entity/light_level/12/mainhand.json new file mode 100644 index 0000000..209b857 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12/mainhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/12", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/12/offhand.json b/data/dynamiclights/predicate/entity/light_level/12/offhand.json new file mode 100644 index 0000000..d25b8c2 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/12/offhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the offhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:light_level/12", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15.json b/data/dynamiclights/predicate/entity/light_level/15.json new file mode 100644 index 0000000..22d23da --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15.json @@ -0,0 +1,72 @@ +[ + { + "//comment": "This predicate returns false if the entity should emit light level 15", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/15/mainhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/15/offhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/15/head" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/15/contents" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/is_on_fire" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:light_level/15" + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 5 + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/15_turn_off" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/15_turn_on" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15/contents.json b/data/dynamiclights/predicate/entity/light_level/15/contents.json new file mode 100644 index 0000000..9930eb0 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15/contents.json @@ -0,0 +1,55 @@ +[ + { + "//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities, item frames and other single slot entities since 24w11a.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:light_level/15", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_illuminate" + } + }, + { + "//comment": "This part ensures that the campfire item is lit. (Compatibility for The Creeper's Code)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "contents": { + "items": [ + "minecraft:campfire", + "minecraft:soul_campfire" + ], + "components": { + "minecraft:block_state": { + "lit": "fase" + } + } + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15/has_mainhand_item.json b/data/dynamiclights/predicate/entity/light_level/15/has_mainhand_item.json new file mode 100644 index 0000000..4942520 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15/has_mainhand_item.json @@ -0,0 +1,40 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand is a light level 15 item (solely used by the item parser)", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/15", + "count": { + "min": 1 + } + } + } + } + }, + { + "//comment": "This part ensures that the campfire item is lit. (Compatibility for The Creeper's Code)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:campfire", + "minecraft:soul_campfire" + ], + "components": { + "minecraft:block_state": { + "lit": "fase" + } + } + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15/head.json b/data/dynamiclights/predicate/entity/light_level/15/head.json new file mode 100644 index 0000000..48f5a26 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15/head.json @@ -0,0 +1,54 @@ +[ + { + "//comment": "This predicate returns true, if the item in the head should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:light_level/15", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_illuminate" + } + }, + { + "//comment": "This part ensures that the campfire item is lit. (Compatibility for The Creeper's Code)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": [ + "minecraft:campfire", + "minecraft:soul_campfire" + ], + "components": { + "minecraft:block_state": { + "lit": "fase" + } + } + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15/mainhand.json b/data/dynamiclights/predicate/entity/light_level/15/mainhand.json new file mode 100644 index 0000000..e00e1a0 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15/mainhand.json @@ -0,0 +1,54 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/15", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_illuminate" + } + }, + { + "//comment": "This part ensures that the campfire item is lit. (Compatibility for The Creeper's Code)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:campfire", + "minecraft:soul_campfire" + ], + "components": { + "minecraft:block_state": { + "lit": "fase" + } + } + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/15/offhand.json b/data/dynamiclights/predicate/entity/light_level/15/offhand.json new file mode 100644 index 0000000..d2e7981 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/15/offhand.json @@ -0,0 +1,54 @@ +[ + { + "//comment": "This predicate returns true, if the item in the offhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:light_level/15", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_illuminate" + } + }, + { + "//comment": "This part ensures that the campfire item is lit. (Compatibility for The Creeper's Code)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": [ + "minecraft:campfire", + "minecraft:soul_campfire" + ], + "components": { + "minecraft:block_state": { + "lit": "fase" + } + } + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3.json b/data/dynamiclights/predicate/entity/light_level/3.json new file mode 100644 index 0000000..413002d --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3.json @@ -0,0 +1,65 @@ +[ + { + "//comment": "This predicate returns false if the entity should emit light level 3", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/3/mainhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/3/offhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/3/head" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/3/contents" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:light_level/3" + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 1 + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/3_turn_off" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/3_turn_on" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3/contents.json b/data/dynamiclights/predicate/entity/light_level/3/contents.json new file mode 100644 index 0000000..83f7f2f --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3/contents.json @@ -0,0 +1,32 @@ +[ + { + "//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities, item frames and other single slot entities since 24w11a.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:light_level/3", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3/has_mainhand_item.json b/data/dynamiclights/predicate/entity/light_level/3/has_mainhand_item.json new file mode 100644 index 0000000..5ab1ddf --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3/has_mainhand_item.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand is a light level 3 item (solely used by the item parser)", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/3", + "count": { + "min": 1 + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3/head.json b/data/dynamiclights/predicate/entity/light_level/3/head.json new file mode 100644 index 0000000..c50a63d --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3/head.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the head should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:light_level/3", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3/mainhand.json b/data/dynamiclights/predicate/entity/light_level/3/mainhand.json new file mode 100644 index 0000000..acc837a --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3/mainhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/3", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/3/offhand.json b/data/dynamiclights/predicate/entity/light_level/3/offhand.json new file mode 100644 index 0000000..39cb4ae --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/3/offhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the offhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:light_level/3", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6.json b/data/dynamiclights/predicate/entity/light_level/6.json new file mode 100644 index 0000000..16658bf --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6.json @@ -0,0 +1,79 @@ +[ + { + "//comment": "This predicate returns false if the entity should emit light level 6", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/6/mainhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/6/offhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/6/head" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/6/contents" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/has_enchanted_items" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/has_amethyst_trimmed_items" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:light_level/6" + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 2 + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/6_turn_off" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/6_turn_on" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6/contents.json b/data/dynamiclights/predicate/entity/light_level/6/contents.json new file mode 100644 index 0000000..6ac34b0 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6/contents.json @@ -0,0 +1,32 @@ +[ + { + "//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities, item frames and other single slot entities since 24w11a.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:light_level/6", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6/has_mainhand_item.json b/data/dynamiclights/predicate/entity/light_level/6/has_mainhand_item.json new file mode 100644 index 0000000..7bd8bac --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6/has_mainhand_item.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand is a light level 6 item (solely used by the item parser)", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/6", + "count": { + "min": 1 + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6/head.json b/data/dynamiclights/predicate/entity/light_level/6/head.json new file mode 100644 index 0000000..e8a20e5 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6/head.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the head should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:light_level/6", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6/mainhand.json b/data/dynamiclights/predicate/entity/light_level/6/mainhand.json new file mode 100644 index 0000000..7f8ed06 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6/mainhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/6", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/6/offhand.json b/data/dynamiclights/predicate/entity/light_level/6/offhand.json new file mode 100644 index 0000000..d2d3d04 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/6/offhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the offhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:light_level/6", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9.json b/data/dynamiclights/predicate/entity/light_level/9.json new file mode 100644 index 0000000..f5e24f3 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9.json @@ -0,0 +1,93 @@ +[ + { + "//comment": "This predicate returns false if the entity should emit light level 9", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/9/mainhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/9/offhand" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/9/head" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/9/contents" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/is_glowing" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/has_fire_aspect_items" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/has_riptide_trident" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/has_channeling_trident" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:light_level/9" + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 3 + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/9_turn_off" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/scores/9_turn_on" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9/contents.json b/data/dynamiclights/predicate/entity/light_level/9/contents.json new file mode 100644 index 0000000..7288356 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9/contents.json @@ -0,0 +1,32 @@ +[ + { + "//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities, item frames and other single slot entities since 24w11a.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:light_level/9", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/contents/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9/has_mainhand_item.json b/data/dynamiclights/predicate/entity/light_level/9/has_mainhand_item.json new file mode 100644 index 0000000..85c5921 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9/has_mainhand_item.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand is a light level 9 item (solely used by the item parser)", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/9", + "count": { + "min": 1 + } + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9/head.json b/data/dynamiclights/predicate/entity/light_level/9/head.json new file mode 100644 index 0000000..71fd2a9 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9/head.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the head should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:light_level/9", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/head/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9/mainhand.json b/data/dynamiclights/predicate/entity/light_level/9/mainhand.json new file mode 100644 index 0000000..2c26cb9 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9/mainhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the mainhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:light_level/9", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/mainhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/light_level/9/offhand.json b/data/dynamiclights/predicate/entity/light_level/9/offhand.json new file mode 100644 index 0000000..d099589 --- /dev/null +++ b/data/dynamiclights/predicate/entity/light_level/9/offhand.json @@ -0,0 +1,31 @@ +[ + { + "//comment": "This predicate returns true, if the item in the offhand should light up", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:light_level/9", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_extinguish" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/water_check/offhand/water_immersion_illuminate" + } + } +] diff --git a/data/dynamiclights/predicate/entity/should_emit_light_level/12.json b/data/dynamiclights/predicate/entity/should_emit_light_level/12.json new file mode 100644 index 0000000..5194d8c --- /dev/null +++ b/data/dynamiclights/predicate/entity/should_emit_light_level/12.json @@ -0,0 +1,10 @@ +[ + { + "//comment": "This predicate returns true if the tested entity should emit light level 12", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/12" + } + } +] diff --git a/data/dynamiclights/predicate/entity/should_emit_light_level/15.json b/data/dynamiclights/predicate/entity/should_emit_light_level/15.json new file mode 100644 index 0000000..5631e68 --- /dev/null +++ b/data/dynamiclights/predicate/entity/should_emit_light_level/15.json @@ -0,0 +1,10 @@ +[ + { + "//comment": "This predicate returns true if the tested entity should emit light level 15", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/15" + } + } +] diff --git a/data/dynamiclights/predicate/entity/should_emit_light_level/3.json b/data/dynamiclights/predicate/entity/should_emit_light_level/3.json new file mode 100644 index 0000000..0b2fabe --- /dev/null +++ b/data/dynamiclights/predicate/entity/should_emit_light_level/3.json @@ -0,0 +1,10 @@ +[ + { + "//comment": "This predicate returns true if the tested entity should emit light level 3", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/3" + } + } +] diff --git a/data/dynamiclights/predicate/entity/should_emit_light_level/6.json b/data/dynamiclights/predicate/entity/should_emit_light_level/6.json new file mode 100644 index 0000000..08a9475 --- /dev/null +++ b/data/dynamiclights/predicate/entity/should_emit_light_level/6.json @@ -0,0 +1,10 @@ +[ + { + "//comment": "This predicate returns true if the tested entity should emit light level 6", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/6" + } + } +] diff --git a/data/dynamiclights/predicate/entity/should_emit_light_level/9.json b/data/dynamiclights/predicate/entity/should_emit_light_level/9.json new file mode 100644 index 0000000..afe86ec --- /dev/null +++ b/data/dynamiclights/predicate/entity/should_emit_light_level/9.json @@ -0,0 +1,10 @@ +[ + { + "//comment": "This predicate returns true if the tested entity should emit light level 9", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:entity/light_level/9" + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_extinguish.json b/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_extinguish.json new file mode 100644 index 0000000..aaa1413 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_extinguish.json @@ -0,0 +1,25 @@ +[ + { + "//comment": "This predicate returns true if the item in the contents slot should not light up, because the entity is inside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_illuminate.json b/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_illuminate.json new file mode 100644 index 0000000..600de50 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/contents/water_immersion_illuminate.json @@ -0,0 +1,25 @@ +[ + { + "//comment": "This predicate returns true if the item in the contents slot should not light up, because the entity is outside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/head/water_immersion_extinguish.json b/data/dynamiclights/predicate/entity/water_check/head/water_immersion_extinguish.json new file mode 100644 index 0000000..8b937cf --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/head/water_immersion_extinguish.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the head should not light up, because the entity is inside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/head/water_immersion_illuminate.json b/data/dynamiclights/predicate/entity/water_check/head/water_immersion_illuminate.json new file mode 100644 index 0000000..d77b0a8 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/head/water_immersion_illuminate.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the head should not light up, because the entity is outside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/is_outside_water.json b/data/dynamiclights/predicate/entity/water_check/is_outside_water.json new file mode 100644 index 0000000..b07d802 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/is_outside_water.json @@ -0,0 +1,20 @@ +[ + { + "//comment": "This predicate returns true if the tested entity is outside water", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/in_water" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_rain": 1 + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_extinguish.json b/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_extinguish.json new file mode 100644 index 0000000..543219b --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_extinguish.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the mainhand should not light up, because the entity is inside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_illuminate.json b/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_illuminate.json new file mode 100644 index 0000000..35c5a4a --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/mainhand/water_immersion_illuminate.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the mainhand should not light up, because the entity is outside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/no_water_immersion_extinguish_items.json b/data/dynamiclights/predicate/entity/water_check/no_water_immersion_extinguish_items.json new file mode 100644 index 0000000..40d0bac --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/no_water_immersion_extinguish_items.json @@ -0,0 +1,68 @@ +[ + { + "//comment": "This predicate returns false if the tested entity is holding or wearing an item that should extinguish inside water (specified in tags/items/water_sensitive/turn_off)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": { + "min": 6, + "max": 10 + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/no_water_immersion_illuminate_items.json b/data/dynamiclights/predicate/entity/water_check/no_water_immersion_illuminate_items.json new file mode 100644 index 0000000..2f5edd1 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/no_water_immersion_illuminate_items.json @@ -0,0 +1,68 @@ +[ + { + "//comment": "This predicate returns false if the tested entity is holding or wearing an item that should illuminate inside water (specified in tags/items/water_sensitive/turn_on)", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "weapon.*": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "slots": { + "armor.*": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#dynamiclights:single_slot_entities", + "slots": { + "contents": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": { + "min": 11, + "max": 15 + } + } + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_extinguish.json b/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_extinguish.json new file mode 100644 index 0000000..3e9a25f --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_extinguish.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the offhand should not light up, because the entity is inside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:water_sensitive/turn_off", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_illuminate.json b/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_illuminate.json new file mode 100644 index 0000000..9966b62 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/offhand/water_immersion_illuminate.json @@ -0,0 +1,24 @@ +[ + { + "//comment": "This predicate returns true if the item in the offhand should not light up, because the entity is outside water.", + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#dynamiclights:water_sensitive/turn_on", + "count": { + "min": 1 + } + } + } + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/12_turn_off.json b/data/dynamiclights/predicate/entity/water_check/scores/12_turn_off.json new file mode 100644 index 0000000..60eb6d6 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/12_turn_off.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 12 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 9 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/12_turn_on.json b/data/dynamiclights/predicate/entity/water_check/scores/12_turn_on.json new file mode 100644 index 0000000..2898b17 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/12_turn_on.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 12 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 14 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/15_turn_off.json b/data/dynamiclights/predicate/entity/water_check/scores/15_turn_off.json new file mode 100644 index 0000000..e1af097 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/15_turn_off.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 15 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 10 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/15_turn_on.json b/data/dynamiclights/predicate/entity/water_check/scores/15_turn_on.json new file mode 100644 index 0000000..7f03710 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/15_turn_on.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 15 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 15 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/3_turn_off.json b/data/dynamiclights/predicate/entity/water_check/scores/3_turn_off.json new file mode 100644 index 0000000..1ee1165 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/3_turn_off.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 3 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 6 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/3_turn_on.json b/data/dynamiclights/predicate/entity/water_check/scores/3_turn_on.json new file mode 100644 index 0000000..0d0534d --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/3_turn_on.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 3 and is inside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 11 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/6_turn_off.json b/data/dynamiclights/predicate/entity/water_check/scores/6_turn_off.json new file mode 100644 index 0000000..3a4fdc3 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/6_turn_off.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 6 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 7 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/6_turn_on.json b/data/dynamiclights/predicate/entity/water_check/scores/6_turn_on.json new file mode 100644 index 0000000..a32d16c --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/6_turn_on.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 6 and is inside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 12 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/9_turn_off.json b/data/dynamiclights/predicate/entity/water_check/scores/9_turn_off.json new file mode 100644 index 0000000..040bf52 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/9_turn_off.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 9 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 8 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 0 + } + } +] diff --git a/data/dynamiclights/predicate/entity/water_check/scores/9_turn_on.json b/data/dynamiclights/predicate/entity/water_check/scores/9_turn_on.json new file mode 100644 index 0000000..69870f0 --- /dev/null +++ b/data/dynamiclights/predicate/entity/water_check/scores/9_turn_on.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns true if the entity should emit light level 9 and is outside water", + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.i.type": 13 + } + }, + { + "condition": "minecraft:entity_scores", + "entity": "this", + "scores": { + "ts.dl.in_water": 1 + } + } +] diff --git a/data/dynamiclights/predicate/ghast_targeting.json b/data/dynamiclights/predicate/ghast_targeting.json new file mode 100644 index 0000000..590f891 --- /dev/null +++ b/data/dynamiclights/predicate/ghast_targeting.json @@ -0,0 +1,26 @@ +[ + { + "//comment": "This predicate returns true if the tested entity is a ghast targeting the player and this feature is enabled", + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$enable_ghast" + }, + "score": "ts.dl.settings" + }, + "range": { + "min": 1, + "max": 2 + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:ghast", + "targeted_entity": {} + } + } +] diff --git a/data/dynamiclights/predicate/visible.json b/data/dynamiclights/predicate/visible.json new file mode 100644 index 0000000..a8967bd --- /dev/null +++ b/data/dynamiclights/predicate/visible.json @@ -0,0 +1,11 @@ +{ + "//comment": "This predicate checks if dynamic lights with light levels 9 and 6 would be visible if placed.", + "condition": "minecraft:location_check", + "predicate": { + "light": { + "light": { + "max": 9 + } + } + } +} diff --git a/data/dynamiclights/predicate/world/in_water.json b/data/dynamiclights/predicate/world/in_water.json new file mode 100644 index 0000000..ea3f803 --- /dev/null +++ b/data/dynamiclights/predicate/world/in_water.json @@ -0,0 +1,9 @@ +{ + "//comment": "Checks if the tested position is inside water", + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } +} diff --git a/data/dynamiclights/predicate/world/is_raining.json b/data/dynamiclights/predicate/world/is_raining.json new file mode 100644 index 0000000..fd1aff7 --- /dev/null +++ b/data/dynamiclights/predicate/world/is_raining.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:weather_check", + "raining": true +} diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/down.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down.json new file mode 100644 index 0000000..975d1ae --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the down direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/down/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/down/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/2.json new file mode 100644 index 0000000..de30ac8 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks down is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetY": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "up" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/3.json new file mode 100644 index 0000000..431f3eb --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/down/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks up is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetY": 3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "down" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/east.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east.json new file mode 100644 index 0000000..3e72fa2 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the east direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/east/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/east/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/2.json new file mode 100644 index 0000000..691d3db --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks east is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetX": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "west" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/3.json new file mode 100644 index 0000000..68f7ef7 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/east/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks east is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetX": 3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "west" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/north.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north.json new file mode 100644 index 0000000..0bdbc7b --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the north direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/north/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/north/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/2.json new file mode 100644 index 0000000..44fa6fc --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks north is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetZ": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "south" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/3.json new file mode 100644 index 0000000..5df8b2e --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/north/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks north is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetZ": -3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "south" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/south.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south.json new file mode 100644 index 0000000..1e1f335 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the south direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/south/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/south/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/2.json new file mode 100644 index 0000000..7828b09 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks south is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetZ": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "north" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/3.json new file mode 100644 index 0000000..b4490c7 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/south/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks south is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetZ": 3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "north" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/up.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up.json new file mode 100644 index 0000000..e189183 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the up direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/up/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/up/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/2.json new file mode 100644 index 0000000..3f2cb1a --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks up is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetY": 2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "down" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/3.json new file mode 100644 index 0000000..1d8c73c --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/up/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks down is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetY": -3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "up" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/west.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west.json new file mode 100644 index 0000000..2d5d92a --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west.json @@ -0,0 +1,17 @@ +[ + { + "//comment": "This predicate returns false if the current position may be affected by a piston in the west direction", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/west/2" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/west/3" + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/2.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/2.json new file mode 100644 index 0000000..ea2d716 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/2.json @@ -0,0 +1,27 @@ +[ + { + "//comment": "This predicate returns true if a piston block 2 blocks west is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetX": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "east" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/3.json b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/3.json new file mode 100644 index 0000000..8fce09c --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/piston_deep_search/west/3.json @@ -0,0 +1,39 @@ +[ + { + "//comment": "This predicate returns true if a piston block 3 blocks west is in direct pushing range of the current position", + "condition": "minecraft:location_check", + "offsetX": -3, + "predicate": { + "block": { + "blocks": "#dynamiclights:piston", + "state": { + "facing": "east" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": -2, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:breaks_piston_push_chain" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/pos_blocked.json b/data/dynamiclights/predicate/world/place_light/pos_blocked.json new file mode 100644 index 0000000..50a5217 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/pos_blocked.json @@ -0,0 +1,30 @@ +[ + { + "//comment": "This predicate returns false if the tested position is replacable by a light block", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": "#dynamiclights:air" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "//comment": "Specifying water here prevents replacing any waterlogged blocks that are not purely water", + "blocks": "minecraft:water" + }, + "fluid": { + "//comment": "Specifying water here prevents replacing flowing_water blocks with water source blocks", + "fluids": "minecraft:water" + } + } + } + } +] diff --git a/data/dynamiclights/predicate/world/place_light/valid_pos.json b/data/dynamiclights/predicate/world/place_light/valid_pos.json new file mode 100644 index 0000000..755cee1 --- /dev/null +++ b/data/dynamiclights/predicate/world/place_light/valid_pos.json @@ -0,0 +1,132 @@ +[ + { + "//comment": "This predicate returns true if the tested location including its surroundings is safe to place a light source", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/pos_blocked" + } + }, + { + "//comment": "Don't block off flowing water above", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "minecraft:flowing_water" + } + } + } + }, + { + "//comment": "Don't block off flowing lava above", + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "minecraft:flowing_lava" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetX": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": 1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetZ": -1, + "predicate": { + "block": { + "blocks": "#dynamiclights:avoid" + } + } + } + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/north" + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/south" + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/west" + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/east" + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/up" + }, + { + "condition": "minecraft:reference", + "name": "dynamiclights:world/place_light/piston_deep_search/down" + } +] diff --git a/data/dynamiclights/tags/block/affected_by_gravity.json b/data/dynamiclights/tags/block/affected_by_gravity.json new file mode 100644 index 0000000..2faabd2 --- /dev/null +++ b/data/dynamiclights/tags/block/affected_by_gravity.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "#minecraft:anvil", + {"id": "#minecraft:concrete_powder", "required": false}, + "#minecraft:sand", + "minecraft:gravel", + {"id": "minecraft:suspicious_gravel", "required": false} + ] +} diff --git a/data/dynamiclights/tags/block/air.json b/data/dynamiclights/tags/block/air.json new file mode 100644 index 0000000..ea2875a --- /dev/null +++ b/data/dynamiclights/tags/block/air.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:air", + "minecraft:cave_air", + "minecraft:light" + ] +} diff --git a/data/dynamiclights/tags/block/avoid.json b/data/dynamiclights/tags/block/avoid.json new file mode 100644 index 0000000..f409d3d --- /dev/null +++ b/data/dynamiclights/tags/block/avoid.json @@ -0,0 +1,26 @@ +{ + "replace": false, + "values": [ + "minecraft:moving_piston", + "minecraft:piston", + "minecraft:sticky_piston", + "minecraft:piston_head", + "minecraft:redstone_torch", + "minecraft:redstone_wall_torch", + "minecraft:redstone_wire", + "minecraft:repeater", + "minecraft:comparator", + "minecraft:observer", + "minecraft:redstone_lamp", + "minecraft:detector_rail", + "minecraft:iron_trapdoor", + "minecraft:iron_door", + "minecraft:slime_block", + "minecraft:honey_block", + "minecraft:tnt", + "minecraft:sponge", + "minecraft:lava", + "minecraft:frosted_ice", + "#dynamiclights:affected_by_gravity" + ] +} diff --git a/data/dynamiclights/tags/block/breaks_piston_push_chain.json b/data/dynamiclights/tags/block/breaks_piston_push_chain.json new file mode 100644 index 0000000..02dde8f --- /dev/null +++ b/data/dynamiclights/tags/block/breaks_piston_push_chain.json @@ -0,0 +1,25 @@ +{ + "//comment": "Some more immovable blocks could be added here but would worsen the performance of the valid position checks", + "replace": false, + "values": [ + "#dynamiclights:air", + "#minecraft:portals", + "#minecraft:anvil", + "minecraft:beacon", + "minecraft:bedrock", + "minecraft:crying_obsidian", + "minecraft:enchanting_table", + "minecraft:end_portal_frame", + "minecraft:grindstone", + "minecraft:jukebox", + "minecraft:lodestone", + "minecraft:spawner", + "minecraft:obsidian", + "minecraft:piston_head", + "minecraft:respawn_anchor", + {"id": "minecraft:reinforced_deepslate", "required": false}, + {"id": "minecraft:sculk_catalyst", "required": false}, + {"id": "minecraft:sculk_sensor", "required": false}, + {"id": "minecraft:sculk_shrieker", "required": false} + ] +} diff --git a/data/dynamiclights/tags/block/piston.json b/data/dynamiclights/tags/block/piston.json new file mode 100644 index 0000000..ddbf412 --- /dev/null +++ b/data/dynamiclights/tags/block/piston.json @@ -0,0 +1,8 @@ +{ + "//comment": "This tag only needs the block ids that could extend and doesn't care about extending (minecraft:moving_piston) and extended (minecraft:piston_head) parts", + "replace": false, + "values": [ + "minecraft:piston", + "minecraft:sticky_piston" + ] +} diff --git a/data/dynamiclights/tags/block/tnt_exclude.json b/data/dynamiclights/tags/block/tnt_exclude.json new file mode 100644 index 0000000..8155418 --- /dev/null +++ b/data/dynamiclights/tags/block/tnt_exclude.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "minecraft:observer", + "minecraft:slime_block", + "minecraft:detector_rail", + "minecraft:moving_piston" + ] +} diff --git a/data/dynamiclights/tags/entity_type/dyn_ignore.json b/data/dynamiclights/tags/entity_type/dyn_ignore.json new file mode 100644 index 0000000..2d99227 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/dyn_ignore.json @@ -0,0 +1,13 @@ +{ + "replace": false, + "values": [ + "minecraft:area_effect_cloud", + "minecraft:fishing_bobber", + "minecraft:leash_knot", + "minecraft:llama_spit", + "minecraft:marker", + "minecraft:painting", + {"id": "minecraft:text_display", "required": false}, + {"id": "minecraft:interaction", "required": false} + ] +} diff --git a/data/dynamiclights/tags/entity_type/light_level/12.json b/data/dynamiclights/tags/entity_type/light_level/12.json new file mode 100644 index 0000000..7ee4c68 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/light_level/12.json @@ -0,0 +1,7 @@ +{ + "//comment": "Entities specified here will always emit light level 12", + "replace": false, + "values": [ + "minecraft:dragon_fireball" + ] +} diff --git a/data/dynamiclights/tags/entity_type/light_level/15.json b/data/dynamiclights/tags/entity_type/light_level/15.json new file mode 100644 index 0000000..78f88d8 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/light_level/15.json @@ -0,0 +1,9 @@ +{ + "//comment": "Entities specified here will always emit light level 15", + "replace": false, + "values": [ + "minecraft:end_crystal", + "minecraft:fireball", + "minecraft:lightning_bolt" + ] +} diff --git a/data/dynamiclights/tags/entity_type/light_level/3.json b/data/dynamiclights/tags/entity_type/light_level/3.json new file mode 100644 index 0000000..ed289bc --- /dev/null +++ b/data/dynamiclights/tags/entity_type/light_level/3.json @@ -0,0 +1,7 @@ +{ + "//comment": "Entities specified here will always emit light level 3", + "replace": false, + "values": [ + "minecraft:magma_cube" + ] +} diff --git a/data/dynamiclights/tags/entity_type/light_level/6.json b/data/dynamiclights/tags/entity_type/light_level/6.json new file mode 100644 index 0000000..50f540a --- /dev/null +++ b/data/dynamiclights/tags/entity_type/light_level/6.json @@ -0,0 +1,9 @@ +{ + "//comment": "Entities specified here will always emit light level 6", + "replace": false, + "values": [ + "minecraft:tnt", + "minecraft:shulker_bullet", + {"id": "minecraft:allay", "required": false} + ] +} diff --git a/data/dynamiclights/tags/entity_type/light_level/9.json b/data/dynamiclights/tags/entity_type/light_level/9.json new file mode 100644 index 0000000..b1a600d --- /dev/null +++ b/data/dynamiclights/tags/entity_type/light_level/9.json @@ -0,0 +1,13 @@ +{ + "//comment": "Entities specified here will always emit light level 9", + "replace": false, + "values": [ + "minecraft:blaze", + "minecraft:glow_squid", + "minecraft:glow_item_frame", + "minecraft:spectral_arrow", + "minecraft:firework_rocket", + "minecraft:wither_skull", + "minecraft:small_fireball" + ] +} diff --git a/data/dynamiclights/tags/entity_type/may_block_explosion.json b/data/dynamiclights/tags/entity_type/may_block_explosion.json new file mode 100644 index 0000000..c708a96 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/may_block_explosion.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "minecraft:creeper", + "minecraft:fireball", + "minecraft:small_fireball", + "minecraft:wither_skull", + "minecraft:tnt_minecart" + ] +} diff --git a/data/dynamiclights/tags/entity_type/parse.json b/data/dynamiclights/tags/entity_type/parse.json new file mode 100644 index 0000000..ceaec6f --- /dev/null +++ b/data/dynamiclights/tags/entity_type/parse.json @@ -0,0 +1,9 @@ +{ + "//comment": "These entities use a different NBT tag for storing their item and need special parsing for detection.", + "//version_notice": "Mentions for single slot entities and reparse functionality are not needed anymore since 24w11a. Instead, take a look at single_slot_entities.json.", + "replace": false, + "values": [ + "minecraft:falling_block", + {"id": "minecraft:block_display", "required": false} + ] +} diff --git a/data/dynamiclights/tags/entity_type/reparse.json b/data/dynamiclights/tags/entity_type/reparse.json new file mode 100644 index 0000000..31d7875 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/reparse.json @@ -0,0 +1,9 @@ +{ + "//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 new file mode 100644 index 0000000..a924ec3 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/reparse_interactible.json @@ -0,0 +1,9 @@ +{ + "//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/dynamiclights/tags/entity_type/single_slot_entities.json b/data/dynamiclights/tags/entity_type/single_slot_entities.json new file mode 100644 index 0000000..1038209 --- /dev/null +++ b/data/dynamiclights/tags/entity_type/single_slot_entities.json @@ -0,0 +1,13 @@ +{ + "//comment": "Single slot item holder entities that correctly expose their slots contents tag to check for light emitting items.", + "replace": false, + "values": [ + "#minecraft:arrows", + "minecraft:trident", + "minecraft:item", + "minecraft:item_display", + "minecraft:item_frame", + "minecraft:glow_item_frame", + {"id": "minecraft:ominous_item_spawner", "required": false} + ] +} diff --git a/data/dynamiclights/tags/function/settings.json b/data/dynamiclights/tags/function/settings.json new file mode 100644 index 0000000..8bbd5e2 --- /dev/null +++ b/data/dynamiclights/tags/function/settings.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dynamiclights:settings" + ] +} diff --git a/data/dynamiclights/tags/item/light_level/12.json b/data/dynamiclights/tags/item/light_level/12.json new file mode 100644 index 0000000..d18ba27 --- /dev/null +++ b/data/dynamiclights/tags/item/light_level/12.json @@ -0,0 +1,7 @@ +{ + "//comment": "Items listed here will emit light level 12", + "replace": false, + "values": [ + {"id": "#dynamiclights:mod_support/light_level/12", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/light_level/15.json b/data/dynamiclights/tags/item/light_level/15.json new file mode 100644 index 0000000..52a52e3 --- /dev/null +++ b/data/dynamiclights/tags/item/light_level/15.json @@ -0,0 +1,21 @@ +{ + "//comment": "Items listed here will emit light level 15", + "replace": false, + "values": [ + "minecraft:torch", + "minecraft:lantern", + "minecraft:campfire", + "minecraft:lava_bucket", + "minecraft:glowstone", + "minecraft:sea_lantern", + "minecraft:jack_o_lantern", + "minecraft:shroomlight", + "minecraft:end_rod", + "minecraft:beacon", + "minecraft:conduit", + {"id": "minecraft:ochre_froglight", "required": false}, + {"id": "minecraft:pearlescent_froglight", "required": false}, + {"id": "minecraft:verdant_froglight", "required": false}, + {"id": "#dynamiclights:mod_support/light_level/15", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/light_level/3.json b/data/dynamiclights/tags/item/light_level/3.json new file mode 100644 index 0000000..5d41a71 --- /dev/null +++ b/data/dynamiclights/tags/item/light_level/3.json @@ -0,0 +1,14 @@ +{ + "//comment": "Items listed here will emit light level 3", + "replace": false, + "values": [ + "minecraft:magma_block", + "minecraft:magma_cream", + "minecraft:large_amethyst_bud", + "minecraft:medium_amethyst_bud", + "minecraft:small_amethyst_bud", + "minecraft:heart_of_the_sea", + "minecraft:totem_of_undying", + {"id": "#dynamiclights:mod_support/light_level/3", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/light_level/6.json b/data/dynamiclights/tags/item/light_level/6.json new file mode 100644 index 0000000..c289d87 --- /dev/null +++ b/data/dynamiclights/tags/item/light_level/6.json @@ -0,0 +1,20 @@ +{ + "//comment": "Items listed here will emit light level 6", + "replace": false, + "values": [ + "minecraft:redstone_torch", + "minecraft:fire_charge", + "minecraft:blaze_powder", + "minecraft:nether_star", + "minecraft:amethyst_cluster", + "minecraft:amethyst_shard", + "minecraft:glow_lichen", + "minecraft:enchanted_golden_apple", + "minecraft:enchanting_table", + "minecraft:enchanted_book", + "minecraft:ender_chest", + {"id": "minecraft:sculk_catalyst", "required": false}, + {"id": "minecraft:vault", "required": false}, + {"id": "#dynamiclights:mod_support/light_level/6", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/light_level/9.json b/data/dynamiclights/tags/item/light_level/9.json new file mode 100644 index 0000000..88fceba --- /dev/null +++ b/data/dynamiclights/tags/item/light_level/9.json @@ -0,0 +1,20 @@ +{ + "//comment": "Items listed here will emit light level 9", + "replace": false, + "values": [ + "minecraft:soul_torch", + "minecraft:soul_lantern", + "minecraft:soul_campfire", + "minecraft:glowstone_dust", + "minecraft:blaze_rod", + "minecraft:spectral_arrow", + "minecraft:glow_berries", + "minecraft:glow_item_frame", + "minecraft:glow_ink_sac", + "minecraft:prismarine_crystals", + "minecraft:sea_pickle", + "minecraft:crying_obsidian", + "minecraft:end_crystal", + {"id": "#dynamiclights:mod_support/light_level/9", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/light_level/12.json b/data/dynamiclights/tags/item/mod_support/light_level/12.json new file mode 100644 index 0000000..cb46a34 --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/light_level/12.json @@ -0,0 +1,6 @@ +{ + "//comment": "Items listed here will emit light level 12 - Intended to get populated by mods", + "replace": false, + "values": [ + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/light_level/15.json b/data/dynamiclights/tags/item/mod_support/light_level/15.json new file mode 100644 index 0000000..df9292f --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/light_level/15.json @@ -0,0 +1,8 @@ +{ + "//comment": "Items listed here will emit light level 15 - Intended to get populated by mods", + "replace": false, + "values": [ + {"id": "#c:lanterns", "required": false}, + {"id": "#c:lava_buckets", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/light_level/3.json b/data/dynamiclights/tags/item/mod_support/light_level/3.json new file mode 100644 index 0000000..b89ab71 --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/light_level/3.json @@ -0,0 +1,9 @@ +{ + "//comment": "Items listed here will emit light level 3 - Intended to get populated by mods", + "replace": false, + "values": [ + {"id": "#c:amethysts", "required": false}, + {"id": "#c:glowing_calamari", "required": false}, + {"id": "#forge:gems/amethyst", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/light_level/6.json b/data/dynamiclights/tags/item/mod_support/light_level/6.json new file mode 100644 index 0000000..a8a59ba --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/light_level/6.json @@ -0,0 +1,9 @@ +{ + "//comment": "Items listed here will emit light level 6 - Intended to get populated by mods", + "replace": false, + "values": [ + {"id": "#c:amethyst_blocks", "required": false}, + {"id": "#forge:storage_blocks/amethyst", "required": false}, + {"id": "#forge:nether_stars", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/light_level/9.json b/data/dynamiclights/tags/item/mod_support/light_level/9.json new file mode 100644 index 0000000..cb0a667 --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/light_level/9.json @@ -0,0 +1,9 @@ +{ + "//comment": "Items listed here will emit light level 9 - Intended to get populated by mods", + "replace": false, + "values": [ + {"id": "#c:glow_berries", "required": false}, + {"id": "#c:glowstone_dusts", "required": false}, + {"id": "#forge:rods/blaze", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_off.json b/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_off.json new file mode 100644 index 0000000..e186417 --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_off.json @@ -0,0 +1,7 @@ +{ + "//comment": "Items listed here will only emit light outside water - Intended to get populated by mods", + "replace": false, + "values": [ + {"id": "#c:lava_buckets", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_on.json b/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_on.json new file mode 100644 index 0000000..a1aca40 --- /dev/null +++ b/data/dynamiclights/tags/item/mod_support/water_sensitive/turn_on.json @@ -0,0 +1,6 @@ +{ + "//comment": "Items listed here will only emit light inside water - Intended to get populated by mods", + "replace": false, + "values": [ + ] +} diff --git a/data/dynamiclights/tags/item/trimmable_armor.json b/data/dynamiclights/tags/item/trimmable_armor.json new file mode 100644 index 0000000..b93d83e --- /dev/null +++ b/data/dynamiclights/tags/item/trimmable_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + {"id": "#minecraft:trimmable_armor", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/water_sensitive/turn_off.json b/data/dynamiclights/tags/item/water_sensitive/turn_off.json new file mode 100644 index 0000000..63e1e5d --- /dev/null +++ b/data/dynamiclights/tags/item/water_sensitive/turn_off.json @@ -0,0 +1,14 @@ +{ + "//comment": "Items listed here will only emit light outside water", + "replace": false, + "values": [ + "minecraft:torch", + "minecraft:campfire", + "minecraft:lava_bucket", + "minecraft:soul_torch", + "minecraft:soul_campfire", + "minecraft:redstone_torch", + "minecraft:fire_charge", + {"id": "#dynamiclights:mod_support/water_sensitive/turn_off", "required": false} + ] +} diff --git a/data/dynamiclights/tags/item/water_sensitive/turn_on.json b/data/dynamiclights/tags/item/water_sensitive/turn_on.json new file mode 100644 index 0000000..e7b1307 --- /dev/null +++ b/data/dynamiclights/tags/item/water_sensitive/turn_on.json @@ -0,0 +1,10 @@ +{ + "//comment": "Items listed here will only emit light inside water", + "replace": false, + "values": [ + "minecraft:sea_pickle", + "minecraft:prismarine_crystals", + "minecraft:heart_of_the_sea", + {"id": "#dynamiclights:mod_support/water_sensitive/turn_on", "required": false} + ] +} diff --git a/data/minecraft/tags/function/load.json b/data/minecraft/tags/function/load.json new file mode 100644 index 0000000..f2a1b08 --- /dev/null +++ b/data/minecraft/tags/function/load.json @@ -0,0 +1,5 @@ +{ + "values": [ + "dynamiclights:install_trigger" + ] +} diff --git a/data/tschipcraft/function/menu.mcfunction b/data/tschipcraft/function/menu.mcfunction new file mode 100644 index 0000000..77fc074 --- /dev/null +++ b/data/tschipcraft/function/menu.mcfunction @@ -0,0 +1,4 @@ +##by Tschipcraft + +scoreboard players set @s tschipcraft.menu 1 +function dynamiclights:settings/hide_feedback/main diff --git a/data/tschipcraft/tags/function/menu.json b/data/tschipcraft/tags/function/menu.json new file mode 100644 index 0000000..84e3739 --- /dev/null +++ b/data/tschipcraft/tags/function/menu.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "tschipcraft:menu" + ] +} From 96a4df7b9da5561e7100a486f202d292aab1c896 Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:46:36 +0200 Subject: [PATCH 3/4] Final changes for v1.8.3 - Removed unused legacy code for 1.21+ (#29) - Added menu message header for 1.21+ - Updated menu trigger to use advancements instead for 1.21+ - Updated README - Updated LICENSE --- .github/workflows/cd.yml | 18 ++++++------- .github/workflows/test_workflow.yml | 6 ++--- CHANGELOG.md | 2 -- CHANGES.md | 6 +++++ LICENSE | 6 ++--- README.md | 16 +++++------- .../dynamiclights/function/install.mcfunction | 25 ++++++++----------- .../internal/item_frame/interacted.mcfunction | 6 ----- .../function/internal/loop.mcfunction | 6 ----- .../function/internal/main.mcfunction | 3 --- .../function/internal/menu.mcfunction | 9 ------- .../function/internal/menu_reset.mcfunction | 4 --- .../internal/messages/welcome.mcfunction | 3 +-- .../sources/parse/extension_1194.mcfunction | 4 --- .../internal/version_checker/start.mcfunction | 10 +------- data/dynamiclights/function/reset.mcfunction | 5 ++-- .../settings/hide_feedback/main.mcfunction | 1 + .../function/uninstall.mcfunction | 1 - .../functions/install.mcfunction | 16 ++++++------ .../internal/messages/welcome.mcfunction | 2 +- .../internal/version_checker/start.mcfunction | 2 -- .../tags/entity_type/reparse.json | 9 ------- .../entity_type/reparse_interactible.json | 9 ------- data/tschipcraft/advancement/menu.json | 23 +++++++++++++++++ data/tschipcraft/function/menu.mcfunction | 8 ++++-- .../function/menu_header.mcfunction | 4 +++ data/tschipcraft/tags/function/menu.json | 3 ++- 27 files changed, 86 insertions(+), 121 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 CHANGES.md delete mode 100644 data/dynamiclights/function/internal/item_frame/interacted.mcfunction delete mode 100644 data/dynamiclights/function/internal/loop.mcfunction delete mode 100644 data/dynamiclights/function/internal/menu.mcfunction delete mode 100644 data/dynamiclights/function/internal/menu_reset.mcfunction delete mode 100644 data/dynamiclights/function/internal/sources/parse/extension_1194.mcfunction delete mode 100644 data/dynamiclights/tags/entity_type/reparse.json delete mode 100644 data/dynamiclights/tags/entity_type/reparse_interactible.json create mode 100644 data/tschipcraft/advancement/menu.json create mode 100644 data/tschipcraft/function/menu_header.mcfunction 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 @@
-> A server-side data pack/mod for Minecraft 1.17x-1.20x +> A server-side data pack/mod for Minecraft 1.17x-1.21x