#why am i dividing by zero here ```Math

1 messages · Page 1 of 1 (latest)

magic drift
#

.

#
public class HypixelPlayer implements ConfigurationSerializable {
    private Farming farming = new Farming();
    private Mining mining = new Mining();
    private Woodcutting woodcutting = new Woodcutting();
    private Combat combat = new Combat();

    private Fishing fishing = new Fishing();

    BossBar skillBossBar = Bukkit.createBossBar("+69 SKILLNAME SKILLXP/REQSKILLXP", BarColor.GREEN, BarStyle.SOLID);

    private UUID uuid;

    private double damage = 1;
    private double health = 20;
    private double defense = 1;

    //.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 10, (int)Math.floor(health), false));
    public void setTrueStats(){
        HypixelSkillCore.getInstance().getServer().getPlayer(uuid).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(health);
    }

    public Skill getSkillWithString(String name){
        switch (name) {
            case "Farming" :
                return farming;
            case "Mining":
                return mining;
            case "Woodcutting":
                return woodcutting;
            case "Combat":
                return combat;
            case "Fishing":
                return fishing;
            default :
                return null;
        }

    }

    //removed getters and setters due to discord limit

    public Map<String, Object> serialize(){
        return Map.of(
            //removed due to discord limit

    public static HypixelPlayer deserialize(Map<String, Object> m){
        return new HypixelPlayer(m);
    }

    public HypixelPlayer(Map<String, Object> m){
        //removed due to discord limit
    }

    public HypixelPlayer(){}
}

timber salmon
#

Static variables don't benefit from inheritance

magic drift
#

wdym by that

timber salmon
#

So the STARTER_XP on your abstract skill class is always 0

#

Regardless of what you define it as on your WoodCuttingSkill class

magic drift
timber salmon
#

I'd probably just make it an abstract int instead

#

public abstract int getStarterXp();

#

and each inheriting skill returns its value

magic drift
timber salmon
#

Your wood cutting skill would override that and return 50