From cd5305a55421645db077910c9cfe31941621ede7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 9 Dec 2016 12:31:08 +1100 Subject: [PATCH] Add API to get default value of an Attribute By: md_5 --- .../bukkit/craftbukkit/attribute/CraftAttributeInstance.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java index 1ed4aa945f..31e608a6a2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +++ b/paper-server/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()); }