LazoYoung / CraftGames

Minecraft Paper plugin that enables you to make custom minigame scripts.
MIT License
2 stars 1 forks source link

Illegal characters in script disrupt Groovy to resolve function. #49

Closed LazoYoung closed 4 years ago

LazoYoung commented 4 years ago
LazoYoung commented 4 years ago

Groovy can't resolve methods for Bukkit Object.

~~My conclusion: Groovy's MOP (Meta Object Protocol) can fail to infer subtle Java methods or variables. I made the compilation bypass MOP with CompileStatic annotation, applying ASTTransformation extension to manually cope with necessary type checks, e.g. Bindings. In this way, type safety is somewhat guaranteed (even though it's still dynamic) and even if it fails, we have fall back extension which handles unresolved method/variable during compile-time. I need to dig into this further because I want to achieve 100% consistent script behavior.~~

Zero width space '\u200B' being appended to the method name had caused the problem.