Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't understand valid methods when used in custom syntax (2.0.0) #124

Open
Moderocky opened this issue Apr 18, 2019 · 2 comments
Open

Can't understand valid methods when used in custom syntax (2.0.0) #124

Moderocky opened this issue Apr 18, 2019 · 2 comments
Labels
priority: high Should be fixed as soon as possible (regressions, unexpected behavior) type: bug

Comments

@Moderocky
Copy link

Moderocky commented Apr 18, 2019

(Using a slightly older version of skript (2.2dev37), which could be responsible. I thought I'd report it just to be safe. If it's caused by my skript version then please ignore this.)

Describe the bug
Certain methods can be used fine in effect commands, but fail to load when used in custom syntax for effects, expressions and conditions.

To reproduce
Run effect command {bar}.setProgress(0.5), where {bar} is a boss bar.
Then try using this (or any similar code using any of the boss bar modifying methods)

effect test for bar %object%:
  trigger:
    set {bar} to expr-1
    {bar}.setProgress(0.5)

Other methods that have the same issue are getTotalExperience​(), ``setTotalExperience​()` and no doubt many others. These are the only ones I have tested it with.

Here is an example of the error produced when loading this:
Can't understand this expression: 'expr-1.getTotalExperience​()'
An example of the custom syntax could be expression %player%'s total experience points:

Here is an example of it working fine by effect command:
Screenshot 2019-04-18 at 14 07 56

Here is an example of it not working fine in custom syntax:
image

Using this syntax for the get method:

player property total [e]xp[erience]:
  get:
    return expr-1.getTotalExperience​()

Additionally, I also receive this error often in conjunction (though not always) -
image

  • if I use return expr-1.getTotalExperience​() instead of setting a variable and returning the variable.
    I presume the two are linked.

Expected behavior
I expected using the method within a custom syntax to work.

Screenshots

image
In theory, this should work fine. All of them work by using effect commands with a player or a variable as the selector.

Server information

  • skript-mirror: 2.0.0 (latest)
  • Skript: 2.2dev37c
  • Bukkit: git-Spigot-dcd1643-e60fc34 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
  • Minecraft: 1.12.2
  • Java: Not sure? It's a fresh install, so presumably a very recent one.
  • OS: Ubuntu 18.04

Additional context
Nope.

@btk5h btk5h added priority: high Should be fixed as soon as possible (regressions, unexpected behavior) type: bug labels Apr 18, 2019
@Blueyescat
Copy link

Blueyescat commented Apr 20, 2019

You had an invisible character right after getTotalExperience xD be careful when copying methods from javadocs. Normally i notice them in console but the console your are using supports them. And in Minecraft chat you can't use unicode characters like that.

The outside of function error happens when the code is not correct, so it thinks the code is not related to skript-mirror and lets Skript to handle its own return effect.

@Blueyescat
Copy link

close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Should be fixed as soon as possible (regressions, unexpected behavior) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants