SkriptLang / skript-aliases

Aliases for Skript
20 stars 36 forks source link

Alias parsing issues #7

Closed TheBentoBox closed 6 years ago

TheBentoBox commented 6 years ago

I've been testing out some of the capabilities of the beta aliases release and am finding both parsing bugs (namely with variations) and some features that would be desirable to make producing aliases easier.

My aim was to test damage value variations (via the Damage tag), block state variations, and a straightforward alias that doesn't use variations. This was my test aliases file:

variations test:
  minecraft versions = 1.12 or newer

  {colored}:
    white = - {Damage:0}
    orange = - {Damage:1}
    magenta = - {Damage:2}
    light blue = - {Damage:3}
    yellow = - {Damage:4}
    (lime [green]|light green) = - {Damage:5}
    pink = - {Damage:6}
    [dark] gr(a|e)y = - {Damage:7}
    light gr(a|e)y = - {Damage:8}
    cyan = - {Damage:9}
    purple = - {Damage:10}
    blue = - {Damage:11}
    brown = - {Damage:12}
    [dark] green = - {Damage:13}
    red = - {Damage:14}
    black = - {Damage:15}

  {oriented}:
    (north-south|south-north) = -[axis=z]
    (east-west|west-east) = -[axis=x]
    (vertical|up-down) = -[axis=y]

  {colored} wool [block¦s] = minecraft:wool
  {oriented} purpur pillar¦s = minecraft:purpur_pillar
  orange wool = minecraft:wool {Damage:1}

Trying to load this in 1.12.2 with the aliases beta release gave the following results in console. Each error was repeated once for each variation of the alias (e.g. 32 times for the wool errors since there are the 16 with [block¦s] included then the 16 without):

[20:03:15 INFO]: Mr_Simba issued server command: /sk reload aliases
[20:03:15 ERROR]: [Skript] Minecraft id 1.12 or newer is not valid (building.sk, line 2: minecraft versions = 1.12 or newer')
[20:03:15 ERROR]: [Skript] Minecraft id - is not valid (building.sk, line 27: {colored} wool [block▒s] = minecraft:wool')
[20:03:15 ERROR]: [Skript] Minecraft id - is not valid (building.sk, line 28: {oriented} purpur pillar▒s = minecraft:purpur_pillar')

We can see a few issues here:

  1. The damage value variation should definitely work. It's using "NBT" (pre-1.13 it's not actually NBT but there's a workaround in-place) which is meant to already be supported (it's the example used in the read me).
  2. It's trying to parse the minecraft versions conditional as an actual alias, which is clearly incorrect. I've also tried to do more extensive testing with variations to see their limits (e.g. a variation that includes part of the ID in it for colored blocks) and I've found that it will also attempt to parse each variation as an ID in that scenario as well (e.g. this doesn't work, it tries to parse each variation as an alias).
  3. Block states don't seem to work for variations either, as is the case for the purpur pillars alias. I'm not sure if this is due to variations not supporting block states or due to the variations not really seeming to work in the first place.

This may be due to some sort of version mismatch that I'm not realizing so of course let me know if that's the case. Regardless, support for defining part of the ID in the variation would be really useful, especially for the colored blocks.

bensku commented 6 years ago

Note that "minecraft version" must be singular. Might change that, as it seems to have confused people (me included, actually).

Variations used to work, but it is certainly possible I broke them while fixing other issues. I'll take a look.

bensku commented 6 years ago

Fixed now.