Skip to content

Commit

Permalink
v1.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
byteful committed May 9, 2024
1 parent 1742808 commit b736242
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static redempt.redlib.misc.FormatUtils.formatMoney;

import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.messages.ActionBar;
import java.util.List;
import me.byteful.plugin.leveltools.LevelToolsPlugin;
import me.byteful.plugin.leveltools.api.event.LevelToolsLevelIncreaseEvent;
Expand Down Expand Up @@ -60,7 +59,7 @@ protected void handle(LevelToolsItem tool, Player player, double modifier) {
.replace("{level}", String.valueOf(tool.getLevel()))
.replace("{max_xp_formatted}", formatMoney(tool.getMaxXp()))
.replace("{xp_formatted}", formatMoney(tool.getXp())));
ActionBar.sendActionBar(player, text);
LevelToolsUtil.sendActionBar(player, text);
}

if (tool.getXp() >= tool.getMaxXp()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static redempt.redlib.misc.FormatUtils.formatMoney;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.messages.ActionBar;
import com.google.common.base.Strings;
import de.tr7zw.changeme.nbtapi.NBTItem;
import java.math.BigDecimal;
Expand All @@ -20,6 +21,8 @@
import me.byteful.plugin.leveltools.api.item.LevelToolsItem;
import me.byteful.plugin.leveltools.api.item.impl.NBTLevelToolsItem;
import me.byteful.plugin.leveltools.api.item.impl.PDCLevelToolsItem;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.apache.commons.lang.math.NumberUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
Expand Down Expand Up @@ -342,4 +345,12 @@ private static ConfigurationSection getCsFromType(Material material) {
return LevelToolsPlugin.getInstance().getConfig().getConfigurationSection("tool_rewards");
}
}

public static void sendActionBar(Player player, String msg) {
if (RedLib.MID_VERSION > 12) {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(msg));
} else {
ActionBar.sendActionBar(player, msg);
}
}
}

0 comments on commit b736242

Please sign in to comment.