Use WE Expressions instead of js evaluation (#2941)

* Implement thread-safe expression evaluation

* Update `{args}` to `plot` automatically

* Stringify more money/balance/price occurrences with EconHandler#format
This commit is contained in:
Hannes Greule
2021-01-02 17:32:07 +01:00
committed by GitHub
parent f47561b580
commit ad99ca1723
12 changed files with 157 additions and 152 deletions

View File

@ -36,6 +36,7 @@ import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.checkerframework.checker.nullness.qual.NonNull;
@Singleton public class BukkitEconHandler extends EconHandler {
@ -84,6 +85,11 @@ import org.bukkit.plugin.RegisteredServiceProvider;
return plotArea.useEconomy();
}
@Override
public @NonNull String format(double balance) {
return this.econ.format(balance);
}
@Override
public boolean isSupported() {
return true;