Skip to content

Commit

Permalink
Support for 1.20.5 Pre-Release 3
Browse files Browse the repository at this point in the history
- Updated to work with 1.20.5 Pre-Release 3 using adjusted overlays
  - Reenabled light emitting from amethyst trimmed armor since checking for partial components works as of 1.20.5 Pre-Release 1
- Simplified light block placement and removal
- Fixed dynamic lights overwriting cave_air with air
  • Loading branch information
Tschipcraft committed Apr 16, 2024
1 parent a6ec58a commit b1a267f
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 32 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ Additionally, all enchanted items will emit light level 6 while Fire Aspect, Rip

**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/mod is completely server-side! No Optifine required!

Since this project is completely server-side, players joining a server with Dynamic Lights installed do not have to install anything on their end for it to work! Nontheless, you can still use the mod on
the client for singleplayer worlds only. Joining a server that has not installed Dynamic Lights will have no effect.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##by Tschipcraft
# Places the light block

execute if block ~ ~ ~ minecraft:water[level=0] run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=15] replace minecraft:water
execute unless block ~ ~ ~ minecraft:water unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=15] replace #dynamiclights:air
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##by Tschipcraft
# Gives an old light a new light level

execute if block ~ ~ ~ minecraft:light[waterlogged=false] unless block ~ ~ ~ minecraft:light[level=15] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=false] replace minecraft:light
execute if block ~ ~ ~ minecraft:light[waterlogged=true] unless block ~ ~ ~ minecraft:light[level=15] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=true] replace minecraft:light
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=false] replace minecraft:light[waterlogged=false]
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=15,waterlogged=true] replace minecraft:light[waterlogged=true]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Summons a new dynamic light entity

execute align xyz run summon minecraft:marker ~ ~ ~ {Tags:["ts.dl.light","ts.dl.new_light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [15]"}'}
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/15/summon_exec
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,distance=..0.1,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/15/summon_exec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##by Tschipcraft
# Places the light block

execute if block ~ ~ ~ minecraft:water[level=0] run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=6] replace minecraft:water
execute unless block ~ ~ ~ minecraft:water unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=6] replace #dynamiclights:air
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##by Tschipcraft
# Gives an old light a new light level

execute if block ~ ~ ~ minecraft:light[waterlogged=false] unless block ~ ~ ~ minecraft:light[level=6] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=false] replace minecraft:light
execute if block ~ ~ ~ minecraft:light[waterlogged=true] unless block ~ ~ ~ minecraft:light[level=6] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=true] replace minecraft:light
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=false] replace minecraft:light[waterlogged=false]
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=6,waterlogged=true] replace minecraft:light[waterlogged=true]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Summons a new dynamic light entity

execute align xyz run summon minecraft:marker ~ ~ ~ {Tags:["ts.dl.light","ts.dl.new_light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [6]"}'}
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/6/summon_exec
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,distance=..0.1,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/6/summon_exec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##by Tschipcraft
# Places the light block

execute if block ~ ~ ~ minecraft:water[level=0] run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=true,level=9] replace minecraft:water
execute unless block ~ ~ ~ minecraft:water unless block ~ ~ ~ minecraft:light run fill ~ ~ ~ ~ ~ ~ minecraft:light[waterlogged=false,level=9] replace #dynamiclights:air
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##by Tschipcraft
# Gives an old light a new light level

execute if block ~ ~ ~ minecraft:light[waterlogged=false] unless block ~ ~ ~ minecraft:light[level=9] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=false] replace minecraft:light
execute if block ~ ~ ~ minecraft:light[waterlogged=true] unless block ~ ~ ~ minecraft:light[level=9] run fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=true] replace minecraft:light
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=false] replace minecraft:light[waterlogged=false]
fill ~ ~ ~ ~ ~ ~ minecraft:light[level=9,waterlogged=true] replace minecraft:light[waterlogged=true]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Summons a new dynamic light entity

execute align xyz run summon minecraft:marker ~ ~ ~ {Tags:["ts.dl.light","ts.dl.new_light","global.ignore","global.ignore.kill","global.ignore.pos","smithed.block"],Invulnerable:1b,Silent:1b,CustomName:'{"text":"Dynamic Light [9]"}'}
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/9/summon_exec
execute align xyz as @e[type=minecraft:marker,tag=ts.dl.new_light,distance=..0.1,sort=nearest,limit=1] at @s run function dynamiclights:internal/place_light/9/summon_exec
10 changes: 7 additions & 3 deletions data/dynamiclights/functions/internal/remove_light.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
##by Tschipcraft
# TODO: Add support for cave_air?

execute if block ~ ~ ~ minecraft:light[waterlogged=true] run fill ~ ~ ~ ~ ~ ~ minecraft:water replace minecraft:light
execute if block ~ ~ ~ minecraft:light[waterlogged=false] run fill ~ ~ ~ ~ ~ ~ minecraft:air replace minecraft:light
# 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"count": {
"min": 1
},
"components": {
"predicates": {
"minecraft:trim": {
"material": "minecraft:amethyst"
}
Expand All @@ -34,7 +34,7 @@
"count": {
"min": 1
},
"components": {
"predicates": {
"minecraft:trim": {
"material": "minecraft:amethyst"
}
Expand All @@ -56,7 +56,7 @@
"count": {
"min": 1
},
"components": {
"predicates": {
"minecraft:trim": {
"material": "minecraft:amethyst"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities and item frames since 24w11a.",
"//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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities and item frames since 24w11a.",
"//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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"//comment": "This predicate returns true, if the item in the contents slot should light up. The contents slot gets used by item entities and item frames since 24w11a.",
"//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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
scoreboard players add $amethyst_trimmed ts.dl.settings 0
function dynamiclights:settings

tellraw @s ["",{"text":"\n❌","bold":true,"color":"red"},{"text":" This feature is not available from Snapshot 24w09a until some future version.","color":"red"}]
tellraw @s ["",{"text":"\n❌","bold":true,"color":"red"},{"text":" This feature is not available from Snapshot 24w09a until 1.20.5-pre1.","color":"red"}]
10 changes: 5 additions & 5 deletions pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"id": "dynamiclights",
"pack": {
"pack_format": 15,
"supported_formats": [7,35],
"supported_formats": [7,41],
"description": "Tschipcraft's Dynamic Lights \n└ v${version} ● mc${mc_version}"
},
"overlays": {
"entries": [
{
"formats": [16,35],
"formats": [16,41],
"directory": "overlay_16"
},
{
"formats": [33,35],
"formats": [33,41],
"directory": "overlay_33"
},
{
"formats": [35,35],
"formats": [35,41],
"directory": "overlay_35"
},
{
"formats": [33,35],
"formats": [33,38],
"directory": "overlay_disable_trim"
}
]
Expand Down

0 comments on commit b1a267f

Please sign in to comment.