From 521b64741e4ba929fbf8bc9f4da4caa2f0e3d9e1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 9 Dec 2016 12:31:08 +1100 Subject: [PATCH] Add API to get default value of an Attribute --- .../bukkit/craftbukkit/attribute/CraftAttributeInstance.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java index 1ed4aa945f..31e608a6a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java @@ -60,6 +60,11 @@ public class CraftAttributeInstance implements AttributeInstance { return handle.getValue(); } + @Override + public double getDefaultValue() { + return handle.getAttribute().getDefault(); + } + private static net.minecraft.server.AttributeModifier convert(AttributeModifier bukkit) { return new net.minecraft.server.AttributeModifier(bukkit.getUniqueId(), bukkit.getName(), bukkit.getAmount(), bukkit.getOperation().ordinal()); }