Skip to content

Commit

Permalink
v1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
byteful committed Dec 29, 2023
1 parent f7b814a commit d371e81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 13 additions & 4 deletions src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -36,6 +38,7 @@ public static LevelToolsPlugin getInstance() {

@Override
public void onEnable() {
sendStartupBanner();
instance = this;
updateChecker = new UpdateChecker(this);

Expand Down Expand Up @@ -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);
Expand All @@ -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() {
Expand Down

0 comments on commit d371e81

Please sign in to comment.