Add API to get default value of an Attribute

This commit is contained in:
md_5 2016-12-09 12:31:08 +11:00
parent 0fa1ad23ed
commit 521b64741e

View File

@ -60,6 +60,11 @@ public class CraftAttributeInstance implements AttributeInstance {
return handle.getValue(); return handle.getValue();
} }
@Override
public double getDefaultValue() {
return handle.getAttribute().getDefault();
}
private static net.minecraft.server.AttributeModifier convert(AttributeModifier bukkit) { private static net.minecraft.server.AttributeModifier convert(AttributeModifier bukkit) {
return new net.minecraft.server.AttributeModifier(bukkit.getUniqueId(), bukkit.getName(), bukkit.getAmount(), bukkit.getOperation().ordinal()); return new net.minecraft.server.AttributeModifier(bukkit.getUniqueId(), bukkit.getName(), bukkit.getAmount(), bukkit.getOperation().ordinal());
} }