All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sucy.skill.api.SkillAPIAttributeProvider Maven / Gradle / Ivy

Go to download

A Minecraft Bukkit plugin aiming to provide an easy code API and skill editor for all server owners to create unique and fully custom classes and skills.

There is a newer version: 1.3.1-R1
Show newest version
package com.sucy.skill.api;

import com.sucy.skill.SkillAPI;
import com.sucy.skill.api.player.PlayerData;
import lombok.RequiredArgsConstructor;
import mc.promcteam.engine.registry.attribute.AttributeProvider;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;

@RequiredArgsConstructor
public class SkillAPIAttributeProvider implements AttributeProvider {
    private final SkillAPI plugin;

    @Override
    public double scaleAttribute(String name, LivingEntity entity, double value) {
        if (!(entity instanceof Player)) return value;

        Player     player = (Player) entity;
        PlayerData data   = plugin.getPlayerData(player);
        if (data == null) return value;

        return data.scaleStat(name, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy