com.sucy.skill.api.SkillAPIAttributeProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proskillapi Show documentation
Show all versions of proskillapi Show documentation
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.
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);
}
}