Skript: Update the Aliases

Created on 11 Mar 2017  路  8Comments  路  Source: SkriptLang/Skript

Currently, Skript's aliases are based on number ids. It has multiple problems:

  • Number ids are deprecated and might disappear in future versions of Spigot
  • Current aliases don't work with potions (#20), and so they are hacked with an expression (which caused #397)
  • Seriously, who remembers those number ids? Fuuun time writing the aliases!
  • Generally, Skript's alias handling has some other bugs that could be fixed at the same time

So, what is the alternative? Of course not using Bukkit's material ids, if we are ever going to support other server platforms... And besides, they are sometimes quite bizarre. Luckily, Minecraft itself has new id format (minecraft:something).

Sadly Spigot doesn't exactly support it, which means Skript would use unsafe code (still better than NMS). You see, these methods are deprecated, but so is using numeric ids. Besides, if Spigot maintainers are stupid enough to remove these methods (which I do not believe), it can be circumvented with NMS. If Mojang removes numeric ids, working with current aliases would become very, very hard (NMS or not).

I'll be working on this in separate branch as low-priority project. If you have ideas, feel free to reply here.

completed enhancement critical

Most helpful comment

Today I added probably the last feature that aliases support on 1.12 requires (data value support).

@Snow-Pyon @tim740 I just invited you to bensku/skript-aliases. Both of you have been interested in working with aliases, and now everything should finally be ready enough. But we should discuss the specifics in Discord or here before going to write them.

@TheBentoBox Invited you, too. There is an issue tracker and I'd appreciate if you check it occasionally. And of course if you want, helping hands on writing aliases wouldn't hurt either :)

Everyone else: No pull requests yet, please. But I have contacted some people who I consider reliable, but who haven't told me if they are interested yet.

All 8 comments

Aliases rework is definitely needed, and Spigot's material enum is way too ugly to be ever used. Minecraft text IDs are the way to go. Something else that could be remade/modified/enhanced on the fly is ch.njol.skript.config. We could also use minecraft vanilla block states instead of data values. I'm saying could.

I need to start working on this more. In fact, I consider it high priority, as 1.13 is likely only months away now. It is unlikely that Skript works at all with 1.13 Spigot using current aliases.

New aliases will be coming for all supported Minecraft versions (1.9-1.12, 1.13 when it hits). Old aliases are to be phased out once this system works reasonable well.

As side effect, numeric ids in scripts may stop working with Minecraft version before 1.13 too. Would this annoy anyone here?

Even if it annoyed people, who cares? Using IDs instead of alias has had a warning for ages.

They were warned enough, it's no use trying to keep their code working. But what should be done is throwing an appropriate error message instead of leaving them in confusion with a "can't understand" or sth.

Java code for aliases rework is almost ready. That means, if we had functional aliases, it would be usable. Aside of fixing bugs, I need to add support for conditional alias loading (due to Minecraft version differences); after that, building the aliases can begin.

I think it would make most sense to have aliases in their own git repo, which Skript has as submodule. If someone has a better idea (submodules are sometimes really annoying), please let me know.

Today I added probably the last feature that aliases support on 1.12 requires (data value support).

@Snow-Pyon @tim740 I just invited you to bensku/skript-aliases. Both of you have been interested in working with aliases, and now everything should finally be ready enough. But we should discuss the specifics in Discord or here before going to write them.

@TheBentoBox Invited you, too. There is an issue tracker and I'd appreciate if you check it occasionally. And of course if you want, helping hands on writing aliases wouldn't hurt either :)

Everyone else: No pull requests yet, please. But I have contacted some people who I consider reliable, but who haven't told me if they are interested yet.

Critical priority: 1.13 support is likely blocked by finishing the new aliases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Anoniempje1234 picture Anoniempje1234  路  3Comments

GiraffeCubed picture GiraffeCubed  路  3Comments

Romitou picture Romitou  路  3Comments

ghost picture ghost  路  3Comments

TheClassic36 picture TheClassic36  路  3Comments