mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Master Angler reworked
This commit is contained in:
@ -8,10 +8,14 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class StringUtils {
|
||||
|
||||
protected static DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
protected static DecimalFormat shortDecimal = new DecimalFormat("##0.0");
|
||||
|
||||
/**
|
||||
* Gets a capitalized version of the target string.
|
||||
*
|
||||
@ -23,6 +27,11 @@ public class StringUtils {
|
||||
return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public static String ticksToSeconds(double ticks) {
|
||||
return shortDecimal.format(ticks / 20) + "s";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a string from an array skipping the first n elements
|
||||
* @param args the array to iterate over when forming the string
|
||||
|
@ -493,6 +493,11 @@ public class TextComponentFactory {
|
||||
{
|
||||
if(subSkillType.getParentSkill() == parentSkill)
|
||||
{
|
||||
//TODO: Hacky rewrite later
|
||||
//Only some versions of MC have this skill
|
||||
if(subSkillType == SubSkillType.FISHING_MASTER_ANGLER && mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() == null)
|
||||
continue;
|
||||
|
||||
if(Permissions.isSubSkillEnabled(player, subSkillType))
|
||||
{
|
||||
if(!InteractionManager.hasSubSkill(subSkillType))
|
||||
|
Reference in New Issue
Block a user