Master Angler reworked

This commit is contained in:
nossr50
2020-11-09 16:46:52 -08:00
parent f4f6abd9d5
commit ba7e235e64
30 changed files with 715 additions and 437 deletions

View File

@ -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

View File

@ -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))