Skip to content

Commit

Permalink
Fix Particle Definition Conflicts (#6760)
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus authored Jun 15, 2024
1 parent 23cc26b commit aa7955c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ public String toVariableNameString(final Experience xp) {
.usage(VisualEffects.getAllNames())
.since("2.1")
.user("(visual|particle) effects?")
.after("itemtype")
.parser(new Parser<VisualEffect>() {
@Override
@Nullable
Expand Down
38 changes: 19 additions & 19 deletions src/main/resources/lang/default.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1473,13 +1473,13 @@ visual effects:

block_marker: # added in 1.18
name: block marker @a
pattern: (barrierbm:barrier|lightbm:light|%-blockdata/itemtype% block marker)
pattern: (barrierbm:barrier [particle]|lightbm:light [particle]|%-blockdata/itemtype% block marker)
barrier:
name: barrier @a
pattern: barrier
pattern: barrier [particle]
light: # added in 1.17
name: light @-
pattern: light
pattern: light [particle]

bubble: # added in 1.20.5
name: bubble @-
Expand Down Expand Up @@ -1534,7 +1534,7 @@ visual effects:

dolphin: # added in 1.13
name: dolphin @-
pattern: dolphin
pattern: dolphin [particle]

dragon_breath: # added in 1.14
name: dragon breath @-
Expand Down Expand Up @@ -1602,10 +1602,10 @@ visual effects:

elder_guardian: # added in 1.20.5
name: elder guardian @-
pattern: (elder guardian|mob appearance|guardian ghost)
pattern: (elder guardian particle|mob appearance|guardian ghost)
mob_appearance: # for versions below 1.20.5
name: mob appearance @-
pattern: (elder guardian|mob appearance|guardian ghost)
pattern: (elder guardian particle|mob appearance|guardian ghost)

electric_spark:
name: electric spark @-
Expand All @@ -1627,7 +1627,7 @@ visual effects:

end_rod:
name: end rod @-
pattern: end rod
pattern: end rod [particle]

entity_effect: # added in 1.20.5
name: entity effect @an
Expand Down Expand Up @@ -1693,10 +1693,10 @@ visual effects:

firework: # added in 1.20.5
name: firework @-
pattern: (firework|firework['s] spark)
pattern: (firework particle|firework['s] spark)
fireworks_spark: # for versions below 1.20.5
name: firework's spark @-
pattern: (firework|firework['s] spark)
pattern: (firework particle|firework['s] spark)

fishing: # added in 1.20.5
name: water wake @-
Expand Down Expand Up @@ -1764,24 +1764,24 @@ visual effects:

item_cobweb: # added in 1.20.5 (for 1.21)
name: cobweb @-
pattern: cobweb
pattern: cobweb [item|particle]

item_slime: # added in 1.20.5
name: slime @-
pattern: slime
pattern: slime [item|particle]
slime: # for versions below 1.20.5
name: slime @-
pattern: slime
pattern: slime [item|particle]

item_snowball: # added in 1.20.5
name: snowball @-
pattern: (snowball [break]|snow shovel|snow(man| golem) spawn)
pattern: (snowball [item|break|particle]|snow shovel|snow(man| golem) spawn)
snowball: # for versions below 1.20.5
name: snowball break @-
pattern: snowball break
snow_shovel: # for versions below 1.20.5
name: snow shovel @-
pattern: (snowball|snow shovel|snow(man| golem) spawn)
pattern: (snowball [item|particle]|snow shovel|snow(man| golem) spawn)

landing_honey: # added in 1.15
name: landing honey @-
Expand All @@ -1808,7 +1808,7 @@ visual effects:

mycelium: # previously town_aura, changed in 1.20.5
name: mycelium @-
pattern: (mycelium|small smoke|town aura)
pattern: (mycelium [particle]|small smoke|town aura)
town_aura:
name: small smoke @-
pattern: (mycelium|small smoke|town aura)
Expand Down Expand Up @@ -1931,10 +1931,10 @@ visual effects:

totem_of_undying: # added in 1.20.5
name: totem of undying @a
pattern: totem [of undying]
pattern: totem [of undying] [particle]
totem: # for versions below 1.20.5
name: totem @a
pattern: totem [of undying]
pattern: totem [of undying] [particle]

trial omen: # added in 1.20.5 (for 1.21)
name: trial omen @a
Expand Down Expand Up @@ -1989,10 +1989,10 @@ visual effects:

witch: # added in 1.20.5
name: witch @a
pattern: (witch [magic|spell]|purple spark)
pattern: (witch (magic|spell|particle)|purple spark)
spell_witch: # for versions below 1.20.5
name: witch spell @a
pattern: (witch [magic|spell]|purple spark)
pattern: (witch (magic|spell|particle)|purple spark)

# -- Inventory Actions --
inventory actions:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test "particle itemtype conflicts":

# itemtype parsing should take priority over visual effects
assert totem of undying is an itemtype with "totem of undying is not an itemtype"
assert mycelium is an itemtype with "mycelium is not an itemtype"
6 changes: 3 additions & 3 deletions src/test/skript/tests/syntaxes/effects/EffVisualEffect.sk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test "visual effects":
play dripping water at {_}
play white dust with size 2 at {_}
play effect at {_}
play elder guardian at {_}
play elder guardian particle at {_}
play enchant at {_}
play enchanted hit at {_}
play end rod at {_}
Expand All @@ -26,7 +26,7 @@ test "visual effects":
play large explosion at {_}
play explosion emitter at {_}
play falling dust of air at {_}
play firework at {_}
play firework spark at {_}
play fishing at {_}
play flame at {_}
play happy villager at {_}
Expand All @@ -51,7 +51,7 @@ test "visual effects":
play totem of undying at {_}
play suspended at {_}
play void fog at {_}
play witch at {_}
play witch particle at {_}
parse if running minecraft "1.14.4":
play campfire cosy smoke at {_}
play campfire signal smoke at {_}
Expand Down

0 comments on commit aa7955c

Please sign in to comment.