-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand predicates to all entities + Adapt Smithed Conventions
**- Mobs holding or wearing light emitting items will now produce light** **- Item frames containing light emitting items will now also produce light** - Allays will now emit light level 9 - Added all the Froglights to light level 15 items - Fixed #1 - Fixed #2 - Adapted to Smithed Conventions - Inactive lights will now be preserved - Increased light updates to 1 tick (2 ticks before) - Active dynamic light radius increased to 65 blocks (30 before)
- Loading branch information
1 parent
508f0bc
commit 938f29d
Showing
31 changed files
with
213 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## by Tschipcraft | ||
|
||
# Items | ||
function dynamiclights:sources/core | ||
|
||
# Debug | ||
#execute as @e[type=minecraft:marker] at @s run particle minecraft:dust 0 90 90 1 | ||
|
||
# Entities | ||
execute as @s[type=#dynamiclights:always_glow] at @s run function dynamiclights:summon_soul_light | ||
execute as @s[type=#dynamiclights:always_burn] at @s unless entity @s[type=minecraft:tnt,nbt={Fuse:1s}] unless entity @s[type=minecraft:tnt,nbt={Fuse:2s}] run function dynamiclights:summon_light | ||
|
||
# Light block sadly blocks explosion | ||
#execute as @s[type=minecraft:creeper,nbt={ignited:1b},tag=!global.ignore,tag=!smithed.strict] at @s run function dynamiclights:summon_light | ||
|
||
# Extension for More Mobs | ||
execute as @s[type=minecraft:wither_skeleton,tag=mm_magma_1] at @s run function dynamiclights:summon_redstone_light | ||
execute as @s[type=minecraft:wither_skeleton,tag=mm_magma_2] at @s run function dynamiclights:summon_soul_light |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
##by Tschipcraft | ||
|
||
function dynamiclights:version_checker | ||
function dynamiclights:install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
##by Tschipcraft | ||
|
||
# Find target | ||
execute at @s unless block ~ ~ ~ #dynamiclights:air run function dynamiclights:light/resolve_no_space | ||
|
||
# Clean already placed lights | ||
execute as @s[tag=ts.dynamiclights.redstone_light] at @s as @e[type=marker,tag=ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.new_light,distance=..0.5] run kill @s | ||
execute as @s[tag=ts.dynamiclights.soul_light] at @s as @e[type=marker,tag=ts.dynamiclights.soul_light,tag=!ts.dynamiclights.new_light,distance=..0.5] run kill @s | ||
execute as @s[tag=!ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.soul_light] at @s as @e[type=marker,tag=ts.dynamiclights.light,tag=!ts.dynamiclights.new_light,distance=..0.5] run kill @s | ||
|
||
# Override light levels | ||
execute as @s at @s if entity @e[type=marker,tag=ts.dynamiclights.light,tag=!ts.dynamiclights.new_light,distance=..0.5] at @s run function dynamiclights:light/resolve_light_override | ||
|
||
# Place light | ||
execute as @s[tag=!ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.soul_light] at @s if block ~ ~ ~ water[level=0] run fill ~ ~ ~ ~ ~ ~ light[waterlogged=true,level=15] replace water | ||
execute as @s[tag=!ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.soul_light] at @s unless block ~ ~ ~ water unless block ~ ~ ~ light run fill ~ ~ ~ ~ ~ ~ light[waterlogged=false,level=15] replace #dynamiclights:air | ||
|
||
execute as @s[tag=ts.dynamiclights.redstone_light] at @s if block ~ ~ ~ water[level=0] run fill ~ ~ ~ ~ ~ ~ light[waterlogged=true,level=6] replace water | ||
execute as @s[tag=ts.dynamiclights.redstone_light] at @s unless block ~ ~ ~ water unless block ~ ~ ~ light run fill ~ ~ ~ ~ ~ ~ light[waterlogged=false,level=6] replace #dynamiclights:air | ||
|
||
execute as @s[tag=ts.dynamiclights.soul_light] at @s if block ~ ~ ~ water[level=0] run fill ~ ~ ~ ~ ~ ~ light[waterlogged=true,level=9] replace water | ||
execute as @s[tag=ts.dynamiclights.soul_light] at @s unless block ~ ~ ~ water unless block ~ ~ ~ light run fill ~ ~ ~ ~ ~ ~ light[waterlogged=false,level=9] replace #dynamiclights:air | ||
|
||
|
||
tag @s remove ts.dynamiclights.new_light |
5 changes: 5 additions & 0 deletions
5
data/dynamiclights/functions/light/resolve_light_override.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
##by Tschipcraft - overrides or merges existing lights | ||
|
||
execute as @s[tag=!ts.dynamiclights.redstone_light] at @s as @e[type=marker,tag=ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.new_light,distance=..0.5] at @s run function dynamiclights:delete | ||
execute as @s[tag=!ts.dynamiclights.soul_light,tag=!redstone_light] at @s as @e[type=marker,tag=soul_light,tag=!ts.dynamiclights.new_light,distance=..0.5] at @s run function dynamiclights:delete | ||
execute as @s[tag=ts.dynamiclights.soul_light] at @s as @e[type=marker,tag=ts.dynamiclights.redstone_light,tag=!ts.dynamiclights.new_light,distance=..0.5] at @s run function dynamiclights:delete |
11 changes: 11 additions & 0 deletions
11
data/dynamiclights/functions/light/resolve_no_space.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
##by Tschipcraft - tries to find a place to place the light | ||
|
||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] if block ~ ~1 ~ #dynamiclights:air run tp @s ~ ~1 ~ | ||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] if block ~1 ~ ~ #dynamiclights:air run tp @s ~1 ~ ~ | ||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] if block ~ ~ ~1 #dynamiclights:air run tp @s ~ ~ ~1 | ||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] if block ~-1 ~ ~ #dynamiclights:air run tp @s ~-1 ~ ~ | ||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] run tp @s ~ ~ ~-1 | ||
|
||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] run tp @s ~ ~2 ~ | ||
|
||
execute at @s unless block ~ ~ ~ #dynamiclights:air unless block ~ ~ ~ water[level=0] run kill @s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,18 @@ | ||
## by Tschipcraft | ||
|
||
tag @e[type=minecraft:marker,tag=light] add old_light | ||
|
||
# Items | ||
execute as @a[gamemode=!spectator] at @s positioned ~ ~1 ~ run function dynamiclights:sources/player | ||
|
||
execute as @e[type=minecraft:item] at @s run function dynamiclights:sources/item | ||
|
||
# Debug | ||
#execute as @e[type=minecraft:marker] at @s run particle minecraft:dust 0 90 90 1 | ||
|
||
# Entities | ||
execute as @e[type=#dynamiclights:always_glow] at @s run function dynamiclights:summon_soul_light | ||
execute as @e[type=#dynamiclights:always_burn] at @s unless entity @s[type=tnt,nbt={Fuse:1s}] unless entity @s[type=tnt,nbt={Fuse:2s}] run function dynamiclights:summon_light | ||
|
||
#execute as @e[type=creeper,nbt={ignited:1b}] at @s if entity @a[gamemode=!spectator,distance=..30] run function dynamiclights:summon_light | ||
|
||
#Extension for More Mobs | ||
execute as @e[type=minecraft:wither_skeleton,tag=magma_1] at @s run function dynamiclights:summon_redstone_light | ||
execute as @e[type=minecraft:wither_skeleton,tag=magma_2] at @s run function dynamiclights:summon_soul_light | ||
|
||
# OnFire | ||
execute unless score global dl_unlimited matches 1 as @e[type=!#dynamiclights:dl_exclude] at @s if entity @a[gamemode=!spectator,distance=..30] if predicate dynamiclights:is_on_fire run function dynamiclights:summon_light | ||
execute if score global dl_unlimited matches 1 as @e[type=!#dynamiclights:dl_exclude] at @s if predicate dynamiclights:is_on_fire run function dynamiclights:summon_light | ||
# Marking old lights | ||
tag @e[type=minecraft:marker,tag=ts.dynamiclights.light] add ts.dynamiclights.old_light | ||
|
||
# Core | ||
execute unless score global ts.dl.unlimited matches 1 as @e at @s if entity @a[gamemode=!spectator,distance=..65] run function dynamiclights:core | ||
execute if score global ts.dl.unlimited matches 1 as @e at @s run function dynamiclights:core | ||
#execute as @e at @s run function dynamiclights:core | ||
|
||
# Clearing old lights and repeat | ||
execute as @e[type=minecraft:marker,tag=old_light] at @s run function dynamiclights:delete | ||
execute unless score global ts.dl.unlimited matches 1 as @e[type=minecraft:marker,tag=ts.dynamiclights.old_light] at @s if entity @a[gamemode=!spectator,distance=..65] run function dynamiclights:delete | ||
execute if score global ts.dl.unlimited matches 1 as @e[type=minecraft:marker,tag=ts.dynamiclights.old_light] at @s run function dynamiclights:delete | ||
|
||
# Menu | ||
function dynamiclights:menu | ||
|
||
schedule function dynamiclights:main 2t | ||
schedule function dynamiclights:main 1t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
##by Tschipcraft | ||
|
||
## menu message | ||
scoreboard players enable @a menu | ||
scoreboard players add @a dl_welcome 0 | ||
execute as @a[scores={menu=1..60,dl_welcome=1}] run scoreboard players set @s dl_welcome 0 | ||
execute as @a[scores={dl_welcome=0}] run function dynamiclights:messages/welcome | ||
execute as @a[scores={dl_how_to_use=1}] run function dynamiclights:messages/how_to_use | ||
## 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:messages/welcome | ||
execute as @a[scores={ts.dl.mess.how=1}] run function dynamiclights:messages/how_to_use | ||
|
||
execute as @a[scores={menu=1..60,dl_welcome=1}] run scoreboard players set @s dl_welcome 2 | ||
execute as @a[scores={menu=61..}] run scoreboard players set @s dl_welcome 1 | ||
scoreboard players reset @a[scores={menu=122..}] menu | ||
scoreboard players add @a[scores={menu=1..}] menu 1 | ||
execute as @a[scores={tschipcraft.menu=1..}] run schedule function dynamiclights:menu_reset 1t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## by Tschipcraft | ||
|
||
tellraw @s ["",{"text":"=-= How to use =-=","bold":true,"color":"gold"},{"text":"\n"},{"text":"Burning entities/items such as torches or lanterns now emit light!","color":"green"}] | ||
scoreboard players reset @s dl_how_to_use | ||
scoreboard players enable @s dl_how_to_use | ||
tellraw @s ["",{"text":"=-= How to use =-=","bold":true,"color":"gold"},{"text":"\n"},{"text":"Supported entities/items such as torches or lanterns now emit light!","color":"green"}] | ||
scoreboard players reset @s ts.dl.mess.how | ||
scoreboard players enable @s ts.dl.mess.how |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## by Tschipcraft | ||
|
||
tellraw @s ["",{"text":"➤ Dynamic Lights by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[How to use]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger dl_how_to_use"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"Reset the whole 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":"Note: No entities/items will glow anymore!","color":"red"}]}},{"text":" "},{"text":"[Check for updates] ","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=1.4"},"hoverEvent":{"action":"show_text","contents":"Click here to check for updates."}}] | ||
scoreboard players set @s dl_welcome 1 | ||
scoreboard players enable @s dl_how_to_use | ||
tellraw @s ["",{"text":"➤ Dynamic Lights by Tschipcraft installed!","italic":false,"color":"green"},{"text":"\n"},{"text":"[How to use]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger ts.dl.mess.how"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":" "},{"text":"[Reset]","color":"red","clickEvent":{"action":"run_command","value":"/function dynamiclights:reset"},"hoverEvent":{"action":"show_text","contents":["",{"text":"Reset the whole 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":"Note: No entities/items will glow anymore!","color":"red"}]}},{"text":" "},{"text":"[Check for updates] ","color":"blue","clickEvent":{"action":"open_url","value":"https://tschipcraft.ddns.net/update/test.html?pack=dynamiclights&v=1.5"},"hoverEvent":{"action":"show_text","contents":"Click here to check for updates."}}] | ||
scoreboard players set @s ts.dl.mess.welc 1 | ||
scoreboard players enable @s ts.dl.mess.how |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
##by Tschipcraft | ||
|
||
execute as @e[type=minecraft:marker,tag=light] at @s run function dynamiclights:delete | ||
execute as @e[type=minecraft:marker,tag=ts.dynamiclights.light] at @s run function dynamiclights:delete | ||
|
||
say Successfully reseted Dynamic lights! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
##by Tschipcraft | ||
|
||
execute as @s[type=minecraft:item] run function dynamiclights:sources/item | ||
execute as @s[type=minecraft:item_frame] run function dynamiclights:sources/item | ||
execute as @s[type=!#dynamiclights:dyn_ignore,tag=!global.ignore,tag=!smithed.strict] positioned ~ ~1 ~ unless entity @s[type=player,gamemode=spectator] run function dynamiclights:sources/entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
##by Tschipcraft | ||
|
||
execute if predicate dynamiclights:light if predicate dynamiclights:campfire_check run function dynamiclights:summon_light | ||
execute if predicate dynamiclights:visible if predicate dynamiclights:campfire_check if predicate dynamiclights:soul_light run function dynamiclights:summon_soul_light | ||
execute if predicate dynamiclights:visible if predicate dynamiclights:redstone_light run function dynamiclights:summon_redstone_light | ||
execute if predicate dynamiclights:is_on_fire run function dynamiclights:summon_light |
Oops, something went wrong.