Skip to content

Commit

Permalink
Final changes for v1.7
Browse files Browse the repository at this point in the history
- Added Shulker Bullets to light level 6 entities
- Fixed Flying Wither Skulls not breaking blocks
- Fixed broken uninstall function in mod version
  • Loading branch information
Tschipcraft committed Sep 4, 2023
1 parent cc8bb5d commit 7a6b799
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description='''Supported entities and items will emit light by using the light b
Additionally, all enchanted items will emit light level 6 while Fire Aspect, Riptide or Channeling enchanted items emit light level 9.
§lSupported Entities:§r Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Firework Rockets and Flying Wither Skulls
§lSupported Entities:§r Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Shulker Bullets, Firework Rockets and Flying Wither Skulls
This mod is completely server-side!
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a href="https://github.com/Tschipcraft/dynamiclights/releases/latest"><img src="https://img.shields.io/github/downloads/Tschipcraft/dynamiclights/total?logo=github&colorA=0c0906&colorB=fbc703&style=for-the-badge"></a>
</p>

> A data pack for Minecraft 1.17x-1.20x
> A data pack/mod for Minecraft 1.17x-1.20x
<details>
<summary>YouTube showcase</summary>
Expand All @@ -20,15 +20,15 @@

## Features

Supported entities and items such as torches or lanterns will emit light by using the light block added in 21w13a. Because of this, the dynamic lights are limited to the block grid.
Supported entities and items such as torches or lanterns will emit light by using the light block added in 21w13a. Because of this, the dynamic lights are limited to the block grid. (see #9 for more information)

**Supported Items:** Torches, Lanterns, Campfires, Glowstone, Glowstone Dust, Blaze Rods, Blaze Powder, Spectral Arrows, Lava Buckets, Sea Lanterns, Prismarine Crystals, Froglights, Glow Ink Sacs, Glow Berries, Glow Item Frames, Glow Lichen, Jack o'Lanterns, Shroomlights, End Rods, End Crystals, Fire Charge, Amethyst Shards, Nether Stars, Ender Chests and Beacons

Additionally, all enchanted items will emit light level 6 while Fire Aspect, Riptide or Channeling enchanted items emit light level 9.

**Supported Entities:** Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Firework Rockets and Flying Wither Skulls
**Supported Entities:** Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Shulker Bullets, Firework Rockets and Flying Wither Skulls

This data pack is completely server-side! No Optifine required!
This data pack/mod is completely server-side! No Optifine required!

[➜ For available settings and planned features, take a look at the wiki](https://github.com/Tschipcraft/dynamiclights/wiki)

Expand All @@ -37,6 +37,8 @@ This data pack is completely server-side! No Optifine required!

Download the latest release from [here](https://github.com/Tschipcraft/dynamiclights/releases/latest) and put the datapack zip file into the `datapacks` folder of your Minecraft world.

This data pack is also available as a mod with an additional global settings menu when installed alongside [MidnightLib](https://modrinth.com/mod/midnightlib). Download the latest release and put the mod .jar file into your `.minecraft/mods` folder.

Also available on Modrinth and CurseForge!

<a href="https://modrinth.com/datapack/dynamic-lights">
Expand All @@ -57,4 +59,4 @@ Also available on Modrinth and CurseForge!

## Manage

To check for updates use `/trigger tschipcraft.menu` and hit the Check for Updates button. There is also a **Reset** and an **Uninstall** button.
To open the ingame menu, execute `/trigger tschipcraft.menu` or `/function #tschipcraft:menu`. There is a **Reset** and an **Uninstall** button.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## by Tschipcraft

tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu"}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack.","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.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues/new/choose"},"hoverEvent":{"action":"show_text","contents":"✉ Report an issue on GitHub."}},{"text":" "},{"text":"[Check for updates]","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=${version}"},"hoverEvent":{"action":"show_text","contents":"🔔 Check for updates on my website."}}]
tellraw @s ["",{"text":"\n▶ Dynamic Lights v${version} by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[Settings]","color":"aqua","clickEvent":{"action":"run_command","value":"/function dynamiclights:settings"},"hoverEvent":{"action":"show_text","contents":"☵ Open the settings menu."}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏏ Reset the data pack/mod.","color":"white"}]}},{"text":" "},{"text":"[Uninstall]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function dynamiclights:uninstall"},"hoverEvent":{"action":"show_text","contents":["",{"text":"⏻ Uninstall the data pack/mod.","color":"white"}]}},{"text":" \n"},{"text":"[Report an issue]","color":"gold","clickEvent":{"action":"open_url","value":"https://github.com/Tschipcraft/dynamiclights/issues/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
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
# These entities use a different NBT tag for storing the item and need special parsing for detection
execute as @s[type=#dynamiclights:parse] unless score @s ts.dl.i.type matches 0..15 run function dynamiclights:internal/sources/parse/main

execute as @s[type=!#dynamiclights:dyn_ignore,tag=!global.ignore,tag=!global.ignore.gui,tag=!smithed.strict] positioned ~ ~1 ~ unless entity @s[type=player,gamemode=spectator] run function dynamiclights:internal/sources/entity
# 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] positioned ~ ~1 ~ run function dynamiclights:internal/sources/entity
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##by Tschipcraft
# Places light, if the current entity matches any criteria for it

execute as @s[type=!minecraft:end_crystal,type=!minecraft:creeper] positioned ~ ~-0.32 ~ if predicate dynamiclights:entity/should_emit_light_level/15 align xyz run function dynamiclights:internal/place_light/15/summon
execute as @s[type=minecraft:end_crystal] positioned ~ ~-1.32 ~ if predicate dynamiclights:entity/should_emit_light_level/15 align xyz run function dynamiclights:internal/place_light/15/summon
execute as @s[type=minecraft:creeper] positioned ~ ~1 ~ if predicate dynamiclights:entity/should_emit_light_level/15 align xyz run function dynamiclights:internal/place_light/15/summon
execute positioned ~ ~-0.32 ~ if predicate dynamiclights:entity/should_emit_light_level/15 align xyz run function dynamiclights:internal/place_light/15/summon
execute positioned ~ ~-0.32 ~ if predicate dynamiclights:entity/should_emit_light_level/9 align xyz run function dynamiclights:internal/place_light/9/summon
execute positioned ~ ~-0.32 ~ if predicate dynamiclights:entity/should_emit_light_level/6 align xyz run function dynamiclights:internal/place_light/6/summon
Original file line number Diff line number Diff line change
Expand Up @@ -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 unless score $global tvc_ignore matches 1 if score $global ts.dl.version matches 3700.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Minecraft version 1.20 or above detected! This data pack may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}]
execute unless score $global tvc_ignore matches 1 if score $global ts.dl.version matches 3700.. run tellraw @a [{"text":"[Dynamic Lights] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Minecraft version 1.20 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!
Expand Down
8 changes: 8 additions & 0 deletions data/dynamiclights/functions/reset.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
##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]
# Kill area effect clouds
kill @e[type=minecraft:area_effect_cloud,tag=ts.dl.explosion]

# Reschedule functions
schedule function dynamiclights:internal/main 5t
schedule function dynamiclights:internal/loop 4t

say ⏏ Successfully resetted Dynamic lights!
2 changes: 1 addition & 1 deletion data/dynamiclights/functions/settings/core.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##by Tschipcraft

tellraw @s {"text":"\n=-=Dynamic Lights Admin Settings=-=","bold":true,"color":"dark_green"}
tellraw @s {"text":"\n=-=Dynamic Lights Settings=-=","bold":true,"color":"dark_green"}

tellraw @s {"text":"\nEnable light emitting from...","bold":true,"color":"white"}

Expand Down
12 changes: 11 additions & 1 deletion data/dynamiclights/functions/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
##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]
# Kill area effect clouds
kill @e[type=minecraft:area_effect_cloud,tag=ts.dl.explosion]

# Remove scores
scoreboard objectives remove ts.dl.ghast_cool
scoreboard objectives remove ts.dl.in_water
scoreboard objectives remove ts.dl.in_rain
Expand All @@ -24,8 +29,13 @@ 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 "file/${file_name}"

say ⏻ Dynamic Lights ${version} by Tschipcraft has been uninstalled by @s! It is safe to disable and remove the data pack.
say ⏻ Dynamic Lights v${version} by Tschipcraft has been uninstalled by @s! It is safe to disable and remove the data pack/mod.
3 changes: 2 additions & 1 deletion data/dynamiclights/tags/entity_types/light_level/6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"//comment": "Entities specified here will always emit light level 6",
"replace": false,
"values": [
"minecraft:tnt"
"minecraft:tnt",
"minecraft:shulker_bullet"
]
}
9 changes: 9 additions & 0 deletions data/dynamiclights/tags/entity_types/may_block_explosion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"minecraft:creeper",
"minecraft:fireball",
"minecraft:small_fireball",
"minecraft:wither_skull"
]
}
2 changes: 1 addition & 1 deletion fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"id": "dynamiclights",
"version": "${version}+mod",
"name": "Dynamic Lights",
"description": "Supported entities and items will emit light by using the light block added in 21w13a.\n§lSupported Items:§r Torches, Lanterns, Campfires, Glowstone, Glowstone Dust, Blaze Rods, Blaze Powder, Spectral Arrows, Lava Buckets, Sea Lanterns, Prismarine Crystals, Froglights, Glow Ink Sacs, Glow Berries, Glow Item Frames, Glow Lichen, Jack o'Lanterns, Shroomlights, End Rods, End Crystals, Fire Charge, Amethyst Shards, Nether Stars, Ender Chests and Beacons\nAdditionally, all enchanted items will emit light level 6 while Fire Aspect, Riptide or Channeling enchanted items emit light level 9.\n§lSupported Entities:§r Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Firework Rockets and Flying Wither Skulls\nThis mod is completely server-side!\nExecute the command §o/function §odynamiclights:settings§r for a world-specific settings menu and/or install MidnightLib for global settings accross all worlds.",
"description": "Supported entities and items will emit light by using the light block added in 21w13a.\n§lSupported Items:§r Torches, Lanterns, Campfires, Glowstone, Glowstone Dust, Blaze Rods, Blaze Powder, Spectral Arrows, Lava Buckets, Sea Lanterns, Prismarine Crystals, Froglights, Glow Ink Sacs, Glow Berries, Glow Item Frames, Glow Lichen, Jack o'Lanterns, Shroomlights, End Rods, End Crystals, Fire Charge, Amethyst Shards, Nether Stars, Ender Chests and Beacons\nAdditionally, all enchanted items will emit light level 6 while Fire Aspect, Riptide or Channeling enchanted items emit light level 9.\n§lSupported Entities:§r Allays, Glow Squids, Glow Item Frames, Blazes, TNT, End Crystals, Fireballs, Spectral Arrows, Shulker Bullets, Firework Rockets and Flying Wither Skulls\nThis mod is completely server-side!\nExecute the command §o/function §odynamiclights:settings§r for a world-specific settings menu and/or install MidnightLib for global settings accross all worlds.",
"license": "Custom",
"icon": "pack.png",
"authors": [
Expand Down
Loading

0 comments on commit 7a6b799

Please sign in to comment.