-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Item frame reparse now triggers when a player right-clicks on an item frame or when an item drops nearby in versions before 24w11a. Global reparse loop now only triggers every 4 seconds instead of every 8 ticks. This should improve performance in regions with a high number of item frames while also improving responsiveness (first steps for #13) - Added support for falling blocks and display entities in versions before 24w11a - Updated GitHub workflow
- Loading branch information
1 parent
0932c1a
commit a6ec58a
Showing
12 changed files
with
82 additions
and
16 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
20 changes: 20 additions & 0 deletions
20
data/dynamiclights/advancements/interacted_with_item_frame.json
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,20 @@ | ||
{ | ||
"criteria": { | ||
"player_interacted": { | ||
"trigger": "minecraft:player_interacted_with_entity", | ||
"conditions": { | ||
"entity": { | ||
"type": "#dynamiclights:reparse_interactible" | ||
} | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"player_interacted" | ||
] | ||
], | ||
"rewards": { | ||
"function": "dynamiclights:internal/item_frame/interacted" | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
data/dynamiclights/functions/internal/item_frame/interacted.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,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 |
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
4 changes: 4 additions & 0 deletions
4
data/dynamiclights/functions/internal/sources/parse/extension_1194.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,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 |
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
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,10 +1,10 @@ | ||
{ | ||
"//comment": "These entities use a different NBT tag for storing the item and need special parsing for detection", | ||
"//comment": "These entities use a different NBT tag for storing their item and need special parsing for detection.", | ||
"replace": false, | ||
"values": [ | ||
"#dynamiclights:reparse", | ||
"minecraft:item", | ||
"minecraft:item_frame", | ||
"minecraft:glow_item_frame", | ||
{"id": "minecraft:item_display", "required": false} | ||
"minecraft:falling_block", | ||
{"id": "minecraft:block_display", "required": false} | ||
] | ||
} |
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,9 +1,8 @@ | ||
{ | ||
"//comment": "These entities are dynamic item holders and may change their item over time. They will get reparsed every 8 ticks", | ||
"//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.", | ||
"replace": false, | ||
"values": [ | ||
"minecraft:item_frame", | ||
"minecraft:glow_item_frame", | ||
"#dynamiclights:reparse_interactible", | ||
{"id": "minecraft:item_display", "required": false} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
data/dynamiclights/tags/entity_types/reparse_interactible.json
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,8 @@ | ||
{ | ||
"//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.", | ||
"replace": false, | ||
"values": [ | ||
"minecraft:item_frame", | ||
"minecraft:glow_item_frame" | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
overlay_35/data/dynamiclights/advancements/interacted_with_item_frame.json
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,10 @@ | ||
{ | ||
"criteria": { | ||
"player_interacted": { | ||
"trigger": "minecraft:impossible" | ||
} | ||
}, | ||
"rewards": { | ||
"function": "dynamiclights:internal/item_frame/interacted" | ||
} | ||
} |