diff --git a/build.gradle b/build.gradle index 0c11539..459ebc4 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ dependencies { } group = 'me.byteful.plugin' -version = '1.3.6' +version = '1.3.6-BETA' description = 'LevelTools' java.sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java b/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java index 4202808..0de7070 100644 --- a/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java +++ b/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java @@ -10,7 +10,7 @@ import org.bukkit.plugin.java.JavaPlugin; import redempt.crunch.CompiledExpression; import redempt.crunch.Crunch; -import redempt.crunch.functional.EvaluationEnvironment; +import redempt.redlib.RedLib; import redempt.redlib.blockdata.BlockDataManager; import redempt.redlib.misc.Task; import revxrsal.commands.bukkit.BukkitCommandHandler; @@ -21,6 +21,8 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; +import static me.byteful.plugin.leveltools.util.Text.colorize; + public final class LevelToolsPlugin extends JavaPlugin { private static LevelToolsPlugin instance; @@ -36,6 +38,7 @@ public static LevelToolsPlugin getInstance() { @Override public void onEnable() { + sendStartupBanner(); instance = this; updateChecker = new UpdateChecker(this); @@ -100,6 +103,14 @@ public void onDisable() { getLogger().info("Successfully stopped " + getDescription().getFullName() + "."); } + private void sendStartupBanner() { + Bukkit.getConsoleSender().sendMessage(colorize("&b _____")); + Bukkit.getConsoleSender().sendMessage(colorize("&d| &b| &8Created by &2byteful")); + Bukkit.getConsoleSender().sendMessage(colorize(String.format("&d| &b| &8Running &6%s &7on &eMC %s", getDescription().getFullName(), RedLib.getServerVersion()))); + Bukkit.getConsoleSender().sendMessage(colorize("&d|_____ &b| &8Join &9&nhttps://discord.gg/G8BDgqsuyw &8for support!")); + Bukkit.getConsoleSender().sendMessage(""); + } + private void registerListeners() { final PluginManager pm = Bukkit.getPluginManager(); pm.registerEvents(new BlockEventListener(), this); @@ -112,9 +123,7 @@ public void setAnvilCombineMode() { } public void setLevelXpFormula() { - final EvaluationEnvironment env = new EvaluationEnvironment(); - env.setVariableNames("{current_level}"); - levelXpFormula = Crunch.compileExpression(getConfig().getString("level_xp_formula"), env); + levelXpFormula = Crunch.compileExpression(getConfig().getString("level_xp_formula").replace("{current_level}", "$1")); } public BlockDataManager getBlockDataManager() {