Skip to content

Commit 2339ede

Browse files
committed
fix(predicate): glowing effect with infinite duration not getting recognized
Add an additional check to the predicates to detect the glowing effect even when its duration is infinite (closes #98)
1 parent b9f8ea7 commit 2339ede

5 files changed

Lines changed: 75 additions & 20 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
- Fixed broken bubble column creation when holding a light source (closes [#105](https://github.com/Tschipcraft/dynamiclights/issues/105))
22
- Fixed possibility to create a suspended water block when holding a light source (closes [#106](https://github.com/Tschipcraft/dynamiclights/issues/106))
3+
- Fixed glowing potion effect with infinite duration not getting recognized (closes [#98](https://github.com/Tschipcraft/dynamiclights/issues/98))
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[
2+
{
3+
"//comment": "This predicate returns false, if the tested entity has the glowing effect",
4+
"condition": "minecraft:inverted",
5+
"term": {
6+
"condition": "minecraft:entity_properties",
7+
"entity": "this",
8+
"predicate": {
9+
"effects": {
10+
"minecraft:glowing": {
11+
"duration": {
12+
"min": 1
13+
}
14+
}
15+
}
16+
}
17+
}
18+
},
19+
{
20+
"condition": "minecraft:inverted",
21+
"term": {
22+
"condition": "minecraft:entity_properties",
23+
"entity": "this",
24+
"predicate": {
25+
"effects": {
26+
"minecraft:glowing": {
27+
"duration": -1
28+
}
29+
}
30+
}
31+
}
32+
}
33+
]

data/dynamiclights/predicate/entity/is_glowing.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@
1616
}
1717
},
1818
{
19-
"condition": "minecraft:entity_properties",
20-
"entity": "this",
21-
"predicate": {
22-
"effects": {
23-
"minecraft:glowing": {
24-
"duration": {
25-
"min": 1
26-
}
27-
}
28-
}
19+
"condition": "minecraft:inverted",
20+
"term": {
21+
"condition": "minecraft:reference",
22+
"name": "dynamiclights:entity/additional_effect_tests/glowing"
2923
}
3024
}
3125
]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[
2+
{
3+
"//comment": "This predicate returns false, if the tested entity has the glowing effect",
4+
"condition": "minecraft:inverted",
5+
"term": {
6+
"condition": "minecraft:entity_properties",
7+
"entity": "this",
8+
"predicate": {
9+
"effects": {
10+
"minecraft:glowing": {
11+
"duration": {
12+
"min": 1
13+
}
14+
}
15+
}
16+
}
17+
}
18+
},
19+
{
20+
"condition": "minecraft:inverted",
21+
"term": {
22+
"condition": "minecraft:entity_properties",
23+
"entity": "this",
24+
"predicate": {
25+
"effects": {
26+
"minecraft:glowing": {
27+
"duration": -1
28+
}
29+
}
30+
}
31+
}
32+
}
33+
]

data/dynamiclights/predicates/entity/is_glowing.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@
1616
}
1717
},
1818
{
19-
"condition": "minecraft:entity_properties",
20-
"entity": "this",
21-
"predicate": {
22-
"effects": {
23-
"minecraft:glowing": {
24-
"duration": {
25-
"min": 1
26-
}
27-
}
28-
}
19+
"condition": "minecraft:inverted",
20+
"term": {
21+
"condition": "minecraft:reference",
22+
"name": "dynamiclights:entity/additional_effect_tests/glowing"
2923
}
3024
}
3125
]

0 commit comments

Comments
 (0)